Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > OpenTracker
Reply
  #1  
Old 16th August 2012, 07:58
lafouine022 lafouine022 is offline
Senior Member
 
Join Date: Feb 2010
P2P
Posts: 120
Smile Color username by group
SQL

PHP Code:
ALTER TABLE `tracker_groupsADD `group_colorvarchar(255utf8_unicode_ci
remplace your files /public_html/CMS/applications/admin/tpl/groups/edit.php

by my files
PHP Code:
<?php
try {
    if (!isset(
$_GET['id']))
        throw new 
Exception("Missing news id");

    if (!
intval($_GET['id']))
        throw new 
Exception("Invalid id");

    
$id $_GET['id'];


    if (isset(
$_POST['save'])) {
        try {

            if (
$_POST['secure_input'] != $_SESSION['secure_token'])
                throw new 
Exception("Wrong secure token");

            if (empty(
$_POST['name']) || empty($_POST['name']))
                throw new 
Exception("Missing data");

            
$db = new DB("groups");
            
$db->setColPrefix("group_");
            
$db->id $_POST['id'];
            
$db->name $_POST['name'];
            
$db->acl $_POST['acl'];
            
$db->color $_POST['color'];
            if (isset(
$_POST['upgradable'])) {
                if (
$_POST['upgradeto'] == 0)
                    throw new 
Exception("Missing upgrade to group data");
                
$db->upgradable 1;
                
$db->upgradeto $_POST['upgradeto'];
                
$db->downgradeto $_POST['downgradeto'];
                
$db->minupload $_POST['minupload'];
                
$db->minratio $_POST['minratio'];
            }
            
$db->update("group_id = '" $id "'");
            
header("location: ".page("admin""groups"));
        } Catch (
Exception $e) {
            echo 
error(_t($e->getMessage()));
        }
    }

    
$db = new DB("groups");
    
$db->setColPrefix("group_");
    
$db->select("group_id = '" $db->escape($id) . "'");
    if (!
$db->numRows())
        throw new 
Exception("Group not found");

    
$db->nextRecord();
    
?>

    <script type="text/javascript">
        $(document).ready(function(){
            $("#upgrade_check").change(function(){
                if($(this).is(":checked")){
                    $("#upgradable").show();
                }else{
                    $("#upgradable").hide();
                }
            });
        });
    </script>
    <h4>Create group</h4>
    <form method="post">
        <input type="hidden" name="secure_input" value="<?php echo $_SESSION['secure_token_last'?>">
        <table>
            <tr>
                <td width="100px"><?php echo _t("Group Id")?>:</td>
                <td><input name="id" type="text" value="<?php echo $db->id ?>" size="25"></td>
            </tr>
            <tr>
                <td width="100px"><?php echo _t("Group name")?>:</td>
                <td><input name="name" type="text" value="<?php echo $db->name ?>" size="25"></td>
            </tr>
            <tr>
                <td><?php echo _t("Group ACL")?>:</td>
                <td><input name="acl" type="text" value="<?php echo $db->acl ?>" size="25"></td>
            </tr>
            
            <tr>
                <td><?php echo _t("Group color")?>:</td>
                <td><input name="color" type="text" value="<?php echo $db->color ?>" size="25"></td>
            </tr>

            <tr>
                <td><?php echo _t("Upgradable")?>:</td>
                <td><input name="upgradable" id="upgrade_check" <?php echo ($db->upgradable == 1) ? "CHECKED" "" ?> type="checkbox"></td>
            </tr>
        </table>
        <table id="upgradable" style="display:<?php echo ($db->upgradable == 1) ? "block" "none" ?>;">
            <tr>
                <td width="100px"><?php echo _t("Upgrade to")?>:</td>
                <td><select name="upgradeto"><option value="0">(<?php echo _t("Choose")?>)</option><?php echo getGroups($db->upgradeto); ?></select></td>
            </tr>
            <tr>
                <td width="100px"><?php echo _t("Downgrade to")?>:</td>
                <td><select name="downgradeto"><option value="0">(<?php echo _t("Choose")?>)</option><?php echo getGroups($db->downgradeto); ?></select></td>
            </tr>
            <tr>
                <td><?php echo _t("Minimum Upload")?>:</td>
                <td><input name="minupload" type="text" value="<?php echo $db->minupload ?>" size="25"></td>
            </tr>
            <tr>
                <td><?php echo _t("Minimum Ratio")?>:</td>
                <td><input name="minratio" value="<?php echo $db->minratio ?>" type="text"></td>
            </tr>
        </table>
        <input type="submit" name="save" value="<?php echo _t("Save group")?>" />
    </form>

    <?php
} Catch (Exception $e) {
    echo 
error(_t($e->getMessage()));
}
?>
and GO for add your color html in all group

for help http://html-color-codes.info/

In
libray/Acl.php line 38

PHP Code:
$this->__set("group_name"$db->name); 
remplace by

PHP Code:
$this->__set("group_name"$db->name);
            
$this->__set("group_color"$db->color); 
after go in /public_html/templates/default/template.php line 64

PHP Code:
<a href="<?php echo page("profile"?>" title="Go to profile"><strong><?php echo $acl->name?></strong></a>
remplace by

PHP Code:
<a href="<?php echo page("profile"?>" title="Go to profile"><strong><font color="<?php echo $acl->group_color?>"><?php echo $acl->name?></font></strong></a>
So remplace all
<?php echo $acl->name; ?> by <font color="<?php echo $acl->group_color; ?>"><?php echo $acl->name; ?></font> :)

Last edited by lafouine022; 16th August 2012 at 08:35.
Reply With Quote
  #2  
Old 16th August 2012, 08:13
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,113
Default
just to be html compliant shouldn't
PHP Code:
<?php echo $acl->name?> by <font color=<?php echo  $acl->group_color?>><?php echo $acl->name;  ?></font>
be
PHP Code:
<?php echo $acl->name?> by <font color="<?php echo  $acl->group_color?>"><?php echo $acl->name;  ?></font>
and
PHP Code:
<a href="<?php echo page("profile"?>" title="Go to profile"><strong><font color=<?php echo $acl->group_color?>><?php echo $acl->name?></font></strong></a>
be
PHP Code:
<a href="<?php echo page("profile"?>" title="Go to profile"><strong><font color="<?php echo $acl->group_color?>"><?php echo $acl->name?></font></strong></a>
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent
Do not ask me to make a mod for any other source
Do not Ask me to setup your site.
I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum
My Current Demo is here http://demo.btmanager.org/
Reply With Quote
  #3  
Old 16th August 2012, 08:37
lafouine022 lafouine022 is offline
Senior Member
 
Join Date: Feb 2010
P2P
Posts: 120
Talking
yep thanks joeroberts I edit the first post
Reply With Quote
  #4  
Old 16th October 2012, 02:42
eedu eedu is offline
Member
 
Join Date: Oct 2012
Brazil
Posts: 6
Exclamation Error
Notice: Undefined index: group_color in /home/gupix/www/library/DB.php on line 549

/-------------------------------------/
548 public function f($name) {
549 return $this->record[$name];
550 }
/-------------------------------------/


Help-me.

Last edited by eedu; 16th October 2012 at 02:58. Reason: add
Reply With Quote
  #5  
Old 16th October 2012, 03:03
ajax's Avatar
ajax ajax is offline
Senior Member
 
Join Date: Apr 2009
United Kingdom
Posts: 165
Default
Quote:
Originally Posted by eedu View Post
Notice: Undefined index: group_color in /home/gupix/www/library/DB.php on line 549

/-------------------------------------/
548 public function f($name) {
549 return $this->record[$name];
550 }
/-------------------------------------/


Help-me.
Add the SQL.
__________________
"ALWAYS BE YOURSELF.
UNLESS YOU CAN BE A UNICORN.
THEN ALWAYS BE A UNICORN."
Reply With Quote
The Following User Says Thank You to ajax For This Useful Post:
eedu (16th October 2012)
  #6  
Old 16th October 2012, 03:07
eedu eedu is offline
Member
 
Join Date: Oct 2012
Brazil
Posts: 6
Default
Quote:
Originally Posted by ajax View Post
Add the SQL.
Error solved! Thanks
Reply With Quote
  #7  
Old 4th September 2013, 19:08
limitzcash limitzcash is offline
Member
 
Join Date: Dec 2012
United States
Posts: 8
Default
How can you add this to the Forum also? I have it working fine for the rest of the site, and it works very well! Thank You!

It just doesn't show the username color on the forums.
Reply With Quote
Reply

Tags
color , group , username

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 23:48. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.