PageRenderTime 42ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/ales/666remove.php

http://cartonbank.googlecode.com/
PHP | 165 lines | 127 code | 29 blank | 9 comment | 10 complexity | 21ea198b730c6b8516465048e83ca0f7 MD5 | raw file
Possible License(s): GPL-3.0, GPL-2.0, LGPL-2.1, AGPL-1.0, LGPL-3.0
  1. <?
  2. require_once('config.php');
  3. global $wpdb;
  4. $link = mysql_connect($mysql_hostname, $mysql_user, $mysql_password);
  5. mysql_set_charset('utf8',$link);
  6. if ($_REQUEST['b'])
  7. {
  8. $brand=trim($_REQUEST['b']);
  9. }
  10. else
  11. {
  12. $brand=1;
  13. }
  14. if ($_REQUEST['rate'] && $_REQUEST['rate']=1)
  15. {
  16. $sql="SELECT id
  17. FROM `wp_product_list`
  18. WHERE brand = ".$brand."
  19. AND category =666
  20. AND approved =1";
  21. $result = mysql_query($sql);
  22. //pokazh ($result);
  23. if (!$result) {die('Invalid query: ' . mysql_error());}
  24. while($row=mysql_fetch_array($result))
  25. {
  26. $file = fopen('http://cartoonbank.ru/wp-content/plugins/five-star-rating/fsr-ajax-stars.php?p='.$row['id'].'&fsr_stars=2', 'r');
  27. fclose($file);
  28. $sql1="INSERT ignore INTO `al_editors_votes` (`image_id`) VALUES (".$row['id'].")";
  29. //pokazh ($sql);
  30. mysql_query($sql1);
  31. }
  32. }
  33. // Execute
  34. if ($_REQUEST['id'] && $_REQUEST['category'])
  35. {
  36. $sql="update wp_fsr_post set votes = ".$_REQUEST['votes'].", points=".$_REQUEST['points']." where id=".$_REQUEST['id'];
  37. //pokazh ($sql);
  38. $result = mysql_query($sql);
  39. if (!$result) {die('Invalid query: ' . mysql_error());}
  40. $sql="update wp_product_list set category = ".$_REQUEST['category']." where id=".$_REQUEST['id'];
  41. //pokazh ($sql);
  42. $result = mysql_query($sql);
  43. if (!$result) {die('Invalid query: ' . mysql_error());}
  44. $sql="update wp_item_category_associations set category_id = ".$_REQUEST['category']." where product_id=".$_REQUEST['id'];
  45. //pokazh ($sql);
  46. $result = mysql_query($sql);
  47. if (!$result) {die('Invalid query: ' . mysql_error());}
  48. header("Location: http://cartoonbank.ru/ales/666remove.php?b=".$brand);
  49. }
  50. $sql = "
  51. SELECT AEV.image_id, AEV.up, AEV.down, (
  52. AEV.up *5 + AEV.down
  53. ) / ( AEV.up + AEV.down ) AS rateModer, WFP.votes, WFP.points, (
  54. WFP.points / WFP.votes
  55. ) AS rateVisitor, (
  56. AEV.up *5 + AEV.down + WFP.points
  57. ) / ( AEV.up + AEV.down + WFP.votes ) AS RateTotal,
  58. P.image
  59. FROM `al_editors_votes` AS AEV, `wp_fsr_post` AS WFP, `wp_product_list` AS P
  60. WHERE AEV.image_id = WFP.id
  61. AND P.id = WFP.id
  62. AND P.category = 666
  63. AND P.approved = '1'
  64. AND P.brand =".$brand."
  65. ORDER BY rateVisitor DESC
  66. LIMIT 1
  67. ";
  68. //pokazh($sql);
  69. $result = mysql_query($sql);
  70. if (!$result) {
  71. die('Invalid query: ' . mysql_error());
  72. }
  73. echo '<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>????? ???????? ?????</title><style>a, a:hover{padding:2px;}a:hover{background-color:#99CCCC;}</style></head><body>';
  74. //echo '<br><a href="http://cartoonbank.ru/ales/666remove.php">?????????>>>>></a><br><br><br><br>';
  75. while($row=mysql_fetch_array($result))
  76. {
  77. $votes = $row['up'] + $row['down'] + $row['votes'];
  78. $points = $row['up']*5 + $row['down'] + $row['points'];
  79. $rate = $row['RateTotal'];
  80. echo '<img src="http://cartoonbank.ru/wp-content/plugins/wp-shopping-cart/product_images/'.$row['image'].'"><br>';
  81. echo '# '.$row['image_id'].': ????? ???????: '.$rate.'<br>';
  82. echo ' ??????? ????? ?????????: <br>';
  83. echo ' <a href="?id='.$row['image_id'].'&category=4&votes='.$votes.'&points='.$points.'&b='.$brand.'">??????????</a>: <br>';
  84. echo ' <a href="?id='.$row['image_id'].'&category=5&votes='.$votes.'&points='.$points.'&b='.$brand.'">??????</a>: <br>';
  85. echo ' <a href="?id='.$row['image_id'].'&category=11&votes='.$votes.'&points='.$points.'&b='.$brand.'">??????</a>: <br>';
  86. echo ' <a href="?id='.$row['image_id'].'&category=14&votes='.$votes.'&points='.$points.'&b='.$brand.'">????</a>: <br>';
  87. echo ' <a href="?id='.$row['image_id'].'&category=6&votes='.$votes.'&points='.$points.'&b='.$brand.'">?????</a>: <br>';
  88. echo ' <a href="?id='.$row['image_id'].'&category=15&votes='.$votes.'&points='.$points.'&b='.$brand.'">?????</a>: <br>';
  89. echo ' <a href="?id='.$row['image_id'].'&category=13&votes='.$votes.'&points='.$points.'&b='.$brand.'">??????</a>: <br><br><br>';
  90. }
  91. ?>
  92. 1 <a href="?b=1">????? ????????</a>
  93. 2 <a href="?b=2">??????? ??????</a>
  94. 3 <a href="?b=3">??????????? ???????</a>
  95. 4 <a href="?b=4">?????? ??????</a>
  96. 5 <a href="?b=5">????? ?????</a>
  97. 6 <a href="?b=6">??????? ??????</a>
  98. 7 <a href="?b=7">??????? ??????</a>
  99. 8 <a href="?b=8">?????? ?????</a>
  100. 9 <a href="?b=9">????? ??????</a>
  101. 11 <a href="?b=11">??????? ?????????</a>
  102. 12 <a href="?b=12">?????? ???????</a>
  103. 14 <a href="?b=14">?????????? ?????</a>
  104. 15 <a href="?b=15">?????? ????????</a>
  105. 16 <a href="?b=16">????????? ???????</a>
  106. 17 <a href="?b=17">???????? ?????</a>
  107. 18 <a href="?b=18">???????? ????</a>
  108. 19 <a href="?b=19">?????????? ???????</a>
  109. 20 <a href="?b=20">???????????? ?????</a>
  110. 21 <a href="?b=21">????? ??????</a>
  111. 22 <a href="?b=22">?????????? ???????</a>
  112. 23 <a href="?b=23">??????? ???????</a>
  113. 24 <a href="?b=24">??????? ????????</a>
  114. 25 <a href="?b=25">???? ???????</a>
  115. 26 <a href="?b=26">??????? ????</a>
  116. 27 <a href="?b=27">????????? ?????????</a>
  117. 29 <a href="?b=29">???????? ????????</a>
  118. 30 <a href="?b=30">??????? ????????</a>
  119. 31 <a href="?b=31">????? ?????????</a>
  120. 32 <a href="?b=32">??????? ???????</a>
  121. 33 <a href="?b=33">????????? ???????</a>
  122. 34 <a href="?b=34">????? ?????????</a>
  123. 35 <a href="?b=35">???????? ?????</a>
  124. 36 <a href="?b=36">?????? ????????</a>
  125. 37 <a href="?b=37">??????? ??????</a>
  126. 38 <a href="?b=38">??????????? ?????</a>
  127. 39 <a href="?b=39">??????? ??????</a>
  128. 40 <a href="?b=40">????? ?????</a>
  129. 41 <a href="?b=41">?????? ?????????</a>
  130. 42 <a href="?b=42">??????????? ?????</a>
  131. 43 <a href="?b=43">??????? ?????</a>
  132. 44 <a href="?b=44">????????? ???????</a>
  133. <?
  134. echo '</body></html>';
  135. //http://cartoonbank.ru/wp-content/plugins/five-star-rating/fsr-ajax-stars.php?id=FSR_form_11696&value=3
  136. ?>