10.04.2012, 03:55
(Dieser Beitrag wurde zuletzt bearbeitet: 26.08.2014, 09:54 von MyBB.de Bot.)
Eine neue Erweiterung wurde veröffentlicht: Nickname Styles
Zitat:Plugin Name: Nickname Styles
Plugin Author: Edson Ordaz
Plugin Website: http://www.mybb-es.com
Plugin Version: 1.0
Plugin Mybb Compatibility: 1.6x
Plugin Description: allows users to edit the style of his nickname.
Admin panel
To change the tab to go to the users and the last module where it says nickname style and enter there.
It will show the table with styles created and two options are to edit and delete.
Creating new style
To create a new way to click on the tab and enter the new style name, style, posts, reputation, time online, and order groups.
Name: Enter the name of style.
Style: Style nickname, you must enter {username} as this will replace the user's name
Posts: Enter the number of messages you need to use this style.
Points: Enter the number of reputation you need to use this style.
Uptime: Enter the number of days / months you need to have the online user to use this style.
Groups: Select the user groups to be able to use this style of nickname.
Order: Enter the order in which they show with the other styles.
This is the configuration with the styles
User Control Panel
Go to control panel user / edit profile and even below this nickname styles and displays a select input to select the style you want (only nickname styles show your user group can see if you comply with the time online, messages and reputation).
Below is a fieldset with the style of your current nickname and down a link to a page, if you click there will open a popup with all styles of his nickname but show styles and his nickname to see which you like best and you choose.
Always on the list will come the default nickname is the style of the group.
*Important:
For operation of the plugin to edit the functions.php file that is inside root / inc if your file is modified and will have to modify it again to add the following.
Open your functions.php file with some preferred editor notepad + + and look for the following
Code:function format_name($username, $usergroup, $displaygroup="")
{
global $groupscache, $cache;
if(!is_array($groupscache))
{
$groupscache = $cache->read("usergroups");
}
if($displaygroup != 0)
{
$usergroup = $displaygroup;
}
$ugroup = $groupscache[$usergroup];
$format = $ugroup['namestyle'];
$userin = substr_count($format, "{username}");
if($userin == 0)
{
$format = "{username}";
}
$format = stripslashes($format);
return str_replace("{username}", $username, $format);
}
and replacing this
Code:function format_name($username, $usergroup, $displaygroup="")
{
global $groupscache, $cache, $db;
if(!is_array($groupscache))
{
$groupscache = $cache->read("usergroups");
}
if($displaygroup != 0)
{
$usergroup = $displaygroup;
}
$ugroup = $groupscache[$usergroup];
$format = $ugroup['namestyle'];
$userin = substr_count($format, "{username}");
if($userin == 0)
{
$format = "{username}";
}
$format = stripslashes($format);
if($db->table_exists("nickstyles_nicks"))
{
global $db;
$query = $db->simple_select('users', 'nickstyle', "username='{$username}' AND usergroup='{$usergroup}'");
$user = $db->fetch_array($query);
if(!empty($user['nickstyle']))
{
$query = $db->simple_select('nickstyles_nicks', 'style', 'nid='.$user['nickstyle']);
$style = $db->fetch_array($query);
$format = $style['style'];
$format = stripslashes($format);
return str_replace("{username}", $username, $format);
}
else
{
return str_replace("{username}", $username, $format);
}
}
return str_replace("{username}", $username, $format);
}
and if it is modified to put the functions.php that is inside the attachment.