The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
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! |
#2
|
|||
|
|||
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. |
#3
|
|||
|
|||
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. |
#4
|
|||
|
|||
Did you go thru the information posted in our articles section?
|
#5
|
|||
|
|||
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. |
#6
|
|||
|
|||
After including global.php, start by examining the $vbulletin array. You will find most information there.
|
#7
|
|||
|
|||
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. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|