/ales/666remove.php
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
- <?
- require_once('config.php');
- global $wpdb;
- $link = mysql_connect($mysql_hostname, $mysql_user, $mysql_password);
- mysql_set_charset('utf8',$link);
- if ($_REQUEST['b'])
- {
- $brand=trim($_REQUEST['b']);
- }
- else
- {
- $brand=1;
- }
- if ($_REQUEST['rate'] && $_REQUEST['rate']=1)
- {
- $sql="SELECT id
- FROM `wp_product_list`
- WHERE brand = ".$brand."
- AND category =666
- AND approved =1";
- $result = mysql_query($sql);
- //pokazh ($result);
-
- if (!$result) {die('Invalid query: ' . mysql_error());}
- while($row=mysql_fetch_array($result))
- {
- $file = fopen('http://cartoonbank.ru/wp-content/plugins/five-star-rating/fsr-ajax-stars.php?p='.$row['id'].'&fsr_stars=2', 'r');
- fclose($file);
-
- $sql1="INSERT ignore INTO `al_editors_votes` (`image_id`) VALUES (".$row['id'].")";
- //pokazh ($sql);
- mysql_query($sql1);
-
- }
- }
- // Execute
- if ($_REQUEST['id'] && $_REQUEST['category'])
- {
- $sql="update wp_fsr_post set votes = ".$_REQUEST['votes'].", points=".$_REQUEST['points']." where id=".$_REQUEST['id'];
- //pokazh ($sql);
- $result = mysql_query($sql);
- if (!$result) {die('Invalid query: ' . mysql_error());}
- $sql="update wp_product_list set category = ".$_REQUEST['category']." where id=".$_REQUEST['id'];
- //pokazh ($sql);
- $result = mysql_query($sql);
- if (!$result) {die('Invalid query: ' . mysql_error());}
- $sql="update wp_item_category_associations set category_id = ".$_REQUEST['category']." where product_id=".$_REQUEST['id'];
- //pokazh ($sql);
- $result = mysql_query($sql);
- if (!$result) {die('Invalid query: ' . mysql_error());}
- header("Location: http://cartoonbank.ru/ales/666remove.php?b=".$brand);
- }
- $sql = "
- SELECT AEV.image_id, AEV.up, AEV.down, (
- AEV.up *5 + AEV.down
- ) / ( AEV.up + AEV.down ) AS rateModer, WFP.votes, WFP.points, (
- WFP.points / WFP.votes
- ) AS rateVisitor, (
- AEV.up *5 + AEV.down + WFP.points
- ) / ( AEV.up + AEV.down + WFP.votes ) AS RateTotal,
- P.image
- FROM `al_editors_votes` AS AEV, `wp_fsr_post` AS WFP, `wp_product_list` AS P
- WHERE AEV.image_id = WFP.id
- AND P.id = WFP.id
- AND P.category = 666
- AND P.approved = '1'
- AND P.brand =".$brand."
- ORDER BY rateVisitor DESC
- LIMIT 1
- ";
- //pokazh($sql);
- $result = mysql_query($sql);
- if (!$result) {
- die('Invalid query: ' . mysql_error());
- }
- 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>';
- //echo '<br><a href="http://cartoonbank.ru/ales/666remove.php">?????????>>>>></a><br><br><br><br>';
- while($row=mysql_fetch_array($result))
- {
- $votes = $row['up'] + $row['down'] + $row['votes'];
- $points = $row['up']*5 + $row['down'] + $row['points'];
- $rate = $row['RateTotal'];
- echo '<img src="http://cartoonbank.ru/wp-content/plugins/wp-shopping-cart/product_images/'.$row['image'].'"><br>';
- echo '# '.$row['image_id'].': ????? ???????: '.$rate.'<br>';
- echo ' ??????? ????? ?????????: <br>';
- echo ' <a href="?id='.$row['image_id'].'&category=4&votes='.$votes.'&points='.$points.'&b='.$brand.'">??????????</a>: <br>';
- echo ' <a href="?id='.$row['image_id'].'&category=5&votes='.$votes.'&points='.$points.'&b='.$brand.'">??????</a>: <br>';
- echo ' <a href="?id='.$row['image_id'].'&category=11&votes='.$votes.'&points='.$points.'&b='.$brand.'">??????</a>: <br>';
- echo ' <a href="?id='.$row['image_id'].'&category=14&votes='.$votes.'&points='.$points.'&b='.$brand.'">????</a>: <br>';
- echo ' <a href="?id='.$row['image_id'].'&category=6&votes='.$votes.'&points='.$points.'&b='.$brand.'">?????</a>: <br>';
- echo ' <a href="?id='.$row['image_id'].'&category=15&votes='.$votes.'&points='.$points.'&b='.$brand.'">?????</a>: <br>';
- echo ' <a href="?id='.$row['image_id'].'&category=13&votes='.$votes.'&points='.$points.'&b='.$brand.'">??????</a>: <br><br><br>';
- }
- ?>
- 1 <a href="?b=1">????? ????????</a>
- 2 <a href="?b=2">??????? ??????</a>
- 3 <a href="?b=3">??????????? ???????</a>
- 4 <a href="?b=4">?????? ??????</a>
- 5 <a href="?b=5">????? ?????</a>
- 6 <a href="?b=6">??????? ??????</a>
- 7 <a href="?b=7">??????? ??????</a>
- 8 <a href="?b=8">?????? ?????</a>
- 9 <a href="?b=9">????? ??????</a>
- 11 <a href="?b=11">??????? ?????????</a>
- 12 <a href="?b=12">?????? ???????</a>
- 14 <a href="?b=14">?????????? ?????</a>
- 15 <a href="?b=15">?????? ????????</a>
- 16 <a href="?b=16">????????? ???????</a>
- 17 <a href="?b=17">???????? ?????</a>
- 18 <a href="?b=18">???????? ????</a>
- 19 <a href="?b=19">?????????? ???????</a>
- 20 <a href="?b=20">???????????? ?????</a>
- 21 <a href="?b=21">????? ??????</a>
- 22 <a href="?b=22">?????????? ???????</a>
- 23 <a href="?b=23">??????? ???????</a>
- 24 <a href="?b=24">??????? ????????</a>
- 25 <a href="?b=25">???? ???????</a>
- 26 <a href="?b=26">??????? ????</a>
- 27 <a href="?b=27">????????? ?????????</a>
- 29 <a href="?b=29">???????? ????????</a>
- 30 <a href="?b=30">??????? ????????</a>
- 31 <a href="?b=31">????? ?????????</a>
- 32 <a href="?b=32">??????? ???????</a>
- 33 <a href="?b=33">????????? ???????</a>
- 34 <a href="?b=34">????? ?????????</a>
- 35 <a href="?b=35">???????? ?????</a>
- 36 <a href="?b=36">?????? ????????</a>
- 37 <a href="?b=37">??????? ??????</a>
- 38 <a href="?b=38">??????????? ?????</a>
- 39 <a href="?b=39">??????? ??????</a>
- 40 <a href="?b=40">????? ?????</a>
- 41 <a href="?b=41">?????? ?????????</a>
- 42 <a href="?b=42">??????????? ?????</a>
- 43 <a href="?b=43">??????? ?????</a>
- 44 <a href="?b=44">????????? ???????</a>
- <?
- echo '</body></html>';
- //http://cartoonbank.ru/wp-content/plugins/five-star-rating/fsr-ajax-stars.php?id=FSR_form_11696&value=3
- ?>