![]() |
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"); 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! :) |
When I try this plugin code:
Code:
$modlinks = array("foo"); |
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! :) |
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()? |
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! :D --------------- 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. :( |
All times are GMT. The time now is 07:03 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|