-
Notifications
You must be signed in to change notification settings - Fork 28
/
mybonus.php
1772 lines (1654 loc) · 111 KB
/
mybonus.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
/**
|--------------------------------------------------------------------------|
| https://github.com/Bigjoos/ |
|--------------------------------------------------------------------------|
| Licence Info: GPL |
|--------------------------------------------------------------------------|
| Copyright (C) 2010 U-232 V4 |
|--------------------------------------------------------------------------|
| A bittorrent tracker source based on TBDev.net/tbsource/bytemonsoon. |
|--------------------------------------------------------------------------|
| Project Leaders: Mindless,putyn. |
|--------------------------------------------------------------------------|
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/ \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \
( U | - | 2 | 3 | 2 )-( S | o | u | r | c | e )-( C | o | d | e )
\_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
*/
require_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'include'.DIRECTORY_SEPARATOR.'bittorrent.php');
require_once(INCL_DIR.'user_functions.php');
require_once(INCL_DIR.'html_functions.php');
dbconn(false);
loggedinorreturn();
/*********************************************************************
09 Seedbonus - Credits to Sir_Snugglebunny also the original coders
Updated for 09 - Nov 28th 2009
**********************************************************************/
$lang = array_merge( load_language('global'), load_language('mybonus') );
$stdhead = array(/** include css **/'css' => array('forums'));
if ($INSTALLER09['seedbonus_on'] == 0
//AND $CURUSER['class'] < UC_MAX*/
)
stderr('Information', 'The Karma bonus system is currently offline for maintainance work');
if (function_exists('parked'))
parked();
$HTMLOUT = $class = '';
function I_smell_a_rat($var){
if ((0 + $var) == 1)
$var = 0 + $var;
else
stderr("Error", "I smell a rat!");
}
/////////freeleech
if (isset($_GET["freeleech_success"]) && $_GET["freeleech_success"]){
$freeleech_success = 0 + $_GET["freeleech_success"];
if($freeleech_success != '1' && $freeleech_success != '2')
stderr("Error", "I smell a rat on freeleech!");
if($freeleech_success == '1'){
if ($_GET["norefund"] != '0') {
$HTMLOUT .="<table width='80%'><tr><td class='colhead' align='left' colspan='2'><h1>Success!</h1></td></tr><tr>".
"<td align='left' class='one'><img src='{$INSTALLER09['pic_base_url']}/smilies/karma.gif' alt='good_karma' title='Good Karma' /></td><td align='left' class='one'><b>Congratulations! </b>
{$CURUSER['username']} you have set the tracker <b>Free Leech !</b> <img src='{$INSTALLER09['pic_base_url']}smilies/w00t.gif' alt='w00t' title='W00t' /><br /><br />Remaining ".htmlsafechars($_GET['norefund'])." points have been contributed towards the next freeleech period automatically!".
"<br /> click to go back to your <a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Bonus Point</a> page.<br /><br />".
"</td></tr></table>";
echo stdhead($CURUSER['username'] . "'s Karma Bonus Points Page", true, $stdhead) . $HTMLOUT . stdfoot();
} else {
$HTMLOUT .="<table width='80%'><tr><td class='colhead' align='left' colspan='2'><h1>Success!</h1></td></tr><tr>".
"<td align='left' class='one'><img src='{$INSTALLER09['pic_base_url']}smilies/karma.gif' alt='good_karma' title='Good Karma' /></td><td align='left' class='one'><b>Congratulations! </b>
{$CURUSER['username']} you have set the tracker <b>Free Leech !</b> <img src='{$INSTALLER09['pic_base_url']}smilies/w00t.gif' alt='w00t' title='W00t' /><br />".
"<br /> click to go back to your <a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Bonus Point</a> page.<br /><br />".
"</td></tr></table>";
echo stdhead($CURUSER['username'] . "'s Karma Bonus Points Page", true, $stdhead) . $HTMLOUT . stdfoot();
}
die;
}
if($freeleech_success == '2'){
$HTMLOUT .="<table width='80%'><tr><td class='colhead' align='left' colspan='2'><h1>Success!</h1></td></tr><tr>".
"<td align='left' class='one'><img src='{$INSTALLER09['pic_base_url']}smilies/karma.gif' alt='good_karma' title='Good Karma' /></td><td align='left' class='one'><b>Congratulations! </b>".
"{$CURUSER['username']} you have contributed towards making the tracker Free Leech ! <img src='{$INSTALLER09['pic_base_url']}smilies/w00t.gif' alt='w00t' title='W00t' /><br />".
"<br /> click to go back to your <a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Bonus Point</a> page.<br /><br />".
"</td></tr></table>";
echo stdhead($CURUSER['username'] . "'s Karma Bonus Points Page", true, $stdhead) . $HTMLOUT . stdfoot();
die;
}
}
////////doubleup
if (isset($_GET["doubleup_success"]) && $_GET["doubleup_success"]){
$doubleup_success = 0 + $_GET["doubleup_success"];
if($doubleup_success != '1' && $doubleup_success != '2')
stderr("Error", "I smell a rat on freeleech!");
if($doubleup_success == '1'){
if ($_GET["norefund"] != '0') {
$HTMLOUT .="<table width='80%'><tr><td class='colhead' align='left' colspan='2'><h1>Success!</h1></td></tr><tr>".
"<td align='left' class='one'><img src='{$INSTALLER09['pic_base_url']}smilies/karma.gif' alt='good_karma' title='Good Karma' /></td><td align='left' class='one'><b>Congratulations! </b>
{$CURUSER['username']} you have set the tracker <b>Double Up !</b> <img src='{$INSTALLER09['pic_base_url']}smilies/w00t.gif' alt='w00t' title='W00t' /><br /><br />Remaining ".htmlsafechars($_GET['norefund'])." points have been contributed towards the next Double upload period automatically!".
"<br /> click to go back to your <a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Bonus Point</a> page.<br /><br />".
"</td></tr></table>";
echo stdhead($CURUSER['username'] . "'s Karma Bonus Points Page", true, $stdhead) . $HTMLOUT . stdfoot();
} else {
$HTMLOUT .="<table width='80%'><tr><td class='colhead' align='left' colspan='2'><h1>Success!</h1></td></tr><tr>".
"<td align='left' class='one'><img src='{$INSTALLER09['pic_base_url']}smilies/karma.gif' alt='good_karma' title='Good Karma' /></td><td align='left' class='one'><b>Congratulations! </b>
{$CURUSER['username']} you have set the tracker <b>Double Up !</b> <img src={$INSTALLER09['pic_base_url']}smilies/w00t.gif alt='w00t' title='W00t' /><br />".
"<b /r> click to go back to your <a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Bonus Point</a> page.<br /><br />".
"</td></tr></table>";
echo stdhead($CURUSER['username'] . "'s Karma Bonus Points Page", true, $stdhead) . $HTMLOUT . stdfoot();
}
die;
}
if($doubleup_success == '2'){
$HTMLOUT .="<table width='80%'><tr><td class='colhead' align='left' colspan='2'><h1>Success!</h1></td></tr><tr>".
"<td align='left' class='one'><img src='{$INSTALLER09['pic_base_url']}smilies/karma.gif' alt='good_karma' title='Good Karma' /></td><td align='left' class='one'><b>Congratulations! </b>".
"{$CURUSER['username']} you have contributed towards making the tracker Double Upload ! <img src='{$INSTALLER09['pic_base_url']}smilies/w00t.gif' alt='w00t' title='W00t' /><br />".
"<br /> click to go back to your <a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Bonus Point</a> page.<br /><br />".
"</td></tr></table>";
echo stdhead($CURUSER['username'] . "'s Karma Bonus Points Page", true, $stdhead) . $HTMLOUT . stdfoot();
die;
}
}
/////////Halfdownload
if (isset($_GET["halfdown_success"]) && $_GET["halfdown_success"]){
$halfdown_success = 0 + $_GET["halfdown_success"];
if($halfdown_success != '1' && $halfdown_success != '2')
stderr("Error", "I smell a rat on halfdownload!");
if($halfdown_success == '1'){
if ($_GET["norefund"] != '0') {
$HTMLOUT .="<table width='80%'><tr><td class='colhead' align='left' colspan='2'><h1>Success!</h1></td></tr><tr>".
"<td align='left' class='one'><img src='{$INSTALLER09['pic_base_url']}smilies/karma.gif' alt='good_karma' title='Good Karma' /></td><td align='left' class='one'><b>Congratulations! </b>
{$CURUSER['username']} you have set the tracker <b>Half Download !</b> <img src='{$INSTALLER09['pic_base_url']}smilies/w00t.gif' alt='w00t' title='W00t' /><br /><br />Remaining ".htmlsafechars($_GET['norefund'])." points have been contributed towards the next Half download period automatically!".
"<br /> click to go back to your <a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Bonus Point</a> page.<br /><br />".
"</td></tr></table>";
echo stdhead($CURUSER['username'] . "'s Karma Bonus Points Page", true, $stdhead) . $HTMLOUT . stdfoot();
} else {
$HTMLOUT .="<table width='80%'><tr><td class='colhead' align='left' colspan='2'><h1>Success!</h1></td></tr><tr>".
"<td align='left' class='one'><img src='{$INSTALLER09['pic_base_url']}smilies/karma.gif' alt='good_karma' title='Good Karma' /></td><td align='left' class='one'><b>Congratulations! </b>
{$CURUSER['username']} you have set the tracker <b>Half Download !</b> <img src='{$INSTALLER09['pic_base_url']}smilies/w00t.gif' alt='w00t' title='W00t' /><br />".
"<br /> click to go back to your <a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Bonus Point</a> page.<br /><br />".
"</td></tr></table>";
echo stdhead($CURUSER['username'] . "'s Karma Bonus Points Page", true, $stdhead) . $HTMLOUT . stdfoot();
}
die;
}
if($halfdown_success == '2'){
$HTMLOUT .="<table width='80%'><tr><td class='colhead' align='left' colspan='2'><h1>Success!</h1></td></tr><tr>".
"<td align='left' class='one'><img src='{$INSTALLER09['pic_base_url']}smilies/karma.gif' alt='good_karma' title='Good Karma' /></td><td align='left' class='one'><b>Congratulations! </b>".
"{$CURUSER['username']} you have contributed towards making the tracker Half Download ! <img src='{$INSTALLER09['pic_base_url']}smilies/w00t.gif' alt='w00t' title='W00t' /><br />".
"<br /> click to go back to your <a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Bonus Point</a> page.<br /><br />".
"</td></tr></table>";
echo stdhead($CURUSER['username'] . "'s Karma Bonus Points Page", true, $stdhead) . $HTMLOUT . stdfoot();
die;
}
}
//////////
switch (true){
case (isset($_GET['up_success'])):
I_smell_a_rat($_GET['up_success']);
$amt = (float)$_GET['amt'];
switch ($amt) {
case $amt == 275.0:
$amt = '1 GB';
break;
case $amt == 350.0:
$amt = '2.5 GB';
break;
case $amt == 550.0:
$amt = '5 GB';
break;
case $amt == 1000.0:
$amt = '10 GB';
break;
case $amt == 2000.0:
$amt = '25 GB';
break;
case $amt == 4000.0:
$amt = '50 GB';
break;
case $amt == 8000.0:
$amt = '100 GB';
break;
case $amt == 40000.0:
$amt = '520 GB';
break;
default:
$amt = '1 TB';
}
$HTMLOUT .= "<table align='center' width='80%'><tr><td class='colhead' align='left' colspan='2'><h1>Success!</h1></td></tr><tr>
<td class='one' align='left'><img src='{$INSTALLER09['pic_base_url']}smilies/karma.gif' alt='good_karma' title='Good karma' /></td>
<td class='one' align='left'><b>Congratulations ! </b>".$CURUSER['username']." you have just increased your upload amount by ".$amt."!
<img src='{$INSTALLER09['pic_base_url']}smilies/w00t.gif' alt='w00t' title='w00t' /><br /><br /><br /><br /> click to go back to your
<a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Bonus Point</a> page.<br /><br /></td></tr></table>";
echo stdhead($CURUSER['username'] . "'s Karma Bonus Points Page", true, $stdhead) . $HTMLOUT . stdfoot();
die;
case (isset($_GET['anonymous_success'])):{
I_smell_a_rat($_GET['anonymous_success']);
}
$HTMLOUT .= "<table align='center' width='80%'><tr><td class='colhead' align='left' colspan='2'><h1>Success!</h1></td></tr><tr>
<td class='one' align='left'><img src='{$INSTALLER09['pic_base_url']}smilies/karma.gif' alt='good_karma' title='Good karma' /></td>
<td class='one' align='left'><b>Congratulations ! </b>".$CURUSER['username']." you have just purchased Anonymous profile for 14 days!
<img src='{$INSTALLER09['pic_base_url']}smilies/w00t.gif' alt='w00t' title='w00t' /><br /><br /><br /><br /> click to go back to your
<a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Bonus Point</a> page.<br /><br /></td></tr></table>";
echo stdhead($CURUSER['username'] . "'s Karma Bonus Points Page", true, $stdhead) . $HTMLOUT . stdfoot();
die;
case (isset($_GET['parked_success'])):{
I_smell_a_rat($_GET['parked_success']);
}
$HTMLOUT .= "<table align='center' width='80%'><tr><td class='colhead' align='left' colspan='2'><h1>Success!</h1></td></tr><tr>
<td class='one' align='left'><img src='{$INSTALLER09['pic_base_url']}smilies/karma.gif' alt='good_karma' title='Good karma' /></td>
<td class='one' align='left'><b>Congratulations ! </b>".$CURUSER['username']." you have just purchased parked option for your profile !
<img src='{$INSTALLER09['pic_base_url']}smilies/w00t.gif' alt='w00t' title='w00t' /><br /><br /><br /><br /> click to go back to your
<a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Bonus Point</a> page.<br /><br /></td></tr></table>";
echo stdhead($CURUSER['username'] . "'s Karma Bonus Points Page", true, $stdhead) . $HTMLOUT . stdfoot();
die;
case (isset($_GET['freeyear_success'])):{
I_smell_a_rat($_GET['freeyear_success']);
}
$HTMLOUT .= "<table align='center' width='80%'><tr><td class='colhead' align='left' colspan='2'><h1>Success!</h1></td></tr><tr>
<td class='one' align='left'><img src='{$INSTALLER09['pic_base_url']}smilies/karma.gif' alt='good_karma' title='Good karma' /></td>
<td class='one' align='left'><b>Congratulations ! </b>".$CURUSER['username']." you have just purchased freeleech for one year!
<img src='{$INSTALLER09['pic_base_url']}smilies/w00t.gif' alt='w00t' title='w00t' /><br /><br /><br /><br /> click to go back to your
<a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Bonus Point</a> page.<br /><br /></td></tr></table>";
echo stdhead($CURUSER['username'] . "'s Karma Bonus Points Page", true, $stdhead) . $HTMLOUT . stdfoot();
die;
case (isset($_GET['freeslots_success'])):{
I_smell_a_rat($_GET['freeslots_success']);
}
$HTMLOUT .= "<table align='center' width='80%'><tr><td class='colhead' align='left' colspan='2'><h1>Success!</h1></td></tr><tr>
<td class='one' align='left'><img src='{$INSTALLER09['pic_base_url']}smilies/karma.gif' alt='good_karma' title='Good karma' /></td>
<td class='one' align='left'><b>Congratulations ! </b>".$CURUSER['username']." you have got your self 3 freeleech slots!!
<img src='{$INSTALLER09['pic_base_url']}smilies/w00t.gif' alt='w00t' title='w00t' /><br /><br /><br /><br /> click to go back to your
<a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Bonus Point</a> page.<br /><br /></td></tr></table>";
echo stdhead($CURUSER['username'] . "'s Karma Bonus Points Page", true, $stdhead) . $HTMLOUT . stdfoot();
die;
case (isset($_GET['itrade_success'])):{
I_smell_a_rat($_GET['itrade_success']);
}
$HTMLOUT .= "<table align='center' width='80%'><tr><td class='colhead' align='left' colspan='2'><h1>Success!</h1></td></tr><tr>
<td class='one' align='left'><img src='{$INSTALLER09['pic_base_url']}smilies/karma.gif' alt='good_karma' title='Good karma' /></td>
<td class='one' align='left'><b>Congratulations ! </b>".$CURUSER['username']." you have got your self 200 points !!
<img src='{$INSTALLER09['pic_base_url']}smilies/w00t.gif' alt='w00t' title='w00t' /><br /><br /><br /><br /> click to go back to your
<a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Bonus Point</a> page.<br /><br /></td></tr></table>";
echo stdhead($CURUSER['username'] . "'s Karma Bonus Points Page", true, $stdhead) . $HTMLOUT . stdfoot();
die;
case (isset($_GET['itrade2_success'])):{
I_smell_a_rat($_GET['itrade2_success']);
}
$HTMLOUT .= "<table align='center' width='80%'><tr><td class='colhead' align='left' colspan='2'><h1>Success!</h1></td></tr><tr>
<td class='one' align='left'><img src='{$INSTALLER09['pic_base_url']}smilies/karma.gif' alt='good_karma' title='Good Karma' /></td>
<td class='one' align='left'><b>Sorry ! </b>".$CURUSER['username']." you just got yourself 2 freeslots !!
<img src='{$INSTALLER09['pic_base_url']}smilies/w00t.gif' alt='W00t' title='W00t' /><br /><br /><br /><br /> click to go back to your
<a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Bonus Point</a> page.<br /><br /></td></tr></table>";
echo stdhead($CURUSER['username'] . "'s Karma Bonus Points Page", true, $stdhead) . $HTMLOUT . stdfoot();
die;
case (isset($_GET['pirate_success'])):{
I_smell_a_rat($_GET['pirate_success']);
}
$HTMLOUT .="<table align='center' width='80%'><tr><td class='colhead' align='left' colspan='2'><h1>Success!</h1></td></tr>
<tr><td align='left' class='one'><img src='{$INSTALLER09['pic_base_url']}smilies/pirate2.gif' alt='good_karma' title='Good karma' /></td><td align='left' class='one'>
<b>Congratulations! </b>".$CURUSER['username']." you have got yourself Pirate Status and Freeleech for two weeks! <img src='{$INSTALLER09['pic_base_url']}smilies/w00t.gif' alt='w00t' title='w00t' /><br />
<br /> Click to go back to your <a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Points</a> page.<br /><br /></td></tr></table>";
echo stdhead($CURUSER['username'] . "'s Karma Bonus Points Page", true, $stdhead) . $HTMLOUT . stdfoot();
die;
case (isset($_GET['king_success'])):{
I_smell_a_rat($_GET['king_success']);
}
$HTMLOUT .="<table align='center' width='80%'><tr><td class='colhead' align='left' colspan='2'><h1>Success!</h1></td></tr>
<tr><td align='left' class='one'><img src='{$INSTALLER09['pic_base_url']}smilies/king.gif' alt='good_karma' title='Good karma' /></td><td align='left' class='one'>
<b>Congratulations! </b>".$CURUSER['username']." you have got yourself King Status and Freeleech for one month! <img src='{$INSTALLER09['pic_base_url']}smilies/w00t.gif' alt='w00t' title='w00t' /><br />
<br /> Click to go back to your <a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Points</a> page.<br /><br /></td></tr></table>";
echo stdhead($CURUSER['username'] . "'s Karma Bonus Points Page", true, $stdhead) . $HTMLOUT . stdfoot();
die;
case (isset($_GET['dload_success']));{
I_smell_a_rat($_GET['dload_success']);
}
$amt = (float)$_GET['amt'];
switch ($amt) {
case $amt == 150.0:
$amt = '1 GB';
break;
case $amt == 300.0:
$amt = '2.5 GB';
break;
default:
$amt = '5 GB';
}
$HTMLOUT .="<table width='80%'><tr><td class='colhead' align='left' colspan='2'><h1>Success!</h1></td></tr><tr>".
"<td class='one align='left'><img src='{$INSTALLER09['pic_base_url']}smilies/karma.gif' alt='good_karma' title='Good Karma' /></td>".
"<td class='one' align='left'><b>Congratulations ! </b>".$CURUSER['username']." you have just decreased your download amount by ".$amt."!".
"<img src='{$INSTALLER09['pic_base_url']}smilies/w00t.gif' alt='w00t' /><br /><br /><br /><br /> click to go back to your ".
"<a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Bonus Point</a> page.<br /><br /></td></tr></table>";
echo stdhead($CURUSER['username'] . "'s Karma Bonus Points Page", true, $stdhead) . $HTMLOUT . stdfoot();
die;
case (isset($_GET['class_success'])):
I_smell_a_rat($_GET['class_success']);
$HTMLOUT .="<table align='center' width='80%'><tr><td class='colhead' align='left' colspan='2'><h1>Success!</h1></td></tr>
<tr><td align='left' class='one'><img src='{$INSTALLER09['pic_base_url']}smilies/karma.gif' alt='good_karma' title='Good karma' /></td><td align='left' class='one'>
<b>Congratulations! </b>".$CURUSER['username']." you have got yourself VIP Status for one month! <img src='{$INSTALLER09['pic_base_url']}smilies/w00t.gif' alt='w00t' title='w00t' /><br />
<br /> Click to go back to your <a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Points</a> page.<br /><br /></td></tr></table>";
echo stdhead($CURUSER['username'] . "'s Karma Bonus Points Page", true, $stdhead) . $HTMLOUT . stdfoot();
die;
case (isset($_GET['smile_success'])):
I_smell_a_rat($_GET['smile_success']);
$HTMLOUT .="<table align='center' width='80%'><tr><td class='colhead' align='left' colspan='2'><h1>Success!</h1></td></tr>
<tr><td align='left' class='one'><img src='{$INSTALLER09['pic_base_url']}smilies/karma.gif' alt='good_karma' title='Good karma' /></td><td align='left' class='one'>
<b>Congratulations! </b>".$CURUSER['username']." you have got yourself a set of custom smilies for one month! <img src='{$INSTALLER09['pic_base_url']}smilies/w00t.gif' alt='w00t' title='w00t' /><br />
<br /> Click to go back to your <a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Points</a> page.<br /><br /></td></tr></table>";
echo stdhead($CURUSER['username'] . "'s Karma Bonus Points Page", true, $stdhead) . $HTMLOUT . stdfoot();
die;
case (isset($_GET['warning_success'])):
I_smell_a_rat($_GET['warning_success']);
$HTMLOUT .="<table align='center' width='80%'><tr><td class='colhead' align='left' colspan='2'><h1>Success!</h1></td></tr>
<tr><td align='left' class='one'><img src='{$INSTALLER09['pic_base_url']}smilies/karma.gif' alt='good_karma' title='Good karma' /></td><td align='left' class='one'>
<b>Congratulations! </b>".$CURUSER['username']." you have removed your warning for the low price of 1000 points!! <img src='{$INSTALLER09['pic_base_url']}smilies/w00t.gif' alt='w00t' title='w00t' /><br />
<br /> Click to go back to your <a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Points</a> page.<br /><br /></td></tr></table>";
echo stdhead($CURUSER['username'] . "'s Karma Bonus Points Page", true, $stdhead) . $HTMLOUT . stdfoot();
die;
case (isset($_GET['invite_success'])):
I_smell_a_rat($_GET['invite_success']);
$HTMLOUT .="<table align='center' width='80%'><tr><td class='colhead' align='left' colspan='2'><h1>Success!</h1></td></tr><tr><td align='left' class='one'>
<img src='{$INSTALLER09['pic_base_url']}smilies/karma.gif' alt='good_karma' title='Good karma' /></td><td align='left' class='one'>
<b>Congratulations! </b>".$CURUSER['username']." you have got your self 3 new invites! <img src='{$INSTALLER09['pic_base_url']}smilies/w00t.gif' alt='w00t' title='w00t' /><br /><br />
click to go back to your <a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Bonus Point</a> page.<br /><br /></td></tr></table>";
echo stdhead($CURUSER['username'] . "'s Karma Bonus Points Page", true, $stdhead) . $HTMLOUT . stdfoot();
die;
case (isset($_GET['freeslots_success'])):
I_smell_a_rat($_GET['freeslots_success']);
$HTMLOUT .="<table align='center' width='80%'><tr><td class='colhead' align='left' colspan='2'><h1>Success!</h1></td></tr><tr><td align='left' class='one'>
<img src='{$INSTALLER09['pic_base_url']}smilies/karma.gif' alt='good_karma' title='Good karma' /></td><td align='left' class='one'>
<b>Congratulations! </b>".$CURUSER['username']." you have got your self 3 freeleech slots! <img src='{$INSTALLER09['pic_base_url']}smilies/w00t.gif' alt='w00t' title='w00t' /><br /><br />
click to go back to your <a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Bonus Point</a> page.<br /><br /></td></tr></table>";
echo stdhead($CURUSER['username'] . "'s Karma Bonus Points Page", true, $stdhead) . $HTMLOUT . stdfoot();
die;
case (isset($_GET['title_success'])):
I_smell_a_rat($_GET['title_success']);
$HTMLOUT .="<table align='center' width='80%'><tr><td class='colhead' align='left' colspan='2'><h1>Success!</h1></td></tr><tr>
<td align='left' class='one'><img src='{$INSTALLER09['pic_base_url']}smilies/karma.gif' alt='good_karma' title='Good karma' /></td><td align='left' class='one'>
<b>Congratulations! </b>".$CURUSER['username']." you are now known as <b>".$CURUSER['title']."</b>! <img src='{$INSTALLER09['pic_base_url']}smilies/w00t.gif' alt='w00t' title='w00t' /><br />
<br /> click to go back to your <a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Bonus Point</a> page.<br /><br /></td></tr></table>";
echo stdhead($CURUSER['username'] . "'s Karma Bonus Points Page", true, $stdhead) . $HTMLOUT . stdfoot();
die;
case (isset($_GET['ratio_success'])):
I_smell_a_rat($_GET['ratio_success']);
$HTMLOUT .="<table align='center' width='80%'><tr><td class='colhead' align='left' colspan='2'><h1>Success!</h1></td></tr><tr>
<td align='left' class='one'><img src='{$INSTALLER09['pic_base_url']}smilies/karma.gif' alt='good_karma' title='Good karma' /></td><td align='left' class='one'><b>Congratulations! </b> ".$CURUSER['username']." you
have gained a 1 to 1 ratio on the selected torrent, and the difference in MB has been added to your total upload! <img src='{$INSTALLER09['pic_base_url']}smilies/w00t.gif' alt='w00t' title='w00t' /><br />
<br /> click to go back to your <a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Bonus Point</a> page.<br /><br />
</td></tr></table>";
echo stdhead($CURUSER['username'] . "'s Karma Bonus Points Page", true, $stdhead) . $HTMLOUT . stdfoot();
die;
case (isset($_GET['gift_fail'])):
I_smell_a_rat($_GET['gift_fail']);
$HTMLOUT .="<table align='center' width='80%'><tr><td class='colhead' align='left' colspan='2'><h1>Huh?</h1></td></tr><tr><td align='left' class='one'>
<img src='{$INSTALLER09['pic_base_url']}smilies/cry.gif' alt='bad_karma' title='Bad karma' /></td><td align='left' class='one'><b>Not so fast there Mr. fancy pants!</b><br />
<b>".$CURUSER['username']."...</b> you can not spread the karma to yourself...<br />If you want to spread the love, pick another user! <br />
<br /> click to go back to your <a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Bonus Point</a> page.<br /><br /></td></tr></table>";
echo stdhead($CURUSER['username'] . "'s Karma Bonus Points Page", true, $stdhead) . $HTMLOUT . stdfoot();
die;
case (isset($_GET['gift_fail_user'])):
I_smell_a_rat($_GET['gift_fail_user']);
$HTMLOUT .="<table align='center' width='80%'><tr><td class='colhead' align='left' colspan='2'><h1>Error</h1></td></tr><tr><td align='left' class='one'>
<img src='{$INSTALLER09['pic_base_url']}smilies/cry.gif' alt='bad_karma' title='Bad karma' /></td><td align='left' class='one'><b>Sorry ".$CURUSER['username']."...</b>
<br /> No User with that username <br /><br /> click to go back to your <a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Bonus Point</a> page.
<br /><br /></td></tr></table>";
echo stdhead($CURUSER['username'] . "'s Karma Bonus Points Page", true, $stdhead) . $HTMLOUT . stdfoot();
die;
case (isset($_GET['bump_success']) && $_GET['bump_success'] == 1):
$res_free = sql_query('SELECT id,name FROM torrents WHERE id = '.sqlesc(0 + $_GET['t_name'])) or sqlerr(__FILE__, __LINE__);
$arr_free = mysqli_fetch_assoc($res_free);
stderr('Success!', '<img src="pic/smilies/karma.gif" alt="good karma" /> <b>Congratulations '.$CURUSER['username'].'!!!</b> <img src="pic/smilies/karma.gif" alt="good karma" /><br /> you have ReAnimated the torrent <b><a class="altlink" href="details.php?id='.$arr_free['id'].'">'.htmlsafechars($arr_free['name']).'</a></b>! Bringing it back to page one! <img src="pic/smilies/w00t.gif" alt="w00t" /><br /><br />
Click to go back to your <a class="altlink" href="mybonus.php">Karma Points</a> page.<br /><br />');
echo stdhead($CURUSER['username'] . "'s Karma Bonus Points Page", true, $stdhead) . $HTMLOUT . stdfoot();
die;
case (isset($_GET['gift_fail_points'])):
I_smell_a_rat($_GET['gift_fail_points']);
$HTMLOUT .="<table align='center' width='80%'><tr><td class='colhead' align='left' colspan='2'><h1>Oops!</h1></td></tr><tr><td align='left' class='one'>
<img src='{$INSTALLER09['pic_base_url']}smilies/cry.gif' alt='oups' title='Bad karma' /></td><td align='left' class='one'><b>Sorry </b>".$CURUSER['username']." you dont have enough Karma points
<br /> go back to your <a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Bonus Point</a> page.<br /><br /></td></tr></table>";
echo stdhead($CURUSER['username'] . "'s Karma Bonus Points Page", true, $stdhead) . $HTMLOUT . stdfoot();
die;
case (isset($_GET['gift_success'])):
I_smell_a_rat($_GET['gift_success']);
$HTMLOUT .="<table align='center' width='80%'><tr><td class='colhead' align='left' colspan='2'><h1>Success!</h1></td></tr><tr><td align='left' class='one'>
<img src='{$INSTALLER09['pic_base_url']}smilies/karma.gif' alt='good_karma' title='Good karma' /></td><td align='left' class='one'><b>Congratulations! ".$CURUSER['username']." </b>
you have spread the Karma well.<br /><br />Member <b>".htmlsafechars($_GET['usernamegift'])."</b> will be pleased with your kindness!<br /><br />This is the message that was sent:<br />
<b>Subject:</b> Someone Loves you!<br /> <p>You have been given a gift of <b>".(0 + $_GET['gift_amount_points'])."</b> Karma points by ".$CURUSER['username']."</p><br />
You may also <a class='altlink' href='{$INSTALLER09['baseurl']}/pm_system.php?action=send_message&receiver=".(0 + $_GET['gift_id'])."'>send ".htmlsafechars($_GET['usernamegift'])." a message as well</a>, or go back to your <a class='altlink' href='mybonus.php'>Karma Bonus Point</a> page.<br /><br /></td></tr></table>";
echo stdhead($CURUSER['username'] . "'s Karma Bonus Points Page", true, $stdhead) . $HTMLOUT . stdfoot();
die;
case (isset($_GET['bounty_success'])):{
I_smell_a_rat($_GET['bounty_success']);
}
$HTMLOUT .="<table align='center' width='80%'><tr><td class='colhead' align='left' colspan='2'><h1>Success!</h1></td></tr>
<tr><td align='left' class='one'><img src='{$INSTALLER09['pic_base_url']}smilies/pirate2.gif' alt='good_karma' title='Good karma' /></td><td align='left' class='one'>
<b>Congratulations! </b>".$CURUSER['username']." you have got yourself bounty and robbed many users of there reputation points! <img src='{$INSTALLER09['pic_base_url']}smilies/w00t.gif' alt='w00t' title='w00t' /><br />
<br /> Click to go back to your <a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Points</a> page.<br /><br /></td></tr></table>";
echo stdhead($CURUSER['username'] . "'s Karma Bonus Points Page", true, $stdhead) . $HTMLOUT . stdfoot();
die;
case (isset($_GET['reputation_success'])):
I_smell_a_rat($_GET['reputation_success']);
$HTMLOUT .="<table align='center' width='80%'><tr><td class='colhead' align='left' colspan='2'><h1>Success!</h1></td></tr><tr><td align='left' class='one'>
<img src='{$INSTALLER09['pic_base_url']}smilies/karma.gif' alt='good_karma' title='Good karma' /></td><td align='left' class='one'>
<b>Congratulations! </b>".$CURUSER['username']." you have got your 100 rep points! <img src='{$INSTALLER09['pic_base_url']}smilies/w00t.gif' alt='w00t' title='w00t' /><br /><br />
click to go back to your <a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Bonus Point</a> page.<br /><br /></td></tr></table>";
echo stdhead($CURUSER['username'] . "'s Karma Bonus Points Page", true, $stdhead) . $HTMLOUT . stdfoot();
die;
case (isset($_GET['immunity_success'])):
I_smell_a_rat($_GET['immunity_success']);
$HTMLOUT .="<table align='center' width='80%'><tr><td class='colhead' align='left' colspan='2'><h1>Success!</h1></td></tr><tr><td align='left' class='one'>
<img src='{$INSTALLER09['pic_base_url']}smilies/yay.gif' alt='good_karma' title='Good karma' /></td><td align='left' class='one'>
<b>Congratulations! </b>".$CURUSER['username']." you have got yourself immuntiy from auto hit and run warnings and auto leech warnings ! <img src='{$INSTALLER09['pic_base_url']}smilies/w00t.gif' alt='w00t' title='w00t' /><br /><br />
click to go back to your <a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Bonus Point</a> page.<br /><br /></td></tr></table>";
echo stdhead($CURUSER['username'] . "'s Karma Bonus Points Page", true, $stdhead) . $HTMLOUT . stdfoot();
die;
case (isset($_GET['userblocks_success'])):
I_smell_a_rat($_GET['userblocks_success']);
$HTMLOUT .="<table align='center' width='80%'><tr><td class='colhead' align='left' colspan='2'><h1>Success!</h1></td></tr><tr><td align='left' class='one'>
<img src='{$INSTALLER09['pic_base_url']}smilies/karma.gif' alt='good_karma' title='Good karma' /></td><td align='left' class='one'>
<b>Congratulations! </b>".$CURUSER['username']." you have got yourself access to control the site user blocks! <img src='{$INSTALLER09['pic_base_url']}smilies/w00t.gif' alt='w00t' title='w00t' /><br /><br />
click to go back to your <a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Bonus Point</a> page.<br /><br /></td></tr></table>";
echo stdhead($CURUSER['username'] . "'s Karma Bonus Points Page", true, $stdhead) . $HTMLOUT . stdfoot();
die;
case (isset($_GET['user_unlocks_success'])):
I_smell_a_rat($_GET['user_unlocks_success']);
$HTMLOUT .="<table align='center' width='80%'><tr><td class='colhead' align='left' colspan='2'><h1>Success!</h1></td></tr><tr><td align='left' class='one'>
<img src='{$INSTALLER09['pic_base_url']}smilies/karma.gif' alt='good_karma' title='Good karma' /></td><td align='left' class='one'>
<b>Congratulations! </b>".$CURUSER['username']." you have got yourself unlocked bonus moods for use on site! <img src='{$INSTALLER09['pic_base_url']}smilies/w00t.gif' alt='w00t' title='w00t' /><br /><br />
click to go back to your <a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Bonus Point</a> page.<br /><br /></td></tr></table>";
echo stdhead($CURUSER['username'] . "'s Karma Bonus Points Page", true, $stdhead) . $HTMLOUT . stdfoot();
die;
}
//=== exchange
if (isset($_GET['exchange'])){
I_smell_a_rat($_GET['exchange']);
$userid = (int)$CURUSER['id'];
if (!is_valid_id($userid))
stderr("Error", "That is not your user ID!");
$option = (int) $_POST['option'];
$res_points = sql_query("SELECT * FROM bonus WHERE id =" . sqlesc($option));
$arr_points = mysqli_fetch_assoc($res_points);
$art = htmlsafechars($arr_points['art']);
$points = (float)$arr_points['points'];
$minpoints = (float)$arr_points['minpoints'];
if ($CURUSER['seedbonus'] <= 0)
stderr("Error", "I smell a rat!");
if ($points <= 0)
stderr("Error", "I smell a rat!");
$sql = sql_query('SELECT uploaded, downloaded, seedbonus, bonuscomment, free_switch, warned, invites, freeslots, reputation '.
'FROM users '.
'WHERE id = '.sqlesc($userid)) or sqlerr(__FILE__, __LINE__);
$User = mysqli_fetch_assoc($sql);
$bonus = (float)$User['seedbonus'];
$seedbonus = ($bonus-$points);
$upload = (float)$User['uploaded'];
$download = (float)$User['downloaded'];
$bonuscomment = htmlsafechars($User['bonuscomment']);
$free_switch = (int)$User['free_switch'];
$warned = (int)$User['warned'];
$reputation = (int)$User['reputation'];
if($bonus < $minpoints)
stderr("Sorry", "you do not have enough Karma points!");
switch ($art){
case 'traffic':
//=== trade for one upload credit
$up = $upload + $arr_points['menge'];
$bonuscomment = get_date( TIME_NOW, 'DATE', 1 ) . " - " .$points. " Points for upload bonus.\n " .$bonuscomment;
sql_query("UPDATE users SET uploaded = ".sqlesc($upload + $arr_points['menge']).", seedbonus = ".sqlesc($seedbonus).", bonuscomment = ".sqlesc($bonuscomment)." WHERE id = ".sqlesc($userid)) or sqlerr(__FILE__, __LINE__);
$mc1->begin_transaction('userstats_'.$userid);
$mc1->update_row(false, array('uploaded' => $upload+$arr_points['menge'], 'seedbonus' => $seedbonus));
$mc1->commit_transaction($INSTALLER09['expires']['u_stats']);
$mc1->begin_transaction('user_stats_'.$userid);
$mc1->update_row(false, array('uploaded' => $upload+$arr_points['menge'], 'seedbonus' => $seedbonus, 'bonuscomment' => $bonuscomment));
$mc1->commit_transaction($INSTALLER09['expires']['user_stats']);
header("Refresh: 0; url={$INSTALLER09['baseurl']}/mybonus.php?up_success=1&amt=$points");
die;
break;
case 'reputation':
//=== trade for reputation
if ($CURUSER['class'] < UC_POWER_USER || $User['reputation'] >= 5000)
stderr("Error", "Time shall unfold what plighted cunning hides\n\nWho cover faults, at last shame them derides...Sorry your not a Power User or you already have to many rep points :-P<br />go back to your <a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Bonus Point</a> page and think that one over.");
$rep = $reputation + $arr_points['menge'];
$bonuscomment = get_date( TIME_NOW, 'DATE', 1 ) . " - " .$points. " Points for 100 rep points.\n " .$bonuscomment;
sql_query("UPDATE users SET reputation = ".sqlesc($rep).", seedbonus = ".sqlesc($seedbonus).", bonuscomment = ".sqlesc($bonuscomment)." WHERE id = ".sqlesc($userid)) or sqlerr(__FILE__, __LINE__);
$mc1->begin_transaction('user'.$userid);
$mc1->update_row(false, array('reputation' => $rep));
$mc1->commit_transaction($INSTALLER09['expires']['user_cache']);
$mc1->begin_transaction('MyUser_'.$userid);
$mc1->update_row(false, array('reputation' => $rep));
$mc1->commit_transaction($INSTALLER09['expires']['curuser']);
$mc1->begin_transaction('userstats_'.$userid);
$mc1->update_row(false, array('seedbonus' => $seedbonus));
$mc1->commit_transaction($INSTALLER09['expires']['u_stats']);
$mc1->begin_transaction('user_stats_'.$userid);
$mc1->update_row(false, array('seedbonus' => $seedbonus, 'bonuscomment' => $bonuscomment));
$mc1->commit_transaction($INSTALLER09['expires']['user_stats']);
header("Refresh: 0; url={$INSTALLER09['baseurl']}/mybonus.php?reputation_success=1");
die;
break;
case 'immunity':
//=== trade for immunity
if ($CURUSER['class'] < UC_POWER_USER || $User['reputation'] < 3000)
stderr("Error", "Time shall unfold what plighted cunning hides\n\nWho cover faults, at last shame them derides...Sorry your not a Power User or you dont have enough rep :-P<br />go back to your <a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Bonus Point</a> page and think that one over.");
$bonuscomment = get_date( TIME_NOW, 'DATE', 1 ) . " - " .$points. " Points for 1 years immunity status.\n " .$bonuscomment;
$immunity = (86400 * 365 + TIME_NOW);
sql_query("UPDATE users SET immunity = ".sqlesc($immunity).", seedbonus = ".sqlesc($seedbonus).", bonuscomment = ".sqlesc($bonuscomment)." WHERE id = ".sqlesc($userid)) or sqlerr(__FILE__, __LINE__);
$mc1->begin_transaction('user'.$userid);
$mc1->update_row(false, array('immunity' => $immunity));
$mc1->commit_transaction($INSTALLER09['expires']['user_cache']);
$mc1->begin_transaction('MyUser_'.$userid);
$mc1->update_row(false, array('immunity' => $immunity));
$mc1->commit_transaction($INSTALLER09['expires']['curuser']);
$mc1->begin_transaction('userstats_'.$userid);
$mc1->update_row(false, array('seedbonus' => $seedbonus));
$mc1->commit_transaction($INSTALLER09['expires']['u_stats']);
$mc1->begin_transaction('user_stats_'.$userid);
$mc1->update_row(false, array('seedbonus' => $seedbonus, 'bonuscomment' => $bonuscomment));
$mc1->commit_transaction($INSTALLER09['expires']['user_stats']);
header("Refresh: 0; url={$INSTALLER09['baseurl']}/mybonus.php?immunity_success=1");
die;
break;
case 'userblocks':
//=== trade for userblock access
$reputation = $User['reputation'];
if ($CURUSER['class'] < UC_POWER_USER || $User['reputation'] < 50)
stderr("Error", "Time shall unfold what plighted cunning hides\n\nWho cover faults, at last shame them derides...Sorry your not a Power User or you dont have enough rep points yet - Minimum 50 required :-P<br />go back to your <a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Bonus Point</a> page and think that one over.");
$bonuscomment = get_date( TIME_NOW, 'DATE', 1 ) . " - " .$points. " Points for user blocks access.\n " .$bonuscomment;
sql_query("UPDATE users SET got_blocks = 'yes', seedbonus = ".sqlesc($seedbonus).", bonuscomment = ".sqlesc($bonuscomment)." WHERE id = ".sqlesc($userid)) or sqlerr(__FILE__, __LINE__);
$mc1->begin_transaction('user'.$userid);
$mc1->update_row(false, array('got_blocks' => 'yes'));
$mc1->commit_transaction($INSTALLER09['expires']['user_cache']);
$mc1->begin_transaction('MyUser_'.$userid);
$mc1->update_row(false, array('got_blocks' => 'yes'));
$mc1->commit_transaction($INSTALLER09['expires']['curuser']);
$mc1->begin_transaction('userstats_'.$userid);
$mc1->update_row(false, array('seedbonus' => $seedbonus));
$mc1->commit_transaction($INSTALLER09['expires']['u_stats']);
$mc1->begin_transaction('user_stats_'.$userid);
$mc1->update_row(false, array('seedbonus' => $seedbonus, 'bonuscomment' => $bonuscomment));
$mc1->commit_transaction($INSTALLER09['expires']['user_stats']);
header("Refresh: 0; url={$INSTALLER09['baseurl']}/mybonus.php?userblocks_success=1");
die;
break;
case 'userunlock':
//=== trade for user_unlocks access
$reputation = $User['reputation'];
if ($CURUSER['class'] < UC_POWER_USER || $User['reputation'] < 50)
stderr("Error", "Time shall unfold what plighted cunning hides\n\nWho cover faults, at last shame them derides...Sorry your not a Power User or you dont have enough rep points yet - Minimum 50 required :-P<br />go back to your <a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Bonus Point</a> page and think that one over.");
$bonuscomment = get_date( TIME_NOW, 'DATE', 1 ) . " - " .$points. " Points for user unlocks access.\n " .$bonuscomment;
sql_query("UPDATE users SET got_moods = 'yes', seedbonus = ".sqlesc($seedbonus).", bonuscomment = ".sqlesc($bonuscomment)." WHERE id = ".sqlesc($userid)) or sqlerr(__FILE__, __LINE__);
$mc1->begin_transaction('user'.$userid);
$mc1->update_row(false, array('got_moods' => 'yes'));
$mc1->commit_transaction($INSTALLER09['expires']['user_cache']);
$mc1->begin_transaction('MyUser_'.$userid);
$mc1->update_row(false, array('got_moods' => 'yes'));
$mc1->commit_transaction($INSTALLER09['expires']['curuser']);
$mc1->begin_transaction('userstats_'.$userid);
$mc1->update_row(false, array('seedbonus' => $seedbonus));
$mc1->commit_transaction($INSTALLER09['expires']['u_stats']);
$mc1->begin_transaction('user_stats_'.$userid);
$mc1->update_row(false, array('seedbonus' => $seedbonus, 'bonuscomment' => $bonuscomment));
$mc1->commit_transaction($INSTALLER09['expires']['user_stats']);
header("Refresh: 0; url={$INSTALLER09['baseurl']}/mybonus.php?user_unlocks_success=1");
die;
break;
case 'anonymous':
//=== trade for 14 days Anonymous profile
$anonymous_until = (86400 * 14 + TIME_NOW);
if ($CURUSER['anonymous_until'] >= 1)
stderr("Error", "Time shall unfold what plighted cunning hides\n\nWho cover faults, at last shame them derides.");
$bonuscomment = get_date( TIME_NOW, 'DATE', 1 ) . " - " .$points. " Points for 14 days Anonymous profile.\n " .$bonuscomment;
sql_query("UPDATE users SET anonymous_until = ".sqlesc($anonymous_until).", seedbonus = ".sqlesc($seedbonus).", bonuscomment = ".sqlesc($bonuscomment)." WHERE id = ".sqlesc($userid)) or sqlerr(__FILE__, __LINE__);
$mc1->begin_transaction('user'.$userid);
$mc1->update_row(false, array('anonymous_until' => $anonymous_until));
$mc1->commit_transaction($INSTALLER09['expires']['user_cache']);
$mc1->begin_transaction('MyUser_'.$userid);
$mc1->update_row(false, array('anonymous_until' => $anonymous_until));
$mc1->commit_transaction($INSTALLER09['expires']['curuser']);
$mc1->begin_transaction('userstats_'.$userid);
$mc1->update_row(false, array('seedbonus' => $seedbonus));
$mc1->commit_transaction($INSTALLER09['expires']['u_stats']);
$mc1->begin_transaction('user_stats_'.$userid);
$mc1->update_row(false, array('seedbonus' => $seedbonus, 'bonuscomment' => $bonuscomment));
$mc1->commit_transaction($INSTALLER09['expires']['user_stats']);
header("Refresh: 0; url={$INSTALLER09['baseurl']}/mybonus.php?anonymous_success=1");
die;
break;
case 'parked':
//=== trade for parked option
$parked_until = 1;
if ($CURUSER['parked_until'] == 1)
stderr("Error", "Time shall unfold what plighted cunning hides\n\nWho cover faults, at last shame them derides.");
$bonuscomment = get_date( TIME_NOW, 'DATE', 1 ) . " - " .$points. " Points for 14 days Anonymous profile.\n " .$bonuscomment;
sql_query("UPDATE users SET parked_until = ".sqlesc($parked_until).", seedbonus = ".sqlesc($seedbonus).", bonuscomment = ".sqlesc($bonuscomment)." WHERE id = ".sqlesc($userid)) or sqlerr(__FILE__, __LINE__);
$mc1->begin_transaction('user'.$userid);
$mc1->update_row(false, array('parked_until' => $parked_until));
$mc1->commit_transaction($INSTALLER09['expires']['user_cache']);
$mc1->begin_transaction('MyUser_'.$userid);
$mc1->update_row(false, array('parked_until' => $parked_until));
$mc1->commit_transaction($INSTALLER09['expires']['curuser']);
$mc1->begin_transaction('userstats_'.$userid);
$mc1->update_row(false, array('seedbonus' => $seedbonus));
$mc1->commit_transaction($INSTALLER09['expires']['u_stats']);
$mc1->begin_transaction('user_stats_'.$userid);
$mc1->update_row(false, array('seedbonus' => $seedbonus, 'bonuscomment' => $bonuscomment));
$mc1->commit_transaction($INSTALLER09['expires']['user_stats']);
header("Refresh: 0; url={$INSTALLER09['baseurl']}/mybonus.php?parked_success=1");
die;
break;
case 'traffic2':
//=== trade for download credit
$down = $download - $arr_points['menge'];
if ($CURUSER['downloaded'] == 0)
stderr("Error", "Time shall unfold what plighted cunning hides\n\nWho cover faults, at last shame them derides.");
$bonuscomment = get_date( TIME_NOW, 'DATE', 1 ) . " - " .$points. " Points for download credit removal.\n " .$bonuscomment;
sql_query("UPDATE users SET downloaded = ".sqlesc($download - $arr_points['menge']).", seedbonus = ".sqlesc($seedbonus).", bonuscomment = ".sqlesc($bonuscomment)." WHERE id = ".sqlesc($userid)) or sqlerr(__FILE__, __LINE__);
$mc1->begin_transaction('userstats_'.$userid);
$mc1->update_row(false, array('downloaded' => $download - $arr_points['menge'], 'seedbonus' => $seedbonus));
$mc1->commit_transaction($INSTALLER09['expires']['u_stats']);
$mc1->begin_transaction('user_stats_'.$userid);
$mc1->update_row(false, array('downloaded' => $download - $arr_points['menge'], 'seedbonus' => $seedbonus, 'bonuscomment' => $bonuscomment));
$mc1->commit_transaction($INSTALLER09['expires']['user_stats']);
header("Refresh: 0; url={$INSTALLER09['baseurl']}/mybonus.php?dload_success=1&amt=$points");
die;
break;
case 'freeyear':
//=== trade for years freeleech
$free_switch = (365 * 86400 + TIME_NOW);
if ($User['free_switch'] != 0)
stderr("Error", "Time shall unfold what plighted cunning hides\n\nWho cover faults, at last shame them derides.");
$bonuscomment = get_date( TIME_NOW, 'DATE', 1 ) . " - " .$points. " Points for One year of freeleech.\n " .$bonuscomment;
sql_query("UPDATE users SET free_switch = ".sqlesc($free_switch).", seedbonus = ".sqlesc($seedbonus).", bonuscomment = ".sqlesc($bonuscomment)." WHERE id = ".sqlesc($userid)) or sqlerr(__FILE__, __LINE__);
$mc1->begin_transaction('user'.$userid);
$mc1->update_row(false, array('free_switch' => $free_switch));
$mc1->commit_transaction($INSTALLER09['expires']['user_cache']);
$mc1->begin_transaction('MyUser_'.$userid);
$mc1->update_row(false, array('free_switch' => $free_switch));
$mc1->commit_transaction($INSTALLER09['expires']['curuser']);
$mc1->begin_transaction('userstats_'.$userid);
$mc1->update_row(false, array('seedbonus' => $seedbonus));
$mc1->commit_transaction($INSTALLER09['expires']['u_stats']);
$mc1->begin_transaction('user_stats_'.$userid);
$mc1->update_row(false, array('seedbonus' => $seedbonus, 'bonuscomment' => $bonuscomment));
$mc1->commit_transaction($INSTALLER09['expires']['user_stats']);
header("Refresh: 0; url={$INSTALLER09['baseurl']}/mybonus.php?freeyear_success=1");
die;
break;
case 'freeslots':
//=== trade for freeslots
$freeslots = (int)$User['freeslots'];
$slots = $freeslots + $arr_points['menge'];
$bonuscomment = get_date( TIME_NOW, 'DATE', 1 ) . " - " .$points. " Points for freeslots.\n " .$bonuscomment;
sql_query("UPDATE users SET freeslots = ".sqlesc($slots).", seedbonus = ".sqlesc($seedbonus).", bonuscomment = ".sqlesc($bonuscomment)." WHERE id = ".sqlesc($userid)) or sqlerr(__FILE__, __LINE__);
$mc1->begin_transaction('user'.$userid);
$mc1->update_row(false, array('freeslots' => $slots));
$mc1->commit_transaction($INSTALLER09['expires']['user_cache']);
$mc1->begin_transaction('MyUser_'.$userid);
$mc1->update_row(false, array('freeslots' => $slots));
$mc1->commit_transaction($INSTALLER09['expires']['curuser']);
$mc1->begin_transaction('userstats_'.$userid);
$mc1->update_row(false, array('seedbonus' => $seedbonus));
$mc1->commit_transaction($INSTALLER09['expires']['u_stats']);
$mc1->begin_transaction('user_stats_'.$userid);
$mc1->update_row(false, array('seedbonus' => $seedbonus, 'bonuscomment' => $bonuscomment));
$mc1->commit_transaction($INSTALLER09['expires']['user_stats']);
header("Refresh: 0; url={$INSTALLER09['baseurl']}/mybonus.php?freeslots_success=1");
die;
break;
case 'itrade':
//=== trade for points
$invites = (int)$User['invites'];
$karma = $User['seedbonus'] + 200;
$inv = $invites - 1;
if ($CURUSER['invites'] == 0)
stderr("Error", "Time shall unfold what plighted cunning hides\n\nWho cover faults, at last shame them derides.");
$bonuscomment = get_date( TIME_NOW, 'DATE', 1 ) . " - " .$points. " invites for bonus points.\n" .$bonuscomment;
sql_query("UPDATE users SET invites = ".sqlesc($inv).", seedbonus = ".sqlesc($karma).", bonuscomment = ".sqlesc($bonuscomment)." WHERE id = ".sqlesc($userid)." AND invites =".sqlesc($invites)) or sqlerr(__FILE__, __LINE__);
$mc1->begin_transaction('user'.$userid);
$mc1->update_row(false, array('invites' => $inv));
$mc1->commit_transaction($INSTALLER09['expires']['user_cache']);
$mc1->begin_transaction('MyUser_'.$userid);
$mc1->update_row(false, array('invites' => $inv));
$mc1->commit_transaction($INSTALLER09['expires']['curuser']);
$mc1->begin_transaction('userstats_'.$userid);
$mc1->update_row(false, array('seedbonus' => $karma));
$mc1->commit_transaction($INSTALLER09['expires']['u_stats']);
$mc1->begin_transaction('user_stats_'.$userid);
$mc1->update_row(false, array('seedbonus' => $karma, 'bonuscomment' => $bonuscomment));
$mc1->commit_transaction($INSTALLER09['expires']['user_stats']);
header("Refresh: 0; url={$INSTALLER09['baseurl']}/mybonus.php?itrade_success=1");
die;
break;
case 'itrade2':
//=== trade for slots
$invites = (int)$User['invites'];
$slots = (int)$User['freeslots'];
$inv = $invites - 1;
$fslot = $slots + 2;
if ($CURUSER['invites'] == 0)
stderr("Error", "Time shall unfold what plighted cunning hides\n\nWho cover faults, at last shame them derides.");
$bonuscomment = get_date( TIME_NOW, 'DATE', 1 ) . " - " .$points. " invites for bonus points.\n" .$bonuscomment;
sql_query("UPDATE users SET invites = ".sqlesc($inv).", freeslots =".sqlesc($fslot).", bonuscomment = ".sqlesc($bonuscomment)." WHERE id = ".sqlesc($userid)." AND invites = ".sqlesc($invites)) or sqlerr(__FILE__, __LINE__);
$mc1->begin_transaction('user'.$userid);
$mc1->update_row(false, array('invites' => $inv, 'freeslots' => $fslot));
$mc1->commit_transaction($INSTALLER09['expires']['user_cache']);
$mc1->begin_transaction('MyUser_'.$userid);
$mc1->update_row(false, array('invites' => $inv, 'freeslots' => $fslot));
$mc1->commit_transaction($INSTALLER09['expires']['curuser']);
$mc1->begin_transaction('userstats_'.$userid);
$mc1->update_row(false, array('seedbonus' => $seedbonus));
$mc1->commit_transaction($INSTALLER09['expires']['u_stats']);
$mc1->begin_transaction('user_stats_'.$userid);
$mc1->update_row(false, array('seedbonus' => $seedbonus, 'bonuscomment' => $bonuscomment));
$mc1->commit_transaction($INSTALLER09['expires']['user_stats']);
header("Refresh: 0; url={$INSTALLER09['baseurl']}/mybonus.php?itrade2_success=1");
die;
break;
case 'pirate':
//=== trade for 2 weeks pirate status
if ($CURUSER['pirate'] != 0 OR $CURUSER['king'] != 0)
stderr("Error", "Now why would you want to add what you already have?<br />go back to your <a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Bonus Point</a> page and think that one over.");
$pirate = (86400 * 14 + TIME_NOW);
$free_switch = (14 * 86400 + TIME_NOW);
$bonuscomment = get_date( TIME_NOW, 'DATE', 1 ) . " - " .$points. " Points for 2 weeks Pirate + freeleech Status.\n " .$bonuscomment;
sql_query("UPDATE users SET free_switch = ".sqlesc($free_switch).", pirate = ".sqlesc($pirate).", seedbonus = ".sqlesc($seedbonus).", bonuscomment = ".sqlesc($bonuscomment)." WHERE id = ".sqlesc($userid)) or sqlerr(__FILE__, __LINE__);
$mc1->begin_transaction('user'.$userid);
$mc1->update_row(false, array('free_switch' => $free_switch, 'pirate' => $pirate));
$mc1->commit_transaction($INSTALLER09['expires']['user_cache']);
$mc1->begin_transaction('MyUser_'.$userid);
$mc1->update_row(false, array('free_switch' => $free_switch, 'pirate' => $pirate));
$mc1->commit_transaction($INSTALLER09['expires']['curuser']);
$mc1->begin_transaction('userstats_'.$userid);
$mc1->update_row(false, array('seedbonus' => $seedbonus));
$mc1->commit_transaction($INSTALLER09['expires']['u_stats']);
$mc1->begin_transaction('user_stats_'.$userid);
$mc1->update_row(false, array('seedbonus' => $seedbonus, 'bonuscomment' => $bonuscomment));
$mc1->commit_transaction($INSTALLER09['expires']['user_stats']);
header("Refresh: 0; url={$INSTALLER09['baseurl']}/mybonus.php?pirate_success=1");
die;
break;
case 'bounty':
//=== trade for pirates bounty
$thief_id = $CURUSER['id'];
$thief_name = $CURUSER['username'];
$thief_rep = (int)$User['reputation'];
$thief_bonus = (float)$User['seedbonus'];
$rep_to_steal = $points/1000;
$new_bonus = $thief_bonus-$points;
$pm = array();
$pm['subject'] = sqlesc("You just got robbed by %s");
$pm['subject_thief'] = sqlesc("Theft summary");
$pm['message'] = sqlesc("Hey\nWe are sorry to announce that you have been robbed by [url=".$INSTALLER09['baseurl']."/userdetails.php?id=%d]%s[/url]\nNow your total reputation is [b]%d[/b]\n[color=#ff0000]This is normal and you should not worry, if you have enough bonus points you can rob other people[/color]");
$pm['message_thief'] = sqlesc("Hey %s\nYou robbed:\n%s\nYour total reputation is now [b]%d[/b] but you lost [b]%d[/b] karma points ");
$foo = array(50=>3,100=>3,150=>4,200=>5,250=>5,300=>6);
$user_limit = isset($foo[$rep_to_steal]) ? $foo[$rep_to_steal] : 0;
$qr = sql_query('select id,username,reputation,seedbonus FROM users WHERE id <> '.$thief_id.' AND reputation >= '.$rep_to_steal.' ORDER BY RAND() LIMIT '.$user_limit) or sqlerr(__FILE__, __LINE__);
$update_users = $pms = $robbed_user = array();
while($ar = mysqli_fetch_assoc($qr)){
$new_rep = $ar['reputation']-$rep_to_steal;
$update_users[] = '('.$ar['id'].','.($ar['reputation']-$rep_to_steal).','.$ar['seedbonus'].')';
$pms[] = '('.$INSTALLER09['bot_id'].','.$ar['id'].','.TIME_NOW.','.sprintf($pm['subject'],$thief_name).','.sprintf($pm['message'],$thief_id,$thief_name,$new_rep).')';
$robbed_users[] = sprintf('[url='.$INSTALLER09['baseurl'].'/userdetails.php?id=%d]%s[/url]',$ar['id'],$ar['username']);
//== cache updates ???
$mc1->begin_transaction('MyUser_'.$ar['id']);
$mc1->update_row(false, array('reputation' => $ar['reputation']-$rep_to_steal));
$mc1->commit_transaction($INSTALLER09['expires']['curuser']);
$mc1->begin_transaction('user'.$ar['id']);
$mc1->update_row(false, array('reputation' => $ar['reputation']-$rep_to_steal));
$mc1->commit_transaction($INSTALLER09['expires']['user_cache']);
$mc1->begin_transaction('userstats_'.$ar['id']);
$mc1->update_row(false, array('seedbonus' => $ar['seedbonus']));
$mc1->commit_transaction($INSTALLER09['expires']['u_stats']);
$mc1->begin_transaction('user_stats_'.$ar['id']);
$mc1->update_row(false, array('seedbonus' => $ar['seedbonus']));
$mc1->commit_transaction($INSTALLER09['expires']['user_stats']);
//$mc1->delete_value('inbox_new_'.$pms);
//$mc1->delete_value('inbox_new_sb_'.$pms);
// end
}
if(count($update_users)) {
$new_bonus = $thief_bonus-$points;
$new_rep = $thief_rep+($user_limit*$rep_to_steal);
$update_users[] = '('.$thief_id.','.$new_rep.','.$new_bonus.')';
$pms[] = '(0,'.$thief_id.','.TIME_NOW.','.$pm['subject_thief'].','.sprintf($pm['message_thief'],$thief_name,join("\n",$robbed_users),$new_rep,$points).')';
sql_query('INSERT INTO users(id,reputation,seedbonus) VALUES '.join(',',$update_users).' ON DUPLICATE KEY UPDATE reputation=values(reputation),seedbonus=values(seedbonus) ') or sqlerr(__FILE__,__LINE__);
sql_query('INSERT INTO messages(sender,receiver,added,subject,msg) VALUES '.join(',',$pms)) or sqlerr(__FILE__,__LINE__);
//== cache updates ???
$mc1->begin_transaction('MyUser_'.$thief_id);
$mc1->update_row(false, array('reputation' => $new_rep));
$mc1->commit_transaction($INSTALLER09['expires']['curuser']);
$mc1->begin_transaction('user'.$thief_id);
$mc1->update_row(false, array('reputation' => $new_rep));
$mc1->commit_transaction($INSTALLER09['expires']['user_cache']);
$mc1->begin_transaction('userstats_'.$thief_id);
$mc1->update_row(false, array('seedbonus' => $new_bonus));
$mc1->commit_transaction($INSTALLER09['expires']['u_stats']);
$mc1->begin_transaction('user_stats_'.$thief_id);
$mc1->update_row(false, array('seedbonus' => $new_bonus));
$mc1->commit_transaction($INSTALLER09['expires']['user_stats']);
//$mc1->delete_value('inbox_new_'.$pms);
//$mc1->delete_value('inbox_new_sb_'.$pms);
}
header("Refresh: 0; url={$INSTALLER09['baseurl']}/mybonus.php?bounty_success=1");
die;
break;
case 'king':
//=== trade for one month king status
if ($CURUSER['king'] != 0 OR $CURUSER['pirate'] != 0)
stderr("Error", "Now why would you want to add what you already have?<br />go back to your <a class='altlink' href='{$INSTALLER09['baseurl']}/mybonus.php'>Karma Bonus Point</a> page and think that one over.");
$king = (86400 * 30 + TIME_NOW);
$free_switch = (30 * 86400 + TIME_NOW);
$bonuscomment = get_date( TIME_NOW, 'DATE', 1 ) . " - " .$points. " Points for 1 month King + freeleech Status.\n " .$bonuscomment;
sql_query("UPDATE users SET free_switch = ".sqlesc($free_switch).", king = ".sqlesc($king).", seedbonus = ".sqlesc($seedbonus).", bonuscomment = ".sqlesc($bonuscomment)." WHERE id = ".sqlesc($userid)) or sqlerr(__FILE__, __LINE__);
$mc1->begin_transaction('user'.$userid);
$mc1->update_row(false, array('free_switch' => $free_switch, 'king' => $king));
$mc1->commit_transaction($INSTALLER09['expires']['user_cache']);
$mc1->begin_transaction('MyUser_'.$userid);
$mc1->update_row(false, array('free_switch' => $free_switch, 'king' => $king));
$mc1->commit_transaction($INSTALLER09['expires']['curuser']);
$mc1->begin_transaction('userstats_'.$userid);
$mc1->update_row(false, array('seedbonus' => $seedbonus));
$mc1->commit_transaction($INSTALLER09['expires']['u_stats']);
$mc1->begin_transaction('user_stats_'.$userid);
$mc1->update_row(false, array('seedbonus' => $seedbonus, 'bonuscomment' => $bonuscomment));
$mc1->commit_transaction($INSTALLER09['expires']['user_stats']);
header("Refresh: 0; url={$INSTALLER09['baseurl']}/mybonus.php?king_success=1");
die;
break;
//--- Freeleech
case 'freeleech':
$points2 = 59999; //== Adjust so that its you can only contribute 1 point under the the bonus option amount doubled - current 30000 x 2 = 60000 - 1 = 59999
$pointspool = (int)$arr_points['pointspool'];
$donation = (int)$_POST['donate'];
$seedbonus = ($bonus - $donation);
if($bonus < $donation || $donation <= 0 || $donation > $points2){
stderr("Error", " <br />Points: ".(float)$donation." <br /> Bonus: ".(float)$bonus." <br /> Donation: ".(float)$donation." <br />Time shall unfold what plighted cunning hides\n\nWho cover faults, at last shame them derides.<br /> Click to go back to your <a class='altlink' href='./mybonus.php'>Karma Bonus Point</a> page.<br />");
die;
}
if(($pointspool + $donation) >= $arr_points["points"]){
$now = TIME_NOW;
$end = (86400 * 3 + TIME_NOW);
$message = sqlesc("FreeLeech [ON]");
sql_query("INSERT INTO events (userid, overlayText, startTime, endTime, displayDates, freeleechEnabled) VALUES (".sqlesc($userid).", $message, $now, $end, 1, 1)") or sqlerr(__FILE__, __LINE__);
$norefund = ($donation + $pointspool) % $points;
$bonuscomment = get_date( TIME_NOW, 'DATE', 1 ) . " - " .$donation. " Points contributed for freeleech.\n " .$bonuscomment;
sql_query("UPDATE users SET seedbonus = ".sqlesc($seedbonus).", bonuscomment = ".sqlesc($bonuscomment)." WHERE id = ".sqlesc($userid)) or sqlerr(__FILE__, __LINE__);
sql_query("UPDATE bonus SET pointspool = ".sqlesc($norefund)." WHERE id = '11' LIMIT 1") or sqlerr(__FILE__, __LINE__);
$mc1->begin_transaction('userstats_'.$userid);
$mc1->update_row(false, array('seedbonus' => $seedbonus));
$mc1->commit_transaction($INSTALLER09['expires']['u_stats']);
$mc1->begin_transaction('user_stats_'.$userid);
$mc1->update_row(false, array('seedbonus' => $seedbonus, 'bonuscomment' => $bonuscomment));
$mc1->commit_transaction($INSTALLER09['expires']['user_stats']);
$mc1->delete_value('freecontribution_');
$mc1->delete_value('top_donators_');
$mc1->delete_value('freeleech_counter');
$mc1->delete_value('freeleech_counter_alerts_');
$mc1->delete_value('freecontribution_datas_');
$mc1->delete_value('freecontribution_datas_alerts_');
write_bonus_log($CURUSER["id"], $donation, $type = "freeleech");
$msg = $CURUSER['username']. " Donated ".$donation." karma point".($donation > 1?'s':'')." into the freeleech contribution pot and has activated freeleech for 3 days ". $donation ."/".$points.'';
$mc1->delete_value('shoutbox_');
autoshout($msg);
header("Refresh: 0; url={$INSTALLER09['baseurl']}//mybonus.php?freeleech_success=1&norefund=$norefund");
die;
} else {
// add to the pool
sql_query("UPDATE bonus SET pointspool = pointspool + ".sqlesc($donation)." WHERE id = '11' LIMIT 1") or sqlerr(__FILE__, __LINE__);
$bonuscomment = get_date( TIME_NOW, 'DATE', 1 ) . " - " .$donation. " Points contributed for freeleech.\n " .$bonuscomment;
sql_query("UPDATE users SET seedbonus = ".sqlesc($seedbonus).", bonuscomment = ".sqlesc($bonuscomment)." WHERE id = ".sqlesc($userid)) or sqlerr(__FILE__, __LINE__);
$mc1->begin_transaction('userstats_'.$userid);
$mc1->update_row(false, array('seedbonus' => $seedbonus));
$mc1->commit_transaction($INSTALLER09['expires']['u_stats']);
$mc1->begin_transaction('user_stats_'.$userid);
$mc1->update_row(false, array('seedbonus' => $seedbonus, 'bonuscomment' => $bonuscomment));
$mc1->commit_transaction($INSTALLER09['expires']['user_stats']);
$mc1->delete_value('freecontribution_');
$mc1->delete_value('top_donators_');
$mc1->delete_value('freeleech_counter');
$mc1->delete_value('freeleech_counter_alerts_');
$mc1->delete_value('freecontribution_datas_');
$mc1->delete_value('freecontribution_datas_alerts_');
write_bonus_log($CURUSER["id"], $donation, $type = "freeleech");
$Remaining = ($arr_points['points'] - $arr_points['pointspool'] - $donation);
$msg = $CURUSER['username']. " Donated ".$donation." karma point".($donation > 1?'s':'')." into the freeleech contribution pot ! * Only [b]".htmlsafechars($Remaining)."[/b] more karma point".($Remaining > 1?'s':'')." to go! * [color=green][b]Freeleech contribution:[/b][/color] [url={$INSTALLER09['baseurl']}/mybonus.php]". $donation ."/".$points.'[/url]';
$mc1->delete_value('shoutbox_');
autoshout($msg);
header("Refresh: 0; url={$INSTALLER09['baseurl']}/mybonus.php?freeleech_success=2");
die;
}
die;
break;
//--- doubleupload
case 'doubleup':
$points2 = 59999; //== Adjust so that its you can only contribute 1 point under the the bonus option amount doubled - current 30000 x 2 = 60000 - 1 = 59999
$pointspool = (int)$arr_points['pointspool'];
$donation = (int)$_POST['donate'];
$seedbonus = ($bonus - $donation);
if($bonus < $donation || $donation <= 0 || $donation > $points2){
stderr("Error", " <br />Points: ".(float)$donation." <br /> Bonus: ".(float)$bonus." <br /> Donation: ".(float)$donation." <br />Time shall unfold what plighted cunning hides\n\nWho cover faults, at last shame them derides.<br /> Click to go back to your <a class='altlink' href='./mybonus.php'>Karma Bonus Point</a> page.<br />");
die;
}
if(($pointspool + $donation) >= $arr_points["points"]){
$now = TIME_NOW;
$end = (86400 * 3 + TIME_NOW);
$message = sqlesc("DoubleUpload [ON]");
sql_query("INSERT INTO events(userid, overlayText, startTime, endTime, displayDates, duploadEnabled) VALUES (".sqlesc($userid).", $message, $now, $end, 1, 1)") or sqlerr(__FILE__, __LINE__);
$norefund = ($donation + $pointspool) % $points;
$bonuscomment = get_date( TIME_NOW, 'DATE', 1 ) . " - " .$donation. " Points contributed for doubleupload.\n " .$bonuscomment;
sql_query("UPDATE users SET seedbonus = ".sqlesc($seedbonus).", bonuscomment = ".sqlesc($bonuscomment)." WHERE id = ".sqlesc($userid)) or sqlerr(__FILE__, __LINE__);
sql_query("UPDATE bonus SET pointspool = ".sqlesc($norefund)." WHERE id = '12' LIMIT 1") or sqlerr(__FILE__, __LINE__);
$mc1->begin_transaction('userstats_'.$userid);
$mc1->update_row(false, array('seedbonus' => $seedbonus));
$mc1->commit_transaction($INSTALLER09['expires']['u_stats']);
$mc1->begin_transaction('user_stats_'.$userid);
$mc1->update_row(false, array('seedbonus' => $seedbonus, 'bonuscomment' => $bonuscomment));
$mc1->commit_transaction($INSTALLER09['expires']['user_stats']);
$mc1->delete_value('freecontribution_');