View Single Post
  #1  
Old 6th December 2009, 17:08
Marco Marco is offline
Senior Member
 
Join Date: Jun 2009
Seychelles
Posts: 327
Default [TSSE 5.6] Christmas Gift
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 `usersADD `gotgiftENUM'yes''no' NOT NULL DEFAULT 'no'
you have to create a gift.php
PHP Code:
<?
 
require './global.php';
 
dbconn();
 
loggedinorreturn();
 
 
 
$xmasdaymktime(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 $CURUSER["id"];
 
if(!
is_valid_id($userid))
 
stderr("Error""Invalid ID");
 
$open $_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
Attached Images
 
Reply With Quote
The Following 8 Users Say Thank You to Marco For This Useful Post:
alpha1969 (6th December 2009), Darkness (9th December 2011), eckeO5 (24th November 2011), FENIX (24th December 2013), Fynnon (6th August 2011), peiratikos (10th November 2011), skyf4llen (14th May 2014), youacehole (5th September 2011)