New Rank Page HouseKeeping :p

Results 1 to 14 of 14
  1. #1
    Account Upgraded | Title Enabled! Punk is offline
    MemberRank
    Dec 2008 Join Date
    VirginiaLocation
    892Posts

    big grin New Rank Page HouseKeeping :p

    PHP Code:
    <?php
    /*===================================================+
    || # HoloCMS - Website and Content Management System
    |+===================================================+
    || # Copyright © 2008 Meth0d. All rights reserved.
    || # http://www.meth0d.org
    |+===================================================+
    || # HoloCMS is provided "as is" and comes without
    || # warrenty of any kind. HoloCMS is free software!
    |+===================================================+
    || # Visual enhancements by Jonty aka Jonathan aka Stopthattwinkie
    |+===================================================*/

    require_once('../core.php');
    if(
    $hkzone !== true){ header("Location: index.php?throwBack=true"); exit; }
    if(!
    session_is_registered(acp)){ header("Location: index.php?p=login"); exit; }

    $pagename "User Rank Management";

    //Edit rank names here//
    $rank3 ""//RANK 3 NAME
    $rank4 ""//RANK 4 NAME
    $rank5 ""//RANK 5 NAME
    $rank6 "Moderator"//RANK 6 NAME
    $rank7 "Administrator"//RANK 7 NAME
    //End of rank names//

    //Edit badges here//
    $badge3 ""//RANK 3 BADGE
    $badge4 ""//RANK 4 BADGE
    $badge5 ""//RANK 5 BADGE
    $badge6 "MOD"//RANK 6 BADGE
    $badge7 "ADM"//RANK 7 BADGE
    //Edit badges here//

    if(isset($_POST['rank'])){
    $rank $_POST['rank'];
    $key FilterText($_POST['name']);

    $check mysql_query("SELECT id FROM users WHERE name = '".$key."' OR id = '".$key."' LIMIT 1") or die(mysql_error());
    $exists mysql_num_rows($check);
    $drow mysql_fetch_assoc($check);

    if(
    $rank == 0){
        
    $msg "No rank specified.";
    }elseif(
    $rank == 3){
    $badge $badge3;
    }elseif(
    $rank == 4){
    $badge $badge4;
    }elseif(
    $rank == 5){
    $badge $badge5;
    }elseif(
    $rank == 6){
    $badge $badge6;
    }elseif(
    $rank == 7){
    $badge $badge7;
    }

        if(
    $exists 0){
            if(
    $rank && $rank 8){
                if(
    $rank && $sysadmin == $my_id || $rank 7){
                    if(
    $sysadmin == $drow['id']){
                        
    mysql_query("INSERT INTO system_stafflog (action,message,note,userid,targetid,timestamp) VALUES ('Housekeeping','Access Denied to Rank Tool; you may not modify the System Administrator\'s rank!','ranktool.php','".$my_id."','".$drow['id']."','".$date_full."')") or die(mysql_error());
                        
    $msg "Access denied. You may not modify the System Administrator's Rank.";
                    } else {
                        
    mysql_query("UPDATE users SET rank = '".$_POST['rank']."' WHERE name = '".$key."' LIMIT 1") or die(mysql_error()); 
                        
    $msg "Rank updated successfully.";
                        
    mysql_query("INSERT INTO system_stafflog (action,message,note,userid,targetid,timestamp) VALUES ('Housekeeping','Changed user rank to ".$rank."','ranktool.php','".$my_id."','".$drow['id']."','".$date_full."')") or die(mysql_error());
                        
    mysql_query("DELETE FROM users_badges WHERE userid = '".$drow['id']."' AND badgeid = '".$badge3."' LIMIT 1");
                        
    mysql_query("DELETE FROM users_badges WHERE userid = '".$drow['id']."' AND badgeid = '".$badge4."' LIMIT 1");
                        
    mysql_query("DELETE FROM users_badges WHERE userid = '".$drow['id']."' AND badgeid = '".$badge5."' LIMIT 1");
                        
    mysql_query("DELETE FROM users_badges WHERE userid = '".$drow['id']."' AND badgeid = '".$badge6."' LIMIT 1");
                        
    mysql_query("DELETE FROM users_badges WHERE userid = '".$drow['id']."' AND badgeid = '".$badge7."' LIMIT 1");
                        
    mysql_query("INSERT INTO users_badges (userid,badgeid,iscurrent) VALUES ('".$drow['id']."','".$badge."','0')");
                    }
                } else {
                    
    mysql_query("INSERT INTO system_stafflog (action,message,note,userid,targetid,timestamp) VALUES ('Housekeeping','Access Denied to Rank Tool; Only the system administrator may give out rank 7!','ranktool.php','".$my_id."','".$drow['id']."','".$date_full."')") or die(mysql_error());
                    
    $msg "Access denied. Only the System Administrator may give out the administrator rank.";
                }
            } else {
                
    $msg "Please choose a rank.";
            }
        } else {
            
    $msg "An user with this name/id does not exist!";
        }

    }

    @include(
    'subheader.php');
    @include(
    'header.php');
    ?>
    <table cellpadding='0' cellspacing='8' width='100%' id='tablewrap'>
    <tr> <td width='22%' valign='top' id='leftblock'>
     <div>
     <!-- LEFT CONTEXT SENSITIVE MENU -->
    <?php @include('usermenu.php'); ?>
     <!-- / LEFT CONTEXT SENSITIVE MENU -->
     </div>
     </td>
     <td width='78%' valign='top' id='rightblock'>
     <div><!-- RIGHT CONTENT BLOCK -->
     
    <?php if(isset($msg)){ ?><p><strong><?php echo $msg?></p></strong><?php ?>
     
    <form action='index.php?p=ranktool&do=something' method='post' name='theAdminForm' id='theAdminForm'>
    <div class='tableborder'>
    <div class='tableheaderalt'>Rank Manager</div>

    <table width='100%' cellspacing='0' cellpadding='5' align='center' border='0'>
    <tr>
    <td class='tablerow1'  width='40%'  valign='middle'><strong>Username</strong><div class='graytext'>The username of who this action will apply to.</div></td>
    <td class='tablerow2'  width='60%'  valign='middle'><input type='text' name='name' value="" size='30' class='textinput'></td>
    </tr>

    <tr>
    <td class='tablerow1'  width='40%'  valign='middle'><strong>Rank</strong><div class='graytext'>Simply choose the rank from the menu.</div></td>
    <td class='tablerow2'  width='60%'  valign='middle'><select name='rank' style="background-color: #FFFFFF; color: #000000; font-family: Verdana; font-size: 11px; width: 115px; ">
        <option value="0">Chose rank...</option>
        <option value="1">Normal User</option>
        <option value="2">Club Member</option>
        <option value="3"><?php echo $rank3?></option>
        <option value="4"><?php echo $rank4?></option>
        <option value="5"><?php echo $rank5?></option>
        <option value="6"><?php echo $rank6?></option>
        <option value="7"><?php echo $rank7?></option>
    </select></td>
    </tr>

    <tr>
    <tr><td align='center' class='tablesubheader' colspan='2' ><input type='submit' value='Change Rank' class='realbutton' accesskey='s'></td></tr>
    </form></table></div><br />

    <?php
    $get_admins 
    mysql_query("SELECT * FROM users WHERE rank = 7 ORDER BY name ASC LIMIT 50") or die(mysql_error());
    ?>

     <div class='tableborder'>
     <div class='tableheaderalt'>Administrators</div>
     <table cellpadding='4' cellspacing='0' width='100%'>
     <tr>
      <td class='tablesubheader' width='60%' align='center'>Username</td>
     </tr>
    <?php

    while($row mysql_fetch_assoc($get_admins)){
        
    printf(" <tr>
      <td class='tablerow1' align='center'>%s (ID: %s)</td>
    </tr>"
    $row['name'], $row['id']);
    }
    ?>
     
     </table><br /></div><br />
     
     <?php
    $get_mods 
    mysql_query("SELECT * FROM users WHERE rank = 6 ORDER BY name ASC LIMIT 50") or die(mysql_error());
    ?>

     <div class='tableborder'>
     <div class='tableheaderalt'>Moderators</div>
     <table cellpadding='4' cellspacing='0' width='100%'>
     <tr>
      <td class='tablesubheader' width='60%' align='center'>Username</td>
     </tr>
    <?php

    while($row mysql_fetch_assoc($get_mods)){
        
    printf(" <tr>
      <td class='tablerow1' align='center'>%s (ID: %s)</td>
      
    </tr>"
    $row['name'], $row['id']);
    }
    ?>
     
     </table><br /></div><br />
     
      <?php
    $get_5 
    mysql_query("SELECT * FROM users WHERE rank = 5 ORDER BY name ASC LIMIT 50") or die(mysql_error());
    ?>

     <div class='tableborder'>
     <div class='tableheaderalt'><?php echo $rank5?></div>
     <table cellpadding='4' cellspacing='0' width='100%'>
     <tr>
      <td class='tablesubheader' width='60%' align='center'>Username</td>
     </tr>
    <?php

    while($row mysql_fetch_assoc($get_5)){
        
    printf(" <tr>
      <td class='tablerow1' align='center'>%s (ID: %s)</td>
      
    </tr>"
    $row['name'], $row['id']);
    }
    ?>
     
     </table><br /></div><br />
     
     <?php
    $get_4 
    mysql_query("SELECT * FROM users WHERE rank = 4 ORDER BY name ASC LIMIT 50") or die(mysql_error());
    ?>

     <div class='tableborder'>
     <div class='tableheaderalt'><?php echo $rank4?></div>
     <table cellpadding='4' cellspacing='0' width='100%'>
     <tr>
      <td class='tablesubheader' width='60%' align='center'>Username</td>
     </tr>
    <?php

    while($row mysql_fetch_assoc($get_4)){
        
    printf(" <tr>
      <td class='tablerow1' align='center'>%s (ID: %s)</td>
      
    </tr>"
    $row['name'], $row['id']);
    }
    ?>
     
     </table><br /></div><br />
     
     <?php
    $get_3 
    mysql_query("SELECT * FROM users WHERE rank = 3 ORDER BY name ASC LIMIT 50") or die(mysql_error());
    ?>

     <div class='tableborder'>
     <div class='tableheaderalt'><?php echo $rank3?></div>
     <table cellpadding='4' cellspacing='0' width='100%'>
     <tr>
      <td class='tablesubheader' width='60%' align='center'>Username</td>
     </tr>
    <?php

    while($row mysql_fetch_assoc($get_3)){
        
    printf(" <tr>
      <td class='tablerow1' align='center'>%s (ID: %s)</td>
      
    </tr>"
    $row['name'], $row['id']);
    }
    ?>
     
     </table><br /></div>
     
    </div>
         </div><!-- / RIGHT CONTENT BLOCK -->
         </td></tr>
    </table>
    </div><!-- / OUTERDIV -->
    <div align='center'><br />
    <?php
    $mtime 
    explode(' 'microtime());
    $totaltime $mtime[0] + $mtime[1] - $starttime;
    printf('Time: %.3f'$totaltime);
    ?>
    </div>
    Also heres a HoloCMS Group Badge Editor
    PHP Code:
    <?php 
    /*===================================================+ 
    || # HoloCMS - Website and Content Management System 
    |+===================================================+ 
    || # Copyright © 2008 Meth0d. All rights reserved. 
    || # http://www.meth0d.org 
    |+===================================================+ 
    || # HoloCMS is provided "as is" and comes without 
    || # warrenty of any kind. HoloCMS is free software! 
    |+===================================================*/ 

    include('../core.php'); 
    include(
    '../includes/session.php'); 

    // simple check to avoid most direct access 
    $refer $_SERVER['HTTP_REFERER']; 
    $pos strrpos($refer"group_profile.php"); 
    if (
    $pos === false) { exit; } 

    $groupid $_POST['groupId']; 
    if(!
    is_numeric($groupid)){ exit; } 

    $check mysql_query("SELECT member_rank FROM groups_memberships WHERE userid = '".$my_id."' AND groupid = '".$groupid."' AND member_rank > 1 AND is_pending = '0' LIMIT 1") or die(mysql_error()); 
    $is_member mysql_num_rows($check); 

    if(
    $is_member 0){ 
        
    $my_membership mysql_fetch_assoc($check); 
        
    $member_rank $my_membership['member_rank']; 
        if(
    $member_rank 2){ exit; } 
    } else { 
        exit; 


    $check mysql_query("SELECT * FROM groups_details WHERE id = '".$groupid."' LIMIT 1") or die(mysql_error()); 
    $valid mysql_num_rows($check); 

    if(
    $valid 0){ $groupdata mysql_fetch_assoc($check); } else {exit; } 

    ?> 
    <div id="badge-editor-flash" align="center"> 
    <strong>Flash is required to use this tool</strong> 
    </div> 
    <script type="text/javascript" language="JavaScript"> 
    var swfobj = new SWFObject("<?php echo $path?>web-gallery/flash/BadgeEditor.swf", "badgeEditor", "280", "366", "8"); 
    swfobj.addParam("base", "<?php echo $path?>web-gallery/flash/"); 
    swfobj.addParam("bgcolor", "#FFFFFF"); 
    swfobj.addVariable("post_url", "<?php echo $path?>save_group_badge.php"); 
    swfobj.addVariable("__app_key", "Meth0d.org"); 
    swfobj.addVariable("groupId", "<?php echo $groupid?>"); 
    swfobj.addVariable("badge_data", "<?php echo $groupdata['badge']; ?>"); 
    swfobj.addVariable("localization_url", "<?php echo $path?>xml/badge_editor.xml"); 
    swfobj.addVariable("xml_url", "<?php echo $path?>xml/badge_data_xml.xml"); 
    swfobj.addParam("allowScriptAccess", "always"); 
    swfobj.write("badge-editor-flash"); 
    </script>


  2. #2
    Enthusiast patrick1995-2 is offline
    MemberRank
    Feb 2009 Join Date
    The NetherlandsLocation
    47Posts

    Re: New Rank Page HouseKeeping :p

    Please upload a screenshot....

  3. #3
    Account Upgraded | Title Enabled! FlamingoBoy is offline
    MemberRank
    Sep 2008 Join Date
    GermanyLocation
    242Posts

    Re: New Rank Page HouseKeeping :p

    cool^^

  4. #4
    Don't buff my pylon! Admiral-Speedy is offline
    MemberRank
    Jun 2008 Join Date
    CanadaLocation
    1,292Posts

    Re: New Rank Page HouseKeeping :p

    screenshot pl0x.

  5. #5
    Account Upgraded | Title Enabled! •╩•andy•╩• is offline
    MemberRank
    Jan 2008 Join Date
    PRLocation
    1,353Posts

    Re: New Rank Page HouseKeeping :p

    Screeeeennnn plizzzz


    would help alot since a bunch of text dosent explain for it self.

  6. #6
    Account Upgraded | Title Enabled! Killah-07 is offline
    MemberRank
    Nov 2007 Join Date
    238Posts

    thumbs up Re: New Rank Page HouseKeeping :p

    me new pic xD me ranks in Adminpanel in holocms



    THX (( mcmsi ))

  7. #7
    Account Upgraded | Title Enabled! Punk is offline
    MemberRank
    Dec 2008 Join Date
    VirginiaLocation
    892Posts

    big grin Re: New Rank Page HouseKeeping :p

    NP (check out my hotel http://*******.com/mehhotel)

  8. #8
    Twinkies are nice. Stopthattwinkie is offline
    MemberRank
    Feb 2007 Join Date
    In your fridge.Location
    509Posts

    Re: New Rank Page HouseKeeping :p

    Eh, the rank page is my code. Give credits where needed, thanks.

    Thanks for keeping my name in the code though. :]

  9. #9
    Account Upgraded | Title Enabled! Punk is offline
    MemberRank
    Dec 2008 Join Date
    VirginiaLocation
    892Posts

    big grin Re: New Rank Page HouseKeeping :p

    Quote Originally Posted by Stopthattwinkie View Post
    Eh, the rank page is my code. Give credits where needed, thanks.

    Thanks for keeping my name in the code though. :]
    NP if it yours m8 i never said it was mine :D but HoloCMS Group Badge Editor is mine :D

  10. #10
    Member Hobblcms is offline
    MemberRank
    Jul 2009 Join Date
    71Posts

    Re: New Rank Page HouseKeeping :p

    thx nice

  11. #11
    Apprentice BadBoyAaron is offline
    MemberRank
    Dec 2009 Join Date
    14Posts

    Re: New Rank Page HouseKeeping :p

    OMG!!! Thanks!!!!!!!!!

  12. #12
    Apprentice Dannyn, is offline
    MemberRank
    Sep 2009 Join Date
    5Posts

    Re: New Rank Page HouseKeeping :p

    Where do i put the "rank" file in the housekeeping folder?

  13. #13
    Twinkies are nice. Stopthattwinkie is offline
    MemberRank
    Feb 2007 Join Date
    In your fridge.Location
    509Posts

    Re: New Rank Page HouseKeeping :p

    Quote Originally Posted by Dannyn, View Post
    Where do i put the "rank" file in the housekeeping folder?
    Replace the code with the code in ranktool.php

  14. #14
    Apprentice Dannyn, is offline
    MemberRank
    Sep 2009 Join Date
    5Posts

    Re: New Rank Page HouseKeeping :p

    Ahh thanks, works great. Nice release.



Advertisement