Okey i have make this plugin for this forum.
sorry i late and i have to share this for other people who want to learn about php server side scripting.
This Plugin will show the avg user's post at day or week or month.
Plugin Name : Post Per Week
- First u have login into vbulletin admin control panel go to Plugins & Products -> Add new plugin
- The u will see form like below
I will explain what is that :
Product : Name of Plugin Product
Hook location : where the plugin code will be execute.
Title : Description what is the plugin for.
Execution Order : index of plugin will be execute...if you have another plugin then you put 1 for this plugin, so this plugin will be execute first
Plugin Code : Here is the code of plugin will be execute.
Plugin is Active : togle to active the plugin.
Okey Now Just fill the form like the image, for code put this code to the plugin code
PHP Code:
$jointime = (TIMENOW - $vbulletin->userinfo['joindate']) / 2419200; //its for a month if you can change to 604800 seconds for 1 week, 84600 for 1 day.
if ($jointime < 1) // if they join time is less then 1 day
{
$postspermonth = vb_number_format($vbulletin->userinfo['posts']); put they current post
}
else
{
$postspermonth = vb_number_format($vbulletin->userinfo['posts'] / $jointime, 2); // more than 1 day..
}
vB_Template::preRegister('memberinfo_block_statistics',array('postspermonth' => $postspermonth)); // puss variable into template hook
Then Click Save and Reload.
For add plugin to you vbulletin is done. but we have edit our template to use the plugin.
Editing Template for Plugin
- First Go To Styles & Templates -> Style Manager
- At a combo box chose the Edit Template
- Then find the template at Member Info Template.. here we used memberinfo_block_statistics inside Member Info Template to hook the plugin..double click memberinfo_block_statistics.
Find The Place that u want to put it..
for example ..
Find This :
PHP Code:
<dl class="blockrow stats">
<dt>{vb:rawphrase posts_per_day}</dt>
<dd> {vb:raw prepared.postsperday}</dd>
</dl>
Add Below :
PHP Code:
<dl class="blockrow stats">
<dt>{vb:rawphrase posts_per_month}</dt>
<dd> {vb:raw postspermonth} </dd>
</dl>
then save and reload.
Then Go To Languages & Phrases -> Phrase Manager
Click Add New Phrase
At Varname put : posts_per_month
at Text put : Post Per Month
Then save it..
Its done just view your user profile or other user profile.. you will see the post per month there..
Hope this tutorial is Useful..
and yes i create this plugin just by my self. if you want to get explain about the code just ask here..