Advertisement
Guest User

Untitled

a guest
Jun 11th, 2017
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.40 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4. _____ _ _ _
  5. |_ _| | | (_)
  6. | | | | |_ _ _ __ ___ _ _ __ __ _
  7. | | | | | | | | '_ ` _ \| | '_ \ / _` |
  8. _| |_| | | |_| | | | | | | | | | | (_| |
  9. |_____|_|_|\__,_|_| |_| |_|_|_| |_|\__,_|
  10.  
  11. Illumina CMS by Jonteh (http://25.78.245.55/)
  12. RaGEZONE Thread for updates & help: https://forum.ragezone.com/f353/rel-illumina-cms-php-oop-917506/
  13.  
  14. ====================================
  15. MAKE SURE YOU EDIT THE CONFIGURATION <<<<
  16. ==================================== <<<<
  17. MAKE SURE YOU EDIT THE CONFIGURATION <<<<
  18. ====================================
  19.  
  20. */
  21.  
  22. class LightCMS {
  23.  
  24. // Database Information (IMPORTANT)
  25. public $db_hostname = "localhost";
  26. public $db_username = "root";
  27. public $db_password = "123";
  28. public $db_dbname = "javaa";
  29.  
  30. // Password Hashing Options (IMPORTANT)
  31. // Valid options:
  32. // MD5 (Uber 1, RevCMS styled hashing)
  33. // Normal (Uber 2 & Illumina styled hashing)
  34. public $hashing_method = "Normal";
  35.  
  36. // Site Information (IMPORTANT)
  37. public $site_url = "http://25.78.245.55";
  38. public $site_name = "Zap Hotel";
  39. public $site_short = "Zap";
  40. public $facebook_account = "ZapHotel";
  41. public $twitter_account = "zaphotelnet";
  42. public $maintenance = false;
  43. public $thehabbos_enabled = true;
  44. public $thehabbos_username = "";
  45. public $c_images = "http://25.78.245.55/c_images";
  46.  
  47. // Misc Settings
  48. public $pin_enabled = true;
  49. public $pin_code = "1234";
  50. public $FORCE_SSL = true;
  51. public $flash_client_dump = true;
  52. public $mus_ip = '127.0.0.1';
  53. public $mus_port = '30001';
  54.  
  55. // Registration Controls
  56. public $max_per_ip = 30;
  57. public $reg_enabled = true;
  58. public $default_credits = "15000";
  59. public $default_pixels = "15000";
  60. public $default_homeroom = "598898";
  61. public $default_look = "hd-180-2.sh-290-92.lg-275-92.ch-3030-63.hr-831-61";
  62. public $default_rank = "2";
  63. public $default_motto = "I am new at Zap, hey!";
  64. public $default_gender = "M";
  65.  
  66. // Server Settings
  67. public $server_type = "Butterfly"; // Phoenix or Butterfly
  68.  
  69. // Caching Settings
  70. public $apc_enabled = false;
  71.  
  72. // Client Settings
  73. public $connection_info_host = "25.78.245.55";
  74. public $connection_info_port = "30000";
  75. public $variables = "http://25.78.245.55/swfs/gamedata/external_variables.txt";
  76. public $texts = "http://25.78.245.55/swfs/gamedata/external_flash_texts.txt";
  77. public $override_texts ="http://25.78.245.55/swfs/gamedata/override/external_flash_override_texts.txt";
  78. public $productdata = "http://25.78.245.55/swfs/gamedata/productdata.txt";
  79. public $furnidata = "http://25.78.245.55/swfs/gamedata/productdata.txt";
  80. public $baseurl = "http://25.78.245.5/";
  81. public $habbo_swf = "http://25.78.245.55/swfs/gordon/PRODUCTION-201604132204-637539863/Habbo.swf";
  82. public $loadingtext = "Please wait! Zap is loading.";
  83.  
  84. // o-------------------------------------------------------------o
  85. // | THIS IS WHERE THE CODING STARTS! DO NOT EDIT IF YOU ARE NEW |
  86. // o-------------------------------------------------------------o
  87. private $extDir = "engine/classes/ext/";
  88. private $classDir = "engine/classes/";
  89. public function exec() {
  90. require $this->extDir . "class_raintpl.php";
  91. require $this->classDir . "class_users.php";
  92. require $this->classDir . "class_settings.php";
  93. require $this->classDir . "class_core.php";
  94. require $this->classDir . "class_db.php";
  95. require $this->classDir . "class_tpl.php";
  96. $this->MySQLi['Hostname'] = $this->db_hostname;
  97. $this->MySQLi['Username'] = $this->db_username;
  98. $this->MySQLi['Password'] = $this->db_password;
  99. $this->MySQLi['Database'] = $this->db_dbname;
  100. session_start();
  101. date_default_timezone_set('America/Los_Angeles');
  102. }
  103. public static function getMainStories($amt) {
  104. global $db, $tpl;
  105. if($r = $db->query("SELECT id,title,topstory_image,snippet FROM site_news ORDER BY id DESC LIMIT " . $amt . "")) {
  106. $c = 0;
  107. while($a = $r->fetch_assoc()) {
  108. $disp = 'block';
  109. $imgurl = $a['topstory_image'];
  110. if($c > 0) { $disp = 'none'; }
  111. $_seo = $a['id'] . "-" . strtolower(str_replace(' ', '-', $a['title']));
  112. echo '<div class="topstory" style="background-image: url(' . $imgurl . '); display: ' . $disp . ';">
  113. <h4>Latest news</h4>
  114. <h3><a href="' . WWW . '/articles/' . $_seo . '">' . $a['title'] . '</a></h3>
  115. <p class="summary">
  116. ' . $a['snippet'] . '
  117. </p>
  118. <p>
  119. <a href="' . WWW . '/articles/' . $_seo . '">Read more &raquo;</a>
  120. </p>
  121. </div>';
  122. $c++;
  123. }
  124. echo '<div id="topstories-nav" style="display: none"><a href="#" class="prev">&laquo; Previous</a><span>1</span> / ' . $c . '<a href="#" class="next">Next &raquo;</a></div>';
  125. }
  126. else {
  127. $db->databaseError($db->error);
  128. }
  129. }
  130. public static function getSubStories() {
  131. global $db;
  132. if($r = $db->query("SELECT id,title,datestr FROM site_news ORDER BY id DESC LIMIT 3,3")) {
  133. $oE = "odd";
  134. while($a = $r->fetch_assoc()) {
  135. if($oE == "odd") { $oE = "even"; } else { $oE = "odd"; }
  136. $_seo = $a['id'] . "-" . strtolower(str_replace(' ', '-', $a['title']));
  137. echo '<li class="' . $oE . '">
  138. <a href="' . WWW . '/articles/' . $_seo . '">' . stripslashes($a['title']) . ' &raquo;</a><div class="newsitem-date">' . $a['datestr'] . '</div>
  139. </li>';
  140. }
  141. }
  142. else {
  143. $db->databaseError($db->error);
  144. }
  145. }
  146. public static function drawNewsList($selectedId) {
  147. global $db;
  148. if($listquery = $db->query("SELECT id,title FROM site_news ORDER BY id DESC LIMIT 50")) {
  149. while($newslist = $listquery->fetch_assoc()) {
  150. $_seo = $newslist['id'] . "-" . strtolower(str_replace(' ', '-', $newslist['title']));
  151. if($newslist['id'] == $selectedId) {
  152. echo "<li>" . $newslist['title'] . "</li>";
  153. }
  154. else {
  155. echo "<li><a href='" . WWW . "/articles/" . $_seo . "'>" . htmlentities(stripslashes($newslist['title'])) . "</a></li>";
  156. }
  157. }
  158. }
  159. else {
  160. $db->databaseError($db->error);
  161. }
  162. }
  163. public static function getHotCampaigns() {
  164. global $db;
  165. if($get = $db->query("SELECT id,enabled,image_url,caption,descr,url FROM site_hotcampaigns ORDER BY id DESC")) {
  166. $oddEven = "odd";
  167. while($camps = $get->fetch_assoc()) {
  168. $imgurl = $camps['image_url'];
  169. $url = $camps['url'];
  170. if($oddEven == "odd") { $oddEven = "even"; } else { $oddEven = "odd"; }
  171. if($camps['enabled'] == 1) {
  172. echo '<li class="' . $oddEven . '">
  173. <div class="hotcampaign-container">
  174. <a href="' . $url . '">
  175. <img src="' . $imgurl . '" align="left" alt="' . htmlentities(stripslashes($camps['caption'])) . '"/></a>
  176. <h3>' . htmlentities(stripslashes($camps['caption'])) . '</h3>
  177. <p>' . htmlentities(stripslashes($camps['descr'])) . '</p>
  178. <p class="link"><a href="' . $url . '">Go there &raquo;</a></p>
  179. </div>';
  180. }
  181. }
  182. }
  183. else {
  184. $db->databaseError($db->error);
  185. }
  186. }
  187. public function errorMessage($str) {
  188. return '<center><font color="red"><b>' . $str . '</center></font></b>';
  189. }
  190. public function successMessage($str) {
  191. return '<center><font color="green"><b>' . $str . '</center></font></b>';
  192. }
  193. public function Mus($header, $data = '') {
  194. $musData = $header . chr(1) . $data;
  195. $sock = @socket_create(AF_INET, SOCK_STREAM, getprotobyname('tcp'));
  196. @socket_connect($sock, $this->mus_ip, $this->mus_port);
  197. @socket_send($sock, $musData, strlen($musData), MSG_DONTROUTE);
  198. @socket_close($sock);
  199. }
  200. public static function drawBadgeList() {
  201. global $users, $db, $light;
  202. echo "<table align='center'>";
  203. if($bdq = $db->query("SELECT badge_id,cost FROM badge_shop")) {
  204. while($bdi = $bdq->fetch_assoc()) {
  205. if(!$users->doesUserHaveBadge(USER_ID, $bdi['badge_id'])) {
  206. $src = "https://";
  207. echo "<tr>";
  208. echo "<td><img src='" . $light->c_images . "/album1584/" . $bdi['badge_id'] . ".gif'></td>";
  209. echo "<td style='font-size:11px;'><form method='post'><input type='hidden' value='" . $bdi['badge_id'] . "' name='BadgeId'> <br />
  210. This badge costs " . number_format($bdi['cost']) . " coins. <br />
  211. <input type='submit' value='Purchase this badge'></form></td>";
  212. echo "</tr>";
  213. }
  214. }
  215. }
  216. else {
  217. $db->databaseError($db->error);
  218. }
  219. echo "</table>";
  220. }
  221. public static function drawRandomHabbos() {
  222. global $db, $users;
  223. if($gethabbosq = $db->query("SELECT username FROM players WHERE online = '1' ORDER BY RAND() LIMIT 18")) {
  224. $i = 0;
  225. while($randomHabbo = $gethabbosq->fetch_assoc()) {
  226. echo '<div id="active-habbo-data-' . $i . '" class="active-habbo-data">
  227. <div class="active-habbo-data-container">
  228. <div class="active-name ' . (($users->userVar($randomHabbo['username'], 'online') == "1") ? 'online' : 'offline') . '">' . $users->userVar($randomHabbo['username'], 'username') . '</div>
  229. Zap created on: ' . $users->userVar($randomHabbo['username'], 'reg_date') . '
  230. <p class="moto">' . $users->userVar($randomHabbo['username'], 'motto') . '</p>
  231. </div>
  232. </div>
  233. <input type="hidden" id="active-habbo-url-' . $i . '" value="' . WWW . '/user/' . $users->userVar($randomHabbo['username'], 'username') . '"/>
  234. <input type="hidden" id="active-habbo-image-' . $i . '" class="active-habbo-image" value="https://avatar-retro.com/habbo-imaging/avatarimage?figure=' . $users->userVar($randomHabbo['username'], 'figure') . '&direction=4&head_direction=4" />';
  235. $i++;
  236. }
  237. }
  238. }
  239. public static function drawStaffPageForRank($rankno) {
  240. global $db, $light, $users;
  241. if($getranks = $db->query("SELECT username FROM players WHERE rank = '" . $rankno . "' ORDER BY id ASC")) {
  242. $oddEven = "fff";
  243. while($udata = $getranks->fetch_assoc()) {
  244. if($oddEven != "E6E6E6") {
  245. $oddEven = "E6E6E6";
  246. }
  247. else {
  248. $oddEven = "fff";
  249. }
  250.  
  251. $u = $udata['username'];
  252. $displayname = $u;
  253.  
  254. $getBadge = $db->query("SELECT badge_code FROM player_badges WHERE player_id = '" . $users->userVar($u, 'id') . "' AND slot = '1' LIMIT 1");
  255. while($bI = $getBadge->fetch_assoc()) {
  256. $usersBadge = $bI['badge_code'];
  257. }
  258. if($users->userVar($u, 'online') == "1") { $online = "online_anim"; } else { $online = "offline"; }
  259. echo '<table width="107%" style="padding: 5px; margin-left: -15px; background-color: #' . $oddEven . '; font-size:11px;">
  260. <tbody>
  261. <tr>
  262. <td valign="middle" width="25">
  263. <img style="margin-top: -10px;" src="https://avatar-retro.com/habbo-imaging/avatarimage?figure=' . $users->userVar($u, 'figure') . '">
  264. </td>
  265. <td valign="top">
  266. <img src="' . WWW . '/images/habbo_' . $online . '.gif" align="left"><b style="font-size: 110%;"><a href="' . WWW . '/user/' . $u . '">' . $displayname . '</a></b><br /><br />
  267. Motto: <i>' . $users->userVar($u, 'motto') . '</i> <br />';
  268.  
  269. if(!empty($usersBadge)) {
  270. echo '<img src="' . $light->c_images . '/album1584/' . $usersBadge . '.gif">'; }
  271.  
  272. echo '</td>
  273. </tr>
  274. </tbody>
  275. </table>';
  276. }
  277. }
  278. else {
  279. echo "<i>There are currently no staff members for this group.</i>";
  280. }
  281. }
  282. public static function getWallComments($pageid) {
  283. global $db, $light, $users;
  284. $getComments = $db->query("SELECT id, poster_id, message, likes FROM profile_wall WHERE page_id = '" . $pageid . "' ORDER BY id DESC LIMIT 10");
  285. echo '<table style="font-size:11px;">';
  286. while($cData = $getComments->fetch_assoc()) {
  287. $username = $users->userVar($users->idToName($cData['poster_id']), 'username');
  288. echo "<tr>";
  289. echo "<td><img src='https://avatar-retro.com/habbo-imaging/avatarimage?figure=" . $users->userVar($username, 'figure') . "&gesture=sml&size=m'><br /><center><a href='" . WWW . "/user/" . $username . "'><b>" . $username . "</b></a>";
  290. if($pageid == USER_ID || USER_RANK > 10) {
  291. echo "<br /><br /><a href='" . WWW . "/user/" . $users->idToName($pageid) . "&deleteComment=" . $cData['id'] . "'>Delete</a>";
  292. }
  293. echo "</center></td>";
  294. echo "<td>" . htmlentities(stripslashes($cData["message"]));
  295. echo "</td>";
  296. echo "</tr>";
  297.  
  298. }
  299. echo "</table>";
  300. }
  301. public static function getUnreadCount($userid) {
  302. global $db;
  303. $query = $db->query("SELECT null FROM profile_wall WHERE page_id = '" . $userid . "' AND owner_read = '0' LIMIT 10");
  304. return $query->num_rows;
  305. }
  306. public static function getOnlineFriends($userid) {
  307. $friendsList = array();
  308. global $db, $users;
  309. $getFriends = $db->query("SELECT * FROM messenger_friendships WHERE user_one_id = '" . $userid . "' OR user_two_id = '" . $userid . "'");
  310. while($friends = $getFriends->fetch_assoc()) {
  311. if($friends['user_one_id'] != $userid && $friends['user_two_id'] == $userid) {
  312. if(in_array($friends['user_one_id'], $friendsList))
  313. continue;
  314.  
  315. $friendsList[] = $friends['user_one_id'];
  316. }
  317. else if($friends['user_two_id'] != $userid && $friends['user_one_id'] == $userid) {
  318. if(in_array($friends['user_two_id'], $friendsList))
  319. continue;
  320. $friendsList[] = $friends['user_two_id'];
  321. }
  322. }
  323. $friendCount = count($friendsList);
  324.  
  325. if($friendCount > 0) {
  326. $noFriends = true;
  327. for($i = 0; $i <= $friendCount; $i++) {
  328. $username = @$users->idToName($friendsList[$i]);
  329. if($users->userVar($username, 'online') == 1) {
  330. echo "<a href='" . WWW . "/user/" . $username . "'><img src='https://avatar-retro.com/habbo-imaging/avatarimage?figure=" . $users->userVar($username, 'figure') . "&gesture=wav&size=s'></a>";
  331. $noFriends = false;
  332. }
  333. }
  334. if($noFriends) {
  335. echo "<i>This user does not have any friends online.</i>";
  336. }
  337. }
  338. else {
  339. echo "<i>This user does not have any friends.</i>";
  340. }
  341. }
  342. public static function displayUserBadges($userid) {
  343. global $db, $light;
  344. $querye = $db->query("SELECT badge_code FROM player_badges WHERE player_id = '" . $userid . "'");
  345. while($badges = $querye->fetch_assoc()) {
  346. echo "<img src='" . $light->c_images . "/album1584/" . $badges['badge_code'] . ".gif'>";
  347. }
  348. }
  349. public function isVotingOnline() {
  350. return @fsockopen("142.4.4.131", 80, $errno, $errstr, 1) ? true : false;
  351. }
  352. }
  353. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement