Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > Project U-232
Reply
  #1  
Old 11th October 2013, 16:01
Typon Typon is offline
Senior Member
 
Join Date: Aug 2012
P2P
Posts: 16
Default user class
Hello. I've been adding some more userclasses, so highest is 10 now.
When i in the database sets it to 10, i go down to what ever.. Nothing happends, and im not staff anymore.. Thats totally sad. What to do?

Info:

Database (user table)
Click the image to open in full size.

Database (user_config)
Click the image to open in full size.

Pm_system.php
Quote:
//===set MAX message amount for users
switch ($CURUSER['class']) {
case UC_MIN:
$maxbox = 50;
$maxboxes = 5;
break;

case UC_POWER_USER:
$maxbox = 100;
$maxboxes = 6;
break;

case UC_VIP:
$maxbox = 250;
$maxboxes = 10;
break;

case UC_UPLOADER:
$maxbox = 300;
$maxboxes = 15;
break;

case UC_FLS :
$maxbox = 300;
$maxboxes = 15;
break;

case UC_STAFF:
$maxbox = 300;
$maxboxes = 20;
break;

case UC_MAX:
$maxbox = 500;
$maxboxes = 40;
break;

case UC_ADMINISTRATOR:
$maxbox = 400;
$maxboxes = 30;
break;

case UC_SYSOP:
$maxbox = 500;
$maxboxes = 40;
break;
case UC_STAFFLEADER:
$maxbox = 500;
$maxboxes = 40;
break;

case UC_DEVELOPER:
$maxbox = 500;
$maxboxes = 40;
break;

case UC_OWNER:
$maxbox = 500;
$maxboxes = 40;
break;
}
User_functions.php
Quote:
$class_names = array(
UC_USER => 'n00b',
UC_POWER_USER => 'Trustee',
UC_VIP => 'Super Elite',
UC_UPLOADER => 'Healer',
UC_FLS => 'First Line Supporter',
UC_MODERATOR => 'Moderator',
UC_ADMINISTRATOR => 'Administrator',
UC_SYSOP => 'Slave',
UC_STAFFLEADER => 'Chef',
UC_DEVELOPER => 'Developer',
UC_OWNER => 'ZeceviThaFuckingBoss'
);

$class_colors = array(
UC_USER => 'A2C257',
UC_POWER_USER => 'AEBB51',
UC_VIP => 'FF6103',
UC_UPLOADER => '6464ff',
UC_FLS => 'F08080',
UC_MODERATOR => '23a4a6',
UC_ADMINISTRATOR => 'B000B0',
UC_SYSOP => 'ff00ff',
UC_STAFFLEADER => 'ff0000',
UC_DEVELOPER => '8A084B',
UC_OWNER => '56a5eb'
);

$class_images = array(
UC_USER => $INSTALLER09['pic_base_url'].'class/member.png',
UC_POWER_USER => $INSTALLER09['pic_base_url'].'class/power.png',
UC_VIP => $INSTALLER09['pic_base_url'].'class/vip.png',
UC_UPLOADER => $INSTALLER09['pic_base_url'].'class/uploaders.png',
UC_FLS => $INSTALLER09['pic_base_url'].'class/junior.gif',
UC_MODERATOR => $INSTALLER09['pic_base_url'].'class/moderator.png',
UC_ADMINISTRATOR => $INSTALLER09['pic_base_url'].'class/admin.png',
UC_SYSOP => $INSTALLER09['pic_base_url'].'class/sysop.png',
UC_STAFFLEADER => $INSTALLER09['pic_base_url'].'class/leader.png',
UC_DEVELOPER => $INSTALLER09['pic_base_url'].'class/coder.gif',
UC_OWNER => $INSTALLER09['pic_base_url'].'class/founder.png'
);
ann_config.php:
Quote:
define('TIME_NOW', time());
define('UC_USER', 0);
define('UC_POWER_USER', 1);
define('UC_VIP', 2);
define('UC_UPLOADER', 3);
define('UC_FLS', 4);
define('UC_MODERATOR', 5);
define('UC_ADMINISTRATOR', 6);
define('UC_SYSOP', 7);
define('UC_STAFFLEADER', 8);
define('UC_DEVELOPER', 9);
define('UC_OWNER', 10);
define('UC_STAFF', 5);
config.php:
Quote:
define('UC_USER', 0);
define('UC_POWER_USER', 1);
define('UC_VIP', 2);
define('UC_UPLOADER', 3);
define('UC_FLS', 4);
define('UC_MODERATOR', 5);
define('UC_ADMINISTRATOR', 6);
define('UC_SYSOP', 7);
define('UC_STAFFLEADER', 8);
define('UC_DEVELOPER', 9);
define('UC_OWNER', 10);
define('UC_MIN', 0); // minimum class
define('UC_MAX', 10); // maximum class
define('UC_STAFF', 5); // start of staff classes
Staff.php:
[HIDE]
Quote:
<?php
/**
* https://github.com/Bigjoos/
* Licence Info: GPL
* Copyright (C) 2010 U-232 v.3
* A bittorrent tracker source based on TBDev.net/tbsource/bytemonsoon.
* Project Leaders: Mindless, putyn.
**/
require_once(dirname(__FILE__).DIRECTORY_SEPARATOR .'include'.DIRECTORY_SEPARATOR.'bittorrent.php');
require_once(INCL_DIR.'user_functions.php');
require_once(INCL_DIR.'html_functions.php');
dbconn();
loggedinorreturn();

$lang = array_merge( load_language('global'), load_language('staff'));

$stdhead = array(/** include the css **/'css' => array('staff'));

$htmlout = $firstline = $support = '';

$query = sql_query("SELECT users.id, username, support, supportfor, email, last_access, class, title, country, status, countries.flagpic, countries.name FROM users LEFT JOIN countries ON countries.id = users.country WHERE class >= ".UC_STAFF." OR support='yes' AND status='confirmed' ORDER BY username") or sqlerr(__FILE__, __LINE__);
unset($support);
while($arr2 = mysqli_fetch_assoc($query)) {

if($arr2["support"] == 'yes')
$support[] = $arr2;

if($arr2["class"] == UC_FLS)
$jstaff[] = $arr2;

if($arr2["class"] == UC_MODERATOR)
$mods[] = $arr2;

if($arr2["class"] == UC_ADMINISTRATOR)
$admin[] = $arr2;

if($arr2["class"] == UC_SYSOP)
$sysop[] = $arr2;

if($arr2["class"] == UC_STAFF_LEADER)
$Leader[] = $arr2;

if($arr2["class"] == UC_DEVELOPER)
$CodeMonkey[] = $arr2;

if($arr2["class"] == UC_OWNER)
$Owner[] = $arr2;




}

function DoStaff($staff, $staffclass, $cols = 4) {
global $INSTALLER09;
$htmlout='';
$dt = TIME_NOW - 180;
$counter = count($staff);

$rows = ceil($counter/$cols);
$cols = ($counter < $cols) ? $counter : $cols;
$r = 0;
$htmlout .= "<div class='global_text'><div class='headline'><img style='vertical-align: middle;' width='20' height='20' src='{$INSTALLER09['pic_base_url']}staff_icon.png' border='0'/> {$staffclass}</div><table width='100%' border='0' cellpadding='3'>";
for($ia = 0; $ia < $rows; $ia++){
$htmlout .= "<tr>";
for($i = 0; $i < $cols; $i++){
if( isset($staff[$r]) ) {
$htmlout .= "<td class='colhead2' width='10px' class='staff_username'><a href='userdetails.php?id=".(int)$staff[$r]['id']."'><font color='#" . get_user_class_color($staff[$r]['class']) . "'><b>".htmlsafechars($staff[$r]['username'])."</b></font></a>"."
<img style='vertical-align: middle;' width='25' height='25' src='images/staff".($staff[$r]['last_access']>$dt?"/online.png":"/offline.png" )."' border='0' alt='' />"."
<a href='pm_system.php?action=send_message&amp;receiv er=".(int)$staff[$r]['id']."&amp;returnto=".urlencode($_SERVER['REQUEST_URI'])."'><img style='vertical-align: middle;' width='25' height='25' src='{$INSTALLER09['pic_base_url']}mailicon.png' border='0' title=\"Personal Message\" alt='' /></a>"."
<img style='vertical-align: middle;' width='70' height='25' src='{$INSTALLER09['pic_base_url']}flag/".htmlsafechars($staff[$r]['flagpic'])."' border='0' alt='".htmlsafechars($staff[$r]['name'])."' /></td>";
$r++;
}else{
$htmlout .= "<td>&nbsp;</td>";
}
}
$htmlout .= "</tr>";

}
$htmlout .="</table></div>";
return $htmlout;
}

$htmlout .= DoStaff($Owner, "Owner");
$htmlout .= DoStaff($CodeMonkey, "Developer");
$htmlout .= DoStaff($Leader, "Staffleader");
$htmlout .= DoStaff($sysop, "Sysops");
$htmlout .= isset($admin) ? DoStaff($admin, "Administrator") : DoStaff($admin=false, "Administrator");
$htmlout .= isset($mods) ? DoStaff($mods, "Moderators") : DoStaff($mods=false, "Moderators");
$htmlout .= isset($jstaff) ? DoStaff($jstaff, "FLS") : DoStaff($jstaff=false, "FLS");
$dt = TIME_NOW - 180;
if (!empty($support)) {
foreach ($support as $a) {
$firstline .= "<tr><td class='colhead2' class='staff_username'><a href='userdetails.php?id=".(int)$a['id']."'><font color='#" . get_user_class_color($a['class']) . "'><b>".htmlsafechars($a['username'])."</b></font></a></td>
<td class='colhead2' class='staff_online'><img style='vertical-align: middle;' width='25' height='25' src='{$INSTALLER09['pic_base_url']}".
($a['last_access']>$dt?"online.png":"offline.png" )."' border='0' alt='' /></td>".
"<td class='colhead2' class='staff_online'><a href='pm_system.php?action=send_message&amp;receiv er=".(int)$a['id']."'>"."<img style='vertical-align: middle;' width='25' height='25' src='{$INSTALLER09['pic_base_url']}mailicon.png' border='0'title=\"{$lang['alt_pm']}\" alt='' /></a></td>".
"<td class='colhead2' class='staff_online'><img style='vertical-align: middle;' width='30' height='20' src='{$INSTALLER09['pic_base_url']}flag/".htmlsafechars($a['flagpic'])."' border='0' alt='".htmlsafechars($a['name'])."' /></td>".
"<td class='colhead2' class='staff_online'>".htmlsafechars($a['supportfor'])."</td></tr>";
}

$htmlout .= "
<div class='global_text'><div class='headline'>{$lang['header_fls']}</div><table width='100%' border='0' cellpadding='3'>
<tr>
<td class='staff_username' colspan='2'>{$lang['text_first']}<br /><br /></td>
</tr>
<tr>
<td class='staff_username' align='left'><b>{$lang['first_name']}&nbsp;</b></td>
<td class='staff_online'><b>{$lang['first_active']}&nbsp;&nbsp;&nbsp;</b></td>
<td class='staff_online'><b>{$lang['first_contact']}&nbsp;&nbsp;&nbsp;&nbsp;</b></td>
<td class='staff_online'><b>{$lang['first_lang']}</b></td>
<td class='staff_online'><b>{$lang['first_supportfor']}</b></td>
</tr>".$firstline."";
$htmlout .="</table></div>";
}
echo stdhead('Staff', true, $stdhead) . $htmlout . stdfoot();
?>
[/HIDE]

Result:
Click the image to open in full size.

BrugerKP = UserCP
Kontakt Staff = Contact staff

Last edited by Typon; 11th October 2013 at 16:17.
Reply With Quote
  #2  
Old 14th October 2013, 19:05
DND DND is offline
VIP
 
Join Date: Dec 2008
Posts: 1,241
Default
why to change user classes if you are not gonna make some code for promotion and demotion ? and some stuff different from class to class? only for estetics?
and of course you are disabled, because in cache/staff_settings.php and staff_settings2.php you have some functions so that staff will be only ids/names that are written there.
Reply With Quote
  #3  
Old 27th March 2014, 14:30
stoner stoner is offline
Senior Member
 
Join Date: May 2011
P2P
Posts: 17
Default
Wait for V4 release and all this can be done via the staff panel.

There is alot of edits to be made when you add user classes.

You also need to clear the memcache entries users, or the site will think they are at the old class.

Also currently with V3, UC_SYSOP is used a class check in some files, so if you add a class over that one, then you will need to make edits.

Best solution around that problem, is keep UC_SYSOP as your top class, but give it another name.

I,e
The define section in config.php will still have UC_SYSOP => 9 << 9 being the top number same as UC_MAX

But the class name can be whatever you want it to be.

So you could have something like.

UC_CODER => 8,
UC_SYSOP =>9

But the name for UC_CODER would be Sysop and for UC_SYSOP would be Coder.

Can cause confusion, but is an easier way than finding all files that need the edit.

That or change all files which have a class check for UC_SYSOP and change it to UC_MAX.
Which is what I'm doing for V4, to allow a staff panel page for adding class's a bit more easily.
Reply With Quote
Reply

Tags
class , user

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 14:15. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.