Dołącz do zespołu ekspertów! Backend lub Frontend Developer?

Sprawdź najnowsze oferty pracy naszego partnera - 8lines.io!

Group Label Plugin Support

Szukam  Założony przez  Nayson Linkz.

Forum address:
http://lightforums.cf/index.php


Engine version:
08/01/14


Description of the problem:
I have fixed postbits, and user cp group etiquette. Default usertitle or custom usertitle .. but memberlist and member profile I can not figure it out ... also in private message my group label background not showing? : /

Sorry, this is not english mybb forum I've been asking for support. I really need this plugin.
But looks I can not figure out, here's screenshots of the problem ...
https://i.imgur.com/H7EWRJm.png
https://i.imgur.com/Al5Bsmk.png
https://i.imgur.com/7fWx7ku.png
https://i.imgur.com/dXDLwBp.png

Plugin Group Label

<?php

/*
       Groupimage to label text [v1.2]
     (c) Copyright 2013-2016 by Inferno

     @author    : Inferno (http://www.Inferno24.pl)
     @contact   : inferno.piotr@gmail.com
     @date      : 03-02-2016
     @update    : 17-11-2017

*/

if(!defined("IN_MYBB")){
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}
$plugins->add_hook("postbit", "rank_postbit");
$plugins->add_hook("member_profile_end", "rank_profile");
$plugins->add_hook("usercp_end", "rank_usercp");
$plugins->add_hook("memberlist_user", "rank_memberlist");

function labelrank_info(){
global $lang;
$lang->load("labelrank_group");
return array(
'name' => 'Groupimage to label text',
'description' => $lang->agi_descr,
'website' => 'http://www.inferno24.pl',
'author' => 'Inferno',
'authorsite' => 'http://www.Inferno24.pl',
'version' => '1.2',
'guid' => 'bab9eaae39210fd31d6c31c4fe4c9baf',
'codename' => 'groupimage_to_labeltext'
);
}
function labelrank_activate(){
   global $db,$lang;
$lang->load("labelrank_group");
   $group = array(
       "gid"            => "NULL",
       "title"          => "Group Label",
       "name"           => "labelrank_group",
       "description"    => $lang->setting_description,
       "disporder"      => "1",
       "isdefault"      => "0",
   );
   
   $db->insert_query("settinggroups", $group);
   $gid = $db->insert_id();
   
   
   $setting_1 = array(
       "sid"            => "NULL",
       "name"           => "labelrank_postbit",
       "title"          => $lang->postbit_title,
       "description"    => $lang->postbit_descr,
       "optionscode"    => "yesno",
       "value"          => 'yes',
       "disporder"      => '1',
       "gid"            => intval($gid),
   );

   $db->insert_query("settings", $setting_1);

   $setting_2 = array(
       "sid"            => "NULL",
       "name"           => "labelrank_profile",
       "title"          => $lang->profile_title,
       "description"    => $lang->profile_descr,
       "optionscode"    => "yesno",
       "value"          => 'yes',
       "disporder"      => '1',
       "gid"            => intval($gid),
   );

   $db->insert_query("settings", $setting_2);

   $setting_3 = array(
       "sid"            => "NULL",
       "name"           => "labelrank_usercp",
       "title"          => $lang->usercp_title,
       "description"    => $lang->usercp_descr,
       "optionscode"    => "yesno",
       "value"          => 'yes',
       "disporder"      => '1',
       "gid"            => intval($gid),
   );

   $db->insert_query("settings", $setting_3);

   $setting_4 = array(
       "sid"            => "NULL",
       "name"           => "labelrank_memberlist",
       "title"          => $lang->memberlist_title,
       "description"    => $lang->memberlist_descr,
       "optionscode"    => "yesno",
       "value"          => 'yes',
       "disporder"      => '1',
       "gid"            => intval($gid),
   );

   $db->insert_query("settings", $setting_4);

   rebuild_settings();

   require_once MYBB_ROOT."/inc/adminfunctions_templates.php";

find_replace_templatesets(
"memberlist_user",
"#" . preg_quote('{$usergroup[\'groupimage\']}') . "#i",
'{$group_label}<br />'
);
}
function labelrank_deactivate(){
   global $db;

$db->delete_query("settinggroups", "name=\"labelrank_group\"");
$db->delete_query("settings", "name LIKE \"labelrank%\"");

require_once MYBB_ROOT."/inc/adminfunctions_templates.php";

find_replace_templatesets(
"memberlist_user",
"#" . preg_quote('{$group_label}<br />') . "#i",
'{$usergroup[\'groupimage\']}'
);
   rebuild_settings();
}

function rank_postbit(&$post){
global $mybb;

if($mybb->settings['labelrank_postbit']){
$usertitle = getgroupname($post['usertitle']);
$post['usertitle'] = "<div class=\"profile-rank\"><span class=\"gid-".$post['usergroup']."\">".($post['usertitle'])."</span></div>";
}

}
function rank_profile(){
global $mybb, $memprofile, $groupimage, $usertitle;

if($mybb->settings['labelrank_profile']){
$usertitle = getgroupname($memprofile['usertitle']);
$usergroup = "<div class=\"profile-rank\"><span class=\"gid-".$memprofile['usergroup']."\">".($memprofile['usertitle'])."</span></div>";
}
}

function rank_usercp(){
global $mybb, $user, $usergroup, $usertitle;

if($mybb->settings['labelrank_usercp']){
$usertitle = getgroupname($mybb->user['usertitle']);
$usergroup = "<div class=\"profile-rank\"><span class=\"gid-".$mybb->user['usergroup']."\">".($mybb->user['usertitle'])."</span></div>";
}
}

function rank_memberlist(){
global $mybb, $user, $group_label;
if($mybb->settings['labelrank_memberlist']){
$groupname = getgroupname($user['usergroup']);
eval("\$group_label = '<div class=\"profile-rank\"><span class=\"gid-".$user['usergroup']."\">".$groupname."</span></div>';");
}
}

function getgroupname($usertitle){
global $cache;

$usergroups = $cache->read("usergroups");
$usertitle=$usergroups[$usertitle]['usertitle'];
return $usertitle;
}
?>
I'm a legend to myself. :D
Try
<?php

/*
       Groupimage to label text [v1.0]
     (c) Copyright 2013-2016 by Inferno

     @author    : Inferno (http://www.Inferno24.pl)
     @contact   : inferno.piotr@gmail.com
     @date      : 03-02-2016
     @update    : 25-06-2017 by Divir (https://nowitam.pl)

*/

if(!defined("IN_MYBB")){
die("Direct initialization of this file is not allowed.<br><br>Please make sure IN_MYBB is defined.");
}
$plugins->add_hook("postbit", "rank_postbit");
$plugins->add_hook("member_profile_end", "rank_profile");
$plugins->add_hook("usercp_end", "rank_usercp");
$plugins->add_hook("memberlist_user", "rank_memberlist");

function labelrank_info(){
global $lang;
$lang->load("labelrank_group");
return array(
'name' => 'Groupimage to label text',
'description' => $lang->agi_descr,
'website' => 'http://www.inferno24.pl',
'author' => 'Inferno',
'authorsite' => 'http://www.Inferno24.pl',
'version' => '1.0',
'guid' => 'bab9eaae39210fd31d6c31c4fe4c9baf'
);
}
function labelrank_activate(){
   global $db,$lang;
$lang->load("labelrank_group");
   $group = array(
       "gid"            => "NULL",
       "title"          => "Group Label",
       "name"           => "labelrank_group",
       "description"    => $lang->setting_description,
       "disporder"      => "1",
       "isdefault"      => "0",
   );

   $db->insert_query("settinggroups", $group);
   $gid = $db->insert_id();


   $setting_1 = array(
       "sid"            => "NULL",
       "name"           => "labelrank_postbit",
       "title"          => $lang->postbit_title,
       "description"    => $lang->postbit_descr,
       "optionscode"    => "yesno",
       "value"          => 'yes',
       "disporder"      => '1',
       "gid"            => intval($gid),
   );

   $db->insert_query("settings", $setting_1);

   $setting_2 = array(
       "sid"            => "NULL",
       "name"           => "labelrank_profile",
       "title"          => $lang->profile_title,
       "description"    => $lang->profile_descr,
       "optionscode"    => "yesno",
       "value"          => 'yes',
       "disporder"      => '1',
       "gid"            => intval($gid),
   );

   $db->insert_query("settings", $setting_2);

   $setting_3 = array(
       "sid"            => "NULL",
       "name"           => "labelrank_usercp",
       "title"          => $lang->usercp_title,
       "description"    => $lang->usercp_descr,
       "optionscode"    => "yesno",
       "value"          => 'yes',
       "disporder"      => '1',
       "gid"            => intval($gid),
   );

   $db->insert_query("settings", $setting_3);

      $setting4 = array(
       "sid"            => "NULL",
       "name"           => "labelrank_memberlist",
       "title"          => $lang->memberlist_title,
       "description"    => $lang->memberlist_descr,
       "optionscode"    => "yesno",
       "value"          => 'yes',
       "disporder"      => '1',
       "gid"            => intval($gid),
   );

   $db->insert_query("settings", $setting4);
   rebuild_settings();
}
function labelrank_deactivate(){
   global $db;

$db->delete_query("settinggroups", "name=\"labelrank_group\"");
$db->delete_query("settings", "name LIKE \"labelrank%\"");
   /*$db->write_query("DELETE FROM ".TABLE_PREFIX."settinggroups WHERE name='labelrank_group'");
   $db->write_query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='labelrank_postbit'");
   $db->write_query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='labelrank_profile'");*/
   rebuild_settings();
}

function rank_postbit(&$post){
global $mybb;

if($mybb->settings['labelrank_postbit']){
$groupname = getgroupname($post['usergroup']);
$post['groupimage'] = "<div class=\"profile-rank\"><div class=\"profile-rank_helper\"></div><span class=\"gid-".$post['usergroup']."\">".$groupname."</span></div>";
}

}
function rank_profile(){
global $mybb, $memprofile, $groupimage;

if($mybb->settings['labelrank_profile']){
$groupname = getgroupname($memprofile['usergroup']);
$groupimage = "<div class=\"profile-rank\"><span class=\"gid-".$memprofile['usergroup']."\">".$groupname."</span></div>";
}
}

function rank_usercp(){
global $mybb, $db, $usergroup, $groupimage;

if($mybb->settings['labelrank_usercp']){
       $query = $db->write_query("SELECT usergroup FROM ".TABLE_PREFIX."users WHERE uid='".$mybb->user['uid']."'");
       $groupid = $db->fetch_array($query);

   $groupimage = "<div class=\"profile-rank\"><span class=\"gid-".$groupid['usergroup']."\">".$usergroup."</span></div>";
   }
}

function rank_memberlist(){
global $mybb, $groupimage, $user;

if($mybb->settings['labelrank_memberlist']){
       $groupname = getgroupname($user['usergroup']);
   $groupimage = "<div class=\"profile-rank\"><span class=\"gid-".$user['usergroup']."\">".$groupname."</span></div>";
   }
}

function getgroupname($groupid){
global $cache;

$usergroups = $cache->read("usergroups");
$groupname=$usergroups[$groupid]['usertitle'];
return $groupname;
}
?>
Nope that doesn't work it just restarts to normal and I've already tried this.. basically I need it to replace instead of group title I need it to work usertitle not group title...
Like user title default etc.....
I'm a legend to myself. :D



Użytkownicy przeglądający ten wątek:

2 gości