Quote:
Originally Posted by radiofranky
that's too much for me..  i guess i need to play vb a little more before I can grasp the idea
is there an easier way to display forum total post and total user number in the header section?
cheers
--------------- Added [DATE]1311838146[/DATE] at [TIME]1311838146[/TIME] ---------------
thanks. But how did you figure out that this is where plugin code gets evaluated? Is there any documentation from vb or just by doing try and error?
what does {vb raw totalpost} menas? and how to use it in the templates?
If I see it in xyz template, can I use it in zzz template? I tried it, but with no luck so far. It seems is returning null.
|
You look to confused but that happens if it is ur first time.
{vb:raw totalpost} = $totalpost
First will start from VB3
For Ex:
Suppose i created a plugin:
Hook: forumhome_complete
Code:
Code:
$myvar = 2;
//and other things....
As you can see in plugin we assigned
$myvar = 2,
so we can use
$myvar variable in
FORUMHOME template.
Now some question's comes in our mind:
1. can i use $myvar in other place like user profile.
Ans.
No, because forumhome_complete plugin hook execute at homepage only. So you need to find a diff hook for it, you can use debug mode to get the right hook.
Now lets come to
VB4
All the things will be same as in vb3, except few changes.
Hook: forumhome_complete
Code:
PHP Code:
$myvar = 2;
//and other things....
vB_Template::preRegister('FORUMHOME',array('myvar' => $myvar)); //This line register myvar in FORUMHOME template.
Now in
FORUMHOME template u can use
Read This article to know more about Registering variable's in templates.
Code:
https://vborg.vbsupport.ru/showthread.php?t=228078