The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Showing Plugin output HELP
I am trying to show the output of a plugin I made:
I want to display the variable in the search widget but it does not seem to work. Code:
vB_Template::preRegister('vbcms_widget_searchwidget_page',array('latestposts' => $latestposts)); Code:
vB_Template::preRegister('header',array('test123' => $latestposts)); On another note what is the best hook to use for widgets ? Currently I am using global start |
#2
|
||||
|
||||
The Problem is the hook you use. global_start is deprecated and no longer existant in the cms. Use global_bootstrap_complete instead.
|
#3
|
|||
|
|||
Thanks cellarius, still does not work on the home page, however the widget is also in my articles template, when I goto the articles page it works fine there.
I did an echo "Executing" to make sure the plugin is executing itself and it does execute on the homepage just does not get put into the widget. here is the code I used. plugin_lastposts.php Code:
<? $date = strtotime('-30 days'); global $vbulletin; $query = "SELECT count(threadid) as counts FROM `thread` WHERE `dateline` > $date"; $latestpostsread = $vbulletin->db->query_read($query); $latestpostsfetch = $vbulletin->db->fetch_array($latestpostsread); $latestposts = $latestpostsfetch['counts']; ?> Code:
require_once('/opt/www/riu/staging/plugin_lastposts.php'); vB_Template::preRegister('vbcms_widget_searchwidget_page',array('latestposts' => $latestposts)); var_dump($latestposts); vB_Template::preRegister('header',array('test123' => $latestposts)); the template code: Code:
<div class="side-bar-box-header"> <div id="speach-bubble"> <span class="posts">x{vb:raw latestposts}x</span><br/> Threads in the last<br/>30 days </div> </div> <div class="side-bar-box-content"> <p class="title">Posts: {vb:raw prepared.totalposts}</p> <p class="date">Threads: {vb:raw totalthreads}</p> <p class="post">Members Online: {vb:raw totalonline}</p> {vb:raw result_html} </div> |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|