Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Latest news add on installation problems


myristica

Recommended Posts

Posted

Hi all,

 

I'm having this problem with the latest news add on.

I added it to my index.php file and it shows on the main page, but the box is super tiny. I don't know what is causing is or how to configure it to stretch wider.

 

This is the website where it is being displayed:

http://twinkels.be/

 

I think the solution is somewere in the catalog > includes > modules > latest news.php file.

These are the contents of the file:

<?php

/*

$Id: latest_news.php,v 1.2 2002/11/11 06:38:08 will Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2002 Will Mays

 

Released under the GNU General Public License

*/

?>

<!-- latest_news //-->

<?php

 

$latest_news_query = tep_db_query('SELECT * from ' . TABLE_LATEST_NEWS . ' WHERE status = 1 ORDER BY date_added DESC LIMIT ' . MAX_DISPLAY_LATEST_NEWS);

 

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

echo '<!-- ' . TEXT_NO_LATEST_NEWS . ' -->';

} else {

echo '<div class="ui-widget infoBoxContainer">';

echo '<div class="ui-widget-header ui-corner-top infoBoxHeading">' . TABLE_HEADING_LATEST_NEWS . '</div>';

 

$info_box_contents = array();

$row = 0;

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

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

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

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

$row++;

}

new contentBox($info_box_contents);

}

echo '</div>';

?>

<!-- latest_news_eof //-->

 

 

The result of this you can see in attached file (post-314912-0-52970500-1389774788_thumb.png)

 

When I change the declaration in red to:

echo '<div class="ui-widget-header ui-corner-top infoBoxHeading" style="width:100%">' .

The heading will strecht to the size I want it to be, but it is still to far to the right. Also I can't find anyway to stretch the text box below to be bigger! (see file attached post-314912-0-05130600-1389774790_thumb.png)

 

Can anyone help me?

 

Thank you!

Posted

Can't really help, sorry for the off-topic, but you have really nice pages!

May I ask, own coding or consulted service?

Posted

Oh thank you! :)

It's own coding. I don't have an IT related degree in school either. I'm just very interested and enjoy playing around with it. It took me a bit but I'm happy with how it's turning out.

Posted

why don't you try to give it a new class? rename it and restyle it to whatever you like.

give it a new class and add the new class inside the stylesheet.css

 

i don't know how far you are with your css skills but i recommend the following link.

 

http://www.w3schools.com/css/default.asp

Posted

Hi,

 

on my site this code works fine:

 

<!-- latest_news //-->

<?php

 

$latest_news_query = tep_db_query('SELECT * from ' . TABLE_LATEST_NEWS . ' WHERE status = 1 ORDER BY date_added DESC LIMIT ' . MAX_DISPLAY_LATEST_NEWS);

 

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

 

} else {

 

?>

<div class="ui-widget-header infoBoxHeading">

<?php echo '<a href="' . tep_href_link(FILENAME_LATEST_NEWS) . '"> ' . TABLE_HEADING_LATEST_NEWS .' </a>' ; ?>

</div>

<div class="ui-widget-content contentTextNews" style="padding-left: 15px;">

 

<?php

$info_box_contents = array();

$row = 0;

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

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

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

'text' => '<strong>' . $latest_news['headline'] . '</strong> - <i>' . tep_date_short($latest_news['date_added']) . '</i>' . $latest_news['content'] .'<hr />');

$row++;

}

new contentBox($info_box_contents);

?>

</div>

<?php

}

?>

 

<!-- latest_news_eof //-->

 

Maybe it also depends on WHERE you include the module into your index.php. I did it right above: include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS);

 

Regards

J.J.

Archived

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

×
×
  • Create New...