The Arcive of vBulletin Modifications Site. |
|
|
#1
|
||||
|
||||
|
I'm trying to integrate my chatbox to the sidebar on the forum
My bloc forum calls my template (which displays well Chatbox [Archives] output_template : $output) my bloc content is : Code:
$output='$output'; return $output; If I put an echo $output in the forum.php file, it displays well at the top of the forum But not in my template (whereas I put Code:
{vb:raw output}
Code:
$templater->register('output',$output);
|
|
#2
|
|||
|
|||
|
I think your problem is this:
PHP Code:
|
|
#3
|
||||
|
||||
|
If I don t add it, the bloc disent display at all I think ...
|
|
#4
|
|||
|
|||
|
I'm not exacly sure what you're trying to do. Where does $output get set?
|
|
#5
|
||||
|
||||
|
Code:
//affichage widget dans forum
// CHATBOX
// SIDE BOX POUR CHATBOX
global $show;
global $output;
// Core
require_once(DIR . '/mgc_cb_evo/classes/class_core.php');
$MGCCbEvoCore = new MGCCbEvo_core(vB::$vbulletin,vB::$vbulletin->userinfo['permissions']);
$MGCCbEvoCore->unserialize_user_params();
if ($MGCCbEvoCore->show_chatbox() && $MGCCbEvoCore->evo_permissions->can_view())
{
$show['mgc_cb_evo'] = 1;
// Construct chatbox display
require_once(DIR . '/mgc_cb_evo/classes/class_display.php');
require_once(DIR . '/mgc_cb_evo/addons/cms/classes/class_display.php');
$MGCCbEvoDisplay = new CMS_MGCCbEvo_display(vB::$vbulletin,$MGCCbEvoCore);
// Display construction
$output = $MGCCbEvoDisplay->construct_display();
//echo "output_fichier : $output";
}
else
{
$show['mgc_cb_evo'] = 0;
}
whereas in my template, this Code:
output template {vb:raw output} $output
|
|
#6
|
|||
|
|||
|
The code you posted above, where so you have that? Is it in a plugin, in the forum block, or in forum.php?
You mentioned you template. What template is it, and where is the code that renders it? You said you added a call to $templater->register at the end of forum.php? Is hat where your template rendering code is, or are you adding it to the line for registering to FORUMHOME? |
|
#7
|
||||
|
||||
|
This code is my forum.php
I m trying to do a "plugin" to add the chatbox in the side bar ! The content of my bloc is Code:
$output='$output'; return $output; Code:
<li>
<div class="block smaller">
<div class="blocksubhead">
<a class="collapse" id="collapse_block_html_mgccbevo" href="{vb:raw relpath}#top"><img alt="" src="{vb:stylevar imgdir_button}/collapse_40b.png" id="collapseimg_html_mgccbevo"/></a>
<span class="blocktitle">
Chatbox [<a href="{vb:raw vboptions.bburl}/{vb:raw vboptions.mgc_cb_evo_filename}.php?{vb:raw session.sessionurl}do=view_archives&page=1">{vb:phrase mgc_cb_evo_archives}</a>]
</span>
</div>
<div id="block_html_mgccbevo" class="blockbody floatcontainer">
<div class="blockrow" align="center">
<div style="width:100%; height: {vb:raw vboptions.mgc_cb_evo_notifs_sidebar_height}px;overflow-y: auto;border: none; z-index: 1;" id="schats_container">
<table width="100%" align="{vb:stylevar left}" cellspacing="0" cellpadding="0">
<tbody id="schats">
<tr>
<td>output template {vb:raw output} $output</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="underblock"></div>
</li>
|
|
#8
|
|||
|
|||
|
OK, I think what you could do is to change the output part of the template to this:
Code:
<td>{vb:raw content}</td>
PHP Code:
You could also put all the code in the bloc content area, and return $output at the end, but maybe you're not doing that because you need $show['mgc_cb_evo'] set before it gets to the block code? |
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|