PDA

View Full Version : last posts in main page in website


q8manar
04-15-2005, 07:40 PM
Hello

I found some webpages have a last posts on there main pages in web site
these last posts are in tables format

I don't want moving last posts

I need as a pages than I can put them in my main page

is this hack or scripts

Please any body advise me >

q8manar
04-17-2005, 06:16 PM
Where is every body
where are the profechonals

I'm sure this is eassy but I couldn't find out it .

Please any body

sabret00the
04-17-2005, 06:34 PM
what'a an example of hwat you're talking about?

Trigunflame
04-17-2005, 06:44 PM
Where is every body
where are the profechonals

I'm sure this is eassy but I couldn't find out it .

Please any body

1. In your php_include template, put

$lastPost = $DB_site->query_first('SELECT * FROM post ORDER BY postid DESC LIMIT 1');

2. wherever you want this stuff to show up, u can use it like

$lastPost[postid]
$lastPost[threadid]
$lastPost[username]
$lastPost[userid]
$lastPost[dateline]
$lastPost[pagetext]

etc..

Enjoy

sabret00the
04-17-2005, 06:50 PM
$lastPost = $DB_site->query_first('SELECT * FROM post ORDER BY postid DESC LIMIT 1');

should be

$lastPost = $DB_site->query_first("SELECT * FROM " . TABLE_PREFIX . "post ORDER BY postid DESC LIMIT 1");

Trigunflame
04-17-2005, 07:36 PM
$lastPost = $DB_site->query_first('SELECT * FROM post ORDER BY postid DESC LIMIT 1');

should be

$lastPost = $DB_site->query_first("SELECT * FROM " . TABLE_PREFIX . "post ORDER BY postid DESC LIMIT 1");

oopsie, i always forget that :'(