PDA


View Full Version : Latest threads/latest posts


Nordinho
08-30-2005, 07:06 PM
I'm trying to get my copied recent threads module to show only the latest threads in the left column while the original center module functions as the 'latest forum posts'...

I tried it a bit myself and come up with the following in latesttopics.php...

if ($mods['modcol'] == 1)
{
ORDER BY lastpost DESC;
}
else
{
ORDER BY thread.dateline DESC;
}

but this doesn't work...getting a parse error...any ideas how it could be done right??

Nordinho
09-01-2005, 04:44 PM
bump ;)

Brian
09-02-2005, 02:13 PM
if ($mods['modcol'] == 1)
{
$torder = 'lastpost';
}
else
{
$torder = 'thread.dateline';
}

Then replace 'ORDER BY lastpost DESC' with 'ORDER BY $torder DESC'.

Nordinho
09-02-2005, 02:45 PM
thanks for your help, but I'm still getting an parse error...this is the part

WHERE open != 10 AND thread.visible = 1
$mods[threadids]
$mods[inforums]
$mods[exforums]
$notdeleted
if ($mods['modcol'] == 1)
{
$torder = 'lastpost';
}
else
{
$torder = 'thread.dateline';
}
ORDER BY $torder DESC
LIMIT $mod_options[portal_threads_maxthreads]
");

Brian
09-02-2005, 03:22 PM
That code needs to be added somewhere above the query.

Nordinho
09-02-2005, 05:04 PM
that was too easy ;) thanks a lot!!