PDA

View Full Version : Need help whith a plugin [vB3.8 > vB4]


Arcade Fire
11-16-2009, 04:46 PM
Hello, long time to create a plugin for my users to add a code in the title (+ pv) deprived his subjects could do if they wanted visitors.

Hook Location: showthread_postbit_create

if(stristr($thread[title], '+pv') == TRUE)
{
$onlyreg = TRUE;
}

and in my showthread after $navbar:

<if condition="($onlyreg == TRUE) and ($bbuserinfo[posts]<=1)">
<center><h2>Thread Visible for Registered Users Only</h2></center>
<else />

and below $footer:

</if>

but doesn?t work in vB4. :(

Lynne
11-16-2009, 04:56 PM
You need to preregister $onlyreg for use in that template after you define it.

vB_Template::preRegister('SHOWTHREAD', array('onlyreg' => $onlyreg));

Arcade Fire
11-16-2009, 05:24 PM
Thanks Lynne, Can you outline the steps to follow? :erm:

Lynne
11-16-2009, 05:30 PM
I did. Add that line after you defined the variable.