xbleed
Sat 11th Dec '04, 5:44pm
I'm hoping someone can help me out. I'm new to this php stuff and I basically want to pull the 10 last updated articles in my article database up in the home page.
In article.php I have managed to add this:
//START NEW ARTICLES
$new = $DB_site->query("SELECT * FROM " . TABLE_PREFIX . "article ORDER BY dateline DESC LIMIT 10");
$newcount = $DB_site->num_rows($new);
eval('$articlebits .= "' . fetch_template('article_newbit') . '";');
if ($newcount > 0)
{
eval('$articlecontent .= "' . fetch_template('article_newlist') . '";');
}
else
{
eval('$articlecontent .= "' . fetch_template('article_newlist_noresults') . '";');
}
//END NEW ARTICLES Now I've added the two new templates, but I don't think I have that code 100% correct. I also need help in putting it it on the index page. Can anyone here point me in the right direction? I've been stuck on this for a while.
Thanks, and sorry for resorting to asking for help, I just can't figure it out.
In article.php I have managed to add this:
//START NEW ARTICLES
$new = $DB_site->query("SELECT * FROM " . TABLE_PREFIX . "article ORDER BY dateline DESC LIMIT 10");
$newcount = $DB_site->num_rows($new);
eval('$articlebits .= "' . fetch_template('article_newbit') . '";');
if ($newcount > 0)
{
eval('$articlecontent .= "' . fetch_template('article_newlist') . '";');
}
else
{
eval('$articlecontent .= "' . fetch_template('article_newlist_noresults') . '";');
}
//END NEW ARTICLES Now I've added the two new templates, but I don't think I have that code 100% correct. I also need help in putting it it on the index page. Can anyone here point me in the right direction? I've been stuck on this for a while.
Thanks, and sorry for resorting to asking for help, I just can't figure it out.