MyBB Community Forums

Full Version: shoutbox problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i'm using shoutbox 2.0..how to make it just display 1 page,if there's many posts than 1 page,old shout will be deleted (always display in 1 page)
and a problem:the old page which has old shout is default page.that mean i always see it when enter my forum.how to solve?

anyone knows please help me,thanks
Hello

Open shoutbox.php

Find
if($total_pages > 1)
			{
				$bgcolor = alt_trow();
				eval("\$multipage_top = \"".$templates->get('shoutbox_multipage')."\";");
			}

Replace with
if($total_pages > 1)
			{
				$new_limit = $count - $limit;
				$clean_query = $db->query("SELECT * FROM ".TABLE_PREFIX."shouts ORDER BY dateline ASC LIMIT 0, $new_limit"); 
				while($to_delete = $db->fetch_array($clean_query))
				{
					$delete = $db->query("DELETE FROM ".TABLE_PREFIX."shouts WHERE sid='".$to_delete['sid']."'");
				}	
			}