Changeset 19 for minimanager/command.php
- Timestamp:
- Aug 13, 2007, 9:05:34 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
minimanager/command.php
r5 r19 25 25 ); 26 26 27 $ mysql = new MySQL;28 $ mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);27 $sql = new SQL; 28 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']); 29 29 30 $query = $ mysql->query("SELECT name,help,`security` FROM command WHERE `security` <= $user_lvl");30 $query = $sql->query("SELECT name,help,`security` FROM command WHERE `security` <= $user_lvl"); 31 31 32 while ($data = $ mysql->fetch_row($query)){32 while ($data = $sql->fetch_row($query)){ 33 33 $tmp_output = "<tr>"; 34 34 $tmp_output .= ($user_lvl > 2) ? "<td><input type=\"checkbox\" name=\"check[$data[0]]\" value=\"$data[2]\" /></td>" : "<td></td>"; 35 $tmp_output .= "<td nowrap align=right>.$data[0]</td>";35 $tmp_output .= "<td align=\"right\">.$data[0]</td>"; 36 36 $comm = explode("\r\n",$data[1],2); 37 37 $syntax = ereg_replace("[a-zA-Z ]+:* *\.".$data[0]." *", "", str_replace("/", "<br />",$comm[0])); … … 52 52 for ($i=0; $i<=$user_lvl; $i++){ 53 53 $output .= "<fieldset style=\"width: 770px;\"> 54 <legend>{$lang_command[$levels[$i][0]]}</legend> 55 <br /> 54 <legend>". 55 (($user_lvl) ? "<a href=\"#\" onclick=\"showHide('{$levels[$i][0]}')\">{$lang_command[$levels[$i][0]]}</a>" : "{$lang_command[$levels[$i][0]]}"). 56 "</legend> 57 <div id=\"{$levels[$i][0]}\"> 58 <br /> 56 59 <table class=\"lined\" style=\"width: 720px;text-align: left;\"> 57 60 <tr style=\"text-align: center;\"> 58 <t d width=\"2%\" class=\"head\"></td>59 <t d width=\"13%\" class=\"head\">{$lang_command['command']}</td>60 <t d width=\"20%\" class=\"head\">{$lang_command['syntax']}</td>61 <t d width=\"65%\" class=\"head\">{$lang_command['description']}</td>61 <th width=\"2%\"></th> 62 <th width=\"13%\">{$lang_command['command']}</th> 63 <th width=\"20%\">{$lang_command['syntax']}</th> 64 <th width=\"65%\">{$lang_command['description']}</th> 62 65 </tr>" . $levels[$i][1]; 63 66 if ($user_lvl > 2) { … … 65 68 makebutton($lang_command['change_level'], "javascript:do_submit()",280); 66 69 } 67 $output .= "</table></ fieldset>";70 $output .= "</table></div></fieldset>"; 68 71 } 69 72 $output .= "</form><br /></center>"; 70 73 71 $ mysql->close();74 $sql->close(); 72 75 } 73 76 … … 77 80 //####################################################################################################### 78 81 function update_commands(){ 79 global $lang_global, $lang_command, $output ;82 global $lang_global, $lang_command, $output, $user_lvl; 80 83 valid_login(3); 81 84 … … 88 91 <table class=\"lined\" style=\"width: 720px;\"> 89 92 <tr> 90 <t d width=\"20%\" class=\"head\"></td>91 <t d width=\"20%\" class=\"head\">{$lang_command['level0']}</td>92 <t d width=\"20%\" class=\"head\">{$lang_command['level1']}</td>93 <t d width=\"20%\" class=\"head\">{$lang_command['level2']}</td>94 <t d width=\"20%\" class=\"head\">{$lang_command['level3']}</td>93 <th width=\"20%\"></th> 94 <th width=\"20%\">{$lang_command['level0']}</th> 95 <th width=\"20%\">{$lang_command['level1']}</th> 96 <th width=\"20%\">{$lang_command['level2']}</th> 97 <th width=\"20%\">{$lang_command['level3']}</th> 95 98 </tr>"; 96 99 … … 128 131 valid_login(3); 129 132 130 $ mysql = new MySQL;131 $ mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);132 if(isset($_GET['change'])) $change = $ mysql->quote_smart($_GET['change']);133 $sql = new SQL; 134 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']); 135 if(isset($_GET['change'])) $change = $sql->quote_smart($_GET['change']); 133 136 else redirect("command.php?error=1"); 134 137 … … 142 145 143 146 for ($i=0; $i<count($change); $i++) { 144 $query = $ mysql->query("UPDATE command SET `security` = '".$change[$commands[$i]]."' WHERE name= '$commands[$i]'");147 $query = $sql->query("UPDATE command SET `security` = '".$change[$commands[$i]]."' WHERE name= '$commands[$i]'"); 145 148 } 146 149 147 $ mysql->close();150 $sql->close(); 148 151 redirect("command.php"); 149 152 }
Note:
See TracChangeset
for help on using the changeset viewer.