Marco |
6th December 2009 17:08 |
[TSSE 5.6] Christmas Gift
1 Attachment(s)
for the start i have to tell you it's not my mod but i modified to working on TS 5.6 so if you wish it take it if you don't then leave it .
10x@ tbdev.net - the original it was created for tbdev by Ezero
the sql part
PHP Code:
ALTER TABLE `users` ADD `gotgift` ENUM( 'yes', 'no' ) NOT NULL DEFAULT 'no';
you have to create a gift.php
PHP Code:
<? require './global.php'; dbconn(); loggedinorreturn(); $xmasday= mktime(0,0,0,12,24,2009); $today = mktime(date("m"),date("d"),date("Y")); $gifts = array("upload", "bonus", "invites"); $randgift = array_rand($gifts); $gift = $gifts[$randgift]; $userid = 0 + $CURUSER["id"]; if(!is_valid_id($userid)) stderr("Error", "Invalid ID"); $open = 0 + $_GET["open"]; if($open != 1){ stderr("Error","Invalid url"); } if($open == 1){ if($today == $xmasday){ if($CURUSER["gotgift"] == 'no'){ if($gift == "upload"){ mysql_query("UPDATE users SET uploaded=uploaded+1024*1024*1024*5, gotgift='yes' WHERE id=$userid") or sqlerr(__FILE__, __LINE__); stderr("Congratulations!","<img src=\"/pic/gift-cat.png\" style=\"float: left; padding-right:10px;\">You received 5GB Christmas Gift! Merry Christmas and a Happy New Year wish to you ".$SITENAME." staff!"); } if($gift == "bonus"){ mysql_query("UPDATE users SET seedbonus = seedbonus + 500, gotgift='yes' WHERE id=$userid") or sqlerr(__FILE__, __LINE__); stderr("Congratulations!","<img src=\"/pic/gift-cat.png\" style=\"float: left; padding-right:10px;\">You received 500 bonuspoint as Christmas Gift! Merry Christmas and a Happy New Year wish to you ".$SITENAME." staff!"); } if($gift == "invites") { mysql_query("UPDATE users SET invites = invites + 2, gotgift='yes' WHERE id=$userid") or sqlerr(__FILE__, __LINE__); mysql_query("UPDATE users SET seedbonus = seedbonus + 700, gotgift='yes' WHERE id=$userid") or sqlerr(__FILE__, __LINE__); stderr("Congratulations!","<img src=\"/pic/gift-cat.png\" style=\"float: left; padding-right:10px;\">You received 2 invitation and 700 bonuspoint as Christmas! Merry Christmas and a Happy New Year wish to you ".$SITENAME." staff!"); } } else { stderr("Sorry...", "You already received your gift, don't cheat!!"); } } else { stderr("Sorry...", "Be Patient ,you can't open your gift till Christmas ! " . date("j", ($xmasday - $today)) . " days left."); } } ?>
and now you create a plugin
PHP Code:
<?php if ($CURUSER["gotgift"] == 'no') {?> <style type="text/css"> <!-- .style1 { color: #FF0000; font-style: italic; font-weight: bold; font-size: 20px; } --> </style> <a href="gift.php?open=1"><img src="/pic/gift-cat.png" style="float: left;border-style: none;"></a> <span class="style1">Christmas Gift please click on the gift:)</span> <?php}?>
you will need a gift pic witch you will put on pic folder
i hope it will working to everyone.
i wish to remember to anyone it's not my work, i just modified to ts5.6
|