Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
Add color for group
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2.08 Mods Completed

Unknown User
2014-09-27 11:21:08
Sql


ALTER TABLE `groups` ADD `Color` varchar(7) NOT NULL default '#FF0000';



and remplace all this code in admincp


/////////////////////// GROUPS MANAGEMENT ///////////////////////
if ($action=="groups" && $do=="view") {
   stdhead("Groups Management");
   navmenu();

begin_frame(T_("USER_GROUP"));
   
   print("<center><a href=admincp.php?action=groups&do=add>".T_("ADD_NEW_GROUP")."</a></center>n");
   print("<br><br>n<table width=100% align=center border=1 class=table_table>n");
   print("<tr>n");
   print("<td class=table_head>".T_("NAME")."</td>n");
   print("<td class=table_head>Torrents<br>".T_("VIEW_EDIT_DEL")."</td>n");
   print("<td class=table_head>".T_("MEMBERS")."<br>".T_("VIEW_EDIT_DEL")."</td>n");
   print("<td class=table_head>".T_("NEWS")."<br>".T_("VIEW_EDIT_DEL")."</td>n");
   print("<td class=table_head>Forum<br>".T_("VIEW_EDIT_DEL")."</td>n");
   print("<td class=table_head>Upload</td>n");
   print("<td class=table_head>Download</td>n");
   print("<td class=table_head>". T_("VIEW_CP")."</td>n");
   print("<td class=table_head>".T_("DELETE")."</td>n");
   print("</tr>n");

   $getlevel=SQL_Query_exec("SELECT * from groups ORDER BY group_id");
   
while ($level=mysql_fetch_array($getlevel)) {
   print("<tr>n");
   print("<td class=table_col1><a href=admincp.php?action=groups&do=edit&group_id=".$level["group_id"]."><font color="$level[color]">".$level["level"]."</font><a></td>n");
   print("<td class=table_col2>".$level["view_torrents"]."/".$level["edit_torrents"]."/".$level["delete_torrents"]."</td>n");
   print("<td class=table_col1>".$level["view_users"]."/".$level["edit_users"]."/".$level["delete_users"]."</td>n");
   print("<td class=table_col2>".$level["view_news"]."/".$level["edit_news"]."/".$level["delete_news"]."</td>n");
   print("<td class=table_col1>".$level["view_forum"]."/".$level["edit_forum"]."/".$level["delete_forum"]."</td>n");
   print("<td class=table_col2>".$level["can_upload"]."</td>n");
   print("<td class=table_col1>".$level["can_download"]."</td>n");
   print("<td class=table_col2>".$level["control_panel"]."</td>n");
   print("<td class=table_col1><a href=admincp.php?action=groups&do=delete&group_id=".$level["group_id"].">". T_("DEL")."<a></td>n");
   print("</tr>n");
}
   print("</table><br><br>");
   
end_frame();
stdfoot();
}

if ($action=="groups" && $do=="edit") {
   $group_id=intval($_GET["group_id"]);
   $rlevel=SQL_Query_exec("SELECT * FROM groups WHERE group_id=$group_id");
   
if (!$rlevel)
   show_error_msg(T_("ERROR"),T_("NO_ID_GROUP"),1);
   
   $level=mysql_fetch_array($rlevel);

   stdhead("Groups Management");
   navmenu();


begin_frame(T_("EDIT_GROUP"));
?>
   <form action="admincp.php?action=groups&do=update&group_id=<?php echo $level["group_id"]; ?>" name="level" method="post">
   <table width="100%" align="center">
   <tr><td><?php echo T_("NAME")?>:</td><td><input type="text" name="gname" value="<?php echo $level["level"]; ?>" size="40" /></td></tr>
   <tr><td><?php echo T_("COLOR")?>:</td><td><input type="text" name="gcolor" value="<?php echo $level["Color"]; ?>" size="10" /></td></tr>
   <tr><td><?php echo T_("VIEW_TORRENT")?>:</td><td>  <?php echo T_("YES"); ?> <input type="radio" name="vtorrent" value="yes" <?php if ($level["view_torrents"]=="yes") echo "checked" ?> />&nbsp;&nbsp; <?php echo T_("NO"); ?> <input type="radio" name="vtorrent" value="no" <?php if ($level["view_torrents"]=="no") echo "checked" ?> /></td></tr>
   <tr><td><?php echo T_("EDIT_TORRENT")?>:</td><td>  <?php echo T_("YES"); ?> <input type="radio" name="etorrent" value="yes" <?php if ($level["edit_torrents"]=="yes") echo "checked" ?> />&nbsp;&nbsp; <?php echo T_("NO"); ?> <input type="radio" name="etorrent" value="no" <?php if ($level["edit_torrents"]=="no") echo "checked" ?> /></td></tr>
   <tr><td><?php echo T_("DELETE_TORRENT")?>:</td><td>  <?php echo T_("YES"); ?> <input type="radio" name="dtorrent" value="yes" <?php if ($level["delete_torrents"]=="yes") echo "checked" ?> />&nbsp;&nbsp; <?php echo T_("NO"); ?> <input type="radio" name="dtorrent" value="no" <?php if ($level["delete_torrents"]=="no") echo "checked" ?> /></td></tr>
   <tr><td><?php echo T_("VIEW_USERS")?>:</td><td>  <?php echo T_("YES"); ?> <input type="radio" name="vuser" value="yes" <?php if ($level["view_users"]=="yes") echo "checked" ?> />&nbsp;&nbsp; <?php echo T_("NO"); ?> <input type="radio" name="vuser" value="no" <?php if ($level["view_users"]=="no") echo "checked" ?> /></td></tr>
   <tr><td><?php echo T_("EDIT_USERS")?>:</td><td>  <?php echo T_("YES"); ?> <input type="radio" name="euser" value="yes" <?php if ($level["edit_users"]=="yes") echo "checked" ?> />&nbsp;&nbsp; <?php echo T_("NO"); ?> <input type="radio" name="euser" value="no" <?php if ($level["edit_users"]=="no") echo "checked" ?> /></td></tr>
   <tr><td><?php echo T_("DELETE_USERS")?>:</td><td>  <?php echo T_("YES"); ?> <input type="radio" name="duser" value="yes" <?php if ($level["delete_users"]=="yes") echo "checked" ?> />&nbsp;&nbsp; <?php echo T_("NO"); ?> <input type="radio" name="duser" value="no" <?php if ($level["delete_users"]=="no") echo "checked" ?> /></td></tr>
   <tr><td><?php echo T_("VIEW_NEWS")?>:</td><td> <?php echo T_("YES"); ?> <input type="radio" name="vnews" value="yes" <?php if ($level["view_news"]=="yes") echo "checked" ?> />&nbsp;&nbsp; <?php echo T_("NO"); ?> <input type="radio" name="vnews" value="no" <?php if ($level["view_news"]=="no") echo "checked" ?> /></td></tr>
   <tr><td><?php echo T_("EDIT_NEWS")?>:</td><td> <?php echo T_("YES"); ?> <input type="radio" name="enews" value="yes" <?php if ($level["edit_news"]=="yes") echo "checked" ?> />&nbsp;&nbsp; <?php echo T_("NO"); ?> <input type="radio" name="enews" value="no" <?php if ($level["edit_news"]=="no") echo "checked" ?> /></td></tr>
   <tr><td><?php echo T_("DELETE_NEWS")?>:</td><td> <?php echo T_("YES"); ?> <input type="radio" name="dnews" value="yes" <?php if ($level["delete_news"]=="yes") echo "checked" ?> />&nbsp;&nbsp; <?php echo T_("NO"); ?> <input type="radio" name="dnews" value="no" <?php if ($level["delete_news"]=="no") echo "checked" ?> /></td></tr>
   <tr><td><?php echo T_("VIEW_FORUMS")?>:</td><td> <?php echo T_("YES"); ?> <input type="radio" name="vforum" value="yes" <?php if ($level["view_forum"]=="yes") echo "checked" ?> />&nbsp;&nbsp; <?php echo T_("NO"); ?> <input type="radio" name="vforum" value="no" <?php if ($level["view_forum"]=="no") echo "checked" ?> /></td></tr>
   <tr><td><?php echo T_("EDIT_FORUMS")?>:</td><td> <?php echo T_("YES"); ?> <input type="radio" name="eforum" value="yes" <?php if ($level["edit_forum"]=="yes") echo "checked" ?> />&nbsp;&nbsp; <?php echo T_("NO"); ?> <input type="radio" name="eforum" value="no" <?php if ($level["edit_forum"]=="no") echo "checked" ?> /></td></tr>
   <tr><td><?php echo T_("DELETE_FORUMS")?>:</td><td> <?php echo T_("YES"); ?> <input type="radio" name="dforum" value="yes" <?php if ($level["delete_forum"]=="yes") echo "checked" ?> />&nbsp;&nbsp; <?php echo T_("NO"); ?> <input type="radio" name="dforum" value="no" <?php if ($level["delete_forum"]=="no") echo "checked" ?> /></td></tr>
   <tr><td><?php echo T_("CAN_UPLOAD")?>:</td><td> <?php echo T_("YES"); ?> <input type="radio" name="upload" value="yes" <?php if ($level["can_upload"]=="yes") echo "checked" ?> />&nbsp;&nbsp; <?php echo T_("NO"); ?> <input type="radio" name="upload" value="no" <?php if ($level["can_upload"]=="no") echo "checked" ?> /></td></tr>
   <tr><td><?php echo T_("CAN_DONWLOAD")?>:</td><td> <?php echo T_("YES"); ?> <input type="radio" name="down" value="yes" <?php if ($level["can_download"]=="yes") echo "checked" ?> />&nbsp;&nbsp; <?php echo T_("NO"); ?> <input type="radio" name="down" value="no" <?php if ($level["can_download"]=="no") echo "checked" ?> /></td></tr>
   <tr><td><?php echo T_("CAN_VIEW_CP")?>:</td><td> <?php echo T_("YES"); ?> <input type="radio" name="admincp" value="yes" <?php if ($level["control_panel"]=="yes") echo "checked" ?> />&nbsp;&nbsp; <?php echo T_("NO"); ?> <input type="radio" name="admincp" value="no" <?php if ($level["control_panel"]=="no") echo "checked" ?> /></td></tr>

<?php
   print("n<tr><td align=center class=header><input type=submit name=write value="".T_("CONFIRM")."" /></td></tr>");
   print("</table></form><br><br>");
   print("n<td align=center ><a href="admincp.php?action=groups&do=view"><input type=submit value="".T_("BACK")."" /></a></td>");
   
end_frame();
stdfoot();
}

if ($action=="groups" && $do=="update") {
   stdhead("Groups Management");
   navmenu();

begin_frame(T_("UPDATE"));

   $update=array();
   $update[]="level='".mysql_real_escape_string($_POST["gname"])."'";
   $update[]="Color='".$_POST["gcolor"]."'";
   $update[]="view_torrents='".$_POST["vtorrent"]."'";
   $update[]="edit_torrents='".$_POST["etorrent"]."'";
   $update[]="delete_torrents='".$_POST["dtorrent"]."'";
   $update[]="view_users='".$_POST["vuser"]."'";
   $update[]="edit_users='".$_POST["euser"]."'";
   $update[]="delete_users='".$_POST["duser"]."'";
   $update[]="view_news='".$_POST["vnews"]."'";
   $update[]="edit_news='".$_POST["enews"]."'";
   $update[]="delete_news='".$_POST["dnews"]."'";
   $update[]="view_forum='".$_POST["vforum"]."'";
   $update[]="edit_forum='".$_POST["eforum"]."'";
   $update[]="delete_forum='".$_POST["dforum"]."'";
   $update[]="can_upload='".$_POST["upload"]."'";
   $update[]="can_download='".$_POST["down"]."'";
   $update[]="control_panel='".$_POST["admincp"]."'";
   $strupdate=implode(",",$update);

   $group_id=intval($_GET["group_id"]);
   SQL_Query_exec("UPDATE groups SET $strupdate WHERE group_id=$group_id") or die(mysql_error());

   echo "<br><center><b>".T_("UPDATED")."</b></center><br>";
       
end_frame();
stdfoot();    
}

if ($action=="groups" && $do=="delete") {
   //Needs to be secured!!!!
   $group_id=intval($_GET["group_id"]);
       
if (($group_id=="1") || ($group_id=="7"))
   show_error_msg("ERROR","You cannot delete this group!",1);

   stdhead("Groups Management");
   navmenu();

begin_frame(T_("DELETE_GROUPS"));
   
   SQL_Query_exec("DELETE FROM groups WHERE group_id=$group_id") or die(mysql_error());
   
   echo "<br><center><b>".T_("DELECTED_OK")."</b></center><br>";
       
end_frame();
stdfoot();    
}

if ($action=="groups" && $do=="add") {
   stdhead("Groups Management");
   navmenu();

begin_frame(T_("ADD_NEW_GROUP"));

?>
   <form action="admincp.php?action=groups&do=addnew" name="level" method="post">
   <table width="100%" align="center">
   <tr><td><?php echo T_("GROUP_NAME")?>:</td><td><input type="text" name="gname" value="" size="40" /></td></tr>
   <tr><td><?php echo T_("GROUP_COLOR")?>:</td>
   <td><input type="text" name="gcolor" value="" size="10" /></td></tr>
   <tr><td><?php echo T_("GROUP_COPY")?>:</td><td><select name="getlevel" size="1">
<?php
   $rlevel=SQL_Query_exec("SELECT DISTINCT group_id, level FROM groups ORDER BY group_id");

while($level=mysql_fetch_array($rlevel)) {
   print("n<option value=".$level["group_id"].">".$level["level"]."</option>");
}
   print("n</select></td></tr>");
   print("n<tr><td align=center class=header><input type=submit name=confirm value="".T_("CONFIRM")."" /></td></tr>");
   print("</table></form><br><br>");
   
end_frame();
stdfoot();    
}

if ($action=="groups" && $do=="addnew") {
   stdhead("Groups Management");
   navmenu();

begin_frame(T_("ADD_NEW_GROUP"));

   $group_id=intval($_POST["getlevel"]);
   $rlevel=SQL_Query_exec("SELECT * FROM groups WHERE group_id=$group_id") or die(mysql_error());
   $level=mysql_fetch_array($rlevel);
   
if (!$level)
   show_error_msg("Error","Invalid ID",1);

   $update=array();
   $update[]="level='".mysql_real_escape_string($_POST["gname"])."'";
   $update[]="Color='".$level["gcolor"]."'";
   $update[]="view_torrents='".$level["view_torrents"]."'";
   $update[]="edit_torrents='".$level["edit_torrents"]."'";
   $update[]="delete_torrents='".$level["delete_torrents"]."'";
   $update[]="view_users='".$level["view_users"]."'";
   $update[]="edit_users='".$level["edit_users"]."'";
   $update[]="delete_users='".$level["delete_users"]."'";
   $update[]="view_news='".$level["view_news"]."'";
   $update[]="edit_news='".$level["edit_news"]."'";
   $update[]="delete_news='".$level["delete_news"]."'";
   $update[]="view_forum='".$level["view_forum"]."'";
   $update[]="edit_forum='".$level["edit_forum"]."'";
   $update[]="delete_forum='".$level["delete_forum"]."'";
   $update[]="can_upload='".$level["can_upload"]."'";
   $update[]="can_download='".$level["can_download"]."'";
   $update[]="control_panel='".$level["control_panel"]."'";
   $strupdate=implode(",",$update);
   $group_id=intval($_GET["group_id"]);
   SQL_Query_exec("INSERT INTO groups SET $strupdate") or die(mysql_error());

   echo "<br><center><b>".T_("ADDED_OK")."</b></center><br>";
   
end_frame();
stdfoot();    
}

if (!$action) {
   stdhead(T_("ADMIN_CP"));
   navmenu();
   
stdfoot();
}
#===============================#
#    Theme Management            #
#===============================#

Unknown User
2014-09-27 20:25:46
lol why all of this ? can you just copy the code of the coloro thing
Unknown User
2014-09-28 18:55:13
The person prob wants colors in the groups cp. But again class_user would have to be modified to use this.

I personally find it simpler to have the colors like this that way they all the same across the site well as long as using class_user

this topic has more about that.

[url="http://devscorner.xyz/topic/17512-req-auto-medal-and-new-class-user-function-for-208-only"]http://devscorner.xyz/topic/17512-req-auto-medal-and-new-class-user-function-for-208-only[/url]
Unknown User
2014-12-17 12:06:32
sorry change group for this groups (sql)
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 9
  • Members: 0
  • Guests online: 9
  • Comments: 3
  • Messages: 1,728