The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Help with a header plugin...
Hi all! I'm trying to create a random quote plugin for my board's header.
So far, i created the following plugin on global_bootstrap_init_start: Code:
if ($result = $vbulletin->db->query_first (" SELECT text, author FROM " . TABLE_PREFIX . "cs_randomquotes WHERE approved = 1 ORDER BY RAND() LIMIT 1 ") ) { $templater = vB_Template::create('header_randomquote'); $templater->register('author', $result['author']); $templater->register('text', $result['text']); $randomquote = $templater->render(); } else $randomquote = ''; vB_Template::preRegister('header', array('randomquote' => $randomquote)); Code:
<div class="text">{vb:raw text}</div> <vb:if condition="$author"> <div class="author">{vb:raw author}</div> </vb:if> Code:
<div id="header_randomquote">{vb:raw randomquote}</div> |
#2
|
||||
|
||||
Change your else to actually spit something out in $randomquote so you can see which path it is taking (if or else).
|
#3
|
||||
|
||||
Quote:
Your missing a closing brace on your IF/ELSE block in your plugin |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|