function categorylist($group_id, $product_id = '', $unique_id = '', $category_id = null, $iteration = 0) { /* * Displays the category forms for adding and editing products * Recurses to generate the branched view for subcategories */ global $wpdb; if (is_numeric($category_id)) { $values = $wpdb->get_results("SELECT * FROM `" . $wpdb->prefix . "product_categories` WHERE `group_id` IN ('{$group_id}') AND `active`='1' AND `category_parent` = '{$category_id}' ORDER BY `id` ASC", ARRAY_A); } else { $values = $wpdb->get_results("SELECT * FROM `" . $wpdb->prefix . "product_categories` WHERE `group_id` IN ('{$group_id}') AND `active`='1' AND `category_parent` = '0' ORDER BY `id` ASC", ARRAY_A); } foreach ((array) $values as $option) { if (is_numeric($product_id) && $product_id > 0) { $category_assoc = $wpdb->get_row("SELECT * FROM `" . $wpdb->prefix . "item_category_associations` WHERE `product_id` IN('" . $product_id . "') AND `category_id` IN('" . $option['id'] . "') LIMIT 1", ARRAY_A); //echo "<pre>".print_r($category_assoc,true)."</pre>"; if (is_numeric($category_assoc['id']) && $category_assoc['id'] > 0) { $selected = "checked='true'"; } } if (is_numeric($category_id) && $iteration > 0) { if ($iteration > 1) { if ($iteration > 3) { $output .= str_repeat(" ", $iteration); } $output .= str_repeat(" ", $iteration); } $output .= "- "; } $output .= "<input id='" . $unique_id . "category_form_" . $option['id'] . "' type='checkbox' {$selected} name='category[]' value='" . $option['id'] . "'><label for='" . $unique_id . "category_form_" . $option['id'] . "' >" . stripslashes($option['name']) . "</label><br />"; $output .= categorylist($group_id, $product_id, $unique_id, $option['id'], $iteration + 1); $selected = ""; } return $output; }
<div class="submit_form_lable"><label><?php echo SUBMIT_IMG; ?> *</label></div> <div class="submit_form_element"> <input type="file" name="thumbnail" id="thumbnail" /> <br /><?php echo SUBMIT_THUMBNAIL_MESSAGE; ?> </div> </div> <div class="submit_form_element_container"> <div class="submit_form_lable"><label><?php echo SUBMIT_CAT; ?> </label></div> <div class="submit_form_element"><select name="category"> <?php categorylist(0); ?> </select></div> </div> <input name="id" type="hidden" value="0" id="id0" /> <div class="submit_button_container"><input class="submit_button" name="Submit" type="submit" value="<?php echo CONTINUE_BUTTON; ?> " id="submit0" /></div> </form> </div>
<tr> <td class='itemfirstcol'> <?php echo TXT_WPSC_CATEGORISATION; ?> </td> <td> <?php $categorisation_groups = $wpdb->get_results("SELECT * FROM `{$wpdb->prefix}wpsc_categorisation_groups` WHERE `active` IN ('1')", ARRAY_A); foreach ($categorisation_groups as $categorisation_group) { $category_count = $wpdb->get_var("SELECT COUNT(*) FROM `{$wpdb->prefix}product_categories` WHERE `group_id` IN ('{$categorisation_group['id']}')"); if ($category_count > 0) { echo "<p>"; $category_group_name = str_replace("[categorisation]", $categorisation_group['name'], TXT_WPSC_PRODUCT_CATEGORIES); echo "<strong>" . $category_group_name . ":</strong><br>"; echo categorylist($categorisation_group['id'], false, 'add_'); echo "</p>"; } } ?> </td> </tr> <tr><td colspan='2'><div id='price_and_stock' class='postbox'> <h3> <a class="togbox">+</a> <?php echo TXT_WPSC_PRICE_AND_STOCK_CONTROL;
function nzshpcrt_getproductform($prodid) { global $wpdb, $nzshpcrt_imagesize_info, $current_user; /* * makes the product form * has functions inside a function */ //$sql = "SELECT * FROM `wp_product_list` WHERE `id`=$prodid LIMIT 1"; $sql = "SELECT wp_product_list.*, wp_product_files.width, wp_product_files.height, wp_product_files.mimetype FROM wp_product_list, wp_product_files WHERE wp_product_files.id=wp_product_list.file AND wp_product_list.id={$prodid} LIMIT 1"; $product_data = $wpdb->get_results($sql, ARRAY_A); $product = $product_data[0]; /* * for security reason add to url for hires images sid - last 6 simbols of idhash * */ $sql = "SELECT `idhash` FROM `wp_product_files` WHERE `id`=" . $product['file']; $idhash_data = $wpdb->get_results($sql, ARRAY_A); if ($idhash_data != null) { $idhash = "&sid=" . substr($idhash_data[0]['idhash'], -6); } $output = "<table>\n\r"; $output .= "<tr>\n\r"; $output .= "<td class='r'>"; $output .= "Автор: "; $output .= "</td>\n\r"; $output .= "<td>\n\r"; $output .= brandslist($product['brand']); $approved = 0; //pokazh($product,"product: "); //pokazh($current_user); if ($product['approved'] == '1') { $approved = " checked='checked'"; if (isset($current_user->wp_capabilities['administrator']) && $current_user->wp_capabilities['administrator'] == 1) { $output .= "<input type='checkbox' name='approved'" . $approved . "/> Утверждено."; } else { if (isset($current_user->wp_capabilities['editor']) && $current_user->wp_capabilities['editor'] == 1) { $output .= "<input type='checkbox' name='approved'" . $approved . "/> Утвержено."; } } $output .= "<div style='color:#669900'>Картинка находится в <b>хранилище банка</b></div>"; } elseif ($product['approved'] == '0') { $approved = ""; if (isset($current_user->wp_capabilities['administrator']) && $current_user->wp_capabilities['administrator'] == 1) { $output .= "<input type='checkbox' name='approved'" . $approved . "/> Утверждено."; } $output .= "<div style='color:#9900CC'>Картинка может находиться в <b>Рабочем столе</b></div>"; } else { $approved = ""; if (isset($current_user->wp_capabilities['administrator']) && $current_user->wp_capabilities['administrator'] == 1) { $output .= "<input type='checkbox' name='approved'" . $approved . "/> Утверждено."; } $output .= "<div style='color:#FF6600'>Картинка находится в <b>прихожей банка</b> в ожидании приёма</div>"; } $output .= "</td>\n\r"; $output .= "</tr>\n\r"; $output .= "<tr>\n\r"; $output .= "<td class='r'>"; $output .= "Название рисунка: "; $output .= "</td>\n\r"; $output .= "<td>"; $output .= "<input id='productnameedit' type='text' style='width:300px;' name='title' value='" . stripslashes($product['name']) . "' /> # <a href='" . SITEURL . "/?page_id=29&cartoonid=" . $product['id'] . "' target=_blank>" . $product['id'] . "</a>"; $output .= "</td>\n\r"; $output .= "</tr>\n\r"; $output .= "<tr>\n\r"; $output .= "<td class='r'>"; $output .= "Краткое описание: "; $output .= "</td>\n\r"; $output .= "<td>"; $output .= "<textarea id='productdescredit' name='description' cols='50' rows='4' >" . stripslashes($product['description']) . "</textarea>"; $output .= "</td>\n\r"; $output .= "</tr>\n\r"; $output .= "<tr>\n\r"; $output .= "<td class='r'>"; $output .= "Ключевые слова,<br />разделённые запятыми:<br>"; $output .= "<a href='" . SITEURL . "/ales/wordassociations/words.php?id=" . $product['id'] . "' target=_blank>добавить<br>ассоциаций</a>"; $output .= "</td>\n\r"; $output .= "<td>"; $output .= "<textarea id='tagsedit' name='additional_description' cols='50' rows='4' >" . stripslashes($product['additional_description']) . "</textarea>"; $output .= "</td>\n\r"; $output .= "</tr>\n\r"; $visible = ""; if ($product['visible'] == '1') { $visible = " checked='checked'"; } $output .= "<tr>\n\r"; $output .= "</tr>\n\r"; if (isset($current_user->wp_capabilities['administrator']) && $current_user->wp_capabilities['administrator'] == 1) { $output .= "<tr>\n\r"; $output .= "<td class='r'>"; $output .= "Видно всем:"; $output .= "</td>\n\r"; $output .= "<td>"; $output .= "<input type='checkbox' name='visible'" . $visible . "/> <span style='color:#999;'>Если выключить — не будет видно покупателям</span>"; $output .= "</td>\n\r"; $output .= "</tr>\n\r"; } $colored = ""; if ($product['color'] == '1') { $colored = " checked='checked' "; } $temadnya = ""; $istemadnya_sql = "SELECT * FROM `wp_item_category_associations` where `category_id` = '777' and `product_id` = " . $product['id']; //pokazh ($istemadnya_sql); $istemadnya = $wpdb->get_results($istemadnya_sql); if ($istemadnya != null) { $temadnya = " checked='checked' "; } //pokazh($istemadnya,"istemadnya: "); $not_for_sale = ""; if ($product['not_for_sale'] == '1') { $not_for_sale = " checked='checked' "; } $license1checked = ""; if ($product['l1_price'] != '0') { $license1checked = " checked='checked' "; } $license2checked = ""; if ($product['l2_price'] != '0') { $license2checked = " checked='checked' "; } $license3checked = ""; if ($product['l3_price'] != '0') { $license3checked = " checked='checked' "; } $output .= "<tr>\n\r"; $output .= "<td class='ralt'>"; $output .= "Цветной рисунок:"; $output .= "</td>\n\r"; $output .= "<td style='background-color:#FFFF33;'>"; $output .= "<input type='checkbox' name='colored'" . $colored . "/> <span style='color:#999;'>Отключите для ч/б рисунков</span>"; $output .= "</td>\n\r"; $output .= "</tr>\n\r"; $output .= "<tr>\n\r"; $output .= "<td class='r'>"; $output .= "Не для продажи:"; $output .= "</td>\n\r"; $output .= "<td>\n\r"; $output .= "<input type='checkbox' name='not_for_sale'" . $not_for_sale . "/> <span style='color:#999;'>Не продаётся, если включено</span>"; $output .= "</td>\n\r"; $output .= "</tr>\n\r"; $output .= "<tr>\n\r"; $output .= "<td>"; $basepath = str_replace("/wp-admin", "", getcwd()); if (file_exists($basepath . "/wp-content/plugins/wp-shopping-cart/product_images/" . $product['image'])) { $image_location = "product_images/" . $product['image']; } else { $image_location = "images/" . $product['image']; } $preview_location = "product_images/" . $product['image']; $icon_location = "images/" . $product['image']; $m_image_link = SITEURL . "/wp-content/plugins/wp-shopping-cart/" . $preview_location; $output .= "<a href='" . $m_image_link . "' target=_blank><img id='previewimage' src='" . SITEURL . "/wp-content/plugins/wp-shopping-cart/{$icon_location}' alt='" . TXT_WPSC_PREVIEW . "' title='" . TXT_WPSC_PREVIEW . "' /></a>"; $output .= "Ш х В: " . $product['width'] . "x" . $product['height'] . "<br>" . $product['mimetype']; $output .= "</td>\n\r"; $output .= "<td>\n\r"; $output .= categorylist($product['id']); /* if (isset($current_user->wp_capabilities['administrator']) && $current_user->wp_capabilities['administrator']==1) { $output .= categorylist($product['id']); } else { $output .= "После утверждения рисунка модераторами Категория может быть изменена администратором"; $output .= "<div style='display:none;'>".categorylist($product['id'])."</div>"; } */ $output .= "</td>\n\r"; $output .= "</tr>\n\r"; $output .= "<tr>\n\r"; $output .= "<td class='ralt'>"; $output .= "Тема дня::"; $output .= "</td>\n\r"; $output .= "<td class='lalt'>"; $output .= "<input type='checkbox' name='temadnya'" . $temadnya . "/> <span style='color:#999;'>считаю актуальной темой</span>"; $output .= "</td>\n\r"; $output .= "</tr>\n\r"; //if (isset($current_user->wp_capabilities['administrator']) && $current_user->wp_capabilities['administrator']==1){ $output .= "<tr>\n\r"; $output .= "<td class='r'>"; $output .= "Доступны лицензии:"; $output .= "</td>\n\r"; $output .= "<td>\n\r"; $output .= " Огр: <input id='license1' type='checkbox' name='license1'" . $license1checked . "> Станд: <input id='license2' type='checkbox' name='license2'" . $license2checked . "> Расш: <input id='license3' type='checkbox' name='license3'" . $license3checked . "><br />"; $output .= "</td>\n\r"; $output .= "</tr>\n\r"; //} $output .= "<tr>\n\r"; $output .= "<td colspan='2'>"; if (isset($current_user->wp_capabilities['administrator']) && $current_user->wp_capabilities['administrator'] == 1) { $output .= "<a href='admin.php?page=wp-shopping-cart/display-items.php&deleteid=" . $product['id'] . "' onclick='return conf();'><img src='../img/trash.gif' title='удалить'></a>"; } $output .= "<a href='admin.php?page=wp-shopping-cart/display-items.php&updateimage=" . $product['id'] . "' ><img src='" . SITEURL . "/img/reload.gif' title='Обновить иконку и слайд с водяными знаками'></a>"; $output .= " <a href='index.php?admin_preview=true&product_id=" . $product['id'] . $idhash . "' style='float: left;' ><img src='http://th.cartoonbank.ru/download.gif' title='Скачать оригинальный файл' /></a>"; $output .= "</td>\n\r"; $output .= "</tr>\n\r"; // download original image if ($product['file'] > 0) { if (is_numeric($product['file']) && $product['file'] > 0) { $file_data = $wpdb->get_results("SELECT * FROM `wp_product_files` WHERE `id`='" . $product['file'] . "' LIMIT 1", ARRAY_A); if ($file_data != null && $file_data[0]['mimetype'] == 'audio/mpeg' && function_exists('listen_button')) { $output .= " " . listen_button($file_data[0]['idhash']); } } $output .= "</td>\n\r"; $output .= "</tr>\n\r"; $output .= "<tr>\n\r"; $output .= "<td class='r'>"; $output .= "Заменить файл:"; $output .= "</td>\n\r"; $output .= "<td>\n\r"; $output .= "<input type='file' name='file' value='' /> <div style='color:#999;'>Это тот файл, ссылка на который<br />будет отправлена заказчику</div>"; $output .= "</td>\n\r"; $output .= "</tr>\n\r"; } $output .= "<tr>\n\r"; $output .= "<td>\n\r"; $output .= "</td>\n\r"; $output .= "<td>\n\r"; $output .= "<input type='hidden' name='prodid' value='" . $product['id'] . "' />"; $output .= "<input type='hidden' name='submit_action' value='edit' />"; $output .= "<br /><input type=\"button\" class='edit_button' style='padding:6px; background-color:#84DF88;' name='sendit' value='Сохранить изменения' onclick=\"checkthefieldsEditForm();\"/>"; if ($product['approved'] != '1' && isset($current_user->wp_capabilities['editor']) && $current_user->wp_capabilities['editor'] == 1) { $output .= "<br /><br /><br /><br /><a class='button' href='admin.php?page=wp-shopping-cart/display-items.php&deleteid=" . $product['id'] . "' onclick=\"return conf();\" ><img src='" . SITEURL . "/img/trash.gif'> стереть изображение!</a>"; } if ($product['approved'] == '1' && isset($current_user->wp_capabilities['administrator']) && $current_user->wp_capabilities['administrator'] == 1) { $output .= "<br /><br /><br /><br /><a class='button' href='admin.php?page=wp-shopping-cart/display-items.php&deleteid=" . $product['id'] . "' onclick=\"return conf();\" ><img src='" . SITEURL . "/img/trash.gif'> стереть изображение</a>"; } $output .= "</td>\n\r"; $output .= "</tr>\n\r"; $output .= "</table>\n\r"; // TODO: Remove before upload to the server! temp! local debug only! if ($_SERVER['SERVER_NAME'] == 'localhost') { $output = Utf8ToWin($output); } return $output; }
exit(); } if($filter){ if(filterBadWords($content) || filterBadWords($title)){ echo "Input Error!, bad word(s) found"; exit(); }else if(!is_valid_url($url)){ echo "Invalid URL!"; exit(); } } echo submitnew($username,$password,$status,$category,$url,$title,$content,$tags,$autovote); }else if($fn == 'list' || $fn == 'cate' || $fn == 'category'){ echo categorylist($username,$password); }else{ $gogo = 'http://api.jum.name/?action=check&ref='.curPageURL(); if(is_valid_url($gogo)) echo "Pligg API Version $version <br>Powered by <a href=\"http://api.jum.name\">Jum.name</a>"; else echo "Connection error!, <br>Try again <a href=\"".$_SERVER['PHP_SELF']."\">here</a>."; } function curPageURL() { $pageURL = 'http'; if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";} $pageURL .= "://"; if ($_SERVER["SERVER_PORT"] != "80") { $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; } else {
<div class="cat_form_element_container_small"> <div class="cat_form_lable"> <label>Sports</label> </div> <div class="cat_form_element"> <select name="category_sports"> <?php categorylist($feed_setting['category_sports']); ?> </select> </div> </div> <div class="cat_form_element_container_small"> <div class="cat_form_lable"> <label>Strategy</label> </div> <div class="cat_form_element"> <select name="category_strategy"> <?php categorylist($feed_setting['category_strategy']); ?> </select> </div> </div> </div> <br style="clear:both;"/><br /><div class="mochi_button_container"><input class="button" name="Submit" type="submit" value="Submit" /></div> </div> </form>
echo $r['height']; ?> " size="3" /> (<a href="#" onclick="GetDimensions(<?php echo $r['id']; ?> );return false">Auto</a>) </div></div> <div class="form_element_container"> <div class="form_lable"><label>Category</label></div> <div class="form_element"><select name="category" id="category<?php echo $r['id']; ?> "> <?php categorylist($r['category']); ?> </select></div> </div> <div class="form_element_container"> <div class="form_lable"><label>Advert</label></div> <div class="form_element"><select name="advert" id="advert<?php echo $r['id']; ?> "> <?php $cq = mysql_query("SELECT * FROM ava_adverts ORDER BY ad_name ASC"); if ($r['advert_id'] == 0) { echo '<option value="0" selected>None</option>';
echo $r['height']; ?> " size="3" /> (<a href="#" onclick="GetDimensions(<?php echo $r['id']; ?> );return false">Auto</a>) </div></div> <div class="form_element_container"> <div class="form_lable"><label>Category</label></div> <div class="form_element"><select name="category" id="category<?php echo $r['id']; ?> "> <?php categorylist($r['category_id']); ?> </select></div> </div> <div class="form_element_container"> <div class="form_lable"><label>Advert</label></div> <div class="form_element"><select name="advert" id="advert<?php echo $r['id']; ?> "> <?php $cq = mysql_query("SELECT * FROM ava_adverts ORDER BY ad_name ASC"); if ($r['advert_id'] == 0) { echo '<option value="0" selected>None</option>';
</tr> <tr> <td class='r'> Не для продажи: </td> <td> <input id='not_for_sale' type="checkbox" name="not_for_sale"> <span style="color:#999;">Не продаётся, если включено</span> </td> </tr> <tr> <td class='ralt'> Выберите<br />категорию: </td> <td class='lalt'> <?php echo categorylist(); ?> </td> </tr> <tr> <td class='r'> Тема дня: </td> <td> <input id='temadnya' type="checkbox" name="temadnya"> <span style="color:#999;">считаю актуальной темой</span> </td> </tr> <?php if (isset($current_user->wp_capabilities['administrator']) && $current_user->wp_capabilities['administrator'] == 1) { $stle = "style='display:none;"; } else {
function nzshpcrt_getproductform($prodid) { global $wpdb, $nzshpcrt_imagesize_info; $variations_processor = new nzshpcrt_variations(); /* * makes the product form * has functions inside a function */ function brandslist($current_brand = '') { global $wpdb; $options = ""; //$options .= "<option value=''>".TXT_WPSC_SELECTACATEGORY."</option>\r\n"; $values = $wpdb->get_results("SELECT * FROM `" . $wpdb->prefix . "product_brands` WHERE `active`='1' ORDER BY `id` ASC", ARRAY_A); $options .= "<option {$selected} value='0'>" . TXT_WPSC_SELECTABRAND . "</option>\r\n"; foreach ((array) $values as $option) { if ($current_brand == $option['id']) { $selected = "selected='selected'"; } $options .= "<option {$selected} value='" . $option['id'] . "'>" . $option['name'] . "</option>\r\n"; $selected = ""; } $concat .= "<select name='brand'>" . $options . "</select>\r\n"; return $concat; } function variationslist($current_variation = '') { global $wpdb; $options = ""; //$options .= "<option value=''>".TXT_WPSC_SELECTACATEGORY."</option>\r\n"; $values = $wpdb->get_results("SELECT * FROM `" . $wpdb->prefix . "product_variations` ORDER BY `id` ASC", ARRAY_A); $options .= "<option {$selected} value='0'>" . TXT_WPSC_PLEASECHOOSE . "</option>\r\n"; foreach ((array) $values as $option) { if ($current_brand == $option['id']) { $selected = "selected='selected'"; } $options .= "<option {$selected} value='" . $option['id'] . "'>" . $option['name'] . "</option>\r\n"; $selected = ""; } $concat .= "<select name='variations' onChange='edit_variation_value_list(this.options[this.selectedIndex].value)'>" . $options . "</select>\r\n"; return $concat; } $sql = "SELECT * FROM `" . $wpdb->prefix . "product_list` WHERE `id`={$prodid} LIMIT 1"; $product_data = $wpdb->get_results($sql, ARRAY_A); $product = $product_data[0]; $sql = "SELECT * FROM `" . $wpdb->prefix . "wpsc_productmeta` WHERE `product_id`={$prodid} AND meta_key='external_link' LIMIT 1"; $meta_data = $wpdb->get_results($sql, ARRAY_A); $product['external_link'] = $meta_data[0]['meta_value']; $sql = "SELECT * FROM `" . $wpdb->prefix . "wpsc_productmeta` WHERE `product_id`={$prodid} AND meta_key='merchant_notes' LIMIT 1"; $meta_data = $wpdb->get_results($sql, ARRAY_A); $product['merchant_notes'] = $meta_data[0]['meta_value']; $engrave = get_product_meta($prodid, 'engraved', true); $can_have_uploaded_image = get_product_meta($prodid, 'can_have_uploaded_image', true); if (function_exists('wp_insert_term')) { $term_relationships = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "term_relationships WHERE object_id = {$prodid}", ARRAY_A); foreach ((array) $term_relationships as $term_relationship) { $tt_ids[] = $term_relationship['term_taxonomy_id']; } foreach ((array) $tt_ids as $tt_id) { $results = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "term_taxonomy WHERE term_taxonomy_id = " . $tt_id . " AND taxonomy = 'product_tag'", ARRAY_A); $term_ids[] = $results[0]['term_id']; } foreach ((array) $term_ids as $term_id) { if ($term_id != NULL) { $results = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "terms WHERE term_id=" . $term_id . " ", ARRAY_A); $tags[] = $results[0]['name']; } } if ($tags != NULL) { $imtags = implode(',', $tags); } } $check_variation_value_count = $wpdb->get_var("SELECT COUNT(*) as `count` FROM `" . $wpdb->prefix . "variation_values_associations` WHERE `product_id` = '" . $product['id'] . "'"); $output .= " <table class='product_editform'>\n\r"; $output .= " <tr>\n\r"; $output .= " <td class='itemfirstcol'>\n\r"; $output .= TXT_WPSC_PRODUCTNAME . ": "; $output .= " </td>\n\r"; $output .= " <td class='itemformcol'>\n\r"; $output .= " <div class='admin_product_name'>\n\r"; $output .= " <input size='30' type='text' class='text' name='title' value='" . htmlentities(stripslashes($product['name']), ENT_QUOTES, 'UTF-8') . "' />\n\r"; $output .= "\t\t\t\t <a href='#' class='shorttag_toggle'></a>\n\r"; $output .= "\t\t\t\t <div class='admin_product_shorttags'>\n\r"; $output .= "\t\t\t\t <dl>\n\r"; // $output .= " <dt>Embed Product:</dt><dd>[buy_now_button={$product['id']}]</dd>\n\r"; // $output .= " <dt>Buy Now Button:</dt><dd></dd>\n\r"; $output .= "\t\t\t\t <dt>Buy Now Shortcode:</dt><dd>[buy_now_button={$product['id']}]</dd>\n\r"; $output .= "\t\t\t\t <dt>Buy Now PHP:</dt><dd><?php echo wpsc_buy_now_button({$product['id']}); ?></dd>\n\r"; $output .= "\t\t\t\t </dl>\n\r"; $output .= "\t\t\t\t <br clear='both' />\n\r"; $output .= "\t\t\t\t </div>\n\r"; $output .= " </div>\n\r"; $output .= " </td>\n\r"; $output .= " </tr>\n\r"; $output .= " <tr>\n\r"; $output .= " <td class='itemfirstcol'>\n\r"; $output .= TXT_WPSC_SKU . ": "; $output .= " </td>\n\r"; $output .= " <td class='itemformcol'>\n\r"; $sku = get_product_meta($product['id'], 'sku'); $sku = $sku[0]; $output .= "<input size='30' type='text' class='text' name='productmeta_values[sku]' value='" . htmlentities(stripslashes($sku), ENT_QUOTES, 'UTF-8') . "' />\n\r"; $output .= " </td>\n\r"; $output .= " </tr>\n\r"; $output .= " <tr>\n\r"; $output .= " <td class='itemfirstcol'>\n\r"; $output .= TXT_WPSC_PRODUCTDESCRIPTION . ": "; $output .= " </td>\n\r"; $output .= " <td class='itemformcol'>\n\r"; $output .= "<textarea name='description' cols='40' rows='8' >" . stripslashes($product['description']) . "</textarea>"; $output .= " </td>\n\r"; $output .= " </tr>\n\r"; $output .= " <tr>\n\r"; $output .= " <td class='itemfirstcol'>\n\r"; $output .= TXT_WPSC_ADDITIONALDESCRIPTION . ": "; $output .= " </td>\n\r"; $output .= " <td class='itemformcol'>\n\r"; $output .= "<textarea name='additional_description' cols='40' rows='8' >" . stripslashes($product['additional_description']) . "</textarea>"; $output .= " </td>\n\r"; $output .= " </tr>\n\r"; $output .= " <tr>\n\r"; $output .= " <td class='itemfirstcol'>\n\r"; $output .= TXT_WPSC_PRODUCT_TAGS . ": "; $output .= " </td>\n\r"; $output .= " <td class='itemformcol'>\n\r"; $output .= "<input type='text' class='text' name='product_tags' value='{$imtags}'><br /><span class='small_italic'>Seperate with commas</span>"; $output .= " </td>\n\r"; $output .= " </tr>\n\r"; // $output .="<tr><td> </td></tr>"; $output .= " <tr>\n\r"; $output .= " <td class='itemfirstcol'>" . TXT_WPSC_CATEGORISATION . ":</td>\n\r"; $output .= " <td>\n\r"; $categorisation_groups = $wpdb->get_results("SELECT * FROM `{$wpdb->prefix}wpsc_categorisation_groups` WHERE `active` IN ('1')", ARRAY_A); foreach ((array) $categorisation_groups as $categorisation_group) { $category_count = $wpdb->get_var("SELECT COUNT(*) FROM `{$wpdb->prefix}product_categories` WHERE `group_id` IN ('{$categorisation_group['id']}')"); if ($category_count > 0) { $output .= "<p>"; $category_group_name = str_replace("[categorisation]", $categorisation_group['name'], TXT_WPSC_PRODUCT_CATEGORIES); $output .= "<strong>" . $category_group_name . ":</strong><br>"; $output .= categorylist($categorisation_group['id'], $product['id'], 'edit_'); $output .= "</p>\n\r"; } } $output .= " </td>\n\r"; $output .= " </tr>\n\r"; $output .= "<tr><td colspan='2'><div id='edit_price_and_stock' class='postbox'>\n\t<h3>\n\t\t<a class='togbox'>+</a>"; $output .= "" . TXT_WPSC_PRICE_AND_STOCK_CONTROL . ""; $output .= " </h3> <div class='inside'> <table>"; $output .= " <tr>\n\r"; $output .= " <td>\n\r"; $output .= TXT_WPSC_PRICE . ": <input type='text' name='price' size='10' value='" . number_format($product['price'], 2, '.', '') . "' />"; $output .= " </td>\n\r"; $output .= " </tr>\n\r"; if ($product['notax'] == 1) { $checked = "checked='true'"; } else { $checked = ""; } $output .= " <tr>\n\r"; $output .= " <td>\n\r"; $output .= "<input id='tax' type='checkbox' name='notax' value='yes' {$checked} /> <label for='tax'>" . TXT_WPSC_TAXALREADYINCLUDED . "</label>"; $output .= " </td>\n\r"; $output .= " </tr>\n\r"; if ($product['donation'] == 1) { $checked = "checked='true'"; } else { $checked = ""; } $output .= " <tr>\n\r"; $output .= " <td>\n\r"; $output .= "<input id='edit_form_donation' type='checkbox' {$checked} name='donation' value='yes' /> <label for='edit_form_donation'>" . TXT_WPSC_IS_DONATION . "</label>"; $output .= " </td>\n\r"; $output .= " </tr>\n\r"; if ($product['no_shipping'] == 1) { $checked = "checked='true'"; } else { $checked = ""; } $output .= " <tr>\n\r"; $output .= " <td>\n\r"; $output .= "<input id='add_form_no_shipping' type='checkbox' {$checked} name='no_shipping' value='yes' /> <label for='add_form_no_shipping'>" . TXT_WPSC_NO_SHIPPING . "</label>"; $output .= " </td>\n\r"; $output .= " </tr>\n\r"; if ($product['special'] == 1) { $checked = "checked='true'"; } else { $checked = ""; } $output .= " <tr>\n\r"; $output .= " <td>\n\r"; $disable_form = ''; if ($check_variation_value_count > 0) { if ($product['special'] != 1) { $disable_form = "disabled='true'"; $disable_form_label = " style='color: #cccccc;'"; } } $output .= "<input id='form_special' type='checkbox' {$checked} name='special' {$disable_form} value='yes' onclick='hideelement(\"edit_special\")' /> <label for='form_special' {$disable_form_label}>" . TXT_WPSC_SPECIAL . "</label>"; if ($disable_form != '') { $output .= "<br /><span class='small'>" . TXT_WPSC_VARIATIONS_AND_SPECIALS_DONT_MIX . "<span>"; } if ($product['special'] == 1) { $output .= " <div id='edit_special' style='display: block;'>\n\r"; $output .= "<input type='text' name='special_price' value='" . number_format($product['price'] - $product['special_price'], 2, '.', '') . "' size='10' />"; } else { $output .= " <div id='edit_special' style='display: none;'>\n\r"; $output .= "<input type='text' name='special_price' value='0.00' size='10' />"; } $output .= " </div>\n\r"; $output .= " </td>\n\r"; $output .= " </tr>\n\r"; if ($product['quantity_limited'] == 1) { $checked = "checked='true'"; } else { $checked = ""; } $output .= " <tr>\n\r"; $output .= " <td style='width:350px;'>\n\r"; $output .= "<input id='form_quantity_limited' type='checkbox' {$checked} name='quantity_limited' value='yes' onclick='hideelement(\"edit_stock\")' /><label for='form_quantity_limited' class='small'>" . TXT_WPSC_UNTICKBOX . "</label>"; $variations_output = $variations_processor->variations_grid_view($product['id']); if ($variations_output != '') { //$output .= $variations_output; $output .= "<div id='edit_stock' style='display: none;'>\n\r"; $output .= "<input type='hidden' name='quantity' value='" . $product['quantity'] . "' />"; $output .= "</div>\n\r"; } else { switch ($product['quantity_limited']) { case 1: $output .= " <div id='edit_stock' style='display: block;'>\n\r"; break; default: $output .= " <div id='edit_stock' style='display: none;'>\n\r"; break; } $output .= "<input type='text' name='quantity' size='10' value='" . $product['quantity'] . "' />"; $output .= " </div>\n\r"; } $output .= "</td></tr>"; $output .= "\n </table></div></div></TD></tr>"; $output .= " </td>\n\r"; $output .= " </tr>\n\r"; ob_start(); do_action('wpsc_product_form', $product['id']); $output .= ob_get_contents(); ob_end_clean(); $output .= " <tr>\n\r"; $output .= " <td colspan='2'>\n\r"; $output .= "<div id='edit_variation' class='postbox closed'>\n <h3>\n\t\t<a class='togbox'>+</a>"; $output .= "" . TXT_WPSC_VARIATION_CONTROL . ""; $output .= " </h3>\n\t<div class='inside'>\n <table>"; $output .= " <tr>\n\r"; $output .= " <td>\n\r"; $output .= TXT_WPSC_ADD_VAR . ": "; $output .= " </td>\n\r"; $output .= " <td>\n\r"; $output .= variationslist(); if ($check_variation_value_count < 1) { $output .= " \t<div id='edit_variations_container'>\n\r"; $output .= " \t</div>\n\r"; } $output .= " </td>\n\r"; $output .= " </tr>\n\r"; if ($check_variation_value_count > 0) { $output .= " <tr>\n\r"; $output .= " <td>\n\r"; $output .= TXT_WPSC_EDIT_VAR . ": "; $output .= " </td>\n\r"; $output .= " <td>\n\r"; $output .= " <div id='edit_product_variations'>"; $output .= " </div>"; $output .= " \t<div id='edit_variations_container'>\n\r"; //$variations_processor = new nzshpcrt_variations; $output .= $variations_processor->display_attached_variations($product['id']); $output .= $variations_output; $output .= " \t</div>\n\r"; $output .= " </td>\n\r"; $output .= " </tr>\n\r"; } $output .= "</table></div></div></td></tr>"; $output .= " <tr>\n\r"; $output .= " <td colspan='2'>\n\r"; $output .= " <div class='postbox closed' id='edit_shipping'>\n\t <h3>\n\t\t <a class='togbox'>+</a>" . TXT_WPSC_SHIPPING_DETAILS . ""; $output .= "</h3>\n <div class='inside'>\n <table>"; if ($product['weight_unit'] == 'pound') { $unit1 = "selected='selected'"; } else { $unit2 = "selected='selected'"; } $output .= "<tr>\n\r"; $output .= "\t<td>\n\r"; $output .= "\t\t" . TXT_WPSC_WEIGHT . "\n\r"; $output .= "\t</td>\n\r"; $output .= "\t<td>\n\r"; $output .= "\t\t<input type='text' size='5' name='weight' value='" . $product['weight'] . "'>\n\r"; $output .= " <select name='weight_unit'>\n\r"; $output .= "\t\t\t<option {$unit1} value='pound'>Pounds</option>\n\r"; $output .= "\t\t\t<option {$unit2} value='once'>Ounce</option>\n\r"; $output .= "\t\t</select>\n\r"; $output .= "\t</td>\n\r"; $output .= "</tr>"; $output .= " <tr>\n\r"; $output .= " <td>"; $output .= TXT_WPSC_LOCAL_PNP; $output .= " </td>\n\r"; $output .= " <td>\n\r"; $output .= " <input type='text' size='10' name='pnp' value='" . $product['pnp'] . "' />\n\r"; $output .= " </td>\n\r"; $output .= " </tr>\n\r"; $output .= " <tr>\n\r"; $output .= " <td>"; $output .= TXT_WPSC_INTERNATIONAL_PNP; if ($product['international_pnp'] == 0) { $product['international_pnp'] = "0.00"; } $output .= " </td>\n\r"; $output .= " <td>\n\r"; $output .= " <input type='text' size='10' name='international_pnp' value='" . $product['international_pnp'] . "' />\n\r"; $output .= " </td>\n\r"; $output .= " </tr>\n\r"; $output .= "</table></div></div></td></tr>"; $output .= "<tr><td colspan='2'>"; $output .= "<div id='edit_advanced' class='postbox closed'>\n\t <h3>\n\t\t <a class='togbox'>+</a>"; $output .= TXT_WPSC_ADVANCED_OPTIONS; $output .= "</h3><div class='inside'>"; $output .= '<table>'; $output .= " <tr>\n\r"; $output .= " <td>\n\r"; $output .= TXT_WPSC_ADMINNOTES . ": "; $output .= " </td>\n\r"; $output .= " <td>\n\r"; $output .= "<textarea name='merchant_notes' cols='40' rows='3' >" . stripslashes($product['merchant_notes']) . "</textarea>"; $output .= " </td>\n\r"; $output .= " </tr>\n\r"; $output .= " <tr>\n\r"; $output .= " <td>\n\r"; $output .= " </td>\n\r"; $output .= " <td>\n\r"; if ($product['display_frontpage'] == 1) { $output .= "<input type='checkbox' checked='true' value='yes' name='display_frontpage' id='form_display_frontpage'/>\n\r"; } else { $output .= "<input type='checkbox' value='yes' name='display_frontpage' id='form_display_frontpage'/>\n\r"; } $output .= "<label for='form_display_frontpage'>" . TXT_WPSC_DISPLAY_FRONT_PAGE . "</form>"; $output .= " </td>\n\r"; $output .= " </tr>\n\r"; if ($engrave[0] == 'on') { $engra = "checked='checked'"; } $output .= " <tr>\n\r"; $output .= " <td>\n\r"; $output .= " </td>\n\r"; $output .= " <td>\n\r"; $output .= "<input type='hidden' name='productmeta_values[engraved]' value='0'>"; $output .= "<input {$engra} type='checkbox' name='productmeta_values[engraved]'>" . TXT_WPSC_ENGRAVE . "<br />"; $output .= " </td>\n\r"; $output .= " </tr>\n\r"; if ($can_have_uploaded_image[0] == 'on') { $can_have_uploaded_image_state = "checked='checked'"; } $output .= " <tr>\n\r"; $output .= " <td>\n\r"; $output .= " </td>\n\r"; $output .= " <td>\n\r"; $output .= "<input type='hidden' name='productmeta_values[can_have_uploaded_image]' value='0'>"; $output .= "<input {$can_have_uploaded_image_state} type='checkbox' name='productmeta_values[can_have_uploaded_image]'>" . TXT_WPSC_ALLOW_UPLOADING_IMAGE . "<br />"; $output .= " </td>\n\r"; $output .= " </tr>\n\r"; if (get_option('payment_gateway') == 'google') { $output .= " <tr>\n\r"; $output .= " <td>\n\r"; $output .= TXT_WPSC_PROHIBITED . ": "; $output .= " </td>\n\r"; $output .= " <td>\n\r"; $output .= "<input type='checkbox' name='productmeta_values[\"google_prohibited\"]'/> "; $output .= "Prohibited <a href='http://checkout.google.com/support/sell/bin/answer.py?answer=75724'>by Google?</a>"; $output .= " </td>\n\r"; $output .= " </tr>\n\r"; } $output .= " <tr>\n\r"; $output .= " <td>\n\r"; $output .= TXT_WPSC_PRODUCT_ID . ": "; $output .= " </td>\n\r"; $output .= " <td>\n\r"; $output .= $product['id']; $output .= " </td>\n\r"; $output .= " </tr>\n\r"; $output .= " <tr>\n\r"; $output .= " <td>\n\r"; $output .= TXT_WPSC_EXTERNALLINK . ": "; $output .= " </td>\n\r"; $output .= " <td>\n\r"; $output .= "<input type='text' class='text' value='" . $product['external_link'] . "' name='external_link' id='external_link' size='40'> "; $output .= " </td>\n\r"; $output .= " </tr>\n\r"; $output .= " <tr>\n\r"; $output .= " <td>\n\r"; $output .= " </td>\n\r"; $output .= " <td>\n\r"; $output .= TXT_WPSC_USEONLYEXTERNALLINK; $output .= " </td>\n\r"; $output .= " </tr>\n\r"; $output .= " <tr>\n\r"; $output .= " <td>\n\r"; $output .= TXT_WPSC_ADD_CUSTOM_FIELD; $output .= " </td>\n\r"; $output .= " <td>\n\r"; //foreach $output .= "<label></label>\n <div class='product_custom_meta'>\n\t\t<label >\n\t\t" . TXT_WPSC_NAME . "\n\t\t<input type='text' class='text' value='' name='new_custom_meta[name][]' >\n\t\t</label>\n\t\t\n\t\t<label >\n\t\t" . TXT_WPSC_VALUE . "\n\t\t<input type='text' class='text' value='' name='new_custom_meta[value][]' > \n\t\t</label>\t\t\n\t\t<a href='#' class='add_more_meta' onclick='return add_more_meta(this)'>+</a>\n\t <br />\n </div>\n "; $output .= " </td>\n\r"; $output .= " </tr>\n\r"; $custom_fields = $wpdb->get_results("SELECT * FROM `{$wpdb->prefix}wpsc_productmeta` WHERE `product_id` IN('{$product['id']}') AND `custom` IN('1') ", ARRAY_A); if (count($custom_fields) > 0) { $output .= " <tr>\n\r"; $output .= " <td>\n\r"; $output .= TXT_WPSC_EDIT_CUSTOM_FIELDS; $output .= " </td>\n\r"; $output .= " <td>\n\r"; //$i = 1; foreach ((array) $custom_fields as $custom_field) { $i = $custom_field['id']; // for editing, the container needs an id, I can find no other tidyish method of passing a way to target this object through an ajax request $output .= "\n\t\t\t<div class='product_custom_meta' id='custom_meta_{$i}'>\n\t\t\t\t<label for='custom_meta_name_{$i}'>\n\t\t\t\t" . TXT_WPSC_NAME . "\n\t\t\t\t<input type='text' class='text' value='{$custom_field['meta_key']}' name='custom_meta[{$i}][name]' id='custom_meta_name_{$i}'>\n\t\t\t\t</label>\n\t\t\t\t\n\t\t\t\t<label for='custom_meta_value_{$i}'>\n\t\t\t\t" . TXT_WPSC_VALUE . "\n\t\t\t\t<input type='text' class='text' value='{$custom_field['meta_value']}' name='custom_meta[{$i}][value]' id='custom_meta_value_{$i}'> \n\t\t\t\t</label>\n\t\t\t\t<a href='#' class='remove_meta' onclick='return remove_meta(this, {$i})'>–</a>\n\t\t\t\t<br />\n\t\t\t</div>\n\t\t\t"; } $output .= " </td>\n\r"; $output .= " </tr>\n\r"; } $output .= "</table></div></div></td></tr>"; $output .= " <tr>\n\r"; $output .= " <td colspan='2'>\n\r"; $output .= "<div id='edit_product_image' class='postbox'>\n <h3> \n\t\t<a class='togbox'>+</a>" . TXT_WPSC_PRODUCTIMAGE . ""; $output .= "</h3>\n\t<div class='inside'>\n\t<table>"; if (function_exists("getimagesize")) { if ($product['image'] != '') { $imagedir = WPSC_THUMBNAIL_DIR; $image_size = @getimagesize(WPSC_THUMBNAIL_DIR . $product['image']); $output .= " <tr>\n\r"; $output .= " <td>\n\r"; $output .= TXT_WPSC_RESIZEIMAGE . ": <br />"; $output .= "<span class='image_size_text'>" . $image_size[0] . "x" . $image_size[1] . "</span>"; $output .= " </td>\n\r"; $output .= " <td>\n\r"; $output .= "<table>"; // style='border: 1px solid black' $output .= " <tr>"; $output .= " <td style='height: 1em;'>"; $output .= "<input type='hidden' id='current_thumbnail_image' name='current_thumbnail_image' value='" . $product['thumbnail_image'] . "' />"; $output .= "<input type='radio' "; // if ($product['thumbnail_state'] == 0) { $output .= "checked='true'"; // } $output .= " name='image_resize' value='0' id='image_resize0' class='image_resize' onclick='hideOptionElement(null, \"image_resize0\")' /> <label for='image_resize0'> " . TXT_WPSC_DONOTRESIZEIMAGE . "<br />"; $output .= " </td>"; // Put lightbox here so doesn't move around with DHTML bits $output .= " <td rowspan=4>"; $image_link = WPSC_IMAGE_URL . $product['image']; $output .= "<a href='" . $image_link . "' rel='edit_product_1' class='thickbox preview_link'><img id='previewimage' src='{$image_link}' alt='" . TXT_WPSC_PREVIEW . "' title='" . TXT_WPSC_PREVIEW . "' />" . "</a>"; $output .= "<br /><span style=\"font-size: 7pt;\">" . TXT_WPSC_PRODUCT_IMAGE_PREVIEW . "</span><br /><br />"; if ($product['thumbnail_image'] != null) { $output .= "<a id='preview_link' href='" . WPSC_THUMBNAIL_URL . $product['thumbnail_image'] . "' rel='edit_product_2' class='thickbox'><img id='previewimage' src='" . WPSC_THUMBNAIL_URL . $product['thumbnail_image'] . "' alt='" . TXT_WPSC_PREVIEW . "' title='" . TXT_WPSC_PREVIEW . "' />" . "</a>"; $output .= "<br /><span style=\"font-size: 7pt;\">" . TXT_WPSC_PRODUCT_THUMBNAIL_PREVIEW . "</span><br />"; } //<div id='preview_button'><a id='preview_button' href='#'>".TXT_WPSC_PREVIEW."</a></div> // onclick='return display_preview_image(".$product['id'].")' $output .= " </td>"; $output .= " </tr>"; $output .= " <tr>"; $output .= " <td>"; $output .= "<input type='radio' "; if ($product['thumbnail_state'] == 1) { //$output .= "checked='true'"; } $output .= "name='image_resize' value='1' id='image_resize1' class='image_resize' onclick='hideOptionElement(null, \"image_resize1\")' /> <label for='image_resize1'>" . TXT_WPSC_USEDEFAULTSIZE . " (" . get_option('product_image_height') . "x" . get_option('product_image_width') . ")"; $output .= " </td>"; $output .= " </tr>"; $output .= " <tr>"; $output .= " <td>"; $output .= "<input type='radio' "; if ($product['thumbnail_state'] == 2) { // $output .= "checked='true'"; } $output .= " name='image_resize' value='2' id='image_resize2' class='image_resize' onclick='hideOptionElement(\"heightWidth\", \"image_resize2\")' /> <label for='image_resize2'>" . TXT_WPSC_USESPECIFICSIZE . " </label>\n\t\t\t<div id=\"heightWidth\" style=\"display: "; if ($product['thumbnail_state'] == 2) { $output .= "block;"; } else { $output .= "none;"; } $output .= "\">\n\t\t\t<input id='image_width' type='text' size='4' name='width' value='' /><label for='image_resize2'>" . TXT_WPSC_PXWIDTH . "</label>\n\t\t\t<input id='image_height' type='text' size='4' name='height' value='' /><label for='image_resize2'>" . TXT_WPSC_PXHEIGHT . " </label></div>"; $output .= " </td>"; $output .= " </tr>"; $output .= " <tr>"; $output .= " <td>"; $output .= "<input type='radio' "; if ($product['thumbnail_state'] == 3) { // $output .= "checked='true'"; } $output .= " name='image_resize' value='3' id='image_resize3' class='image_resize' onclick='hideOptionElement(\"browseThumb\", \"image_resize3\")' /> <label for='image_resize3'> " . TXT_WPSC_SEPARATETHUMBNAIL . "</label><br />"; $output .= "<div id='browseThumb' style='display: "; if ($product['thumbnail_state'] == 3) { $output .= "block"; } else { $output .= "none"; } $output .= ";'>\n\r<input type='file' name='thumbnailImage' size='15' value='' />"; $output .= "</div>\n\r"; $output .= " </td>"; $output .= " </tr>"; // }.pe $output .= "</table>"; $output .= " </td>\n\r"; $output .= " </tr>\n\r"; } } $output .= " <tr>\n\r"; $output .= " <td>\n\r"; $output .= " </td>\n\r"; $output .= " <td>\n\r"; $output .= TXT_WPSC_UPLOADNEWIMAGE . ": <br />"; $output .= "<input type='file' name='image' value='' />"; $output .= " </td>\n\r"; $output .= " </tr>\n\r"; if (function_exists("getimagesize")) { if ($product['image'] == '') { $output .= " <tr>\n\r"; $output .= " <td></td>\n\r"; $output .= " <td>\n\r"; $output .= "<table>\n\r"; if (is_numeric(get_option('product_image_height')) && is_numeric(get_option('product_image_width'))) { $output .= " <tr>\n\r"; $output .= " <td>\n\r"; $output .= " <input type='radio' name='image_resize' value='0' id='image_resize0' class='image_resize' onclick='hideOptionElement(null, \"image_resize0\");' /> <label for='image_resize0'>" . TXT_WPSC_DONOTRESIZEIMAGE . "</label>\n\r"; $output .= " </td>\n\r"; $output .= " </tr>\n\r"; $output .= " <tr>\n\r"; $output .= " <td>\n\r"; $output .= " <input type='radio' checked='true' name='image_resize' value='1' id='image_resize1' class='image_resize' onclick='hideOptionElement(null, \"image_resize1\");' /> <label for='image_resize1'>" . TXT_WPSC_USEDEFAULTSIZE . " (" . get_option('product_image_height') . "x" . get_option('product_image_width') . ")</label>\n\r"; $output .= " </td>\n\r"; $output .= " </tr>\n\r"; } $output .= " <tr>\n\r"; $output .= " <td>\n\r"; $output .= " <input type='radio' name='image_resize' value='2' id='image_resize2' class='image_resize' onclick='hideOptionElement(\"heightWidth\", \"image_resize2\");' />\n\r"; $output .= " <label for='image_resize2'>" . TXT_WPSC_USESPECIFICSIZE . "</label>\n\r"; $output .= " <div id='heightWidth' style='display: none;'>\n\r"; $output .= " <input type='text' size='4' name='width' value='' /><label for='image_resize2'>" . TXT_WPSC_PXWIDTH . "</label>\n\r"; $output .= " <input type='text' size='4' name='height' value='' /><label for='image_resize2'>" . TXT_WPSC_PXHEIGHT . "</label>\n\r"; $output .= " </div>\n\r"; $output .= " </td>\n\r"; $output .= " </tr>\n\r"; $output .= " <tr>\n\r"; $output .= " <td>\n\r"; $output .= " <input type='radio' name='image_resize' value='3' id='image_resize3' class='image_resize' onclick='hideOptionElement(\"browseThumb\", \"image_resize3\");' />\n\r"; $output .= " <label for='image_resize3'>" . TXT_WPSC_SEPARATETHUMBNAIL . "</label><br />"; $output .= " <div id='browseThumb' style='display: none;'>\n\r"; $output .= " <input type='file' name='thumbnailImage' value='' />\n\r"; $output .= " </div>\n\r"; $output .= " </td>\n\r"; $output .= " </tr>\n\r"; $output .= " </table>\n\r"; $output .= " </td>\n\r"; $output .= " </tr>\n\r"; } } $output .= " <tr>\n\r"; $output .= " <td>\n\r"; $output .= " </td>\n\r"; $output .= " <td>\n\r"; $output .= "<input id='delete_image' type='checkbox' name='deleteimage' value='1' /> "; $output .= "<label for='delete_image'>" . TXT_WPSC_DELETEIMAGE . "</label>"; $output .= " </td>\n\r"; $output .= " </tr>\n\r"; if (function_exists('edit_multiple_image_form')) { $output .= edit_multiple_image_form($product['id']); } $output .= "</table></div></div></td></tr>"; if ($product['file'] > 0) { $output .= " <tr>\n\r"; $output .= " <td colspan='2'>\n\r"; $output .= "<div id='edit_product_download' class='postbox closed'>\n <h3>\n\t\t<a class='togbox'>+</a>" . TXT_WPSC_PRODUCTDOWNLOAD . ""; $output .= " </h3>\n\t<div class='inside'>\n\t<table>"; $output .= " <tr>\n\r"; $output .= " <td>\n\r"; $output .= TXT_WPSC_PREVIEW_FILE . ": "; $output .= " </td>\n\r"; $output .= " <td>\n\r"; $output .= "<a class='admin_download' href='index.php?admin_preview=true&product_id=" . $product['id'] . "' style='float: left;' ><img align='absmiddle' src='" . WPSC_URL . "/images/download.gif' alt='' title='' /><span>" . TXT_WPSC_CLICKTODOWNLOAD . "</span></a>"; $file_data = $wpdb->get_row("SELECT * FROM `" . $wpdb->prefix . "product_files` WHERE `id`='" . $product['file'] . "' LIMIT 1", ARRAY_A); if ($file_data != null && function_exists('listen_button')) { $output .= "" . listen_button($file_data['idhash'], $file_data['id']); } $output .= " </td>\n\r"; $output .= " </tr>\n\r"; $output .= " <tr>\n\r"; $output .= " <td>\n\r"; $output .= TXT_WPSC_DOWNLOADABLEPRODUCT . ": "; $output .= " </td>\n\r"; $output .= " <td>\n\r"; $output .= "<input type='file' name='file' value='' /><br />"; $output .= wpsc_select_product_file($product['id']); $output .= " </td>\n\r"; $output .= " </tr>\n\r"; if (function_exists("make_mp3_preview") && $file_data['mimetype'] == 'audio/mpeg' || function_exists("wpsc_media_player")) { $output .= " <tr>\n\r"; $output .= " <td>\n\r"; $output .= TXT_WPSC_NEW_PREVIEW_FILE . ": "; $output .= " </td>\n\r"; $output .= " <td>\n\r"; $output .= "<input type='file' name='preview_file' value='' /><br />"; //$output .= "<span class='admin_product_notes'>".TXT_WPSC_PREVIEW_FILE_NOTE."</span>"; $output .= "<br /><br />"; $output .= " </td>\n\r"; $output .= " </tr>\n\r"; } } else { $output .= "<tr><td colspan='2'>"; $output .= "<div id='edit_product_download' class='postbox closed'>\n <h3>\n\t\t<a class='togbox'>+</a>" . TXT_WPSC_PRODUCTDOWNLOAD . ""; $output .= " </h3>\n\t<div class='inside'>\n\t<table>"; $output .= " <tr>"; $output .= " <td>"; // $output .= "".TXT_WPSC_DOWNLOADABLEPRODUCT.":"; $output .= " </td>"; $output .= " <td>"; $output .= " <input type='file' name='file' value='' />"; $output .= wpsc_select_product_file($product['id']); $output .= " </td>"; $output .= " </tr>"; } $output .= " </table></div></div></td></tr>"; $output .= " <tr>\n\r"; $output .= " <td>\n\r"; $output .= " </td>\n\r"; $output .= " <td>\n\r"; $output .= " <br />\n\r"; $output .= "<input type='hidden' name='prodid' id='prodid' value='" . $product['id'] . "' />"; $output .= "<input type='hidden' name='submit_action' value='edit' />"; $output .= "<input class='button' style='float:left;' type='submit' name='submit' value='" . TXT_WPSC_EDIT_PRODUCT . "' />"; $output .= "<a class='button delete_button' ' href='admin.php?page=" . WPSC_DIR_NAME . "/display-items.php&deleteid=" . $product['id'] . "' onclick=\"return conf();\" >" . TXT_WPSC_DELETE_PRODUCT . "</a>"; $output .= " <td>\n\r"; $output .= " </tr>\n\r"; $output .= " </table>\n\r"; return $output; }