Advertisement
Guest User

Untitled

a guest
Jul 27th, 2011
1,259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.11 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 1.1.3.0
  8. * @ Author : DeZender
  9. * @ Release on : 17.05.2011
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. function forceupdate() {
  15. global $backcheck;
  16. global $reranktime;
  17. global $reranks;
  18. global $uniquetime;
  19. global $trace_ip;
  20. global $frequentupdate;
  21. global $newhour;
  22. global $newday;
  23.  
  24. $recalculate = 0;
  25.  
  26. if ($ff = @fopen( 'datafiles/calctime.dat', 'r+' )) {
  27. flock( $ff, 2 );
  28. $calctime = array( );
  29. $calctime = explode( '|', fgets( $ff, 1024 ) );
  30. $nowtime = time( );
  31. $newhour = $newday = $clearip = 0;
  32.  
  33. if ($reranktime < $nowtime - $calctime[2]) {
  34. $newhour = 1;
  35. --$calctime[3];
  36. $calctime[2] += $reranktime;
  37.  
  38. if ($reranktime < $nowtime - $calctime[2]) {
  39. $calctime[2] = $nowtime;
  40. }
  41.  
  42. if ($calctime[3] <= 0) {
  43. $newday = 1;
  44. $calctime[3] = $reranks;
  45. }
  46.  
  47. if (30 < $calctime[3]) {
  48. $calctime[3] = 1;
  49. }
  50. }
  51.  
  52. if ($uniquetime < $nowtime - $calctime[1]) {
  53. $clearip = 1;
  54. $calctime[1] = $nowtime;
  55. }
  56.  
  57. fseek( $ff, 0 );
  58. fputs( $ff, $calctime[0] . '|' . $calctime[1] . '|' . $calctime[2] . '|' . $calctime[3] . '|' );
  59. $recalculate = 1;
  60. flock( $ff, 3 );
  61. fclose( $ff );
  62.  
  63. if ($clearip) {
  64. $i = 0;
  65.  
  66. while ($i <= 9) {
  67. $j = 0;
  68.  
  69. while ($j <= 9) {
  70. if ($fc = @fopen( 'datafiles/ips' . $i . $j . '.txt', 'w' )) {
  71. fwrite( $fc, '
  72. ' );
  73. fclose( $fc );
  74. }
  75.  
  76. ++$j;
  77. }
  78.  
  79. ++$i;
  80. }
  81. }
  82.  
  83. $backcheck = 0;
  84. recalculate( );
  85.  
  86. if (!$frequentupdate) {
  87. toplist_generate( );
  88. }
  89. }
  90.  
  91. }
  92.  
  93. function recalculate() {
  94. global $scripts_path;
  95. global $defaultgroup;
  96. global $nowtime;
  97. global $newhour;
  98. global $newday;
  99. global $badclickslimit;
  100. global $badlangratio;
  101. global $anticheatlink;
  102. global $affiliateid;
  103. global $email;
  104. global $sitename;
  105. global $scripts_path;
  106. global $mailstats;
  107. global $reranks;
  108. global $frequentupdate;
  109. global $linkback;
  110. global $backcheck;
  111. global $backwards;
  112. global $adcat;
  113. global $paydomainok;
  114. global $logip;
  115. global $rateby;
  116. global $resetmode;
  117. global $hclim;
  118. global $approve;
  119. global $jsp;
  120. global $CATEGORIES;
  121. global $WAP;
  122.  
  123. if (!checkdiscspace( )) {
  124. return null;
  125. }
  126.  
  127. if (!$nowtime) {
  128. $nowtime = time( );
  129. }
  130.  
  131. $today = date( 'm.d.Y', $nowtime );
  132. $dayweek = date( 'l', $nowtime );
  133. $daymonth = date( 'j', $nowtime );
  134. $month = date( 'm', $nowtime );
  135. $hour = date( 'H', $nowtime );
  136. $hitsin = $hitsout = $linktrack = $refurl = $lang = $popular = $clickpage = $useragent = $ip = array( );
  137. read_explode( 'datafiles/hitsin.dat', '
  138. ', $hitsin );
  139. read_explode( 'datafiles/hitsout.dat', '
  140. ', $hitsout );
  141. readunserialize( 'datafiles/linktrack.dat', $linktrack );
  142. readunserialize( 'datafiles/refurl.dat', $refurl );
  143. readunserialize( 'datafiles/lang.dat', $lang );
  144. readunserialize( 'datafiles/clickpage.dat', $clickpage );
  145. read_explode( 'datafiles/cheat.dat', '|', $popular );
  146. readunserialize( 'datafiles/useragent.dat', $useragent );
  147.  
  148. if ($ff = @fopen( 'datafiles/hitsin.dat', 'w' )) {
  149. fclose( $ff );
  150. }
  151.  
  152. if ($ff = @fopen( 'datafiles/hitsout.dat', 'w' )) {
  153. fclose( $ff );
  154. }
  155.  
  156. $totals = array( );
  157. $uniquetotal = $rawtotal = 0;
  158. $i = 0;
  159.  
  160. while ($i < sizeof( $hitsin )) {
  161. if ($hitsin[$i]) {
  162. $aa = array( );
  163. $aa = explode( '|', $hitsin[$i] );
  164.  
  165. if (!file_exists( 'memberfiles/' . $aa[0] . '.dat' )) {
  166. $aa[0] = 'auxout';
  167. }
  168.  
  169. if ($aa[0] == 'auxout') {
  170. $aa[4] = 0;
  171. }
  172.  
  173. ++$rawtotal;
  174. $uniquetotal += $aa[2];
  175. $found = 0;
  176. $loop = 0;
  177.  
  178. while ($loop < sizeof( $totals )) {
  179. $bb = array( );
  180. $bb = explode( '|', $totals[$loop] );
  181.  
  182. if ($bb[0] == $aa[0]) {
  183. ++$bb[4];
  184. $bb[1] += $aa[2];
  185. $bb[9] += $aa[4];
  186. $found = 1;
  187. $totals[$loop] = $bb[0] . '|' . $bb[1] . '|0|0|' . $bb[4] . '|0|0|0|0|' . $bb[9];
  188. break;
  189. }
  190.  
  191. ++$loop;
  192. }
  193.  
  194.  
  195. if ($found == 0) {
  196. $totals[] = $aa[0] . '|' . $aa[2] . '|0|0|1|0|0|0|0|' . $aa[4];
  197. }
  198. }
  199.  
  200. ++$i;
  201. }
  202.  
  203. $outtotal = 0;
  204. $i = 0;
  205.  
  206. while ($i < sizeof( $hitsout )) {
  207. if ($hitsout[$i]) {
  208. $aa = array( );
  209. $aa = explode( '|', $hitsout[$i] );
  210.  
  211. if (!file_exists( 'memberfiles/' . $aa[0] . '.dat' )) {
  212. $aa[0] = 'auxout';
  213. }
  214.  
  215. if (( !$nobadouts || !$aa[4] )) {
  216. if ($aa[0] != 'sponsor') {
  217. ++$outtotal;
  218. }
  219.  
  220. $found = 0;
  221. $loop = 0;
  222.  
  223. while ($loop < sizeof( $totals )) {
  224. $bb = array( );
  225. $bb = explode( '|', $totals[$loop] );
  226.  
  227. if ($bb[0] == $aa[0]) {
  228. ++$bb[2];
  229. $bb[9] += $aa[6];
  230. $found = 1;
  231. $totals[$loop] = $bb[0] . '|' . $bb[1] . '|' . $bb[2] . '|0|' . $bb[4] . '|0|0|0|0|' . $bb[9];
  232. break;
  233. }
  234.  
  235. ++$loop;
  236. }
  237.  
  238.  
  239. if ($found == 0) {
  240. $totals[] = $aa[0] . '|0|1|0|0|0|0|0|0|' . $aa[6];
  241. }
  242. }
  243. }
  244.  
  245. ++$i;
  246. }
  247.  
  248. $clicktotal = 0;
  249. $i = 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement