The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Making a variable global?
I installed a the VB Image Hosting mod (https://vborg.vbsupport.ru/showthread.php?t=123481) which I love, but have an issue and though it's marked "supported", the author is not replying. I am hoping someone can help.
There's a template modification made to make the number of images the user has uploaded show in the postbit. It works fine in the forums, however, if I post an announcement, that space is left blank, like it can't retrieve the variable to know what to display. The variable it pulls into the postbit is called $post[vbimghost] and I'm wondering if someone could help direct me as to where to find what that variable is pulling from? I've gone through the files from the product but there's no "$post[vbimghost]" in them, so I'm a little lsot as to where to look. I'm newer to vB, but not to programming, so a push in the right direction would be helpful. |
#2
|
||||
|
||||
The $post variable is an array in the core vb functions that queries iirc the user and userfield tables.
|
#3
|
|||
|
|||
Thank you, that got me started. I actually found the code in a postbit for the mod, and it looks like this:
Code:
$rec = $vbulletin->db->query_read(" SELECT count(*) mark FROM ".TABLE_PREFIX."vbimghost WHERE userid='".$post['userid']."' and imgprivate='0' "); $row = $vbulletin->db->fetch_array($rec); $post['vbimghost']=$row['mark']; Now I am stuck. I can only guess that somehow, this plugin isn't being used when the postbit of an announcement is pulled, but I don't know why. |
#4
|
||||
|
||||
I'm not familiar with the mod but there are other hacks (like the journal and photopost and vbgallery, and maybe a few others) that work in a similiar way, they may have an answer to your issue.
If anything, I think the plug in is using a hook that is only called up for threads, not announcements. You may need to add the code to a new plugin using the correct hook, or changing the hook location to global. The later may have a performance hit on your forums so use with care. |
#5
|
|||
|
|||
Ah ha! You got me going in the right direction. The hook location was showthread_postbit_create and I changed it to postbit_display_complete and that fixed the issue.
Thank you. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|