Guest User

ravan script staff.php decoded

a guest
Nov 30th, 2011
518
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.98 KB | None | 0 0
  1. <?php
  2.  
  3. include "sglobals.php";
  4. //This contains general thingies
  5. switch($_GET['action'])
  6. {
  7. case 'basicset': basicsettings(); break;
  8. case 'announce': announcements(); break;
  9. case 'cmanual': cronmanual(); break;
  10. default: index(); break;
  11. }
  12. function basicsettings()
  13. {
  14. global $db,$ir,$c,$h,$userid,$set;
  15. if($ir['user_level'] != 2)
  16. {
  17. die("403");
  18. }
  19. if($_POST['submit'])
  20. {
  21. unset($_POST['submit']);
  22. foreach($_POST as $k => $v)
  23. {
  24. $db->query("UPDATE `settings` SET conf_value='$v' WHERE conf_name='$k'");
  25. }
  26. print "Settings updated!
  27. <a href='staff.php?action=basicset'>Back</a>";
  28. stafflog_add("Updated the basic game settings");
  29. }
  30. else
  31. {
  32. print "
  33.  
  34. <div class='generalinfo_txt'>
  35. <div><img src='images/info_left.jpg' alt='' /></div>
  36. <div class='info_mid'><h2 style='padding-top:10px;'> Basic Settings</h2></div>
  37. <div><img src='images/info_right.jpg' alt='' /></div> </div>
  38. <div class='generalinfo_simple'>
  39.  
  40.  
  41.  
  42.  
  43. <form action='staff.php?action=basicset' method='post'>
  44. <input type='hidden' name='submit' value='1' />
  45. Game Name: <input type='text' STYLE='color: black; background-color: white;' name='game_name' value='{$set['game_name']}' />
  46. Game Owner: <input type='text' STYLE='color: black; background-color: white;' name='game_owner' value='{$set['game_owner']}' />
  47. Game Description:
  48. <textarea rows='15' cols='55' name='game_description'>{$set['game_description']}</textarea>
  49. Paypal Address: <input type='text' STYLE='color: black; background-color: white;' name='paypal' value='{$set['paypal']}' />
  50. Gym/Crimes Validation: <select name='validate_on' type='dropdown'>";
  51. $opt=array(
  52. "1" => "On",
  53. "0" => "Off"
  54. );
  55. foreach($opt as $k => $v)
  56. {
  57. if($k == $set['validate_on'])
  58. {
  59. print "<option value='{$k}' selected='selected'>{$v}</option>";
  60. }
  61. else
  62. {
  63. print "<option value='{$k}'>{$v}</option>";
  64. }
  65. }
  66. print "</select>
  67. Validation Period: <select name='validate_period' type='dropdown'>";
  68. $opt=array(
  69. "5" => "Every 5 Minutes",
  70. "15" => "Every 15 Minutes",
  71. "60" => "Every Hour",
  72. "login" => "Every Login"
  73. );
  74. foreach($opt as $k => $v)
  75. {
  76. if($k == $set['validate_period'])
  77. {
  78. print "<option value='{$k}' selected='selected'>{$v}</option>";
  79. }
  80. else
  81. {
  82. print "<option value='{$k}'>{$v}</option>";
  83. }
  84. }
  85. print "</select>
  86. Registration CAPTCHA: <select name='regcap_on' type='dropdown'>";
  87. $opt=array(
  88. "1" => "On",
  89. "0" => "Off"
  90. );
  91. foreach($opt as $k => $v)
  92. {
  93. if($k == $set['regcap_on'])
  94. {
  95. print "<option value='{$k}' selected='selected'>{$v}</option>";
  96. }
  97. else
  98. {
  99. print "<option value='{$k}'>{$v}</option>";
  100. }
  101. }
  102. print "</select>
  103. Send Crystals: <select name='sendcrys_on' type='dropdown'>";
  104. $opt=array(
  105. "1" => "On",
  106. "0" => "Off"
  107. );
  108. foreach($opt as $k => $v)
  109. {
  110. if($k == $set['sendcrys_on'])
  111. {
  112. print "<option value='{$k}' selected='selected'>{$v}</option>";
  113. }
  114. else
  115. {
  116. print "<option value='{$k}'>{$v}</option>";
  117. }
  118. }
  119. print "</select>
  120. Bank Xfers: <select name='sendbank_on' type='dropdown'>";
  121. $opt=array(
  122. "1" => "On",
  123. "0" => "Off"
  124. );
  125. foreach($opt as $k => $v)
  126. {
  127. if($k == $set['sendbank_on'])
  128. {
  129. print "<option value='{$k}' selected='selected'>{$v}</option>";
  130. }
  131. else
  132. {
  133. print "<option value='{$k}'>{$v}</option>";
  134. }
  135. }
  136. print "</select>
  137. Energy Refill Price (crystals): <input type='text' STYLE='color: black; background-color: white;' name='ct_refillprice' value='{$set['ct_refillprice']}' />
  138. IQ per crystal: <input type='text' STYLE='color: black; background-color: white;' name='ct_iqpercrys' value='{$set['ct_iqpercrys']}' />
  139. Money per crystal: <input type='text' STYLE='color: black; background-color: white;' name='ct_moneypercrys' value='{$set['ct_moneypercrys']}' />
  140. Will Potion Item: ".item_dropdown($c, "willp_item", $set['willp_item'])."
  141. <input type='submit' STYLE='color: black; background-color: white;' value='Update Settings' /></form></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div></div></div></div></div></div>";
  142. }
  143. }
  144. function announcements()
  145. {
  146. global $db,$ir,$c,$h,$userid,$set;
  147. if($ir['user_level'] != 2)
  148. {
  149. die("403");
  150. }
  151. if($_POST['text'])
  152. {
  153. $db->query("INSERT INTO announcements VALUES('{$_POST['text']}', unix_timestamp())");
  154. $db->query("UPDATE users SET new_announcements=new_announcements+1");
  155. print "Announcement added!
  156. &gt; <a href='staff.php'>Back</a>";
  157. stafflog_add("Added a new announcement");
  158. }
  159. else
  160. {
  161. print "
  162.  
  163. <div class='generalinfo_txt'>
  164. <div><img src='images/info_left.jpg' alt='' /></div>
  165. <div class='info_mid'><h2 style='padding-top:10px;'> Adding an announcement...</h2></div>
  166. <div><img src='images/info_right.jpg' alt='' /></div> </div>
  167. <div class='generalinfo_simple'>
  168.  
  169. Please try to make sure the announcement is concise and covers everything you want it to.<form action='staff.php?action=announce' method='post'>
  170. Announcement text:
  171. <textarea name='text' rows='10' cols='60'></textarea>
  172. <input type='submit' STYLE='color: black; background-color: white;' value='Add Announcement' /></form></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div></div></div></div></div></div>";
  173. }
  174. }
  175.  
  176.  
  177. function cronmanual()
  178. {
  179. global $db,$ir,$c,$h,$userid,$set;
  180. if($ir['user_level'] != 2)
  181. {
  182. die("403");
  183. }
  184. print "
  185.  
  186.  
  187.  
  188. <div class='generalinfo_txt'>
  189. <div><img src='images/info_left.jpg' alt='' /></div>
  190. <div class='info_mid'><h2 style='padding-top:10px;'> Manual Cron Jobs</h2></div>
  191. <div><img src='images/info_right.jpg' alt='' /></div> </div>
  192. <div class='generalinfo_simple'>
  193.  
  194.  
  195. <style type='text/css'>
  196. .style1 {
  197. color: #FF0000;
  198. }
  199. .style2 {
  200. text-decoration: underline;
  201. color: #008000;
  202. }
  203. </style>
  204.  
  205. You can manually run cron jobs from here.
  206. <span class='style1'><b>Warning</b></span>: Use only for testing. Statistics are updated
  207. every time you run a corresponding cron instead of time limit.
  208.  
  209. <a href='cron_srun_minute.php'>Run 1 Minute Cron Jobs</a> [ Updates Jail and
  210. Hospital Time ]
  211. <a href='cron_srun_five.php'>Run 5 Minute Cron Jobs</a> [ Updates User
  212. Statistics ]
  213.  
  214. <a href='cron_srun_hour.php'>Run Hourly Cron Jobs</a>&nbsp; [ Updates Hourly
  215. Cron ]
  216.  
  217. <a href='cron_srun_day.php'>Run Daily Cron Jobs</a>&nbsp; [ Updates Daily Cron ]
  218.  
  219.  
  220. <a href='battle_cron.php'>Run Battle Ladder Cron</a>&nbsp; [ Updates Battle Ladder Cron Job ]
  221.  
  222. Run Battle Ladder cron , every week , month or so ! Running this job credit the table leader with cash and points and also reset the battle ladder for new tournament !
  223.  
  224. </div><div><img src='images/generalinfo_btm.jpg' alt='' /></div></div></div></div></div></div>
  225.  
  226.  
  227. ";
  228. }
  229.  
  230.  
  231.  
  232. function index()
  233. {
  234. global $db,$ir,$c,$h,$userid,$set, $_CONFIG;
  235. $pv=phpversion();
  236. $mv=$db->fetch_single($db->query("SELECT VERSION()"));
  237. $dv=$_CONFIG['driver'];
  238. if($ir['user_level']==2)
  239. {
  240. $versionno=2101;
  241. $version="2.1.01";
  242. print "
  243.  
  244. <div class='generalinfo_txt'>
  245. <div><img src='images/info_left.jpg' alt='' /></div>
  246. <div class='info_mid'><h2 style='padding-top:10px;'> Game Engine Information</h2></div>
  247. <div><img src='images/info_right.jpg' alt='' /></div> </div>
  248. <div class='generalinfo_simple'>
  249.  
  250.  
  251.  
  252. <table width='75%' cellspacing='1' class='table'>
  253. <tr>
  254. <th>PHP Version:</th>
  255. <td>$pv</td>
  256. </tr>
  257. <tr>
  258. <th>MySQL Version:</th>
  259. <td>$mv</td>
  260. </tr>
  261. <tr>
  262. <th>MySQL Driver:</th>
  263. <td>$dv</td>
  264. </tr>
  265. <tr>
  266. <th>Ravan's MMORPG Script </th>
  267. <td>2.1.01 (Build: 2101)</td>
  268. </tr>
  269. </table></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div></div></div></div></div></div>
  270.  
  271.  
  272. <div class='generalinfo_txt'>
  273. <div><img src='images/info_left.jpg' alt='' /></div>
  274. <div class='info_mid'><h2 style='padding-top:10px;'> Last 10 Staff Actions</h2></div>
  275. <div><img src='images/info_right.jpg' alt='' /></div> </div>
  276. <div class='generalinfo_simple'>
  277.  
  278.  
  279.  
  280. <table width='90%' cellspacing='1' class='table'>
  281. <tr>
  282. <th>Staff</th>
  283. <th>Action</th>
  284. <th>Time</th>
  285. <th>IP</th>
  286. </tr>";
  287. $q=$db->query("SELECT s.*, u.* FROM stafflog AS s LEFT JOIN users AS u ON s.user=u.userid ORDER BY s.time DESC LIMIT 10");
  288. while($r=$db->fetch_row($q))
  289. {
  290. print "<tr><td>{$r['username']} [{$r['user']}]</td> <td>{$r['action']}</td> <td>".date('F j Y g:i:s a', $r['time'])."</td> <td>{$r['ip']}</td></tr>";
  291. }
  292. print "</table></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div></div></div></div></div></div>";
  293. }
  294. print "
  295.  
  296. <div class='generalinfo_txt'>
  297. <div><img src='images/info_left.jpg' alt='' /></div>
  298. <div class='info_mid'><h2 style='padding-top:10px;'> Staff Notepad</h2></div>
  299. <div><img src='images/info_right.jpg' alt='' /></div> </div>
  300. <div class='generalinfo_simple'> ";
  301. if($_POST['pad'])
  302. {
  303. $db->query("UPDATE settings SET conf_value='{$_POST['pad']}' WHERE conf_name='staff_pad'");
  304. $set['staff_pad']=stripslashes($_POST['pad']);
  305. print "<b>Staff Notepad Updated!</b><hr />";
  306. }
  307. print "<form action='staff.php' method='post'>
  308. <textarea rows='10' cols='60' name='pad'>".htmlspecialchars($set['staff_pad'])."</textarea>
  309. <input type='submit' STYLE='color: black; background-color: white;' value='Update Notepad' /></form></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div></div></div></div></div></div>";
  310. }
  311. $h->endpage();
  312. ?>
  313.  
Advertisement
Add Comment
Please, Sign In to add comment