Advertisement
Guest User

Untitled

a guest
Nov 1st, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.35 KB | None | 0 0
  1. <div id="container">
  2. <div id="content">
  3. <div id="column1" class="column">
  4. <div class="habblet-container ">
  5. <div class="cbb clearfix darkred ">
  6. <div id="contentTitleredSmall">Random Groups</div>
  7. <?php
  8. $color = 'E6E6E6';
  9. $q = mysql_query("SELECT * FROM groups WHERE badge != '' ORDER BY RAND()")or die(mysql_error());
  10. while($r = mysql_fetch_assoc($q)) {
  11. $color = $color != 'E6E6E6' ? 'E6E6E6' : 'FFFFFF';
  12. echo "<div style='padding:6px;background-color:#{$color}'>";
  13. echo "<table><tr>";
  14. echo "<td style='width:50px'><img src='{$_CONFIG['hotel']['url']}/habbo-imaging/badge/{$r["badge"]}.gif'></td>";
  15. echo "<td><a href='{url}/group/{$r['id']}'>" . $r['name'] . "</a><br/>" . $r['desc'] . "<td>";
  16. echo "</tr></table>";
  17. echo "</div>";
  18.  
  19. }
  20.  
  21. ?>
  22. </div>
  23. </div>
  24. </div>
  25.  
  26. <div id="column2" class="column">
  27.  
  28. <div class="content">
  29. <div class="habblet-container ">
  30. <div class="cbb settings">
  31. <div id="contentBoxaccountsettings">Group Badge Code Details</div>
  32. <div class="box-content">
  33. <div id="settingsNavigation">
  34. <b>Details about what badges can be added</b><br>
  35. Any normal badge from habbo works. Just enter the badge code, without the .gif at the end. If you want a custom badge added, contact Joe.</br><br>
  36.  
  37.  
  38.  
  39.  
  40. </ul>
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45.  
  46.  
  47. <div id="column2" class="column">
  48. <div class="habblet-container ">
  49. <div class="cbb clearfix blue ">
  50. <div id="contentTitleblueSmall">Create A Group</div>
  51. <div style='padding:5px;'>
  52. <?php
  53. if(isset($_POST['submit']))
  54. {
  55. ##->Inserting values in database
  56.  
  57. $cost = '2500'; // How much each group will cost
  58.  
  59. // Grabbing the POST'ed figures
  60. $id = mysql_real_escape_string(stripslashes($_POST['id']));
  61. $name = mysql_real_escape_string(stripslashes($_POST['name']));
  62. $desc = mysql_real_escape_string(stripslashes($_POST['desc']));
  63. $badge = mysql_real_escape_string(stripslashes($_POST['badge']));
  64. $ownerid = $_SESSION['user']['id'];
  65. $created = mysql_real_escape_string(stripslashes($_POST['created']));
  66. $roomid = mysql_real_escape_string(stripslashes($_POST['roomid']));
  67. $group_id = mysql_num_rows(mysql_query("SELECT NULL FROM groups")) + 15;
  68. $group_memberships = mysql_num_rows(mysql_query("SELECT NULL FROM groupid")) + 15;
  69. $userCoins = "" . $_SESSION['user']['credits'] . "";
  70.  
  71. // If users coins are below the group cost, we'll send the header as an error
  72. if($userCoins < $cost)
  73. {
  74. echo "<div class=\"rounded rounded-red\">Oh, snap! You do not have enough credits to create a group!</div>";
  75. }
  76. else {
  77.  
  78. // Taking away the cost of group to the users account
  79. $coins = mysql_query("UPDATE `users` SET `credits` = credits - ". $cost ." WHERE username = '" . $_SESSION['user']['username'] . "'");
  80.  
  81. // Inserting the values into database, we'll send the header as successful
  82. if (empty($_POST['name']) || empty($_POST['desc']) || empty($_POST['badge']))
  83. {
  84. echo "<div class=\"rounded rounded-red\">No way, something was missing. Please fill in all fields!</div>";
  85. }
  86. else
  87. {
  88. mysql_query("INSERT INTO groups (id,name,`desc`,badge,ownerid,created,roomid) VALUES ('".$group_id."', '".$name."', '".$desc."', '".$badge."', '".$ownerid."', '".$created."', '".$roomid."')") or die(mysql_error());
  89. mysql_query("INSERT INTO group_memberships (groupid,userid) VALUES ('".$group_id."', '".$ownerid."')") or die(mysql_error());
  90. $updateGroup = mysql_query("UPDATE user_stats SET groupid = '".$group_id."' WHERE id = '".$_SESSION['user']['id']."' LIMIT 1");
  91. echo "<div class=\"rounded rounded-green\">You have successfully created a group!</div>";
  92.  
  93. }
  94. }
  95. }
  96. ?>
  97. <form name="submit" method='post'>
  98.  
  99. Name Of Your Group
  100. <input type="text" name="name" style="width: 95%" /><br/>
  101.  
  102. Description Of Your Group
  103. <input type="text" name="desc" style="width: 95%" /><br/>
  104.  
  105.  
  106. Badge Code
  107. <input type="text" name="badge"style="width: 95%" /><br/>
  108.  
  109. <input type="hidden" name="ownerid" value="{id}" style="width: 95%" />
  110. <input type="hidden" name="created" value="{username}" style="width: 95%" />
  111. Room
  112. <br/><select name="roomid">
  113. <?php
  114. $query = mysql_query("SELECT id, caption FROM rooms WHERE owner = '".$_SESSION['user']['username']."'");
  115. echo '<option selected="selected" value="0">Pick A Room:</option>';
  116. while($row = mysql_fetch_array($query)){
  117. echo '<option value="' . $row['id'] . '">' . $row['caption'] . '</option>';
  118. }
  119. ?>
  120. </select><br/>
  121.  
  122.  
  123. <input type="submit" name="submit" class="submit" value="Submit">
  124.  
  125. </form>
  126. </div>
  127. </div>
  128. </div>
  129. <div class="habblet-container ">
  130. <div class="cbb clearfix blue ">
  131. <div id="contentTitlegreenSmall">My Groups</div>
  132. <div style='padding:5px;' align = "center">
  133. Click one of your groups to edit it!<br><br>
  134. <?php
  135. /*
  136. Simple My Groups script by Lewis
  137. htps://hostsavor.com/
  138. */
  139. $mygroups = mysql_query("SELECT * FROM groups WHERE ownerid = '{$_SESSION['user']['id']}'");
  140. if (mysql_num_rows($mygroups) <= 0){
  141. echo 'You have no groups.';
  142. }
  143. else{
  144. while($mygroupq = mysql_fetch_array($mygroups)){
  145. echo '<a href = "' . $_CONFIG['hotel']['url'] . '/group/' . $mygroupq['id'] .'">' . $mygroupq['name'] . '</a><br><img src="' . $_CONFIG['hotel']['url'] . '/habbo-imaging/badge/' . $mygroupq["badge"] . '.gif"><br>';
  146. }
  147. }
  148. ?>
  149. </div>
  150. </div>
  151. </div>
  152. </div>
  153. </div>
  154. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement