MyBB Community Forums

Full Version: /forum/private.php?fid=3
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
hi jim,

.usercp_nav_drafts -----> is the setting for saved drafts in the misc. section

i want to change draft image which is the my profile section below inbox and sent items

as posted before i changed the image for sub_pmfolder but it applies to both Sent and Drafts

whereas i want to have separate images for sent and drafts in the profile section....


a modification to usercp.css to create a new class (e.g. usercp_nav_draft_pmfolder) with the image wanted and then core edit or plugin to alter the HTML before being output.

core edit: modify \inc\functions_user.php
find
function usercp_menu_messenger()
{
	global $db, $mybb, $templates, $theme, $usercpmenu, $lang, $collapsed, $collapsedimg;

	$foldersexploded = explode("$%%$", $mybb->user['pmfolders']);
	foreach($foldersexploded as $key => $folders)
	{
		$folderinfo = explode("**", $folders, 2);
		$folderinfo[1] = get_pm_folder_name($folderinfo[0], $folderinfo[1]);
		if($folderinfo[0] == 4)
		{
			$class = "usercp_nav_trash_pmfolder";
		}
		else if($folderlinks)
		{
			$class = "usercp_nav_sub_pmfolder";
		}
		else
		{
			$class = "usercp_nav_pmfolder";
		}

		$folderlinks .= "<div><a href=\"private.php?fid=$folderinfo[0]\" class=\"usercp_nav_item {$class}\">$folderinfo[1]</a></div>\n";
	}
	
	eval("\$usercpmenu .= \"".$templates->get("usercp_nav_messenger")."\";");
}

and change it to
function usercp_menu_messenger()
{
	global $db, $mybb, $templates, $theme, $usercpmenu, $lang, $collapsed, $collapsedimg;

	$foldersexploded = explode("$%%$", $mybb->user['pmfolders']);
	foreach($foldersexploded as $key => $folders)
	{
		$folderinfo = explode("**", $folders, 2);
		$folderinfo[1] = get_pm_folder_name($folderinfo[0], $folderinfo[1]);
		if($folderinfo[0] == 4)
		{
			$class = "usercp_nav_trash_pmfolder";
		}
		if($folderinfo[0] == 3)
		{
			$class = "usercp_nav_draft_pmfolder";
		}
		else if($folderlinks)
		{
			$class = "usercp_nav_sub_pmfolder";
		}
		else
		{
			$class = "usercp_nav_pmfolder";
		}

		$folderlinks .= "<div><a href=\"private.php?fid=$folderinfo[0]\" class=\"usercp_nav_item {$class}\">$folderinfo[1]</a></div>\n";
	}
	
	eval("\$usercpmenu .= \"".$templates->get("usercp_nav_messenger")."\";");
}

or a plugin that hooks into "usercp_menu_built" and does a preg_replace or str_replace on the variable $usercpnav to get the output you want

search = "<a href=\"private.php?fid=3\" class=\"usercp_nav_item usercp_nav_sub_pmfolder\">"

replace = "<a href=\"private.php?fid=3\" class=\"usercp_nav_item usercp_nav_draft_pmfolder\">"
HI paveman

thanks for script....


i am going to try this now....i feel its goin to work....i hav been trying to do this for a quite a few days now....

thanks again

Paveman & Jim for your help !
SmileSmileSmileSmileSmile
Pages: 1 2