MyBB Community Forums

Full Version: [Release] How to appear stars in two rows in postbit
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Hi,

In this tutorial I teach you how to appear stars in two differents rows in postbit.

Open inc/functions_post.php and go on 255 row
Now modify this part
if($usergroup['stars'])
		{
			$post['stars'] = $usergroup['stars'];
			
		}

		if(!$post['starimage'])
		{
			$post['starimage'] = $usergroup['starimage'];
		}
		$post['starimage'] = str_replace("{theme}", $theme['imgdir'], $post['starimage']);
		
		for($i = 0; $i < $post['stars']; ++$i)
		{
			$post['userstars'] .= "<img src=\"".$post['starimage']."\" border=\"0\" alt=\"*\" />";
}
		 }
With this
if($usergroup['stars'])
		{
			$post['stars'] = intval($usergroup['stars']);
			$post['new_stars'] = $post['stars']/2;
		}

		if(!$post['starimage'])
		{
			$post['starimage'] = $usergroup['starimage'];
		}
		$post['starimage'] = str_replace("{theme}", $theme['imgdir'], $post['starimage']);
		
		for($i = 0; $i < $post['new_stars']; ++$i)
		{
			$post['userstars'] .= "<img src=\"".$post['starimage']."\" border=\"0\" alt=\"*\" />";
		}
		$post['userstars'].= "<br />";
		
		for ($i = 0; $i < $post['new_stars']; ++$i) {
		 $post['userstars'] .= "<img src=\"".$post['starimage']."\" border=\"0\" alt=\"*\" />";
		 }

Only one problem, you must insert number of stars divisible for 2

Bye
It would be better if you provide a snapshot what this Tutorial actualy does...!

Thanks for the reply
Oh I get it. Nice trick, but useless for me. Hopefully someone will find it usefull.
Nice job, but it really serves no purpose.
This is good for admins who like 1000 stars Toungue i'll forward the thread to him thanks!
Nice work.....

Thank you ketto93.

Owen
You should be able to find $post['userstars'] in templates and just double it.
(2009-06-09, 02:12 AM)labrocca Wrote: [ -> ]You should be able to find $post['userstars'] in templates and just double it.

In this way the stars will be doubled but not under each other untill putting <br/> between them Smile
Still 10x better than a tutorial which requires a core file change.
Pages: 1 2 3