last article on frontpage
hi! I installed eggblog in my site, I'm making some changes and I've a question...
How I can print the last article in the frontpage?
I add inc_main.php (you can see inside of red square) for include somes blocks, like "last articles wrote"
http://s4.subirimagenes.com/imagen/41985901.png
I can see that the function eb_article($comments,$id) in news.php print the articles if you select the ID.
I was thinking about a MySQL query, sort by ID and select the largest (up to here I come) and call eb_article function (this is where I locked)
Here you can see the inc_main.php code:
http://www.pastebin.org/11112
keen - 4:42pm, 12 March 2010
Maybe someone wants help me... I sure that's easy, but I can't find the solution :S
Thanks!
keen - 4:45pm, 12 March 2010
I think your idea would work. Look for the article id or even the article date. Seems like your on the right track.
eggbuser - 8:15pm, 13 March 2010
yes of course, but, How I use the eb_article fuction in another php (inc_main.php) ?
I think this's the only thing missing... or How I can make the php file using the fuction?
keen - 4:46pm, 14 March 2010
I discovered how,
<?php
require_once '_lib/global.php';
$lastID = XXX // any function that returns the last ID or date of the article
echo eb_article(1,array($lastID));
?>
enjoy :S
keen - 2:49pm, 15 March 2010
Submit a post to this topic
You are not logged in.