--- epublish.css 1 Feb 2007 11:33:06 -0000 1.1 +++ epublish.css 1 Feb 2007 11:34:01 -0000 1.2 @@ -1,7 +1,6 @@ .epublish { padding: 0px 0 10px 10px; } - .epublish .one_two .other_heads { margin-top: 10px; border-top: 1px solid #666; @@ -40,6 +39,7 @@ color: #900; text-transform: uppercase; margin-top: 10px; + background-color: #BBBBBB; } .epublish .one_two .description, .epublish .regular .description, .epublish .nodes .description { @@ -71,4 +71,75 @@ .epublish_navigation { border-top: 1px solid black; border-bottom: 1px solid black; -} \ No newline at end of file +} +.epublish .advertisement{ + float:right; + width:auto; + margin-top: 20px; + border-left:1px solid #000; + border-bottom:1px solid #000; + border-top:1px solid #000; + border-right:1px solid #000; + height:350; + display:block; + background-color:#fff; + padding: 2px; +} +.epublish .regular{ + border-left:1px solid #000; + border-bottom:1px solid #000; + border-top:1px solid #000; + border-right:1px solid #000; + padding: 2px ; +} + +.abstract { + font-family: Verdana; + font-size: 9 pt; +} +.epub-title a { + font-family: "Verdana", "Arial", "Helvetica", "sans-serif"; + font-size: 11 pt; + font-weight: bold; + color: #069; +} +.epub-title a:link { color: #006699; } +.epub-title a:hover { color: #006699; } +.link-title a { + font-family: "Verdana", "Arial", "Helvetica", "sans-serif"; + font-size: 9 pt; + font-weight: bold; + color: #069; + text-decoration: underline; +} +.ad-link-title a { + font-family: "Verdana", "Arial", "Helvetica", "sans-serif"; + font-size: 9 pt; + color: #900; + text-decoration: underline; +} +.ad-title a { + font-family: "Verdana", "Arial", "Helvetica", "sans-serif"; + font-size: 9 pt; + font-weight: bold; + color: #900; +} +.ad-title a:link { color: #990000; } +.ad-title a:hover { color: #990000; } +.topic{ + color: #000; +} +.abstract a { + font-family: "Verdana", "Arial", "Helvetica", "sans-serif"; + font-size: 9 pt; + color: #069; +} +.ad-abstract { + font-family: Verdana; + font-size: 9 pt; +} +.ad-abstract a { + font-family: "Verdana", "Arial", "Helvetica", "sans-serif"; + font-size: 9 pt; + color: #990000; +} --- epublish.module 1 Feb 2007 11:33:06 -0000 1.1 +++ epublish.module 1 Feb 2007 11:34:01 -0000 1.2 @@ -1,5 +1,5 @@ node_types), explode(',', $topic->node_types)))); $exclusions = _epublish_build_node_exclusions($all_nodes); - if ($topic->tid == -1) { + // -2 condition added + // Condition to handle another default section **20061208** + if ($topic->tid == -2) { //**20061208** + $topic->name = variable_get('epublish_advertisement', t('advertisement')); + $result2 = db_query("SELECT DISTINCT(n.nid) FROM {node} n WHERE ($exclusions) AND ($included_node_types) AND n.promote = 1 AND n.status = 1$timeframe AND n.sticky = 1 ORDER by n.created DESC LIMIT $topic->count"); + } else if ($topic->tid == -1) { $topic->name = variable_get('epublish_top_stories', t('top stories')); $result2 = db_query("SELECT DISTINCT(n.nid) FROM {node} n WHERE ($exclusions) AND ($included_node_types) AND n.promote = 1 AND n.status = 1$timeframe AND n.sticky = 1 ORDER by n.created DESC LIMIT $topic->count"); } else if ($topic->tid == 0) { @@ -945,7 +952,9 @@ $result = db_query("SELECT et.tid, td.name FROM {epublish_topic} et LEFT JOIN {term_data} td USING (tid) WHERE et.sid='%d' ORDER BY et.weight", $sid); $topics = array(); while ($topic = db_fetch_object($result)) { - if ($topic->tid == -1) { + if ($topic->tid == -2) { // condition added to handle additional default topic **20061208** + $topic->name = variable_get('epublish_advertisement', t('advertisement')); + } else if ($topic->tid == -1) { $topic->name = variable_get('epublish_top_stories', t('top stories')); } else if ($topic->tid == 0) { $topic->name = variable_get('epublish_miscellaneous', t('miscellaneous')); @@ -1042,7 +1051,14 @@ $rows = array(); $result2 = db_query("SELECT et.*, td.name FROM {epublish_topic} et LEFT JOIN {term_data} td USING (tid) WHERE et.sid='%d' ORDER BY et.weight", $edit["sid"]); while ($topic = db_fetch_object($result2)) { - if ($topic->tid == -1) { + // condition added to handle additional default field **20061208** + if ($topic->tid == -2) { + $topic->name = variable_get('epublish_advertisement', t('advertisement')); + $rows[] = array("$topic->name", + form_hidden('weight]['. $topic->tid, -98), + l(t('options'), "admin/epublish/edit/topic/" . $edit["sid"] . "/$topic->tid") + ); + } elseif ($topic->tid == -1) { $topic->name = variable_get('epublish_top_stories', t('top stories')); $rows[] = array("$topic->name", form_hidden('weight]['. $topic->tid, -99), @@ -1189,7 +1205,7 @@ * @param $sid * A section ID * @param $tid - * A term ID (a taxonomy term, or else 0 for "top stories" or -1 for "miscellaneous") + * A term ID (a taxonomy term, or else 0 for "top stories" or -1 for "miscellaneous" or -2 for "advertisement")//**20061208** * * @return * An object containing all of the values for a single record in the @@ -1223,6 +1239,7 @@ // If creating a new topic, display a pulldown menu to select it $form .= "

Add topic to section \"$section->title\"

\n"; $terms = array(); + $terms[-2] = variable_get('epublish_advertisement', t('advertisement')); //**20061208** $terms[-1] = variable_get('epublish_top_stories', t('top stories')); $tree = module_invoke('taxonomy', 'get_tree', $section->vid); $edit["tid"] = 0; @@ -1252,6 +1269,9 @@ $range = drupal_map_assoc(range(-10, 10)); if ($topic && $edit['tid'] == 0) { $form .= form_hidden('weight', 99); + } elseif ($topic && $edit['tid'] == -2) { + $form .= form_hidden('weight', -98); + $form .= form_submit(t("Delete")); } elseif ($topic && $edit['tid'] == -1) { $form .= form_hidden('weight', -99); $form .= form_submit(t("Delete")); @@ -1350,7 +1370,7 @@ function epublish_section_topics($sid, $eid) { $section = epublish_get_section($sid); - $result = db_query("SELECT DISTINCT(n.nid), een.tid FROM {node} n LEFT JOIN {epublish_edition_node} een USING (nid) LEFT JOIN {epublish_topic} et ON et.tid=een.tid WHERE eid='$eid' AND et.sid='$sid' ORDER BY et.weight, een.weight, n.changed DESC"); + $result = db_query("SELECT DISTINCT(n.nid), een.tid, et.weight FROM {node} n LEFT JOIN {epublish_edition_node} een USING (nid) LEFT JOIN {epublish_topic} et ON et.tid=een.tid WHERE eid='$eid' AND et.sid='$sid' ORDER BY et.weight, een.weight, n.changed DESC"); //**20061208** $last_tid = NULL; $topics = array(); $topic = NULL; @@ -1359,8 +1379,10 @@ if ($topic) { $topics[] = $topic; } - $topic = db_fetch_object(db_query("SELECT et.tid, td.name FROM {epublish_topic} et LEFT JOIN {term_data} td USING (tid) WHERE et.sid='%d' AND et.tid='%d'", $sid, $node->tid)); - if ($topic->tid == -1) { + $topic = db_fetch_object(db_query("SELECT et.tid, td.name, et.weight FROM {epublish_topic} et LEFT JOIN {term_data} td USING (tid) WHERE et.sid='%d' AND et.tid='%d'", $sid, $node->tid)); //**20061208** + if ($topic->tid == -2) { //**20061208** + $topic->name = variable_get('epublish_advertisement', t('advertisement')); + } else if ($topic->tid == -1) { $topic->name = variable_get('epublish_top_stories', t('top stories')); } else if ($topic->tid == 0) { $topic->name = variable_get('epublish_miscellaneous', t('miscellaneous')); @@ -1689,7 +1711,7 @@ form_select(NULL, 'tid]['.$node->nid, $node->tid, $topics), node_invoke($node, 'node_name'), ($node->status ? t('published') : t('not published')), - form_weight(NULL, 'node_weight]['. $node->nid, $node->weight, 10) + form_weight(NULL, 'node_weight]['. $node->nid, $node->weight, 30) ); } $group .= theme('table', $header, $rows); @@ -2002,7 +2024,7 @@ form_select(NULL, 'tid]['.$node->nid, $node->tid, $topics), node_invoke($node, 'node_name'), ($node->status ? t('published') : t('not published')), - form_weight(NULL, 'weight]['. $node->nid, $node->weight, 10) + form_weight(NULL, 'weight]['. $node->nid, $node->weight, 30) ); } @@ -2033,8 +2055,11 @@ } $section = epublish_get_section($sid); $vid = $section->vid; - if ($tid == -1) { - $term = db_fetch_object(db_query("SELECT vid FROM {vocabulary} WHERE vid = '%d'", $vid)); + if ($tid == -2) { //**20061208** + $term = db_fetch_object(db_query("SELECT vid FROM {vocabulary} WHERE vid = '%d'", $vid)); + $term->name = variable_get('epublish_advertisement', t('advertisement')); + } else if ($tid == -1) { + $term = db_fetch_object(db_query("SELECT vid FROM {vocabulary} WHERE vid = '%d'", $vid)); $term->name = variable_get('epublish_top_stories', t('top stories')); } else { $term = db_fetch_object(db_query("SELECT vid FROM {vocabulary} WHERE vid = '%d'", $vid)); @@ -2139,7 +2164,7 @@ if ($next = epublish_next($node, $topics)) { $links[] = "Next story: " . l($next->title, 'node/'. $next->nid); } - $output .= "

Published in " . l("$publication->name", "epublish/$publication->pid") . ", " .l(theme('epublish_edition_reference', $edition), "epublish/$publication->pid/$edition->eid") . "

\n"; + $output .= "

Published in " . l("$publication->name", "epublish/$publication->pid") . ", " .l(theme('epublish_edition_reference', $edition), "epublish/$publication->pid/$edition->eid") . "


\n"; $output .= theme('item_list', $links); $output .= ''; ++-- Contents of layout_indexed.inc. Copy the contents below and create a new file layout_indexed.inc $url, 'image_width' => $width, 'image_height' => $height, 'caption' => $caption) * * @return * An HTML-formatted list of topics and their nodes. */ function theme_epublish_layout_indexed($topics, $params=NULL) { if ($params['description']) { //$description = '
' . $params['description'] . '
'; } $o_index = "" ; $o_detail = "" ; $o_header = "" ; $o_footer = "" ; $o_advertisement = "" ; $counter = 1 ; // define class variables $css_title = "epub-title"; $css_linktitle = "link-title" ; $css_abstract = "abstract" ; foreach ($topics as $topic) { // begin foreach (two) if (count($topic->nodes)) { $subsection = epublish_get_section_by_title($topic->name); // Add topic to output string, ignore if topic is top or bottom one if ( ($topic->weight != 99) && ($topic->weight != (-99)) && ($topic->weight != (-98)) ){ // HTML Documentation comments $o_index .= "\n" ; $o_detail .= "\n" ; if ($subsection->sid) { if(arg(2)) { $o_index .= '
' . l( $topic->name,"epublish/".arg(1)."/".arg(2).'#T'.$sid. '_'.$counter). "
\n"; }else { $o_index .= '
' . l( $topic->name,"epublish/".arg(1).'#T'.$sid. '_'.$counter). "
\n"; } $o_detail .= '
' . l(t($topic->name), "headlines/" . $subsection->sid) . ' ' . "
\n"; } else { if(arg(2)) { $o_index .= '
' . l( $topic->name,"epublish/".arg(1)."/".arg(2).'#T'.$sid. '_'.$counter)."
\n"; }else { $o_index .= '
' . l( $topic->name,"epublish/".arg(1).'#T'.$sid. '_'.$counter)."
\n"; } $o_detail .= '
 ' . $topic->name . "
\n"; } } // for translation foreach ($topic->nodes as $nid) { // beigin of foreach (one) if (module_exist('translation')) { $lang = i18n_get_lang(); $transnid .= translation_node_nid($nid, $lang); if ($transnid) { $nid = $transnid; $transnid = '';} } $node = node_load((array('nid' => $nid))); // if it is not top or bottom topic add node title if ( ($topic->weight != 99) && ($topic->weight != (-99)) && ($topic->weight != (-98)) ){ if(arg(2)) { $o_index .= '
o '. l( $node->title,"epublish/".arg(1)."/".arg(2).'#N'.$sid. '_'.$counter).'
'; }else{ $o_index .= '
o '. l( $node->title,"epublish/".arg(1).'#N'.$sid. '_'.$counter).'
'; } $o_detail .= '
o ' . l(t($node->title), "node/$nid") . ' ' . "
\n" ; } // Add commented section //$o_index .= '
' . t('by') . ' ' . l($node->name, "blog/" . $node->uid) . "
\n"; //$o_detail .= '
' . t('by') . ' ' . l($node->name, "blog/" . $node->uid) . "
\n"; // Now detail has got additional information // Add Abstract if ($node->epublish_abstract) { if ( ($topic->weight != 99) && ($topic->weight != (-99)) && ($topic->weight != (-98)) ){ $o_detail .= '
' . check_output($node->epublish_abstract . ' ' . l("[more..]", "node/$nid") . ' ', $node->format) . "
\n"; } else { // Footer if ( ($topic->weight == 99) ){ $o_footer .= '
' . check_output($node->epublish_abstract, $node->format) . "
\n"; } // Header if ( $topic->weight == (-99)) { $o_header .= '
' . check_output($node->epublish_abstract, $node->format) . "
\n"; } // Advertisement if ( ($topic->weight == (-98)) ){ $o_advertisement .= ''. check_output($node->epublish_abstract, $node->format ); } } } // end of if for abstract $counter++ ; } // end of foreach statement (one) } if ( ($topic->weight != 99) && ($topic->weight != (-99)) && ($topic->weight != (-98)) ) { $o_index .= "\n\n" ; $o_detail .= "\n\n" ; $o_detail .= '
'.l( "Top","epublish/".arg(1)."/".arg(2).'#').'
' ; } } //end of foreach (two) if ( $o_advertisement ) { $o_advertisement = '\n"; } // Add a line after header if exists if ( $o_header ) { $o_header = $o_header . '
' ; } // Add a line before footer if exists if ( $o_footer ) { $o_footer = '
' . $o_footer ; } $output .= $o_header . $o_advertisement . $o_index . $o_detail . $o_footer ; $output = '
' . '
' . $description . $output . '
' .'
'; return $output ; } ?>