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.

Log In



Forum

Mods and Licensing
Hi Egg, Its been a while, but I noticed some user...
F4ris @ 3:39pm, 8 September 2010

Need search engine friend...
Hi again, I have managed to have a look through m...
F4ris @ 11:47am, 8 September 2010

Can't create article...
Hi all, I just downloaded and installed Eggblog, ...
Daniel @ 1:30pm, 21 August 2010

Any more Templates and CS...
Another simple modified eggBlog in action http://w...
wL @ 6:09pm, 17 August 2010

Why can't open the l...
I just review some website link,but unfortunatly,i...
fansi123 @ 8:26am, 13 July 2010

Sourceforge

Download bandwidth is kindly supplied by sourceforge.net.

Donations

Donating to the eggBlog project is a great way to say thanks and to keep security updates and this website going.

Web Design

This project is supported by tenfourzero.net, freelance web design and development.