Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-21-2010, 02:34 AM
gcc.programmer gcc.programmer is offline
 
Join Date: Feb 2010
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How to access $threadbits??

I've been called upon to do some modifications to vB 3.8.x, and though I'm a PHP programmer, I'm sure everyone here knows that doesn't mean squat for *knowing* how to code vB! I'm hoping to cut corners in having to read through a lot of source code.

I've done all the I suppose "regular" things, i.e. importing ./global.php, as well as some of the source from index.php to grab hold of some of the variables it exposes. A bit more difficult is finding the ellusive $threadbits. It appears that some of the db access done in forumdisplay.php may be what I need, but I don't find the actual variable $threadbits being built there.

Is there a resource I could be pointed to that breaks down vB databases, or even some source code someone might share that would allow me to grab $threadbits in my template?

I've essentially created a test.php file, and a TEST template, and am able to pull in, as I said, the info built in the index.php page.

Any guidance or wisdom would be greatly appreciated!
Reply With Quote
  #2  
Old 02-21-2010, 10:54 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just started myself around 6 months ago. There is no resource that I know of, unfortunately. I use grep a lot.

I think threadbits is built in forumdisplay like you said. Around line 959 $threadbit is set as a reference to either $threadbits or $threabit_sticky, then one or the other is added on to by evaling a template. (That's all in the loop getting records from the database).

If you have to read the db yourself, I use install/mysql-schema.php as a reference.
Reply With Quote
  #3  
Old 02-22-2010, 05:11 PM
gcc.programmer gcc.programmer is offline
 
Join Date: Feb 2010
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks kh99.

Yeah, I noted that also, and attempted a few cut and paste permutations to try and set it up in my test.php file, making sure to do all the includes, etc. that were called for in forumdisplay, but thus far haven't found the right mojo. Only a small part of my failure can be attributed to being in a hurry. The bulk of my failure so far, I think, has more to do with the fact that this is apparently going to take some detailed study of forumdisplay.

I just hate to get into it that deeply, and re-invent the wheel when I feel that someone else must have already done it, and have the boilerplate code. So far though, it's looking more like I'm going to have to dig in.
Reply With Quote
  #4  
Old 02-25-2010, 10:56 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Did you go thru the information posted in our articles section?
Reply With Quote
  #5  
Old 03-02-2010, 02:40 AM
gcc.programmer gcc.programmer is offline
 
Join Date: Feb 2010
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello Marco:

Yes, in fact, I read fairly extensively on the forums and articles sections. In the end, for this and a few other things I needed to do, I just dug through the DB Schemas, and then accessed the things I needed directly from the database. A very quick, and very easy solution to the problem!

Thank you for taking the time to post.
Reply With Quote
  #6  
Old 03-02-2010, 08:14 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

After including global.php, start by examining the $vbulletin array. You will find most information there.
Reply With Quote
  #7  
Old 03-03-2010, 09:47 AM
gcc.programmer gcc.programmer is offline
 
Join Date: Feb 2010
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks again, Marco.

It looks like I will be getting my hands dirty inside of vB after all. This was actually a question due to my need to pull info out to then pass to outside of vB.

I ended up going to the database direct for a lot of the things, and also making use of external.php for it's javascript goodness. But I do appreciate the heads up. Now my boss wants some tweaks inside of vB too, so this gives me a good starting point.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:01 PM.


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.03902 seconds
  • Memory Usage 2,213KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete