MyBB Community Forums

Full Version: Total thread on the postpit [Help]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How i can add the total thread to postpit ? Help me plz.
Hi SN1P3R,

Here is a simple way to diplay total threads on postbit. But its cost surely performence. Its better if we create a field on the users table and modify the datahandler to count created threads. Its really simple so there are no options to hide threads from sections or something else.

Open inc/functions_posts.php
Search:
eval("\$post['user_details'] = \"".$templates->get("postbit_author_user")."\";");
Upper it add:
		$count_threads_query = $db->query("SELECT tid FROM ".TABLE_PREFIX."threads WHERE uid='".$post['uid']."'");
		$count_threads_result = $db->num_rows($count_threads_query);
		if($count_threads_result)
		{
			$post['threads'] = $count_threads_result;
		}
		else 
		{
			$post['threads'] = '0';
		}
Search:
$post['userregdate'] = $lang->na;
Under it add:
$post['threads'] = $lang->na;
Save and close.

Open the file global.lang.php
$l['postbit_threads'] = 'Threads';
Open the template postbit->postbit_author_user
Search:
	{$post['useravatar']}<br />
After it add:
	{$lang->postbit_threads} {$post['threads']}<br />
Save and Close.

Its not tested but its should work.

Have fun with it. Smile

Garlant
Thax im trying