Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Mods & Themes (http://www.bvlist.com/forumdisplay.php?f=117)
-   -   [TSSE 5.6] Christmas Gift (http://www.bvlist.com/showthread.php?t=3942)

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 `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

alpha1969 6th December 2009 23:59

works to tsse 5.4.1 :ok:
www.gutezone.se

ciobancai 8th December 2009 17:27

Can somebody make to work on 5.1 ?

Marco 8th December 2009 23:35

Quote:

Originally Posted by ciobancai (Post 18175)
Can somebody make to work on 5.1 ?

i really don't know that source but it's possible to need
require bittorent.php or functions.php maybe you give me what error you are received and maybe i will could help you ;)

require './global.php';
change to : include("include/bittorrent.php"); or include("include/functions.php"); this i tested and work on ts 3.1 :D


ciobancai 9th December 2009 12:50

I tested and it`s work ;)

Marco 9th December 2009 16:11

i am happy then :) use it well :)

ciobancai 24th December 2009 14:55

Reacive this msg :| , why ?

open 22nd November 2011 23:31

Christmas Gift
 
hello I want s'avoir mods if this works well for a 5.6 ts
thank you:sad:

Marco 24th December 2013 10:49

yes my work is still functionally even is more than 2 years when i do this :)


All times are GMT +2. The time now is 00:39.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.