/wp-content/plugins/wp-shopping-cart/display-items.php
PHP | 1189 lines | 937 code | 163 blank | 89 comment | 216 complexity | 39d0773d488d2d2652cc63ce0566d9e4 MD5 | raw file
Possible License(s): GPL-3.0, GPL-2.0, LGPL-2.1, AGPL-1.0, LGPL-3.0
Large files files are truncated, but you can click here to view the full file
- <style>
- .tdc2{
- text-align:center;
- line-height:1em;
- background-color:#FFFFFF;
- padding:2px;
- }
- td.r{
- text-align: right;
- vertical-align: top;
- width: 150px;
- }
- td.ralt{
- text-align: right;
- background-color:#FFFF00;
- vertical-align: top;
- }
- td.lalt{
- text-align: left;
- background-color:#FFFF00;
- vertical-align: top;
- }
- </style>
- <?php
- // Filter for authors
- // pokazh($current_user->wp_capabilities['author'],"wp_capabilities"); // ?????
- // pokazh($current_user->wp_capabilities['administrator'],"wp_capabilities"); ?????
-
- global $user_brand;
-
- $_SITEURL = get_option('siteurl');
-
- if (isset($current_user->ID) && is_numeric($current_user->ID))
- {
- $user_id = $current_user->ID;
- $sql = "SELECT * FROM `wp_product_brands` where user_id=".$user_id;
- $user_brand = $wpdb->get_results($sql,ARRAY_A);
- }
-
- if (isset($user_brand[0]['id']))
- {
- $user_brand = $user_brand[0]['id'];
- }
- else
- {
- $user_brand = 0;
- }
-
- $author_group_sql = " AND `wp_product_list`.`brand` = '".$user_brand."' ";
-
- if (isset($current_user->wp_capabilities['administrator']))
- {
- $author_group_sql = "";
- }
- if (isset($current_user->wp_capabilities['editor']))
- {
- $author_group_sql = "";
- }
-
-
- $category_data = null;
- $basepath = str_replace("/wp-admin", "" , getcwd());
- $basepath = str_replace("\\wp-admin", "" , $basepath);
-
- $imagedir = $basepath."/wp-content/plugins/wp-shopping-cart/images/";
- $product_images = $basepath."/wp-content/plugins/wp-shopping-cart/product_images/";
- $filedir = $basepath."/wp-content/plugins/wp-shopping-cart/files/";
-
- $preview_clips_dir = $basepath."/wp-content/plugins/wp-shopping-cart/preview_clips/";
- $image = '';
- global $authors;
-
- // update preview
- if (isset($_GET['updateimage']))
- {
-
- $id = $_GET['updateimage'];
- $fileid_data = $wpdb->get_results("SELECT `file` FROM `wp_product_list` WHERE `id` = '$id' LIMIT 1",ARRAY_A);
- $fileid = $fileid_data[0]['file'];
- $file_data = $wpdb->get_results("SELECT * FROM `wp_product_files` WHERE `id` = '$fileid' LIMIT 1",ARRAY_A);
- $idhash = $file_data[0]['idhash'];
-
-
- if (file_exists($filedir.$idhash))
- {
- $mimetype = $file_data[0]['mimetype'];
- $filename = $file_data[0]['filename'];
-
- $height = get_option('product_image_height');
- $width = get_option('product_image_width');
-
- $imagedir = $basepath."/wp-content/plugins/wp-shopping-cart/images/";
- $product_images = $basepath."/wp-content/plugins/wp-shopping-cart/product_images/";
- $filedir = $basepath."/wp-content/plugins/wp-shopping-cart/files/";
-
- copy($filedir.$idhash, $imagedir.$filename); // icon
- copy($filedir.$idhash, $product_images.$filename); // preview
-
- $imgsize = getimagesize($product_images.$filename);
- $file_w = $imgsize[0];
- $file_h = $imgsize[1];
-
- //ales here we replace slides to that from LG
- $chwidth = get_option('lg_pictwidth'); // crop size
- $chheight = get_option('lg_pictheight'); // crop size
- //$thatdir = $product_images; //destination dir
- $ifolder = ''; //subfolder for artist
- $file = $filename; //
- $resample_quality = 100; //image quality
-
- // slide
- al_create_resized_file($chwidth, $chheight, $product_images, $ifolder, $file, $resample_quality);
-
- // watremark
- $wm = $basepath."/img/watermark.png";
- wtrmark($product_images.$file,$wm);
-
- // icon
- al_create_cropped_file(140, 140, $imagedir, $ifolder, $file, $resample_quality);
- }
- else
- {
- echo "<div class='error'><b>WARNING:</b> original file is not found at: ".$filedir.$idhash." <br /></div>";
- }
- }
-
- // add product
- if(isset($_POST['submit_action']) && $_POST['submit_action'] == 'add') {
-
- if($_FILES['file']['name'] != null) {
-
- //upload_and_resize_and_watermark_images();
-
- //transliterate file
- $_FILES['file']['name'] = rus2translit($_FILES['file']['name']);
- //rename the file
- $_FILES['file']['name'] = uniqid('', true).$_FILES['file']['name'];
- //ales default upload
- if(!is_dir($product_images))
- {
- mkdir($product_images);
- }
- if(function_exists("getimagesize"))
- {
- switch(isset($_POST['image_resize']) && $_POST['image_resize'])
- {
- case 2:
- $height = $_POST['height'];
- $width = $_POST['width'];
- break;
-
- default:
- $height = get_option('product_image_height');
- $width = get_option('product_image_width');
- break;
- }
- copy($_FILES['file']['tmp_name'], $product_images.$_FILES['file']['name']);
- copy($_FILES['file']['tmp_name'], $imagedir.$_FILES['file']['name']);
-
- $imgsize = getimagesize($product_images.$_FILES['file']['name']);
- $file_w = $imgsize[0];
- $file_h = $imgsize[1];
-
- //ales here we replace slides to that from LG
- $chwidth = get_option('lg_pictwidth'); // crop size
- $chheight = get_option('lg_pictheight'); // crop size
- $thatdir = $product_images; //destination dir
- $ifolder = ''; //subfolder for artist
- $file = $_FILES['file']['name']; //
- $resample_quality = 100; //image quality
-
- al_create_resized_file($chwidth, $chheight, $thatdir, $ifolder, $file, $resample_quality);
- $wm = $basepath."/wp-content/plugins/wp-shopping-cart/images/watermark.png";
- wtrmark($thatdir.$file,$wm);
-
- // ales here we replace thumbs to that from LG
- $chwidth = $width; // crop size
- $chheight = $height; // crop size
- $thatdir = $imagedir; //destination dir
-
- al_create_cropped_file($chwidth, $chheight, $thatdir, $ifolder, $file, $resample_quality);
- $image = $wpdb->escape($_FILES['file']['name']);
-
- /// ales
- }
- else {
- move_uploaded_file($_FILES['file']['tmp_name'], ($imagedir.$_FILES['file']['name']));
- $image = $wpdb->escape($_FILES['file']['name']);
- }
- ///ales
-
- $timestamp = time();
- $wpdb->query("INSERT INTO `wp_product_files` ( `id` , `filename` , `mimetype` , `idhash` , `date` , `width`, `height`) VALUES ( '' , '', '', '', '$timestamp', '', '');");
- $fileid_raw = $wpdb->get_results("SELECT `id` FROM `wp_product_files` WHERE `date` = '$timestamp'",ARRAY_A);
- $fileid = $fileid_raw[0]['id'];
- $idhash = sha1($fileid);
- $mimetype = $_FILES['file']['type'];
- $splitname = explode(".",$_FILES['file']['name']);
- $splitname = array_reverse($splitname);
- $filename = $_FILES['file']['name'];
-
- if(move_uploaded_file($_FILES['file']['tmp_name'],($filedir.$idhash)))
- {
- $wpdb->query("UPDATE `wp_product_files` SET `filename` = '".$filename."', `mimetype` = '$mimetype', `idhash` = '$idhash', `width` = '$file_w', `height` = '$file_h' WHERE `id` = '$fileid' LIMIT 1");
- }
- $file = $fileid;
- }
- else
- {
- $file = '0';
- }
-
- if(isset($_POST['display_frontpage']) && $_POST['display_frontpage'] == "yes")
- {
- $display_frontpage = 1;
- }
- else
- {
- $display_frontpage = 0;
- }
-
- $temadnya = '0';
- $visible = '0';
- $approved = Null;
-
-
- if (isset($_POST['temadnya']) && $_POST['temadnya'] == 'on')
- {$temadnya = '1';} else {$temadnya = '0';}
- if (isset($_POST['approved']) && $_POST['approved'] == 'on')
- {$approved = '1';} else {$approved = '0';}
- if (isset($_POST['visible']) && $_POST['visible'] == 'on')
- $visible = '1';
- if (isset($_POST['colored']) && $_POST['colored'] == 'on'){$colored = '1'; }
- else{$colored="0";}
- if (isset($_POST['not_for_sale']) && $_POST['not_for_sale'] == 'on'){$not_for_sale = '1'; }
- else{$not_for_sale="0";}
- if (isset($_POST['portfolio']) && $_POST['portfolio'] == 'on'){$portfolio = '1'; }
- else{$portfolio="0";}
-
- if (isset($_POST['license1']) && $_POST['license1'] == 'on'){$license1 = '1'; }
- else{$license1="0";}
- if (isset($_POST['license2']) && $_POST['license2'] == 'on'){$license2 = '1'; }
- else{$license2="0";}
- if (isset($_POST['license3']) && $_POST['license3'] == 'on'){$license3 = '1'; }
- else{$license3="0";}
-
-
-
-
- // TODO: take it off to the SQL table
- // License prices
- // Category group 1
- $l1_price_cat1_default = 250;
- $l2_price_cat1_default = 500;
- $l3_price_cat1_default = 2500;
- // Category group 2
- $l1_price_cat2_default = 250;
- $l2_price_cat2_default = 500;
- $l3_price_cat2_default = 2500;
- //UPDATE `wp_product_list` SET l1_price = 200 WHERE id in (SELECT product_id from `wp_item_category_associations` WHERE category_id in (4,14,5,11));
-
- $category_id = $wpdb->escape($_POST['category'][0]);
-
- /*
- pokazh($category_id,"category_id");
- pokazh($_POST['category'],"_POST['category']");
- */
- switch($category_id)
- {
- case 4:
- case 14:
- case 5:
- case 11:
- $l1_price = $l1_price_cat1_default;
- $l2_price = $l2_price_cat1_default;
- $l3_price = $l3_price_cat1_default;
- break;
-
- case 13:
- case 8:
- case 15:
- case 6:
- $l1_price = $l1_price_cat2_default;
- $l2_price = $l2_price_cat2_default;
- $l3_price = $l3_price_cat2_default;
- break;
-
- default:
- $l1_price = $l1_price_cat1_default;
- $l2_price = $l2_price_cat1_default;
- $l3_price = $l3_price_cat1_default;
- break;
- }
-
- // unset not available licences
- if (!isset($license1)||$license1=='0'){$l1_price = '0';}
- if (!isset($license2)||$license2=='0'){$l2_price = '0';}
- if (!isset($license3)||$license3=='0'){$l3_price = '0';}
-
-
- if (isset($_POST['brand']) && is_numeric($_POST['brand']))
- {$_brand = $wpdb->escape($_POST['brand']);}
- else {$_brand = $user_brand;}
-
- $insertsql = "INSERT INTO `wp_product_list` ( `id`, `name`, `description`, `additional_description`, `file` , `image` , `category`, `brand`, `display_frontpage`, `visible`, `approved`, `color`, `not_for_sale`, `l1_price`, `l2_price`, `l3_price`) VALUES ('', '".$wpdb->escape(removeCrLf(htmlspecialchars($_POST['name'])))."', '".$wpdb->escape(removeCrLf(htmlspecialchars($_POST['description'])))."', '".$wpdb->escape(correct_comma(removeCrLf(htmlspecialchars($_POST['additional_description']))))."','".$file."', '".$image."', '".$category_id."', '".$_brand."', '$display_frontpage', '$visible', NULL, '$colored', '$not_for_sale', $l1_price, $l2_price, $l3_price);";
-
- // To send HTML mail, the Content-type header must be set
- $headers = 'MIME-Version: 1.0' . "\r\n";
- $headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
- $headers .= 'From: CartoonBank Robot <cartoonbank.ru@gmail.com>' . "\r\n";
-
- //mail($to, $subject, $message, $headers);
- //mail("igor.aleshin@gmail.com","new cartoon added",print_r($insertsql,true),$headers);
-
- if($wpdb->query($insertsql))
- {
- $new_id = mysql_insert_id();
- $product_id = $new_id;
-
- //mail("igor.aleshin@gmail.com","????????? ???????? ".$new_id,$new_id);
-
- $sql_purgery = "insert into al_editors_votes (image_id, up, down) values ('".$new_id."','0','0')";
- $wpdb->query($sql_purgery);
-
- if (get_option('editors_notification_send')=='1')
- {
-
- // aleshin
- $Current_ID = 16;
- $votecontent = "<html><head><title>Please vote!</title></head><body><a href='".$_SITEURL."/wp-admin/admin.php?page=purgatory/purgatory.php'>?????? ? ????????</a><br /><b>".$wpdb->escape(removeCrLf(htmlspecialchars($_POST['name'])))."</b><br />".$wpdb->escape(removeCrLf(htmlspecialchars($_POST['description'])))."<br />[".$wpdb->escape(removeCrLf(htmlspecialchars($_POST['additional_description'])))."]<br /><img src='".$_SITEURL."/wp-content/plugins/wp-shopping-cart/product_images/".$image."'> <br /><br /> <div> ???????????? ?? ???????:<br/> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=5' target='_blank'>5 - ???????</a> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=4' target='_blank'>4 - ??????</a> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=3' target='_blank'>3 - ???????</a> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=2' target='_blank'>2 - ?????</a> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=1' target='_blank'>1 - ?????</a> </div> </body></html>";
- mail("igor.aleshin@gmail.com","????? ???????? ? ????????!",$votecontent,$headers);
-
- // bogorad
- $Current_ID = 11;
- $votecontent = "<html><head><title>Please vote!</title></head><body><a href='".$_SITEURL."/wp-admin/admin.php?page=purgatory/purgatory.php'>?????? ? ????????</a><br /><b>".$wpdb->escape(removeCrLf(htmlspecialchars($_POST['name'])))."</b><br />".$wpdb->escape(removeCrLf(htmlspecialchars($_POST['description'])))."<br />[".$wpdb->escape(removeCrLf(htmlspecialchars($_POST['additional_description'])))."]<br /><img src='".$_SITEURL."/wp-content/plugins/wp-shopping-cart/product_images/".$image."'> <br /><br /> <div> ???????????? ?? ???????:<br/> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=5' target='_blank'>5 - ???????</a> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=4' target='_blank'>4 - ??????</a> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=3' target='_blank'>3 - ???????</a> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=2' target='_blank'>2 - ?????</a> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=1' target='_blank'>1 - ?????</a> </div> </body></html>";
- mail("vbogorad@mail.ru","????? ???????? ? ????????!",$votecontent,$headers);
-
- // shilov
- $Current_ID = 21;
- $votecontent = "<html><head><title>Please vote!</title></head><body><a href='".$_SITEURL."/wp-admin/admin.php?page=purgatory/purgatory.php'>?????? ? ????????</a><br /><b>".$wpdb->escape(removeCrLf(htmlspecialchars($_POST['name'])))."</b><br />".$wpdb->escape(removeCrLf(htmlspecialchars($_POST['description'])))."<br />[".$wpdb->escape(removeCrLf(htmlspecialchars($_POST['additional_description'])))."]<br /><img src='".$_SITEURL."/wp-content/plugins/wp-shopping-cart/product_images/".$image."'> <br /><br /> <div> ???????????? ?? ???????:<br/> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=5' target='_blank'>5 - ???????</a> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=4' target='_blank'>4 - ??????</a> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=3' target='_blank'>3 - ???????</a> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=2' target='_blank'>2 - ?????</a> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=1' target='_blank'>1 - ?????</a> </div> </body></html>";
- mail("vfshilov@gmail.com","????? ???????? ? ????????!",$votecontent,$headers);
-
- // popov
- $Current_ID = 90;
- $votecontent = "<html><head><title>Please vote!</title></head><body><a href='".$_SITEURL."/wp-admin/admin.php?page=purgatory/purgatory.php'>?????? ? ????????</a><br /><b>".$wpdb->escape(removeCrLf(htmlspecialchars($_POST['name'])))."</b><br />".$wpdb->escape(removeCrLf(htmlspecialchars($_POST['description'])))."<br />[".$wpdb->escape(removeCrLf(htmlspecialchars($_POST['additional_description'])))."]<br /><img src='".$_SITEURL."/wp-content/plugins/wp-shopping-cart/product_images/".$image."'> <br /><br /> <div> ???????????? ?? ???????:<br/> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=5' target='_blank'>5 - ???????</a> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=4' target='_blank'>4 - ??????</a> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=3' target='_blank'>3 - ???????</a> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=2' target='_blank'>2 - ?????</a> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=1' target='_blank'>1 - ?????</a> </div> </body></html>";
- mail("popov.a.a@bk.ru","????? ???????? ? ????????!",$votecontent,$headers);
-
- // alexandrov
- $Current_ID = 2;
- $votecontent = "<html><head><title>Please vote!</title></head><body><a href='".$_SITEURL."/wp-admin/admin.php?page=purgatory/purgatory.php'>?????? ? ????????</a><br /><b>".$wpdb->escape(removeCrLf(htmlspecialchars($_POST['name'])))."</b><br />".$wpdb->escape(removeCrLf(htmlspecialchars($_POST['description'])))."<br />[".$wpdb->escape(removeCrLf(htmlspecialchars($_POST['additional_description'])))."]<br /><img src='".$_SITEURL."/wp-content/plugins/wp-shopping-cart/product_images/".$image."'> <br /><br /> <div> ???????????? ?? ???????:<br/> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=5' target='_blank'>5 - ???????</a> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=4' target='_blank'>4 - ??????</a> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=3' target='_blank'>3 - ???????</a> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=2' target='_blank'>2 - ?????</a> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=1' target='_blank'>1 - ?????</a> </div> </body></html>";
- mail("Alexandrov_Vasil@mail.ru","????? ???????? ? ????????!",$votecontent,$headers);
-
- // elkin
- $Current_ID = 38;
- $votecontent = "<html><head><title>Please vote!</title></head><body><a href='".$_SITEURL."/wp-admin/admin.php?page=purgatory/purgatory.php'>?????? ? ????????</a><br /><b>".$wpdb->escape(removeCrLf(htmlspecialchars($_POST['name'])))."</b><br />".$wpdb->escape(removeCrLf(htmlspecialchars($_POST['description'])))."<br />[".$wpdb->escape(removeCrLf(htmlspecialchars($_POST['additional_description'])))."]<br /><img src='".$_SITEURL."/wp-content/plugins/wp-shopping-cart/product_images/".$image."'> <br /><br /> <div> ???????????? ?? ???????:<br/> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=5' target='_blank'>5 - ???????</a> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=4' target='_blank'>4 - ??????</a> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=3' target='_blank'>3 - ???????</a> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=2' target='_blank'>2 - ?????</a> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=1' target='_blank'>1 - ?????</a> </div> </body></html>";
- mail("elkin99@yandex.ru","????? ???????? ? ????????!",$votecontent,$headers);
-
- // stepanov
- $Current_ID = 62;
- $votecontent = "<html><head><title>Please vote!</title></head><body><a href='".$_SITEURL."/wp-admin/admin.php?page=purgatory/purgatory.php'>?????? ? ????????</a><br /><b>".$wpdb->escape(removeCrLf(htmlspecialchars($_POST['name'])))."</b><br />".$wpdb->escape(removeCrLf(htmlspecialchars($_POST['description'])))."<br />[".$wpdb->escape(removeCrLf(htmlspecialchars($_POST['additional_description'])))."]<br /><img src='".$_SITEURL."/wp-content/plugins/wp-shopping-cart/product_images/".$image."'> <br /><br /> <div> ???????????? ?? ???????:<br/> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=5' target='_blank'>5 - ???????</a> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=4' target='_blank'>4 - ??????</a> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=3' target='_blank'>3 - ???????</a> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=2' target='_blank'>2 - ?????</a> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=1' target='_blank'>1 - ?????</a> </div> </body></html>";
- mail("stevladimir@yandex.ru","????? ???????? ? ????????!",$votecontent,$headers);
-
- // sergeev
- $Current_ID = 28;
- $votecontent = "<html><head><title>Please vote!</title></head><body><a href='".$_SITEURL."/wp-admin/admin.php?page=purgatory/purgatory.php'>?????? ? ????????</a><br /><b>".$wpdb->escape(removeCrLf(htmlspecialchars($_POST['name'])))."</b><br />".$wpdb->escape(removeCrLf(htmlspecialchars($_POST['description'])))."<br />[".$wpdb->escape(removeCrLf(htmlspecialchars($_POST['additional_description'])))."]<br /><img src='".$_SITEURL."/wp-content/plugins/wp-shopping-cart/product_images/".$image."'> <br /><br /> <div> ???????????? ?? ???????:<br/> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=5' target='_blank'>5 - ???????</a> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=4' target='_blank'>4 - ??????</a> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=3' target='_blank'>3 - ???????</a> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=2' target='_blank'>2 - ?????</a> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=1' target='_blank'>1 - ?????</a> </div> </body></html>";
- mail("aserg48@gmail.com","????? ???????? ? ????????!",$votecontent,$headers);
-
- // smagin
- $Current_ID = 23;
- $votecontent = "<html><head><title>Please vote!</title></head><body><a href='".$_SITEURL."/wp-admin/admin.php?page=purgatory/purgatory.php'>?????? ? ????????</a><br /><b>".$wpdb->escape(removeCrLf(htmlspecialchars($_POST['name'])))."</b><br />".$wpdb->escape(removeCrLf(htmlspecialchars($_POST['description'])))."<br />[".$wpdb->escape(removeCrLf(htmlspecialchars($_POST['additional_description'])))."]<br /><img src='".$_SITEURL."/wp-content/plugins/wp-shopping-cart/product_images/".$image."'> <br /><br /> <div> ???????????? ?? ???????:<br/> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=5' target='_blank'>5 - ???????</a> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=4' target='_blank'>4 - ??????</a> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=3' target='_blank'>3 - ???????</a> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=2' target='_blank'>2 - ?????</a> <a style='display:block;padding:4px;margin:4px;size:24px;' href='".$_SITEURL."/wp-content/plugins/purgatory/moder_vote.php?ip=".$Current_ID."&id=".$new_id."&vote=1' target='_blank'>1 - ?????</a> </div> </body></html>";
- mail("m_smagin@mail.ru","????? ???????? ? ????????!",$votecontent,$headers);
- }
-
- if(isset ($_FILES['extra_image']) && ($_FILES['extra_image'] != null) && function_exists('edit_submit_extra_images'))
- {
- $var = edit_submit_extra_images($product_id);
- }
-
- $variations_procesor = new nzshpcrt_variations;
- if(isset($_POST['variation_values']) && $_POST['variation_values'] != null)
- {
- $variations_procesor->add_to_existing_product($product_id,$_POST['variation_values']);
- }
-
- $counter = 0;
- $item_list = '';
- if(count($_POST['category']) > 0)
- {
- foreach($_POST['category'] as $category_id)
- {
- $sql_delete = "DELETE `wp_item_category_associations`.* FROM `wp_item_category_associations` WHERE `product_id` = '".$product_id."'";
- $wpdb->query($sql_delete);
- $wpdb->query("INSERT INTO `wp_item_category_associations` ( `id` , `product_id` , `category_id` ) VALUES ('', '".$product_id."', '".$category_id."');");
- }
- }
- else
- {
- $default_cat = get_option('default_category');
- $check_existing = $wpdb->get_var("SELECT `id` FROM `wp_item_category_associations` WHERE `product_id` = ".$product_id." LIMIT 1");
- if($check_existing == null)
- {
- $wpdb->query("INSERT INTO `wp_item_category_associations` ( `id` , `product_id` , `category_id` ) VALUES ('', '".$product_id."', '".$default_cat."');");
- }
- }
-
- // insert temadnya
- if ($temadnya == '1') // insert category 777
- {
- $sql_temadnya = "insert into `wp_item_category_associations` (product_id, category_id) values ('".$product_id."','777')";
- $res = $wpdb->query($sql_temadnya);
- }
-
-
- $display_added_product = "filleditform(".$product_id.");";
-
- echo "<div class='updated'><p align='center'>???? ????????</p></div>";
- }
- else
- {
- echo "<div class='updated'><p align='center'>???? ?? ????????!</p></div>";
- }
- }
-
- if(isset($_GET['submit_action']) && $_GET['submit_action'] == "remove_set")
- {
- if(is_numeric($_GET['product_id']) && is_numeric($_GET['variation_assoc_id']))
- {
- $product_id = $_GET['product_id'];
- $variation_assoc_id = $_GET['variation_assoc_id'];
- $variation_association = $wpdb->get_results("SELECT * FROM `wp_variation_associations` WHERE `id` = '$variation_assoc_id' LIMIT 1",ARRAY_A);
- if($variation_association != null)
- {
- $variation_association = $variation_association[0];
- $variation_id = $variation_association['variation_id'];
- $delete_variation_sql = "DELETE FROM `wp_variation_associations` WHERE `id` = '$variation_assoc_id' LIMIT 1";
- $delete_value_sql = "DELETE FROM `wp_variation_values_associations` WHERE `product_id` = '$product_id' AND `variation_id` = '$variation_id'";
- $wpdb->query($delete_variation_sql);
- $wpdb->query($delete_value_sql);
- echo "<div class='updated'><p align='center'>".TXT_WPSC_PRODUCTHASBEENEDITED."</p></div>";
- }
- }
- }
-
- // edit product
- if(isset($_POST['submit_action']) && $_POST['submit_action'] == "edit")
- {
- //transliterate file
- $_FILES['file']['name'] = rus2translit($_FILES['file']['name']);
- //rename the file
- $_FILES['file']['name'] = uniqid('', true).$_FILES['file']['name'];
-
- $id = $_POST['prodid'];
- if(function_exists('edit_submit_extra_images'))
- {
- if(($_FILES['extra_image'] != null))
- {
- $var = edit_submit_extra_images($id);
- }
- }
- if(function_exists('edit_extra_images'))
- {
- $var = edit_extra_images($id);
- }
- //$basepath = str_replace("/wp-admin", "" , getcwd()); this defined at the top of the page
- $imagedir = $basepath."/wp-content/plugins/wp-shopping-cart/images/";
- $product_images = $basepath."/wp-content/plugins/wp-shopping-cart/product_images/";
- $filedir = $basepath."/wp-content/plugins/wp-shopping-cart/files/";
- $preview_clips_dir = $basepath."/wp-content/plugins/wp-shopping-cart/preview_clips/";
-
- if(($_FILES['file']['tmp_name'] != null) && ($_FILES['file']['name'] != null))
- {
- $id = $_POST['prodid'];
- $fileid_data = $wpdb->get_results("SELECT `file` FROM `wp_product_list` WHERE `id` = '$id' LIMIT 1",ARRAY_A);
- $fileid = $fileid_data[0]['file'];
- $file_data = $wpdb->get_results("SELECT `id`,`idhash` FROM `wp_product_files` WHERE `id` = '$fileid' LIMIT 1",ARRAY_A);
- $idhash = $file_data[0]['idhash'];
- $mimetype = $_FILES['file']['type'];
-
- $filename = $_FILES['file']['name'];
-
- if(!is_dir($product_images))
- {
- mkdir($product_images);
- }
- if(function_exists("getimagesize"))
- {
- switch(isset ($_POST['image_resize']) && $_POST['image_resize'])
- {
- case 2:
- $height = $_POST['height'];
- $width = $_POST['width'];
- break;
-
- default:
- $height = get_option('product_image_height');
- $width = get_option('product_image_width');
- break;
- }
- copy($_FILES['file']['tmp_name'], $product_images.$_FILES['file']['name']);
- copy($_FILES['file']['tmp_name'], $imagedir.$_FILES['file']['name']);
-
- $imgsize = getimagesize($product_images.$_FILES['file']['name']);
- $file_w = $imgsize[0];
- $file_h = $imgsize[1];
-
- //ales here we replace slides to that from LG
- $chwidth = get_option('lg_pictwidth'); // crop size
- $chheight = get_option('lg_pictheight'); // crop size
- $thatdir = $product_images; //destination dir
- $ifolder = ''; //subfolder for artist
- $file = $_FILES['file']['name']; //
- $resample_quality = 100; //image quality
-
- al_create_resized_file($chwidth, $chheight, $thatdir, $ifolder, $file, $resample_quality);
- $wm = $basepath."/wp-content/plugins/wp-shopping-cart/images/watermark.png";
- wtrmark($thatdir.$file,$wm);
-
- // ales here we replace thumbs to that from LG
- $chwidth = $width; // crop size
- $chheight = $height; // crop size
- $thatdir = $imagedir; //destination dir
-
- al_create_cropped_file($chwidth, $chheight, $thatdir, $ifolder, $file, $resample_quality);
- $image = $wpdb->escape($_FILES['file']['name']);
-
- /// ales
-
-
- }
- else {
- move_uploaded_file($_FILES['file']['tmp_name'], ($imagedir.$_FILES['file']['name']));
- $image = $wpdb->escape($_FILES['file']['name']);
- }
- //include("image_processing.php");
-
- if(move_uploaded_file($_FILES['file']['tmp_name'],($filedir.$idhash)))
- {
- $wpdb->query("UPDATE `wp_product_files` SET `filename` = '".$filename."', `mimetype` = '$mimetype', `width` = '$file_w', `height` = '$file_h' WHERE `id` = '".$file_data[0]['id']."' LIMIT 1");
- }
- }
-
- if(is_numeric($_POST['prodid']))
- {
- if(isset($_POST['image_resize']) && ($_POST['image_resize'] > 0) && ($image === ''))
- {
- $imagesql = "SELECT `image` FROM `wp_product_list` WHERE `id`=".$_POST['prodid']." LIMIT 1";
- $imagedata = $wpdb->get_results($imagesql,ARRAY_A);
- if($imagedata[0]['image'] != '')
- {
- $imagepath = $imagedir . $imagedata[0]['image'];
- switch($_POST['image_resize'])
- {
- case 0:
- $height = get_option('product_image_height');
- $width = get_option('product_image_width');
- break;
-
- case 1:
- $height = get_option('product_image_height');
- $width = get_option('product_image_width');
- break;
-
- case 2:
- $height = $_POST['height'];
- $width = $_POST['width'];
- break;
- }
- include("image_resize.php");
- }
- }
-
- if(is_numeric($_POST['prodid']))
- {
- $counter = 0;
- $item_list = '';
- if(count($_POST['category']) > 0)
- {
- foreach($_POST['category'] as $category_id)
- {
- $check_existing = $wpdb->get_var("SELECT `id` FROM `wp_item_category_associations` WHERE `product_id` = ".$id." AND `category_id` = '$category_id' LIMIT 1");
- if($check_existing == null)
- {
- $wpdb->query("INSERT INTO `wp_item_category_associations` ( `id` , `product_id` , `category_id` ) VALUES ('', '".$id."', '".$category_id."');");
- }
- if($counter > 0)
- {
- $item_list .= ", ";
- }
- $item_list .= "'".$category_id."'";
- $counter++;
- }
- }
- else
- {
- $item_list = "'0'";
- }
- $sql_delete_query = "DELETE FROM `wp_item_category_associations` WHERE `product_id`= '$id' AND `category_id` NOT IN (".$item_list.")";
- $wpdb->query($sql_delete_query);
- }
-
- if(isset($_POST['display_frontpage']) && $_POST['display_frontpage'] == "yes")
- {
- $display_frontpage = 1;
- }
- else
- {
- $display_frontpage = 0;
- }
-
- $visible = '0';
- if (isset($_POST['visible']) && $_POST['visible'] == 'on')
- $visible = '1';
- if (isset($_POST['approved']) && $_POST['approved'] == 'on')
- {$approved = '1';} else {$approved = Null;}
- if (isset($_POST['colored']) && $_POST['colored'] == 'on'){$colored = '1';}
- else {$colored = '0';}
- if (isset($_POST['temadnya']) && $_POST['temadnya'] == 'on'){$temadnya = '1';}
- else {$temadnya = '0';}
- if (isset($_POST['not_for_sale']) && $_POST['not_for_sale'] == 'on'){$not_for_sale = '1';}
- else {$not_for_sale = '0';}
-
-
- if (isset($_POST['license1']) && $_POST['license1'] == 'on'){$license1 = '1'; }
- else{$license1="0";}
- if (isset($_POST['license2']) && $_POST['license2'] == 'on'){$license2 = '1'; }
- else{$license2="0";}
- if (isset($_POST['license3']) && $_POST['license3'] == 'on'){$license3 = '1'; }
- else{$license3="0";}
-
-
- // TODO: take it off to the SQL table
- // License prices
- // Category group 1
- $l1_price_cat1_default = 250;
- $l2_price_cat1_default = 500;
- $l3_price_cat1_default = 2500;
- // Category group 2
- $l1_price_cat2_default = 250;
- $l2_price_cat2_default = 500;
- $l3_price_cat2_default = 2500;
- //UPDATE `wp_product_list` SET l1_price = 200 WHERE id in (SELECT product_id from `wp_item_category_associations` WHERE category_id in (4,14,5,11));
-
- $category_id = $wpdb->escape($_POST['category']);
- switch($category_id)
- {
- case 4:
- case 14:
- case 5:
- case 11:
- $l1_price = $l1_price_cat1_default;
- $l2_price = $l2_price_cat1_default;
- $l3_price = $l3_price_cat1_default;
- break;
-
- case 13:
- case 8:
- case 15:
- case 6:
- $l1_price = $l1_price_cat2_default;
- $l2_price = $l2_price_cat2_default;
- $l3_price = $l3_price_cat2_default;
- break;
-
- default:
- $l1_price = $l1_price_cat1_default;
- $l2_price = $l2_price_cat1_default;
- $l3_price = $l3_price_cat1_default;
- break;
- }
-
- // unset not available licences
- if (!isset($license1)||$license1=='0'){$l1_price = '0';}
- if (!isset($license2)||$license2=='0'){$l2_price = '0';}
- if (!isset($license3)||$license3=='0'){$l3_price = '0';}
-
- //
-
- if (isset($_POST['brand']) && is_numeric($_POST['brand']))
- {$_brand = $_POST['brand'];}
- else
- {$_brand = $user_brand;}
-
-
-
-
- if (isset($current_user->wp_capabilities['author']) && $current_user->wp_capabilities['author']==1)
- {
- $updatesql = "UPDATE `wp_product_list` SET `name` = '".$wpdb->escape(removeCrLf(htmlspecialchars($_POST['title'])))."', `description` = '".$wpdb->escape(removeCrLf(htmlspecialchars($_POST['description'])))."', `additional_description` = '".$wpdb->escape(correct_comma(removeCrLf(htmlspecialchars($_POST['additional_description']))))."', `category` = '".$wpdb->escape($_POST['category'][0])."', `brand` = '".$_brand."', `display_frontpage`='$display_frontpage', `visible`='$visible',`color`='$colored', `not_for_sale`='$not_for_sale', `l1_price`='$l1_price', `l2_price`='$l2_price', `l3_price`='$l3_price' WHERE `id`='".$_POST['prodid']."' LIMIT 1";
- }
- else
- {
- $updatesql = "UPDATE `wp_product_list` SET `name` = '".$wpdb->escape(removeCrLf(htmlspecialchars($_POST['title'])))."', `description` = '".$wpdb->escape(removeCrLf(htmlspecialchars($_POST['description'])))."', `additional_description` = '".$wpdb->escape(correct_comma(removeCrLf(htmlspecialchars($_POST['additional_description']))))."', `category` = '".$wpdb->escape($_POST['category'][0])."', `brand` = '".$_brand."', `display_frontpage`='$display_frontpage', `visible`='$visible', `approved`='$approved', `color`='$colored', `not_for_sale`='$not_for_sale', `l1_price`='$l1_price', `l2_price`='$l2_price', `l3_price`='$l3_price' WHERE `id`='".$_POST['prodid']."' LIMIT 1";
- }
-
- $wpdb->query($updatesql);
-
- // update temadnya
- if ($temadnya == '1') // insert category 777
- {
- $sql_temadnya = "insert into `wp_item_category_associations` (product_id, category_id) values ('".$_POST['prodid']."','777')";
- $wpdb->query($sql_temadnya);
- }
- elseif ($temadnya == '0') // remove category 777
- {
- $sql_temadnya = "delete from `wp_item_category_associations` where product_id=".$_POST['prodid']." and category_id='777'";
- $wpdb->query($sql_temadnya);
- }
-
-
-
- if($image != null)
- {
- $updatesql2 = "UPDATE `wp_product_list` SET `image` = '".$image."' WHERE `id`='".$_POST['prodid']."' LIMIT 1";
- $wpdb->query($updatesql2);
- }
- if(isset($_POST['deleteimage']) && $_POST['deleteimage'] == 1)
- {
- $updatesql2 = "UPDATE `wp_product_list` SET `image` = '' WHERE `id`='".$_POST['prodid']."' LIMIT 1";
- $wpdb->query($updatesql2);
- }
-
- $variations_procesor = new nzshpcrt_variations;
- if(isset($_POST['variation_values']) && $_POST['variation_values'] != null)
- {
- $variations_procesor->add_to_existing_product($_POST['prodid'],$_POST['variation_values']);
- }
-
- if(isset($_POST['edit_variation_values']) && $_POST['edit_variation_values'] != null)
- {
- $variations_procesor->edit_product_values($_POST['prodid'],$_POST['edit_variation_values']);
- }
-
- if(isset($_POST['edit_add_variation_values']) && $_POST['edit_add_variation_values'] != null)
- {
- $variations_procesor->edit_add_product_values($_POST['prodid'],$_POST['edit_add_variation_values']);
- }
-
- echo "<div class='updated'><p align='center'>".TXT_WPSC_PRODUCTHASBEENEDITED."</p></div>";
- }
- }
-
- if(isset($_GET['deleteid']) && is_numeric($_GET['deleteid']))
- {
- if (isset($current_user->wp_capabilities['administrator']) && $current_user->wp_capabilities['administrator']==1)
- {
- $deletesql = "UPDATE `wp_product_list` SET `active` = '0' WHERE `id`='".$_GET['deleteid']."' LIMIT 1";
- $wpdb->query($deletesql);
- }
-
- if (isset($current_user->wp_capabilities['editor']) && $current_user->wp_capabilities['editor']==1)
- {
- $deletesql = "UPDATE `wp_product_list` SET `active` = '0' WHERE `id`='".$_GET['deleteid']."' LIMIT 1";
- $wpdb->query($deletesql);
- }
-
- if (isset($current_user->wp_capabilities['author']) && $current_user->wp_capabilities['author']==1)
- {
- $deletesql = "UPDATE `wp_product_list` SET `active` = '0' WHERE `id`='".$_GET['deleteid']."' LIMIT 1";
- $wpdb->query($deletesql);
- }
- }
-
-
- /*
- * Gets the product list, commented to make it stick out more, as it is hard to notice
- */
-
- $items_on_page = 15;
- if(isset($_GET['offset']) && is_numeric($_GET['offset']))
- {
- $offset = $_GET['offset'];
- }
- else
- {
- $offset = 0;
- }
-
- if(current_user_can('publish_posts'))
- $visiblesql = " ";
- else
- $visiblesql = " AND `wp_product_list`.`visible`='1' ";
-
- $exclude_category_777 = " ";
-
- if(isset($_GET['catid']) && is_numeric($_GET['catid']))
- {
- // if we are getting items from only one category
- $sql = "SELECT `wp_product_list`.*,`wp_product_list`.`category` AS `category_id` FROM `wp_product_list` WHERE `wp_product_list`.`active`='1' ".$visiblesql.$author_group_sql.$exclude_category_777." AND `wp_product_list`.`category`='".$_GET['catid']."' order by wp_product_list.id DESC LIMIT ".$offset.",".$items_on_page;
-
- $category_count = $wpdb->get_results("SELECT COUNT(id) as count FROM `wp_product_list` WHERE `wp_product_list`.`active`='1' ".$visiblesql." AND `wp_product_list`.`category`='".$_GET['catid']."'",ARRAY_A);
-
- }
- else if (isset($_GET['brand']) && is_numeric($_GET['brand']))
- {
- // if we are getting items from only one brand
- $sql = "SELECT `wp_product_list`.*,`wp_product_list`.`category` AS `category_id` FROM `wp_product_list` WHERE `wp_product_list`.`active`='1' ".$visiblesql.$author_group_sql.$exclude_category_777." AND `wp_product_list`.`brand`='".$_GET['brand']."' order by wp_product_list.id DESC LIMIT ".$offset.",".$items_on_page;
-
- $category_count = $wpdb->get_results("SELECT COUNT(id) as count FROM `wp_product_list` WHERE `wp_product_list`.`active`='1' ".$visiblesql." AND `wp_product_list`.`brand`='".$_GET['brand']."'",ARRAY_A);
- }
- else
- {
- // if not, get everything that is not deleted (denoted by the active column, 1 = present, 0 = deleted, no real deletion because that would screw up the product log)
- $sql = "SELECT `wp_product_list`.*, `wp_product_list`.`category` AS `category_id` FROM `wp_product_list` WHERE `wp_product_list`.`active`='1' ".$visiblesql.$author_group_sql.$exclude_category_777." order by wp_product_list.id DESC LIMIT ".$offset.",".$items_on_page;
-
- $category_count = $wpdb->get_results("SELECT COUNT(id) as count FROM `wp_product_list` WHERE `wp_product_list`.`active`='1' ".$visiblesql.$author_group_sql.";",ARRAY_A);
-
- }
- $product_list = $wpdb->get_results($sql,ARRAY_A) ;
-
- $items_count = $category_count[0]['count'];
- ?>
-
- <div class="wrap">
- <h2><?php echo TXT_WPSC_DISPLAYPRODUCTS;?></h2>
-
- <?php
- echo "???????: ";
- echo topcategorylist($offset);
- echo (" ??? ".al_brandslist());
-
- ?>
-
- ?:<input type="text" value="000" id='editpicid' style="width:60px;">
- <a href="#" class="button add-new-h2" onclick="var editpicid=document.getElementById('editpicid').value;filleditform(editpicid.replace(/(^\s+)|(\s+$)/g, ''));return false;">??????????…
Large files files are truncated, but you can click here to view the full file