Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Releases
Daily Gift System
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Queso" data-source="post: 425393" data-attributes="member: 72618"><p>Hi there <strong>DevBest</strong>, releasing another basic simple script. Basically this script allows a user to get a free item everyday, which can be selected from a table in the database.</p><p>First off, add this code to the page.</p><p>[CODE]<center>Here at <strong>{hotelname}</strong> we reward our active users with various items. <br /></p><p> Everyday you login, you can click on the box below to receive an item in-game. <br /></center></p><p> </p></p><p> <center><a href="#" onclick="window.open('{url}/reward', 'newwindow', 'width=300, height=180');" target="_blank"><img src="IMAGEHERE"></a></center>[/CODE]</p><p>Next, create a new file called reward.php and paste this into it</p><p>[PHP]<?php</p><p>$user = mysql_query("SELECT * FROM `users` WHERE id='".$_SESSION['user']['id']."'");</p><p> while ($u = mysql_fetch_array($user)){</p><p> if ($u['id'] > 0 || $u['id'] != null){</p><p> if(date("Y-m-d") == date("Y-m-d", $u['account_created'])){</p><p> echo "<br><div class=\"rounded-green rounded-done\">You need to be a member for at least one day!</div>";</p><p> }</p><p> else</p><p> {</p><p> if ($u['online'] == 0){</p><p> if(date("Y-m-d") == $u['lastusedgift']){</p><p> if ($u['lastmysteryprize'] == null){</p><p> echo '<div class="rounded-red rounded-done">You can only receieve one reward per day!</div>';</p><p> } else {</p><p> echo '<br><div class="rounded-red rounded-done">You can only receive one reward per day!</div>';</p><p> echo '<br><div class="rounded-red rounded-done">You last received a '.$u['lastdailygift'].'!</div>';</p><p> }</p><p> } else {</p><p> $rare = mysql_query("SELECT * FROM `gift_settings` ORDER BY RAND() LIMIT 1");</p><p> $r = mysql_fetch_assoc($rare);</p><p> if ($r){</p><p> $urRare = $r['rare_id'];</p><p> $urRareName = $r['rare_name'];</p><p> $urRareImg = $r['rare_img'];</p><p> mysql_query("INSERT INTO `items` (`user_id`, `base_item`, `extra_data`) VALUES ('".$_SESSION['user']['id']."', '".$urRare."', '0')");</p><p> mysql_query("UPDATE `users` SET `lastusedgift` = '".date("Y-m-d", time())."' WHERE `id` = '".$_SESSION['user']['id']."'");</p><p> mysql_query("UPDATE `users` SET `lastdailygift` = '".$urRareName."' WHERE `id`='".$_SESSION['user']['id']."'");</p><p> echo '<br><div class="rounded-green rounded-done">You have just received a '.$urRareName.'!</div>';</p><p> }}</p><p> } else {</p><p> echo "<br><div class=\"rounded-red rounded-done\">Make sure you're logged out of the client first!</div>";</p><p> }</p><p> }}}</p><p>?>[/PHP] <em>P.S, this was made on a Habbo theme, so you may have to change some lines if you use a different skin than Habbo</em></p><p>Lastly, run these queries in your Navicat</p><p>[CODE]ALTER TABLE users ADD lastusedgift varchar(255);[/CODE]</p><p>[CODE]ALTER TABLE users ADD lastdailygift varchar(255);[/CODE]</p><p>[CODE]</p><p>DROP TABLE IF EXISTS `gift_settings`;</p><p>CREATE TABLE `gift_settings` (</p><p> `id` int(11) NOT NULL AUTO_INCREMENT,</p><p> `rare_name` varchar(255) DEFAULT NULL,</p><p> `rare_id` int(11) DEFAULT NULL,</p><p> PRIMARY KEY (`id`)</p><p>) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;</p><p>[/CODE]</p><p>Screenshots:</p><p><a href="https://prnt.sc/hsllr6" target="_blank">https://prnt.sc/hsllr6</a></p><p><a href="https://prnt.sc/hslm2z" target="_blank">https://prnt.sc/hslm2z</a></p><p><a href="https://prnt.sc/hsln3m" target="_blank">https://prnt.sc/hsln3m</a></p><p><a href="https://prnt.sc/hslnd1" target="_blank">https://prnt.sc/hslnd1</a></p><p><a href="https://prnt.sc/hslnse" target="_blank">https://prnt.sc/hslnse</a></p><p><strong>Done.</strong></p><p>If you have any questions or need help, PM me, and I can try to help you. Don't really care if you think this poorly coded or anything, I'm not a professional web developer, nor do I really know of ways this can be sql injected, so yeah. This was just something I wanted to have on my hotel.</p></blockquote><p></p>
[QUOTE="Queso, post: 425393, member: 72618"] Hi there [B]DevBest[/B], releasing another basic simple script. Basically this script allows a user to get a free item everyday, which can be selected from a table in the database. First off, add this code to the page. [CODE]<center>Here at <strong>{hotelname}</strong> we reward our active users with various items. <br /> Everyday you login, you can click on the box below to receive an item in-game. <br /></center> </p> <center><a href="#" onclick="window.open('{url}/reward', 'newwindow', 'width=300, height=180');" target="_blank"><img src="IMAGEHERE"></a></center>[/CODE] Next, create a new file called reward.php and paste this into it [PHP]<?php $user = mysql_query("SELECT * FROM `users` WHERE id='".$_SESSION['user']['id']."'"); while ($u = mysql_fetch_array($user)){ if ($u['id'] > 0 || $u['id'] != null){ if(date("Y-m-d") == date("Y-m-d", $u['account_created'])){ echo "<br><div class=\"rounded-green rounded-done\">You need to be a member for at least one day!</div>"; } else { if ($u['online'] == 0){ if(date("Y-m-d") == $u['lastusedgift']){ if ($u['lastmysteryprize'] == null){ echo '<div class="rounded-red rounded-done">You can only receieve one reward per day!</div>'; } else { echo '<br><div class="rounded-red rounded-done">You can only receive one reward per day!</div>'; echo '<br><div class="rounded-red rounded-done">You last received a '.$u['lastdailygift'].'!</div>'; } } else { $rare = mysql_query("SELECT * FROM `gift_settings` ORDER BY RAND() LIMIT 1"); $r = mysql_fetch_assoc($rare); if ($r){ $urRare = $r['rare_id']; $urRareName = $r['rare_name']; $urRareImg = $r['rare_img']; mysql_query("INSERT INTO `items` (`user_id`, `base_item`, `extra_data`) VALUES ('".$_SESSION['user']['id']."', '".$urRare."', '0')"); mysql_query("UPDATE `users` SET `lastusedgift` = '".date("Y-m-d", time())."' WHERE `id` = '".$_SESSION['user']['id']."'"); mysql_query("UPDATE `users` SET `lastdailygift` = '".$urRareName."' WHERE `id`='".$_SESSION['user']['id']."'"); echo '<br><div class="rounded-green rounded-done">You have just received a '.$urRareName.'!</div>'; }} } else { echo "<br><div class=\"rounded-red rounded-done\">Make sure you're logged out of the client first!</div>"; } }}} ?>[/PHP] [I]P.S, this was made on a Habbo theme, so you may have to change some lines if you use a different skin than Habbo[/I] Lastly, run these queries in your Navicat [CODE]ALTER TABLE users ADD lastusedgift varchar(255);[/CODE] [CODE]ALTER TABLE users ADD lastdailygift varchar(255);[/CODE] [CODE] DROP TABLE IF EXISTS `gift_settings`; CREATE TABLE `gift_settings` ( `id` int(11) NOT NULL AUTO_INCREMENT, `rare_name` varchar(255) DEFAULT NULL, `rare_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; [/CODE] Screenshots: [URL]https://prnt.sc/hsllr6[/URL] [URL]https://prnt.sc/hslm2z[/URL] [URL]https://prnt.sc/hsln3m[/URL] [URL]https://prnt.sc/hslnd1[/URL] [URL]https://prnt.sc/hslnse[/URL] [B]Done.[/B] If you have any questions or need help, PM me, and I can try to help you. Don't really care if you think this poorly coded or anything, I'm not a professional web developer, nor do I really know of ways this can be sql injected, so yeah. This was just something I wanted to have on my hotel. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Releases
Daily Gift System
Top