MyBB Community Forums

Full Version: How to sort Thread Prefixes menu in a new thread by name (not by ID)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I wish to change the thread prefix order by name instead of prefix id which is default. I found this topic on myBB wiki, but I could not find the related text in the file mentioned in the wiki.

http://wiki.mybb.com/index.php/Admin_CP_Config_Thread_Prefixes#Can_I_change_the_thread_prefix_order_on_their_listings_.3F
Any way to solve this problem, can anyone help me with the required code modifications??
Anybody can help me out with this, as I could not find the required code/file to edit
No replies??
Try this:

Find in /inc/datacache.php
function update_threadprefixes()
	{
		global $db;

		$prefixes = array();
		$query = $db->simple_select("threadprefixes", "*", "", array("order_by" => "pid"));

		while($prefix = $db->fetch_array($query))
		{
			$prefixes[$prefix['pid']] = $prefix;
		}

		$this->update("threadprefixes", $prefixes);
	}

Replace with
function update_threadprefixes()
	{
		global $db;

		$prefixes = array();
		$query = $db->simple_select("threadprefixes", "*", "", array("order_by" => "prefix"));

		while($prefix = $db->fetch_array($query))
		{
			$prefixes[$prefix['pid']] = $prefix;
		}

		$this->update("threadprefixes", $prefixes);
	}
worked perfectly, thanks a lot
btw, in my case, the file was named class_datacache.php
I also need the same, but the modification above didnt worked for me...

I don't have any file /inc/datacache.php
Im using 1.6.6 version.

I already tried many things, but without luck.
Can someone help me?
dragonexpert meant to say ./inc/class_datacache.php.