muskokee Posted January 31, 2007 Share Posted January 31, 2007 Hi everyone, I am once again working on an article manager addition. The last one was HERE. All the code and fixes are within that thread--it adds another date option to indicate when the article was written as opposed to the date it was added or the date it is available. My next mod involves showing a random article on the index page, default section (but could be placed anywhere really). I wrote the mod myself, but could not get it to behave properly..so I re-wrote this CONTRIB to work with the article table rather than the product table. Problem: this behaves exactly the same way my hand coded mod does What happens: The article is randomly chosen and displayed BUT the description or short description does not get displayed each and everytime the page is loaded. The name, and link work fine...just an empty description. VERY VERY FRUSTRATING. I cannot see what the problem is. Anyone else? <?php //SET THE QUERYS $sql_query = tep_db_query("select distinct a.articles_id, ad.articles_name, ad.articles_description from " . TABLE_ARTICLES_DESCRIPTION . " ad left join " . TABLE_ARTICLES . " a on a.articles_id = ad.articles_id where a.articles_status = '1' and a.articles_protected = '1' order by rand() limit " . MAX_DISPLAY_RANDOM_ARTICLES); $info_box_contents = array(); $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_ARTICLES)); new contentBoxHeading($info_box_contents); $info_box_contents = array(); $row = 0; $col = 0; $info_box_contents = array(); while ($new_articles = tep_db_fetch_array($sql_query)) { $new_articles['articles_name'] = tep_get_articles_name($new_articles['articles_id']); $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"', 'text' => '<a href="' . tep_href_link(FILENAME_ARTICLE_INFO, 'articles_id=' . $new_articles['articles_id']) . '">' . $new_articles['articles_name'] . '</a><br>'.$new_articles['articles_description'] ); $col ++; if ($col > 2) { $col = 0; $row ++; } } new contentBox($info_box_contents); ?> Any help appreciated. :) Sheri PS - I have article manager 1.2 installed. I don't want to update the version as it is working just fine. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.