The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Adding quick moderation to header template
I'm trying to add everything back to a few of my sites since I've upgraded everything to vBulletin 4+...
I had all of my moderation links display in the header template if I had anything that needed to be moderated. Basically, the idea is pretty much: Moderation link replaces logo if there are items to be moderated. I'm currently using the following code in the global_start hook: Code:
$modlinks = $db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "adv_links WHERE valid = 0"); vB_Template::preRegister('header',array('modlinks' => $modlinks)); Code:
<vb:if condition="$modlinks">Test</vb:if> I have also tried the parse_templates hook, which works for some things, however, when using that hook instead of global_start... I get a blank page. Any help would be appreciated! |
#2
|
|||
|
|||
When I try this plugin code:
Code:
$modlinks = array("foo"); vB_Template::preRegister('header',array('modlinks' => $modlinks)); |
#3
|
||||
|
||||
adv_links is an addon vBadvanced Links Directory.
I'm trying to do the same thing with everything else... you could also try with this: Code:
$modthreads = $db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "thread WHERE visible = 0"); Thanks for your help! |
#4
|
|||
|
|||
Hmm...I may be wrong. I'm not sure if there is any condition where $db->query_first returns something that would cause the conditional to be false. I put a different query in there like you suggested and it worked.
So could you problem be that something else is changing the value of $modthreads before you get to the header template render()? |
#5
|
||||
|
||||
Hmm... well, I'm glad you said that, however there isn't anything else changing the value of it. It seems to have been the execution order for some reason. Anything 5+ doesn't work, less than 5, it works just fine.
Thank you! --------------- Added [DATE]1306898872[/DATE] at [TIME]1306898872[/TIME] --------------- Err... looks like I actually spoke too soon. When changing to execution order to 4 or below, all of the variables have a value of "Array" instead of the actual number. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|