vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Getting Var to Work on forumhome (https://vborg.vbsupport.ru/showthread.php?t=118428)

Kirk Y 06-12-2006 11:38 PM

Getting Var to Work on forumhome
 
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:
Code:

function construct_forum_bit located in functions_forumlist.php
In that function there is the following if-block:
Code:

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:
PHP Code:

$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:
Code:

                        // 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.


All times are GMT. The time now is 07:36 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01294 seconds
  • Memory Usage 1,722KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete