Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Help with latest news v1.1.5 - Some questions on how to fix


Guest

Recommended Posts

How do i make the first headline in classic view then skip a couple of lines and have the text older news? Older news would be centered in bold. Then skip a couple more lines and display the next two headlines in normal view with the clickable link? Meaning a total of 3 headlines in the box. Below is an idea of what I am looking for. Any input would be appreciated. I have been playing around with this and having a little trouble getting it to work.

 

Help me help me! - Friday 12 May, 2006

Its super late and night and hopefully I made enough sense for you guys to kinda get an idea of what I am looking for.

 

---Older News (click on headline to read)---

 

 

New site features! - Thursday 04 May, 2006

Site upgrades coming soon! - Tuesday 02 May, 2006

Link to comment
Share on other sites

here is a copy of my latest_news.php in includes/modules

 

<?php

/*

latest_news.php v1.1.4 (by J0J0)

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2002 Will Mays

 

Released under the GNU General Public License

*/

?>

<!-- latest_news //-->

 

<?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);

}

}

 

 

if (LATEST_NEWS_BOX == "classic") {

 

$latest_news_query = tep_db_query('SELECT news_id, headline, content, date_added from ' . TABLE_LATEST_NEWS . " WHERE status = '1' and language = '". $languages_id. "' ORDER BY date_added DESC LIMIT " . MAX_DISPLAY_LATEST_NEWS);

 

} else {

 

$latest_news_query = tep_db_query('SELECT news_id, headline, date_added from ' . TABLE_LATEST_NEWS . " WHERE status = '1' and language = '". $languages_id. "' ORDER BY date_added DESC LIMIT " . MAX_DISPLAY_LATEST_NEWS);

}

 

 

if (!tep_db_num_rows($latest_news_query)) { // there are no news

echo '<!-- no news -->';

} else {

$info_box_contents = array();

$info_box_contents[] = array('align' => 'left',

'text' => TABLE_HEADING_LATEST_NEWS);

new contentBoxHeading($info_box_contents);

 

$info_box_contents = array();

$row = 0;

while ($latest_news = tep_db_fetch_array($latest_news_query)) {

 

if(LATEST_NEWS_BOX == "small") {

 

$info_box_contents[$row] = array('align' => 'left',

'params' => 'valign="top" class="smallText"',

'text' => '<a href="' . tep_href_link(FILENAME_NEWS, "news_id=".$latest_news['news_id']) ."#newsid". $latest_news['news_id'] .'">'

."<b>".tep_date_short($latest_news['date_added'])

.'</b> - '

.eval_html($latest_news['headline']) . '</a><br>');

 

} elseif (LATEST_NEWS_BOX == "classic") {

 

$info_box_contents[$row] = array('align' => 'left',

'params' => 'class="smallText" valign="top"',

'text' => '<b>' . eval_html($latest_news['headline']) . '</b> - <i>' . tep_date_long($latest_news['date_added']) . '</i><br>' . nl2br(eval_html($latest_news['content'])) . '<br>');

 

 

} else {

 

$info_box_contents[$row] = array('align' => 'left',

'params' => 'valign="top"',

'text' => '<table border="0" cellspacing="0" cellpadding="0"><tr>'

.'<td class="smallText">'

.'<a href="' . tep_href_link(FILENAME_NEWS, "news_id=".$latest_news['news_id']) ."#newsid". $latest_news['news_id'] .'">'

.tep_date_short($latest_news['date_added'])."</a></td>"

.'<td class="smallText"> - </td>'

.'<td class="smallText"><b>'

.'<a href="' . tep_href_link(FILENAME_NEWS, "news_id=".$latest_news['news_id']) ."#newsid". $latest_news['news_id'] .'">'

.eval_html($latest_news['headline']) . '</a></b></td></tr></table>');

}

 

$row++;

}

new contentBox($info_box_contents);

}

?>

<!-- latest_news_eof //-->

Link to comment
Share on other sites

anyone....:(

 

 

You may want to try the support thread for the contribution. Anytime you have questions/problems with a particular contribution the best place to go is the support thread.

The Knowledge Base is a wonderful thing.

Do you have a problem? Have you checked out Common Problems?

There are many very useful osC Contributions

Are you having trouble with a installed contribution? Have you checked out the support thread found Here

BACKUP BACKUP BACKUP!!! You did backup, right??

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...