Quote:
Originally Posted by aeroguy
could some add a join table function as to also enable to show what forum the threads are in. The get thread function within the mod already sees the forum id just need a join to get the name from the id.
|
Should be done with:
PHP Code:
## GET LATEST THREADS ##
$getthreads = $db->query_read("
SELECT forum.title AS forumtitle, thread.*, thread.iconid AS threadiconid $previewfield
FROM " . TABLE_PREFIX . "thread AS thread
LEFT JOIN " . TABLE_PREFIX . "deletionlog AS deletionlog ON (thread.threadid = deletionlog.primaryid AND type = 'thread')
LEFT JOIN " . TABLE_PREFIX . "forum AS forum ON (forum.forumid = thread.forumid)
$previewjoin
WHERE thread.open = '1'
AND thread.forumid NOT IN (0$limitfids)
AND thread.visible = '1'
AND deletionlog.primaryid IS NULL
ORDER BY lastpost
DESC LIMIT 10");
and to restrict the lenght add after:
PHP Code:
$thread['title'] = fetch_censored_text(fetch_trimmed_title(unhtmlspecialchars($thread['title']), 55));
PHP Code:
$thread['forumtitle'] = fetch_censored_text(fetch_trimmed_title(unhtmlspecialchars($thread['forumtitle']), 50));
To show the name of the forum you have to change the Template forumhome_latestthreadbit, add
PHP Code:
<a href="forumdisplay.php?$session[sessionurl]f=$thread[forumid]" title="go to $thread[forumtitle]">$thread[forumtitle]
or something like that.