View Full Version : Getting Var to Work on forumhome
Kirk Y
06-12-2006, 11:38 PM
How can I get the $thread variable to work on the index/forumhome. For example: $thread['closed']. I need to check whether or not the last thread shown on the forumbit is closed or not. Thanks in advance.
calorie
06-21-2006, 07:05 PM
An idea... Check the following function:
function construct_forum_bit located in functions_forumlist.php
In that function there is the following if-block:
if ($vbulletin->forumcache["$lastpostarray[$forumid]"]['lastpost'] > 0)
Where you could add some code to determine the status.
Kirk Y
06-21-2006, 09:45 PM
I was playing around with this code in that if-block:
$lastpostinfo['trimthread'] = fetch_trimmed_title($lastpostinfo['lastthread']);
But I don't think the thread's status is stored in the forumcache -- so it can't be checked. That was the wall I hit whenever I posted this thread.
calorie
06-21-2006, 10:27 PM
Right before the if-block, find and add the part in bold on a test board, and make sure to read the comments:
// dates & thread title
$lastpostinfo = $vbulletin->forumcache["$lastpostarray[$forumid]"];
// this is just an example and you may need to reduce the queries!
// do _NOT_ do it this way because there can be a query per forum!
$forumhome_threadid = $lastpostinfo['lastthreadid'];
$forumhome_threadinfo = fetch_threadinfo($forumhome_threadid);
$forumhome_open = $forumhome_threadinfo['open'];
// if $forumhome_open is the number one, then the thread is open
Again, heed the comments, as this is untested code and you may need to edit the file to reduce the queries.
Kirk Y
06-22-2006, 01:18 AM
Thanks Calorie -- this should be a good starting point for me.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.