[Vbulletin Plugin] Post This Month / User
Okey this seconds plugin for PGC forum.
For how to used it, same as before but the plugin code is diferent...and must add some new template code.[Only registered and activated users can see links. Click Here To Register...]
Now i just put the code and the template code that u have add.
if have any question just posting here..
HERE IS THE PLUGIN CODE
PHP Code:
$getlastposts = $db->query_read("
SELECT COUNT(*) as total
FROM " . TABLE_PREFIX . "post AS post
WHERE post.userid = " . $vbulletin->userinfo['userid'] . "
AND
MONTH(FROM_UNIXTIME( post.dateline )) = MONTH(NOW())
AND
YEAR(FROM_UNIXTIME( post.dateline )) = YEAR(NOW())
ORDER BY post.dateline DESC
");
if ($getlastpost = $db->fetch_array($getlastposts))
{
vB_Template::preRegister('memberinfo_block_statistics',array('poststhismonth' => $getlastpost['total']));
}
And put This Code On - 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_this_month}</dt>
<dd> {vb:raw poststhismonth} </dd>
</dl>
then save and reload.
Then Go To Languages & Phrases -> Phrase Manager
Click Add New Phrase
At Varname put : posts_this_month
at Text put : Post This Month
Then save it..
Hope This is Useful for PGC. :D