I'll tell you the things I still need to do and maybe one of ya can point me in the right direction. I'm pretty damn good, but honestly, I don't really know php. some of it is easy and then I have stupid stuff like this.
the idea is to list the last 20 posts but only show a thread once so several of the latest posts don't all point to the same thread.
right now it lists every post in a thread. I only want the newest post listed. here's the code I'm using to grab the postids
PHP Code:
$getpostids=$DB_site->query("
SELECT post.postid FROM post
WHERE post.visible=1 $datecut ORDER BY post.dateline DESC
LIMIT ".($limitlower-1).",$perpage ");
//GROUP BY post.threadid
this will give me the last 20 posts made in any forum but I don't want the same thread showing up multiple times.
see the Group by line I have commented out. If I stick that in right before the order by line, it limits the output to just one post per thread alright, but it gives me the first post in each thread instead of the latest. it's almost like it groups them before it orders them. I need it to be ordered before grouping but if I move the group by line to after the order by line, it doesn't work at all.
next
I'd like to limit the text to x amount of chars and tag on a "... read more" but I don't want to screw up the vb code by cutting off the text in the middle of a tag. do you guys know of any other vb hack that already does this so I could take a look at it instead of reinventing the wheel? maybe one of the news scripts?
finally
I forget there was something else but oh well.
please shoot me any suggestions or ideas.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
Unfortunately nobody here is interested in hacking the active thread topic as follows:
I Just want a simple listing in a table that is 25 rows and 2 columns wide, with each topic occupying one row (topic title, with link to it in like this:
here, use this. you should be able to modify it to build the table. it's from the any forum news hack
PHP Code:
/ ###################### Start Active Topics #######################
$getheadssql=$DB_site->query("SELECT threadid,thread.title as title,lastpost,forumid,open,replycount,dateline,views,visible,thread.iconid
".iif($foruminfo[allowicons],',icon.title as icontitle,icon.iconpath','')."
FROM thread
".iif($foruminfo[allowicons],'LEFT JOIN icon ON (icon.iconid = thread.iconid)','')."
WHERE visible=1 AND open!=10
ORDER BY lastpost DESC LIMIT 0,$maxactivetopics ");
while ($getheads=$DB_site->fetch_array($getheadssql)) {
$glforumid=$getheads[forumid];
$getforumnamesql=$DB_site->query("SELECT forumid,title FROM forum WHERE forumid=$glforumid");
$getforumname=$DB_site->fetch_array($getforumnamesql);
if (!$foruminfo[allowicons] or $getheads[iconid]==0) {
if ($showdeficon) {
$glicon='<img src="images/icons/icon1.gif" border="0" alt="">';
} else {
$glicon=" ";
}
} else {
$glicon="<img src=\"$getheads[iconpath]\" alt=\"$getheads[icontitle]\" width=\"15\" height=\"15\" border=\"0\">";
}
if ($foruminfo[allowicons] and $getheads[pollid]!=0) {
$glicon='<img src="{imagesfolder}/poll.gif" alt="Poll" width="15" height="15" border="0">';
}