MikeyF Posted June 21, 2004 Posted June 21, 2004 First of all the different people who contributed to this add-on did a great job! I installed the "Latest News Box" on the right column. Is there a way to comment out the date on the box? If this is possible please explain where and how to accomplish this. Thanks
MikeyF Posted June 23, 2004 Author Posted June 23, 2004 Here is the code to the news.php: <?php /* latest_news.php v1.1.4 (by J0J0) osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 Johannes Hoppe Released under the GNU General Public License */ require('includes/application_top.php'); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT); $breadcrumb->add(TABLE_HEADING_LATEST_NEWS, tep_href_link(FILENAME_NEWS)); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <?php if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) { require(DIR_WS_INCLUDES . 'header_tags.php'); } else { ?> <title><?php echo TITLE; ?></title> <?php } ?> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="3" cellpadding="3"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table></td> <!-- body_text //--> <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php echo TABLE_HEADING_LATEST_NEWS; ?></td> <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_specials.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td> </tr> </table></td> </tr> <!-- <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> --> <tr> <td class="main"> <!-- latest_news //--> <?php $listing_sql = 'select news_id, headline, content, date_added from ' . TABLE_LATEST_NEWS . " news where status = '1' and language = '". $languages_id. "' order by date_added DESC"; if (PROJECT_VERSION == "osCommerce 2.2-MS1" OR defined("LATEST_NEWS_MS1")) { $listing_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_LATEST_NEWS_PAGE, $listing_sql, $listing_numrows); $listing_query = tep_db_query($listing_sql); } else { $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_LATEST_NEWS_PAGE); $listing_numrows = $listing_split->number_of_rows; $listing_query = tep_db_query($listing_split->sql_query); } if ( ($listing_numrows > 0) && ( (PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3') ) ) { ?> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="smallText" align="right"><?php if (PROJECT_VERSION == "osCommerce 2.2-MS1" OR defined("LATEST_NEWS_MS1")) { echo TEXT_RESULT_PAGE . ' '; $listing_split->display_links($listing_numrows, MAX_DISPLAY_LATEST_NEWS_PAGE, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'info', 'x', 'y'))); } else { echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); }?></td> <td class="smallText" align="right"><?php ?></td> </tr> </table> <?php } if(!function_exists('eval_buffer')) { function eval_buffer($string) { ob_start(); eval("$string[2];"); $return = ob_get_contents(); ob_end_clean(); return $return; } } if(!function_exists('eval_print_buffer')) { function eval_print_buffer($string) { ob_start(); eval("print $string[2];"); $return = ob_get_contents(); ob_end_clean(); return $return; } } if(!function_exists('eval_html')) { function eval_html($string) { $string = preg_replace_callback("/(<\?=)(.*?)\?>/si", "eval_print_buffer",$string); return preg_replace_callback("/(<\?php|<\?)(.*?)\?>/si", "eval_buffer",$string); } } echo "<div style=\"width:100%;text-align:center;\">"; echo "<div style=\"width:90%\">"; while ($listing = tep_db_fetch_array($listing_query)) { echo '<a name="newsid'. $listing["news_id"] .'"><br></a>'; $info_box_contents = array(); if(isset($HTTP_GET_VARS["news_id"]) AND $HTTP_GET_VARS["news_id"] == $listing["news_id"]) { $info_box_contents[] = array('text' => '<table border="0" width="100%" cellspacing="0" cellpadding="0"><tr>' .'<td align="left" class="infoBoxHeading">' .'<div class="main" style="color:black;">'.eval_html($listing["headline"]).'</div>' .'</td>' .'<td align="right" class="infoBoxHeading">' .'<div class="main" style="color:black;">'.tep_date_long($listing["date_added"].'</div>') .'</td>' ."</tr></table>\n"); } else { $info_box_contents[] = array('text' => '<table border="0" width="100%" cellspacing="0" cellpadding="0"><tr>' .'<td align="left" class="infoBoxHeading">' .'<div class="main">'.eval_html($listing["headline"]).'</div>' .'</td>' .'<td align="right" class="infoBoxHeading">'. '<div class="main">'.tep_date_long($listing["date_added"].'</div>') .'</td>' ."</tr></table>\n"); } new infoBoxHeading($info_box_contents, true, true); $info_box_contents = array(); $info_box_contents[] = array('text' => '<div class="main">'.nl2br(eval_html($listing["content"])).'</div>'); new infoBox($info_box_contents); echo "<br>"; } echo "</div>"; echo "</div>"; if ( ($listing_numrows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) { ?> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="smallText" align="right"><?php if (PROJECT_VERSION == "osCommerce 2.2-MS1" OR defined("LATEST_NEWS_MS1")) { echo TEXT_RESULT_PAGE . ' '; $listing_split->display_links($listing_numrows, MAX_DISPLAY_LATEST_NEWS_PAGE, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'info', 'x', 'y'))); } else { echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); }?></td> </tr> </table> <?php } ?> <!-- latest_news_eof //--> </td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> </table></td> <!-- body_text_eof //--> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- right_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?> <!-- right_navigation_eof //--> </table></td> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> <br> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
Recommended Posts
Archived
This topic is now archived and is closed to further replies.