Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $dbhost = 'localhost';
- $dbuser = 'xxxxxxxx';
- $dbpass = 'xxxxxxxx';
- $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
- $dbname = 'godcraft_site';
- mysql_select_db($dbname);
- $q = mysql_query('SELECT u.username as username, up.user_upgrade_id as group_id
- FROM xf_user u, xf_user_upgrade_active up
- WHERE up.user_id = u.user_id
- AND (up.user_upgrade_id = 3 OR up.user_upgrade_id = 4 OR up.user_upgrade_id = 5 OR up.user_upgrade_id = 2 OR up.user_upgrade_id = 6)
- ORDER BY u.username asc') or die(mysql_error());
- $excludedPeople = array("kane_hart","cypher_code","sniper3","confuzzledyma","zach00123","quizzbee","sounas","madcat1030","bodydrag","electrobot4");
- $groupUsers = array();
- $groupNameIndex = array();
- while($row2 = mysql_fetch_array($q)){
- $name = strtolower($row2['username']);
- $canWrite = 1;
- $existingEntry = 0;
- for ($i = 0; $i < (count($excludedPeople)); $i++) {
- if($name == $excludedPeople[$i]){
- $canWrite = 0;
- }
- }
- for($i = 0; $i < (count($groupNameIndex)); $i++){
- if($groupNameIndex[$i] == $name){
- $existingEntry = 1;
- }
- }
- if($existingEntry == 0 && $canWrite == 1){
- $groupNameIndex[count($groupNameIndex)+1] = $name;
- }
- if($canWrite == 1){
- $group_id = $row2['group_id'];
- $groupUsers[$name] .= ",".$group_id;
- }
- }
- for($i = 1; $i < count($groupNameIndex); $i++){
- if(strstr($groupUsers[$groupNameIndex[$i]],"5")){
- $group = "VIP3";
- }else if(strstr($groupUsers[$groupNameIndex[$i]],"4")){
- $group = "VIP2";
- }else if(strstr($groupUsers[$groupNameIndex[$i]],"3")){
- $group = "VIP1";
- }else{
- $group = "";
- }
- if($i>0){
- if($groupUsers[$groupNameIndex[$i] == $groupUsers[$groupNameIndex[$i-1]){
- break;
- }
- }
- echo " $groupNameIndex[$i]:</br> groups:<br/> - $group<br/> permissions:<br/>";
- if(strstr($groupUsers[$groupNameIndex[$i]],"2") || $group == "VIP3"){
- echo " - stargate.network.PVP-NET<br />";
- }
- if(strstr($groupUsers[$groupNameIndex[$i]],"6") || $group == "VIP3"){
- echo " - stargate.network.Nether<br />";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement