Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Andrew J

Archived
  • Posts

    389
  • Joined

  • Last visited

Everything posted by Andrew J

  1. I'd like to add MaxiDVD Added WYSIWYG HTML Area Box + Admin Function to NewsDesk 1.48.3. NewsDesk has already a HTML area editor. I like MaxiDVD's editor and I use it everywhere in admin's textarea boxes cos I can paste any selected html thing into the textboxarea it will parse like html code. The current html editor of the NewsDesk contribution could not, that's because I want to get rid the old one and implement MaxiDVD's editor. Any help will be appreciated! Andrew
  2. The last update made by: "Updated version 1.6.0 (03/02/2004) by Eric Montgomery (Islander2u) [email protected]"
  3. Does anybody have a working NewsDesk 1.48.3 (admin/newsdesk.php) version with MaxiDVD Added WYSIWYG HTML Area Box + Admin Function?
  4. Be patient and a littlebit less offensive with the creator. He spent a lot of time here to help others just for "fun". I spent weeks to make it work with all other contributions. It is possible that you have some code that incompatible or interfere with EP or have some configuration problem.
  5. Hi Steve! How can I change the way on the index.php page how the Sticky and News and Information heading looks? In short which php file describes this? When I write a sticky about a new product it will be a COOL FEATURE if I can assign direct link to a product in the header of the article so the headline will be the link itself. If the article or news has the headline Logitech Driving Force Pro then the link should point to the product_info page. Can you help me to make it possible to control it through admin pe. with a "direct link to the product" input field under the headline input field? Previously I asked from you how can I remove the wyiswyg editor used by you cos I like to use HTML wyiswyg 1.7 wich can be assign to every necessary window in admin/newsdesk.php. The News and Information box on the index.php displays an image. I dont want to take me to the newsdesk_info.php page when I click on the image. How can I turn off this feature? Sorry for my poor english if something was not clear enough please let me know!
  6. part 2 $header_array[$key4] = $iii++; for ($i=0, $n=sizeof($languages); $i<$n; $i++) { $l_id = $languages[$i]['id']; $key5 = 'v_attribute_values_name_' . $attribute_options_count . '_' . $attribute_values_count . '_' . $l_id; $header_array[$key5] = $iii++; } $attribute_values_count++; } $attribute_options_count++; } $header_array['v_manufacturers_name'] = $iii++; $filelayout = array_merge($filelayout, $header_array); // VJ product attribs end // build the categories name section of the array based on the number of categores the user wants to have for($i=1;$i<$max_categories+1;$i++){ $filelayout = array_merge($filelayout, array('v_categories_name_' . $i => $iii++)); } $filelayout = array_merge($filelayout, array( 'v_tax_class_title' => $iii++, 'v_status' => $iii++, )); $filelayout_sql = "SELECT p.products_id as v_products_id, p.products_model as v_products_model, p.products_image as v_products_image, p.products_image_med as v_products_image_med, p.products_image_lrg as v_products_image_lrg, p.products_image_sm_1 as v_products_image_sm_1, p.products_image_xl_1 as v_products_image_xl_1, p.products_image_sm_2 as v_products_image_sm_2, p.products_image_xl_2 as v_products_image_xl_2, p.products_image_sm_3 as v_products_image_sm_3, p.products_image_xl_3 as v_products_image_xl_3, p.products_image_sm_4 as v_products_image_sm_4, p.products_image_xl_4 as v_products_image_xl_4, p.products_image_sm_5 as v_products_image_sm_5, p.products_image_xl_5 as v_products_image_xl_5, p.products_image_sm_6 as v_products_image_sm_6, p.products_image_xl_6 as v_products_image_xl_6, p.products_price as v_products_price, p.products_weight as v_products_weight, p.products_date_available as v_date_avail, p.products_date_added as v_date_added, p.products_tax_class_id as v_tax_class_id, p.products_quantity as v_products_quantity, p.manufacturers_id as v_manufacturers_id, subc.categories_id as v_categories_id, p.products_status as v_status FROM ".TABLE_PRODUCTS." as p, ".TABLE_CATEGORIES." as subc, ".TABLE_PRODUCTS_TO_CATEGORIES." as ptoc WHERE p.products_id = ptoc.products_id AND ptoc.categories_id = subc.categories_id "; break; case 'priceqty': $iii = 0; // uncomment the customer_price and customer_group to support multi-price per product contrib $filelayout = array( 'v_products_model' => $iii++, 'v_products_price' => $iii++, 'v_products_quantity' => $iii++, #'v_customer_price_1' => $iii++, #'v_customer_group_id_1' => $iii++, #'v_customer_price_2' => $iii++, #'v_customer_group_id_2' => $iii++, #'v_customer_price_3' => $iii++, #'v_customer_group_id_3' => $iii++, #'v_customer_price_4' => $iii++, #'v_customer_group_id_4' => $iii++, ); $filelayout_sql = "SELECT p.products_id as v_products_id, p.products_model as v_products_model, p.products_price as v_products_price, p.products_tax_class_id as v_tax_class_id, p.products_quantity as v_products_quantity FROM ".TABLE_PRODUCTS." as p "; break; case 'category': // The file layout is dynamically made depending on the number of languages $iii = 0; $filelayout = array( 'v_products_model' => $iii++, ); // build the categories name section of the array based on the number of categores the user wants to have for($i=1;$i<$max_categories+1;$i++){ $filelayout = array_merge($filelayout, array('v_categories_name_' . $i => $iii++)); } $filelayout_sql = "SELECT p.products_id as v_products_id, p.products_model as v_products_model, subc.categories_id as v_categories_id FROM ".TABLE_PRODUCTS." as p, ".TABLE_CATEGORIES." as subc, ".TABLE_PRODUCTS_TO_CATEGORIES." as ptoc WHERE p.products_id = ptoc.products_id AND ptoc.categories_id = subc.categories_id "; break; case 'froogle': // this is going to be a little interesting because we need // a way to map from internal names to external names // // Before it didn't matter, but with froogle needing particular headers, // The file layout is dynamically made depending on the number of languages $iii = 0; $filelayout = array( 'v_froogle_products_url_1' => $iii++, ); // // here we need to get the default language and put $l_id = 1; // dummy it in for now. // foreach ($langcode as $key => $lang){ // $l_id = $lang['id']; $filelayout = array_merge($filelayout , array( 'v_froogle_products_name_' . $l_id => $iii++, 'v_froogle_products_description_' . $l_id => $iii++, )); // } $filelayout = array_merge($filelayout , array( 'v_products_price' => $iii++, 'v_products_fullpath_image' => $iii++, 'v_category_fullpath' => $iii++, 'v_froogle_offer_id' => $iii++, 'v_froogle_instock' => $iii++, 'v_froogle_ shipping' => $iii++, 'v_manufacturers_name' => $iii++, 'v_froogle_ upc' => $iii++, 'v_froogle_color' => $iii++, 'v_froogle_size' => $iii++, 'v_froogle_quantitylevel' => $iii++, 'v_froogle_product_id' => $iii++, 'v_froogle_manufacturer_id' => $iii++, 'v_froogle_exp_date' => $iii++, 'v_froogle_product_type' => $iii++, 'v_froogle_delete' => $iii++, 'v_froogle_currency' => $iii++, )); $iii=0; $fileheaders = array( 'product_url' => $iii++, 'name' => $iii++, 'description' => $iii++, 'price' => $iii++, 'image_url' => $iii++, 'category' => $iii++, 'offer_id' => $iii++, 'instock' => $iii++, 'shipping' => $iii++, 'brand' => $iii++, 'upc' => $iii++, 'color' => $iii++, 'size' => $iii++, 'quantity' => $iii++, 'product_id' => $iii++, 'manufacturer_id' => $iii++, 'exp_date' => $iii++, 'product_type' => $iii++, 'delete' => $iii++, 'currency' => $iii++, ); $filelayout_sql = "SELECT p.products_id as v_products_id, p.products_model as v_products_model, p.products_image as v_products_image, p.products_image_med as v_products_image_med, p.products_image_lrg as v_products_image_lrg, p.products_image_sm_1 as v_products_image_sm_1, p.products_image_xl_1 as v_products_image_xl_1, p.products_image_sm_2 as v_products_image_sm_2, p.products_image_xl_2 as v_products_image_xl_2, p.products_image_sm_3 as v_products_image_sm_3, p.products_image_xl_3 as v_products_image_xl_3, p.products_image_sm_4 as v_products_image_sm_4, p.products_image_xl_4 as v_products_image_xl_4, p.products_image_sm_5 as v_products_image_sm_5, p.products_image_xl_5 as v_products_image_xl_5, p.products_image_sm_6 as v_products_image_sm_6, p.products_image_xl_6 as v_products_image_xl_6, p.products_price as v_products_price, p.products_weight as v_products_weight, p.products_date_added as v_date_avail, p.products_tax_class_id as v_tax_class_id, p.products_quantity as v_products_quantity, p.manufacturers_id as v_manufacturers_id, subc.categories_id as v_categories_id FROM ".TABLE_PRODUCTS." as p, ".TABLE_CATEGORIES." as subc, ".TABLE_PRODUCTS_TO_CATEGORIES." as ptoc WHERE p.products_id = ptoc.products_id AND ptoc.categories_id = subc.categories_id "; break; // VJ product attributes begin case 'attrib': $iii = 0; $filelayout = array( 'v_products_model' => $iii++ ); $header_array = array(); $languages = tep_get_languages(); global $attribute_options_array; $attribute_options_count = 1; foreach ($attribute_options_array as $attribute_options_values) { $key1 = 'v_attribute_options_id_' . $attribute_options_count; $header_array[$key1] = $iii++; for ($i=0, $n=sizeof($languages); $i<$n; $i++) { $l_id = $languages[$i]['id']; $key2 = 'v_attribute_options_name_' . $attribute_options_count . '_' . $l_id; $header_array[$key2] = $iii++; } $attribute_values_query = "select products_options_values_id from " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " where products_options_id = '" . (int)$attribute_options_values['products_options_id'] . "' order by products_options_values_id"; $attribute_values_values = tep_db_query($attribute_values_query); $attribute_values_count = 1; while ($attribute_values = tep_db_fetch_array($attribute_values_values)) { $key3 = 'v_attribute_values_id_' . $attribute_options_count . '_' . $attribute_values_count; $header_array[$key3] = $iii++; $key4 = 'v_attribute_values_price_' . $attribute_options_count . '_' . $attribute_values_count; $header_array[$key4] = $iii++; for ($i=0, $n=sizeof($languages); $i<$n; $i++) { $l_id = $languages[$i]['id']; $key5 = 'v_attribute_values_name_' . $attribute_options_count . '_' . $attribute_values_count . '_' . $l_id; $header_array[$key5] = $iii++; } $attribute_values_count++; } $attribute_options_count++; } $filelayout = array_merge($filelayout, $header_array); $filelayout_sql = "SELECT p.products_id as v_products_id, p.products_model as v_products_model FROM ".TABLE_PRODUCTS." as p "; break; // VJ product attributes end } $filelayout_count = count($filelayout); } function walk( $item1 ) { global $filelayout, $filelayout_count, $modelsize; global $active, $inactive, $langcode, $default_these, $deleteit, $zero_qty_inactive; global $epdlanguage_id, $price_with_tax, $replace_quotes; global $default_images, $default_image_manufacturer, $default_image_product, $default_image_category; global $separator, $max_categories; // first we clean up the row of data // chop blanks from each end $item1 = ltrim(rtrim($item1)); // blow it into an array, splitting on the tabs $items = explode($separator, $item1); // make sure all non-set things are set to ''; // and strip the quotes from the start and end of the stings. // escape any special chars for the database. foreach( $filelayout as $key=> $value){ $i = $filelayout[$key]; if (isset($items[$i]) == false) { $items[$i]=''; } else { // Check to see if either of the magic_quotes are turned on or off; // And apply filtering accordingly. if (function_exists('ini_get')) { //echo "Getting ready to check magic quotes<br>"; if (ini_get('magic_quotes_runtime') == 1){ // The magic_quotes_runtime are on, so lets account for them // check if the last character is a quote; // if it is, chop off the quotes. if (substr($items[$i],-1) == '"'){ $items[$i] = substr($items[$i],2,strlen($items[$i])-4); } // now any remaining doubled double quotes should be converted to one doublequote $items[$i] = str_replace('\"\"',""",$items[$i]); if ($replace_quotes){ $items[$i] = str_replace('\"',""",$items[$i]); $items[$i] = str_replace("\'","'",$items[$i]); } } else { // no magic_quotes are on // check if the last character is a quote; // if it is, chop off the 1st and last character of the string. if (substr($items[$i],-1) == '"'){ $items[$i] = substr($items[$i],1,strlen($items[$i])-2); } // now any remaining doubled double quotes should be converted to one doublequote $items[$i] = str_replace('""',""",$items[$i]); if ($replace_quotes){ $items[$i] = str_replace('"',""",$items[$i]); $items[$i] = str_replace("'","'",$items[$i]); } } } } } /* if ( $items['v_status'] == $deleteit ){ // they want to delete this product. echo "Deleting product " . $items['v_products_model'] . " from the database<br>"; // Get the ID // kill in the products_to_categories // Kill in the products table return; // we're done deleteing! } */ // now do a query to get the record's current contents $sql = "SELECT p.products_id as v_products_id, p.products_model as v_products_model, p.products_image as v_products_image, p.products_image_med as v_products_image_med, p.products_image_lrg as v_products_image_lrg, p.products_image_sm_1 as v_products_image_sm_1, p.products_image_xl_1 as v_products_image_xl_1, p.products_image_sm_2 as v_products_image_sm_2, p.products_image_xl_2 as v_products_image_xl_2, p.products_image_sm_3 as v_products_image_sm_3, p.products_image_xl_3 as v_products_image_xl_3, p.products_image_sm_4 as v_products_image_sm_4, p.products_image_xl_4 as v_products_image_xl_4, p.products_image_sm_5 as v_products_image_sm_5, p.products_image_xl_5 as v_products_image_xl_5, p.products_image_sm_6 as v_products_image_sm_6, p.products_image_xl_6 as v_products_image_xl_6, p.products_price as v_products_price, p.products_weight as v_products_weight, p.products_date_added as v_date_avail, p.products_tax_class_id as v_tax_class_id, p.products_quantity as v_products_quantity, p.manufacturers_id as v_manufacturers_id, subc.categories_id as v_categories_id FROM ".TABLE_PRODUCTS." as p, ".TABLE_CATEGORIES." as subc, ".TABLE_PRODUCTS_TO_CATEGORIES." as ptoc WHERE p.products_id = ptoc.products_id AND p.products_model = '" . $items[$filelayout['v_products_model']] . "' AND ptoc.categories_id = subc.categories_id "; $result = tep_db_query($sql); $row = tep_db_fetch_array($result); while ($row){ // OK, since we got a row, the item already exists. // Let's get all the data we need and fill in all the fields that need to be defaulted to the current values // for each language, get the description and set the vals foreach ($langcode as $key => $lang){ //echo "Inside defaulting loop"; //echo "key is $key<br>"; //echo "langid is " . $lang['id'] . "<br>"; // $sql2 = "SELECT products_name, products_description // FROM ".TABLE_PRODUCTS_DESCRIPTION." // WHERE // products_id = " . $row['v_products_id'] . " AND // language_id = '" . $lang['id'] . "' // "; $sql2 = "SELECT * FROM ".TABLE_PRODUCTS_DESCRIPTION." WHERE products_id = " . $row['v_products_id'] . " AND language_id = '" . $lang['id'] . "' "; $result2 = tep_db_query($sql2); $row2 = tep_db_fetch_array($result2); // Need to report from ......_name_1 not ..._name_0 $row['v_products_name_' . $lang['id']] = $row2['products_name']; $row['v_products_description_' . $lang['id']] = $row2['products_description']; $row['v_products_url_' . $lang['id']] = $row2['products_url']; // support for Linda's Header Controller 2.0 here if(isset($filelayout['v_products_head_title_tag_' . $lang['id'] ])){ $row['v_products_head_title_tag_' . $lang['id']] = $row2['products_head_title_tag']; $row['v_products_head_desc_tag_' . $lang['id']] = $row2['products_head_desc_tag']; $row['v_products_head_keywords_tag_' . $lang['id']] = $row2['products_head_keywords_tag']; } // end support for Header Controller 2.0 } // start with v_categories_id // Get the category description // set the appropriate variable name // if parent_id is not null, then follow it up. $thecategory_id = $row['v_categories_id']; for( $categorylevel=1; $categorylevel<$max_categories+1; $categorylevel++){ if ($thecategory_id){ $sql2 = "SELECT categories_name FROM ".TABLE_CATEGORIES_DESCRIPTION." WHERE categories_id = " . $thecategory_id . " AND language_id = " . $epdlanguage_id; $result2 = tep_db_query($sql2); $row2 = tep_db_fetch_array($result2); // only set it if we found something $temprow['v_categories_name_' . $categorylevel] = $row2['categories_name']; // now get the parent ID if there was one $sql3 = "SELECT parent_id FROM ".TABLE_CATEGORIES." WHERE categories_id = " . $thecategory_id; $result3 = tep_db_query($sql3); $row3 = tep_db_fetch_array($result3); $theparent_id = $row3['parent_id']; if ($theparent_id != ''){ // there was a parent ID, lets set thecategoryid to get the next level $thecategory_id = $theparent_id; } else { // we have found the top level category for this item, $thecategory_id = false; } } else { $temprow['v_categories_name_' . $categorylevel] = ''; } } // temprow has the old style low to high level categories. $newlevel = 1; // let's turn them into high to low level categories for( $categorylevel=$max_categories+1; $categorylevel>0; $categorylevel--){ if ($temprow['v_categories_name_' . $categorylevel] != ''){ $row['v_categories_name_' . $newlevel++] = $temprow['v_categories_name_' . $categorylevel]; } } if ($row['v_manufacturers_id'] != ''){ $sql2 = "SELECT manufacturers_name FROM ".TABLE_MANUFACTURERS." WHERE manufacturers_id = " . $row['v_manufacturers_id'] ; $result2 = tep_db_query($sql2); $row2 = tep_db_fetch_array($result2); $row['v_manufacturers_name'] = $row2['manufacturers_name']; } //elari - //We check the value of tax class and title instead of the id //Then we add the tax to price if $price_with_tax is set to true $row_tax_multiplier = tep_get_tax_class_rate($row['v_tax_class_id']); $row['v_tax_class_title'] = tep_get_tax_class_title($row['v_tax_class_id']); if ($price_with_tax){ $row['v_products_price'] = round($row['v_products_price'] + ($row['v_products_price'] * $row_tax_multiplier / 100),2); } // now create the internal variables that will be used // the $$thisvar is on purpose: it creates a variable named what ever was in $thisvar and sets the value foreach ($default_these as $thisvar){ $$thisvar = $row[$thisvar]; } $row = tep_db_fetch_array($result); } // this is an important loop. What it does is go thru all the fields in the incoming file and set the internal vars. // Internal vars not set here are either set in the loop above for existing records, or not set at all (null values) // the array values are handled separatly, although they will set variables in this loop, we won't use them. foreach( $filelayout as $key => $value ){ $$key = $items[ $value ]; } // so how to handle these? we shouldn't built the array unless it's been giving to us. // The assumption is that if you give us names and descriptions, then you give us name and description for all applicable languages foreach ($langcode as $lang){ //echo "Langid is " . $lang['id'] . "<br>"; $l_id = $lang['id']; if (isset($filelayout['v_products_name_' . $l_id ])){ //we set dynamically the language values $v_products_name[$l_id] = $items[$filelayout['v_products_name_' . $l_id]]; $v_products_description[$l_id] = $items[$filelayout['v_products_description_' . $l_id ]]; $v_products_url[$l_id] = $items[$filelayout['v_products_url_' . $l_id ]]; // support for Linda's Header Controller 2.0 here if(isset($filelayout['v_products_head_title_tag_' . $l_id])){ $v_products_head_title_tag[$l_id] = $items[$filelayout['v_products_head_title_tag_' . $l_id]]; $v_products_head_desc_tag[$l_id] = $items[$filelayout['v_products_head_desc_tag_' . $l_id]]; $v_products_head_keywords_tag[$l_id] = $items[$filelayout['v_products_head_keywords_tag_' . $l_id]]; } // end support for Header Controller 2.0 } } //elari... we get the tax_clas_id from the tax_title //on screen will still be displayed the tax_class_title instead of the id.... if ( isset( $v_tax_class_title) ){ $v_tax_class_id = tep_get_tax_title_class_id($v_tax_class_title); } //we check the tax rate of this tax_class_id $row_tax_multiplier = tep_get_tax_class_rate($v_tax_class_id); //And we recalculate price without the included tax... //Since it seems display is made before, the displayed price will still include tax //This is same problem for the tax_clas_id that display tax_class_title if ($price_with_tax){ $v_products_price = round( $v_products_price / (1 + ( $row_tax_multiplier * $price_with_tax/100) ), 4); } // if they give us one category, they give us all 6 categories unset ($v_categories_name); // default to not set. if ( isset( $filelayout['v_categories_name_1'] ) ){ $newlevel = 1; for( $categorylevel=6; $categorylevel>0; $categorylevel--){ if ( $items[$filelayout['v_categories_name_' . $categorylevel]] != ''){ $v_categories_name[$newlevel++] = $items[$filelayout['v_categories_name_' . $categorylevel]]; } } while( $newlevel < $max_categories+1){ $v_categories_name[$newlevel++] = ''; // default the remaining items to nothing } } if (ltrim(rtrim($v_products_quantity)) == '') { $v_products_quantity = 1; } if ($v_date_avail == '') { // $v_date_avail = "CURRENT_TIMESTAMP"; $v_date_avail = "NULL"; } else { // we put the quotes around it here because we can't put them into the query, because sometimes // we will use the "current_timestamp", which can't have quotes around it. $v_date_avail = '"' . $v_date_avail . '"'; } if ($v_date_added == '') { $v_date_added = "CURRENT_TIMESTAMP"; } else { // we put the quotes around it here because we can't put them into the query, because sometimes // we will use the "current_timestamp", which can't have quotes around it. $v_date_added = '"' . $v_date_added . '"'; } // default the stock if they spec'd it or if it's blank $v_db_status = '1'; // default to active if ($v_status == $inactive){ // they told us to deactivate this item $v_db_status = '0'; } if ($zero_qty_inactive && $v_products_quantity == 0) { // if they said that zero qty products should be deactivated, let's deactivate if the qty is zero $v_db_status = '0'; } if ($v_manufacturer_id==''){ $v_manufacturer_id="NULL"; } if (trim($v_products_image)==''){ $v_products_image = $default_image_product; } if (strlen($v_products_model) > $modelsize ){ echo "<font color='red'>" . strlen($v_products_model) . $v_products_model . "... ERROR! - Too many characters in the model number.<br> 12 is the maximum on a standard OSC install.<br> Your maximum product_model length is set to $modelsize<br> You can either shorten your model numbers or increase the size of the field in the database.</font>"; die(); } // OK, we need to convert the manufacturer's name into id's for the database if ( isset($v_manufacturers_name) && $v_manufacturers_name != '' ){ $sql = "SELECT man.manufacturers_id FROM ".TABLE_MANUFACTURERS." as man WHERE man.manufacturers_name = '" . $v_manufacturers_name . "'"; $result = tep_db_query($sql); $row = tep_db_fetch_array($result); if ( $row != '' ){ foreach( $row as $item ){ $v_manufacturer_id = $item; } } else { // to add, we need to put stuff in categories and categories_description $sql = "SELECT MAX( manufacturers_id) max FROM ".TABLE_MANUFACTURERS; $result = tep_db_query($sql); $row = tep_db_fetch_array($result); $max_mfg_id = $row['max']+1; // default the id if there are no manufacturers yet if (!is_numeric($max_mfg_id) ){ $max_mfg_id=1; } // Uncomment this query if you have an older 2.2 codebase /* $sql = "INSERT INTO ".TABLE_MANUFACTURERS."( manufacturers_id, manufacturers_name, manufacturers_image ) VALUES ( $max_mfg_id, '$v_manufacturers_name', '$default_image_manufacturer' )"; */ // Comment this query out if you have an older 2.2 codebase $sql = "INSERT INTO ".TABLE_MANUFACTURERS."( manufacturers_id, manufacturers_name, manufacturers_image, date_added, last_modified ) VALUES ( $max_mfg_id, '$v_manufacturers_name', '$default_image_manufacturer', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP )"; $result = tep_db_query($sql); $v_manufacturer_id = $max_mfg_id; } } // if the categories names are set then try to update them if ( isset($v_categories_name_1)){ // start from the highest possible category and work our way down from the parent $v_categories_id = 0; $theparent_id = 0; for ( $categorylevel=$max_categories+1; $categorylevel>0; $categorylevel-- ){ $thiscategoryname = $v_categories_name[$categorylevel]; if ( $thiscategoryname != ''){ // we found a category name in this field // now the subcategory $sql = "SELECT cat.categories_id FROM ".TABLE_CATEGORIES." as cat, ".TABLE_CATEGORIES_DESCRIPTION." as des WHERE cat.categories_id = des.categories_id AND des.language_id = $epdlanguage_id AND cat.parent_id = " . $theparent_id . " AND des.categories_name = '" . $thiscategoryname . "'"; $result = tep_db_query($sql); $row = tep_db_fetch_array($result); if ( $row != '' ){ foreach( $row as $item ){ $thiscategoryid = $item; } } else { // to add, we need to put stuff in categories and categories_description $sql = "SELECT MAX( categories_id) max FROM ".TABLE_CATEGORIES; $result = tep_db_query($sql); $row = tep_db_fetch_array($result); $max_category_id = $row['max']+1; if (!is_numeric($max_category_id) ){ $max_category_id=1; } $sql = "INSERT INTO ".TABLE_CATEGORIES."( categories_id, categories_image, parent_id, sort_order, date_added, last_modified ) VALUES ( $max_category_id, '$default_image_category', $theparent_id, 0, CURRENT_TIMESTAMP ,CURRENT_TIMESTAMP )"; $result = tep_db_query($sql); $sql = "INSERT INTO ".TABLE_CATEGORIES_DESCRIPTION."( categories_id, language_id, categories_name ) VALUES ( $max_category_id, '$epdlanguage_id', '$thiscategoryname' )"; $result = tep_db_query($sql); $thiscategoryid = $max_category_id; } // the current catid is the next level's parent $theparent_id = $thiscategoryid; $v_categories_id = $thiscategoryid; // keep setting this, we need the lowest level category ID later } } } if ($v_products_model != "") { // products_model exists! array_walk($items, 'print_el'); // First we check to see if this is a product in the current db. $result = tep_db_query("SELECT products_id FROM ".TABLE_PRODUCTS." WHERE (products_model = '". $v_products_model . "')"); if (tep_db_num_rows($result) == 0) { // insert into products $sql = "SHOW TABLE STATUS LIKE '".TABLE_PRODUCTS."'"; $result = tep_db_query($sql); $row = tep_db_fetch_array($result); $max_product_id = $row['Auto_increment']; if (!is_numeric($max_product_id) ){ $max_product_id=1; } $v_products_id = $max_product_id; echo "<font color='green'> !New Product!</font><br>"; $query = "INSERT INTO ".TABLE_PRODUCTS." ( products_image, products_image_med, products_image_lrg, products_image_sm_1, products_image_xl_1, products_image_sm_2, products_image_xl_2, products_image_sm_3, products_image_xl_3, products_image_sm_4, products_image_xl_4, products_image_sm_5, products_image_xl_5, products_image_sm_6, products_image_xl_6, products_model, products_price, products_status, products_last_modified, products_date_added, products_date_available, products_tax_class_id, products_weight, products_quantity, manufacturers_id) VALUES ( '$v_products_image', '$v_products_image_med', '$v_products_image_lrg', '$v_products_image_sm_1', '$v_products_image_xl_1', '$v_products_image_sm_2', '$v_products_image_xl_2', '$v_products_image_sm_3', '$v_products_image_xl_3', '$v_products_image_sm_4', '$v_products_image_xl_4', '$v_products_image_sm_5', '$v_products_image_xl_5', '$v_products_image_sm_6', '$v_products_image_xl_6',"; // unmcomment these lines if you are running the image mods /* $query .= . $v_products_mimage . '", "' . $v_products_bimage . '", "' . $v_products_subimage1 . '", "' . $v_products_bsubimage1 . '", "' . $v_products_subimage2 . '", "' . $v_products_bsubimage2 . '", "' . $v_products_subimage3 . '", "' . $v_products_bsubimage3 . '", "' */ $query .=" '$v_products_model', '$v_products_price', '$v_db_status', CURRENT_TIMESTAMP, $v_date_added, $v_date_avail, '$v_tax_class_id', '$v_products_weight', '$v_products_quantity', '$v_manufacturer_id') "; $result = tep_db_query($query); } else { // existing product, get the id from the query // and update the product data $row = tep_db_fetch_array($result); $v_products_id = $row['products_id']; echo "<font color='black'> Updated</font><br>"; $row = tep_db_fetch_array($result); $query = 'UPDATE '.TABLE_PRODUCTS.' SET products_price="'.$v_products_price. '" ,products_image="'.$v_products_image. '" ,products_image_med="'.$v_products_image_med . '" ,products_image_lrg="'. $v_products_image_lrg . '" ,products_image_sm_1="'.$v_products_image_sm_1 . '" ,products_image_xl_1="'.$v_products_image_xl_1 . '" ,products_image_sm_2="'.$v_products_image_sm_2 . '" ,products_image_xl_2="'.$v_products_image_xl_2 . '" ,products_image_sm_3="'.$v_products_image_sm_3 . '" ,products_image_xl_3="'.$v_products_image_xl_3 . '" ,products_image_sm_4="'.$v_products_image_sm_4 . '" ,products_image_sm_4="'.$v_products_image_xl_4 . '" ,products_image_sm_5="'.$v_products_image_sm_5 . '" ,products_image_xl_5="'.$v_products_image_xl_5 . '" ,products_image_sm_6="'.$v_products_image_sm_6 . '" ,products_image_xl_6="'.$v_products_image_xl_6; // uncomment these lines if you are running the image mods /* $query .= '" ,products_mimage="'.$v_products_mimage. '" ,products_bimage="'.$v_products_bimage. '" ,products_subimage1="'.$v_products_subimage1. '" ,products_bsubimage1="'.$v_products_bsubimage1. '" ,products_subimage2="'.$v_products_subimage2. '" ,products_bsubimage2="'.$v_products_bsubimage2. '" ,products_subimage3="'.$v_products_subimage3. '" ,products_bsubimage3="'.$v_products_bsubimage3; */ $query .= '", products_weight="'.$v_products_weight . '", products_tax_class_id="'.$v_tax_class_id . '", products_date_available= ' . $v_date_avail . ', products_date_added= ' . $v_date_added . ', products_last_modified=CURRENT_TIMESTAMP , products_quantity="' . $v_products_quantity . '" ,manufacturers_id=' . $v_manufacturer_id . ' , products_status=' . $v_db_status . ' WHERE (products_id = "'. $v_products_id . '")'; $result = tep_db_query($query); } // the following is common in both the updating an existing product and creating a new product if ( isset($v_products_name)){ foreach( $v_products_name as $key => $name){ if ($name!=''){ $sql = "SELECT * FROM ".TABLE_PRODUCTS_DESCRIPTION." WHERE products_id = $v_products_id AND language_id = " . $key; $result = tep_db_query($sql); if (tep_db_num_rows($result) == 0) { // nope, this is a new product description $result = tep_db_query($sql); $sql = "INSERT INTO ".TABLE_PRODUCTS_DESCRIPTION." (products_id, language_id, products_name, products_description, products_url) VALUES ( '" . $v_products_id . "', " . $key . ", '" . $name . "', '". $v_products_description[$key] . "', '". $v_products_url[$key] . "' )"; // support for Linda's Header Controller 2.0 if (isset($v_products_head_title_tag)){ // override the sql if we're using Linda's contrib $sql = "INSERT INTO ".TABLE_PRODUCTS_DESCRIPTION." (products_id, language_id, products_name, products_description, products_url, products_head_title_tag, products_head_desc_tag, products_head_keywords_tag) VALUES ( '" . $v_products_id . "', " . $key . ", '" . $name . "', '". $v_products_description[$key] . "', '". $v_products_url[$key] . "', '". $v_products_head_title_tag[$key] . "', '". $v_products_head_desc_tag[$key] . "', '". $v_products_head_keywords_tag[$key] . "')"; } // end support for Linda's Header Controller 2.0 $result = tep_db_query($sql); } else { // already in the description, let's just update it $sql = "UPDATE ".TABLE_PRODUCTS_DESCRIPTION." SET products_name='$name', products_description='".$v_products_description[$key] . "', products_url='" . $v_products_url[$key] . "' WHERE products_id = '$v_products_id' AND language_id = '$key'"; // support for Lindas Header Controller 2.0 if (isset($v_products_head_title_tag)){ // override the sql if we're using Linda's contrib $sql = "UPDATE ".TABLE_PRODUCTS_DESCRIPTION." SET products_name = '$name', products_description = '".$v_products_description[$key] . "', products_url = '" . $v_products_url[$key] ."', products_head_title_tag = '" . $v_products_head_title_tag[$key] ."', products_head_desc_tag = '" . $v_products_head_desc_tag[$key] ."', products_head_keywords_tag = '" . $v_products_head_keywords_tag[$key] ."' WHERE products_id = '$v_products_id' AND language_id = '$key'"; } // end support for Linda's Header Controller 2.0 $result = tep_db_query($sql); } } } } if (isset($v_categories_id)){ //find out if this product is listed in the category given $result_incategory = tep_db_query('SELECT '.TABLE_PRODUCTS_TO_CATEGORIES.'.products_id, '.TABLE_PRODUCTS_TO_CATEGORIES.'.categories_id FROM '.TABLE_PRODUCTS_TO_CATEGORIES.' WHERE '.TABLE_PRODUCTS_TO_CATEGORIES.'.products_id='.$v_products_id.' AND '.TABLE_PRODUCTS_TO_CATEGORIES.'.categories_id='.$v_categories_id); if (tep_db_num_rows($result_incategory) == 0) { // nope, this is a new category for this product $res1 = tep_db_query('INSERT INTO '.TABLE_PRODUCTS_TO_CATEGORIES.' (products_id, categories_id) VALUES ("' . $v_products_id . '", "' . $v_categories_id . '")'); } else { // already in this category, nothing to do! } } // for the separate prices per customer module $ll=1; if (isset($v_customer_price_1)){ if (($v_customer_group_id_1 == '') AND ($v_customer_price_1 != '')) { echo "<font color=red>ERROR - v_customer_group_id and v_customer_price must occur in pairs</font>"; die(); } // they spec'd some prices, so clear all existing entries $result = tep_db_query(' DELETE FROM '.TABLE_PRODUCTS_GROUPS.' WHERE products_id = ' . $v_products_id ); // and insert the new record if ($v_customer_price_1 != ''){ $result = tep_db_query(' INSERT INTO '.TABLE_PRODUCTS_GROUPS.' VALUES ( ' . $v_customer_group_id_1 . ', ' . $v_customer_price_1 . ', ' . $v_products_id . ', ' . $v_products_price .' )' ); } if ($v_customer_price_2 != ''){ $result = tep_db_query(' INSERT INTO '.TABLE_PRODUCTS_GROUPS.' VALUES ( ' . $v_customer_group_id_2 . ', ' . $v_customer_price_2 . ', ' . $v_products_id . ', ' . $v_products_price . ' )' ); } if ($v_customer_price_3 != ''){ $result = tep_db_query(' INSERT INTO '.TABLE_PRODUCTS_GROUPS.' VALUES ( ' . $v_customer_group_id_3 . ', ' . $v_customer_price_3 . ', ' . $v_products_id . ', ' . $v_products_price . ' )' ); } if ($v_customer_price_4 != ''){ $result = tep_db_query(' INSERT INTO '.TABLE_PRODUCTS_GROUPS.' VALUES ( ' . $v_customer_group_id_4 . ', ' . $v_customer_price_4 . ', ' . $v_products_id . ', ' . $v_products_price . ' )' ); } } // VJ product attribs begin if (isset($v_attribute_options_id_1)){ $attribute_rows = 1; // master row count $languages = tep_get_languages(); // product options count $attribute_options_count = 1; $v_attribute_options_id_var = 'v_attribute_options_id_' . $attribute_options_count; while (isset($$v_attribute_options_id_var) && !empty($$v_attribute_options_id_var)) { // remove product attribute options linked to this product before proceeding further // this is useful for removing attributes linked to a product $attributes_clean_query = "delete from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$v_products_id . "' and options_id = '" . (int)$$v_attribute_options_id_var . "'"; tep_db_query($attributes_clean_query); $attribute_options_query = "select products_options_name from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . (int)$$v_attribute_options_id_var . "'"; $attribute_options_values = tep_db_query($attribute_options_query); // option table update begin if ($attribute_rows == 1) { // insert into options table if no option exists if (tep_db_num_rows($attribute_options_values) <= 0) { for ($i=0, $n=sizeof($languages); $i<$n; $i++) { $lid = $languages[$i]['id']; $v_attribute_options_name_var = 'v_attribute_options_name_' . $attr
  7. Here's my solid ep.php in two part to avoid code cutting and including new fields for Ultrapics contribution. First part is from line 1 to 999 and the second have the rest. <?php // Current EP Version $curver = '2.74-MS2'; /* $Id: easypopulate.php,v 2.74 2005/02/01 VJ Exp $ Modified by Andrew_J to handle Ultrapics fields */ // //******************************* //******************************* // C O N F I G U R A T I O N // V A R I A B L E S //******************************* //******************************* // **** Temp directory **** // if you changed your directory structure from stock and do not have /catalog/temp/, then you'll need to change this accordingly. // $tempdir = "/temp/"; $tempdir2 = "/temp/"; //**** File Splitting Configuration **** // we attempt to set the timeout limit longer for this script to avoid having to split the files // NOTE: If your server is running in safe mode, this setting cannot override the timeout set in php.ini // uncomment this if you are not on a safe mode server and you are getting timeouts // set_time_limit(330); // if you are splitting files, this will set the maximum number of records to put in each file. // if you set your php.ini to a long time, you can make this number bigger global $maxrecs; $maxrecs = 300; // default, seems to work for most people. Reduce if you hit timeouts //$maxrecs = 4; // for testing //**** Image Defaulting **** global $default_images, $default_image_manufacturer, $default_image_product, $default_image_category; // set them to your own default "We don't have any picture" gif $default_image_manufacturer = 'manufacturer_default.gif'; $default_image_product = 'default.gif'; $default_image_category = 'category_default.gif'; // or let them get set to nothing //$default_image_manufacturer = ''; //$default_image_product = ''; //$default_image_category = ''; //**** Status Field Setting **** // Set the v_status field to "Inactive" if you want the status=0 in the system // Set the v_status field to "Delete" if you want to remove the item from the system <- THIS IS NOT WORKING YET! // If zero_qty_inactive is true, then items with zero qty will automatically be inactive in the store. global $active, $inactive, $zero_qty_inactive, $deleteit; $active = 'Active'; $inactive = 'Inactive'; //$deleteit = 'Delete'; // not functional yet $zero_qty_inactive = false; //**** Size of products_model in products table **** // set this to the size of your model number field in the db. We check to make sure all models are no longer than this value. // this prevents the database from getting fubared. Just making this number bigger won't help your database! They must match! global $modelsize; $modelsize = 20; //**** Price includes tax? **** // Set the v_price_with_tax to // 0 if you want the price without the tax included // 1 if you want the price to be defined for import & export including tax. global $price_with_tax; $price_with_tax =false; // **** Quote -> Escape character conversion **** // If you have extensive html in your descriptions and it's getting mangled on upload, turn this off // set to 1 = replace quotes with escape characters // set to 0 = no quote replacement global $replace_quotes; $replace_quotes = true; // **** Field Separator **** // change this if you can't use the default of tabs // Tab is the default, comma and semicolon are commonly supported by various progs // Remember, if your descriptions contain this character, you will confuse EP! global $separator; $separator = "\t"; // tab is default //$separator = ","; // comma //$separator = ";"; // semi-colon //$separator = "~"; // tilde //$separator = "-"; // dash //$separator = "*"; // splat // **** Max Category Levels **** // change this if you need more or fewer categories global $max_categories; $max_categories = 7; // 7 is default // VJ product attributes begin // **** Product Attributes **** // change this to false, if do not want to download product attributes global $products_with_attributes; $products_with_attributes = false; // change this if you want to download selected product options // this might be handy, if you have a lot of product options, and your output file exceeds 256 columns (which is the max. limit MS Excel is able to handle) global $attribute_options_select; //$attribute_options_select = array('Size', 'Model'); // uncomment and fill with product options name you wish to download // comment this line, if you wish to download all product options // VJ product attributes end // **************************************** // Froogle configuration variables // -- YOU MUST CONFIGURE THIS! IT WON'T WORK OUT OF THE BOX! // **************************************** // **** Froogle product info page path **** // We can't use the tep functions to create the link, because the links will point to the admin, since that's where we're at. // So put the entire path to your product_info.php page here global $froogle_product_info_path; $froogle_product_info_path = "http://localhost/catalog/product_info.php"; // **** Froogle product image path **** // Set this to the path to your images directory global $froogle_image_path; $froogle_image_path = "http://localhost/catalog/images/"; // **** Froogle - search engine friendly setting // if your store has SEARCH ENGINE FRIENDLY URLS set, then turn this to true // I did it this way because I'm having trouble with the code seeing the constants // that are defined in other places. global $froogle_SEF_urls; $froogle_SEF_urls = true; // **************************************** // End Froogle configuration variables // **************************************** //******************************* //******************************* // E N D // C O N F I G U R A T I O N // V A R I A B L E S //******************************* //******************************* //******************************* //******************************* // S T A R T // INITIALIZATION //******************************* //******************************* require('includes/application_top.php'); require('includes/database_tables.php'); //******************************* // If you are running a pre-Nov1-2002 snapshot of OSC, then we need this include line to avoid // errors like: // undefined function tep_get_uploaded_file if (!function_exists(tep_get_uploaded_file)){ include ('easypopulate_functions.php'); } //******************************* // VJ product attributes begin global $attribute_options_array; $attribute_options_array = array(); if ($products_with_attributes == true) { if (is_array($attribute_options_select) && (count($attribute_options_select) > 0)) { foreach ($attribute_options_select as $value) { $attribute_options_query = "select distinct products_options_id from " . TABLE_PRODUCTS_OPTIONS . " where products_options_name = '" . $value . "'"; $attribute_options_values = tep_db_query($attribute_options_query); if ($attribute_options = tep_db_fetch_array($attribute_options_values)){ $attribute_options_array[] = array('products_options_id' => $attribute_options['products_options_id']); } } } else { $attribute_options_query = "select distinct products_options_id from " . TABLE_PRODUCTS_OPTIONS . " order by products_options_id"; $attribute_options_values = tep_db_query($attribute_options_query); while ($attribute_options = tep_db_fetch_array($attribute_options_values)){ $attribute_options_array[] = array('products_options_id' => $attribute_options['products_options_id']); } } } // VJ product attributes end global $filelayout, $filelayout_count, $filelayout_sql, $langcode, $fileheaders; // these are the fields that will be defaulted to the current values in the database if they are not found in the incoming file global $default_these; $default_these = array( 'v_products_image', #'v_products_mimage', #'v_products_bimage', #'v_products_subimage1', #'v_products_bsubimage1', #'v_products_subimage2', #'v_products_bsubimage2', #'v_products_subimage3', #'v_products_bsubimage3', 'v_categories_id', 'v_products_price', 'v_products_quantity', 'v_products_weight', 'v_date_avail', 'v_instock', 'v_tax_class_title', 'v_manufacturers_name', 'v_manufacturers_id', 'v_products_dim_type', 'v_products_length', 'v_products_width', 'v_products_height' ); //elari check default language_id from configuration table DEFAULT_LANGUAGE $epdlanguage_query = tep_db_query("select languages_id, name from " . TABLE_LANGUAGES . " where code = '" . DEFAULT_LANGUAGE . "'"); if (tep_db_num_rows($epdlanguage_query)) { $epdlanguage = tep_db_fetch_array($epdlanguage_query); $epdlanguage_id = $epdlanguage['languages_id']; $epdlanguage_name = $epdlanguage['name']; } else { Echo 'Strange but there is no default language to work... That may not happen, just in case... '; } $langcode = ep_get_languages(); if ( $dltype != '' ){ // if dltype is set, then create the filelayout. Otherwise it gets read from the uploaded file ep_create_filelayout($dltype); // get the right filelayout for this download } //******************************* //******************************* // E N D // INITIALIZATION //******************************* //******************************* if ( $download == 'stream' or $download == 'tempfile' ){ //******************************* //******************************* // DOWNLOAD FILE //******************************* //******************************* $filestring = ""; // this holds the csv file we want to download if ( $dltype=='froogle' ){ // set the things froogle wants at the top of the file $filestring .= "# html_escaped=YES\n"; $filestring .= "# updates_only=NO\n"; $filestring .= "# product_type=OTHER\n"; $filestring .= "# quoted=YES\n"; } $result = tep_db_query($filelayout_sql); $row = tep_db_fetch_array($result); // Here we need to allow for the mapping of internal field names to external field names // default to all headers named like the internal ones // the field mapping array only needs to cover those fields that need to have their name changed if ( count($fileheaders) != 0 ){ $filelayout_header = $fileheaders; // if they gave us fileheaders for the dl, then use them } else { $filelayout_header = $filelayout; // if no mapping was spec'd use the internal field names for header names } //We prepare the table heading with layout values foreach( $filelayout_header as $key => $value ){ $filestring .= $key . $separator; } // now lop off the trailing tab $filestring = substr($filestring, 0, strlen($filestring)-1); // set the type if ( $dltype == 'froogle' ){ $endofrow = "\n"; } else { // default to normal end of row $endofrow = $separator . 'EOREOR' . "\n"; } $filestring .= $endofrow; $num_of_langs = count($langcode); while ($row){ // if the filelayout says we need a products_name, get it // build the long full froogle image path $row['v_products_fullpath_image'] = $froogle_image_path . $row['v_products_image']; // Other froogle defaults go here for now $row['v_froogle_instock'] = 'Y'; $row['v_froogle_shipping'] = ''; $row['v_froogle_upc'] = ''; $row['v_froogle_color'] = ''; $row['v_froogle_size'] = ''; $row['v_froogle_quantitylevel'] = ''; $row['v_froogle_manufacturer_id'] = ''; $row['v_froogle_exp_date'] = ''; $row['v_froogle_product_type'] = 'OTHER'; $row['v_froogle_delete'] = ''; $row['v_froogle_currency'] = 'USD'; $row['v_froogle_offer_id'] = $row['v_products_model']; $row['v_froogle_product_id'] = $row['v_products_model']; // names and descriptions require that we loop thru all languages that are turned on in the store foreach ($langcode as $key => $lang){ $lid = $lang['id']; // for each language, get the description and set the vals $sql2 = "SELECT * FROM ".TABLE_PRODUCTS_DESCRIPTION." WHERE products_id = " . $row['v_products_id'] . " AND language_id = '" . $lid . "' "; $result2 = tep_db_query($sql2); $row2 = tep_db_fetch_array($result2); // I'm only doing this for the first language, since right now froogle is US only.. Fix later! // adding url for froogle, but it should be available no matter what if ($froogle_SEF_urls){ // if only one language if ($num_of_langs == 1){ $row['v_froogle_products_url_' . $lid] = $froogle_product_info_path . '/products_id/' . $row['v_products_id']; } else { $row['v_froogle_products_url_' . $lid] = $froogle_product_info_path . '/products_id/' . $row['v_products_id'] . '/language/' . $lid; } } else { if ($num_of_langs == 1){ $row['v_froogle_products_url_' . $lid] = $froogle_product_info_path . '?products_id=' . $row['v_products_id']; } else { $row['v_froogle_products_url_' . $lid] = $froogle_product_info_path . '?products_id=' . $row['v_products_id'] . '&language=' . $lid; } } $row['v_products_name_' . $lid] = $row2['products_name']; $row['v_products_description_' . $lid] = $row2['products_description']; $row['v_products_url_' . $lid] = $row2['products_url']; // froogle advanced format needs the quotes around the name and desc $row['v_froogle_products_name_' . $lid] = '"' . strip_tags(str_replace('"','""',$row2['products_name'])) . '"'; $row['v_froogle_products_description_' . $lid] = '"' . strip_tags(str_replace('"','""',$row2['products_description'])) . '"'; // support for Linda's Header Controller 2.0 here if(isset($filelayout['v_products_head_title_tag_' . $lid])){ $row['v_products_head_title_tag_' . $lid] = $row2['products_head_title_tag']; $row['v_products_head_desc_tag_' . $lid] = $row2['products_head_desc_tag']; $row['v_products_head_keywords_tag_' . $lid] = $row2['products_head_keywords_tag']; } // end support for Header Controller 2.0 } // for the categories, we need to keep looping until we find the root category // start with v_categories_id // Get the category description // set the appropriate variable name // if parent_id is not null, then follow it up. // we'll populate an aray first, then decide where it goes in the $thecategory_id = $row['v_categories_id']; $fullcategory = ''; // this will have the entire category stack for froogle for( $categorylevel=1; $categorylevel<$max_categories+1; $categorylevel++){ if ($thecategory_id){ $sql2 = "SELECT categories_name FROM ".TABLE_CATEGORIES_DESCRIPTION." WHERE categories_id = " . $thecategory_id . " AND language_id = " . $epdlanguage_id; $result2 = tep_db_query($sql2); $row2 = tep_db_fetch_array($result2); // only set it if we found something $temprow['v_categories_name_' . $categorylevel] = $row2['categories_name']; // now get the parent ID if there was one $sql3 = "SELECT parent_id FROM ".TABLE_CATEGORIES." WHERE categories_id = " . $thecategory_id; $result3 = tep_db_query($sql3); $row3 = tep_db_fetch_array($result3); $theparent_id = $row3['parent_id']; if ($theparent_id != ''){ // there was a parent ID, lets set thecategoryid to get the next level $thecategory_id = $theparent_id; } else { // we have found the top level category for this item, $thecategory_id = false; } //$fullcategory .= " > " . $row2['categories_name']; $fullcategory = $row2['categories_name'] . " > " . $fullcategory; } else { $temprow['v_categories_name_' . $categorylevel] = ''; } } // now trim off the last ">" from the category stack $row['v_category_fullpath'] = substr($fullcategory,0,strlen($fullcategory)-3); // temprow has the old style low to high level categories. $newlevel = 1; // let's turn them into high to low level categories for( $categorylevel=6; $categorylevel>0; $categorylevel--){ if ($temprow['v_categories_name_' . $categorylevel] != ''){ $row['v_categories_name_' . $newlevel++] = $temprow['v_categories_name_' . $categorylevel]; } } // if the filelayout says we need a manufacturers name, get it if (isset($filelayout['v_manufacturers_name'])){ if ($row['v_manufacturers_id'] != ''){ $sql2 = "SELECT manufacturers_name FROM ".TABLE_MANUFACTURERS." WHERE manufacturers_id = " . $row['v_manufacturers_id'] ; $result2 = tep_db_query($sql2); $row2 = tep_db_fetch_array($result2); $row['v_manufacturers_name'] = $row2['manufacturers_name']; } } // If you have other modules that need to be available, put them here // VJ product attribs begin if (isset($filelayout['v_attribute_options_id_1'])){ $languages = tep_get_languages(); $attribute_options_count = 1; foreach ($attribute_options_array as $attribute_options) { $row['v_attribute_options_id_' . $attribute_options_count] = $attribute_options['products_options_id']; for ($i=0, $n=sizeof($languages); $i<$n; $i++) { $lid = $languages[$i]['id']; $attribute_options_languages_query = "select products_options_name from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . (int)$attribute_options['products_options_id'] . "' and language_id = '" . (int)$lid . "'"; $attribute_options_languages_values = tep_db_query($attribute_options_languages_query); $attribute_options_languages = tep_db_fetch_array($attribute_options_languages_values); $row['v_attribute_options_name_' . $attribute_options_count . '_' . $lid] = $attribute_options_languages['products_options_name']; } $attribute_values_query = "select products_options_values_id from " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " where products_options_id = '" . (int)$attribute_options['products_options_id'] . "' order by products_options_values_id"; $attribute_values_values = tep_db_query($attribute_values_query); $attribute_values_count = 1; while ($attribute_values = tep_db_fetch_array($attribute_values_values)) { $row['v_attribute_values_id_' . $attribute_options_count . '_' . $attribute_values_count] = $attribute_values['products_options_values_id']; $attribute_values_price_query = "select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$row['v_products_id'] . "' and options_id = '" . (int)$attribute_options['products_options_id'] . "' and options_values_id = '" . (int)$attribute_values['products_options_values_id'] . "'"; $attribute_values_price_values = tep_db_query($attribute_values_price_query); $attribute_values_price = tep_db_fetch_array($attribute_values_price_values); $row['v_attribute_values_price_' . $attribute_options_count . '_' . $attribute_values_count] = $attribute_values_price['price_prefix'] . $attribute_values_price['options_values_price']; for ($i=0, $n=sizeof($languages); $i<$n; $i++) { $lid = $languages[$i]['id']; $attribute_values_languages_query = "select products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id = '" . (int)$attribute_values['products_options_values_id'] . "' and language_id = '" . (int)$lid . "'"; $attribute_values_languages_values = tep_db_query($attribute_values_languages_query); $attribute_values_languages = tep_db_fetch_array($attribute_values_languages_values); $row['v_attribute_values_name_' . $attribute_options_count . '_' . $attribute_values_count . '_' . $lid] = $attribute_values_languages['products_options_values_name']; } $attribute_values_count++; } $attribute_options_count++; } } // VJ product attribs end // this is for the separate price per customer module if (isset($filelayout['v_customer_price_1'])){ $sql2 = "SELECT customers_group_price, customers_group_id FROM ".TABLE_PRODUCTS_GROUPS." WHERE products_id = " . $row['v_products_id'] . " ORDER BY customers_group_id" ; $result2 = tep_db_query($sql2); $ll = 1; $row2 = tep_db_fetch_array($result2); while( $row2 ){ $row['v_customer_group_id_' . $ll] = $row2['customers_group_id']; $row['v_customer_price_' . $ll] = $row2['customers_group_price']; $row2 = tep_db_fetch_array($result2); $ll++; } } if ($dltype == 'froogle'){ // For froogle, we check the specials prices for any applicable specials, and use that price // by grabbing the specials id descending, we always get the most recently added special price // I'm checking status because I think you can turn off specials $sql2 = "SELECT specials_new_products_price FROM ".TABLE_SPECIALS." WHERE products_id = " . $row['v_products_id'] . " and status = 1 and expires_date < CURRENT_TIMESTAMP ORDER BY specials_id DESC" ; $result2 = tep_db_query($sql2); $ll = 1; $row2 = tep_db_fetch_array($result2); if( $row2 ){ // reset the products price to our special price if there is one for this product $row['v_products_price'] = $row2['specials_new_products_price']; } } //elari - //We check the value of tax class and title instead of the id //Then we add the tax to price if $price_with_tax is set to 1 $row_tax_multiplier = tep_get_tax_class_rate($row['v_tax_class_id']); $row['v_tax_class_title'] = tep_get_tax_class_title($row['v_tax_class_id']); $row['v_products_price'] = round($row['v_products_price'] + ($price_with_tax * $row['v_products_price'] * $row_tax_multiplier / 100),2); // Now set the status to a word the user specd in the config vars if ( $row['v_status'] == '1' ){ $row['v_status'] = $active; } else { $row['v_status'] = $inactive; } // remove any bad things in the texts that could confuse EasyPopulate $therow = ''; foreach( $filelayout as $key => $value ){ //echo "The field was $key<br>"; $thetext = $row[$key]; // kill the carriage returns and tabs in the descriptions, they're killing me! $thetext = str_replace("\r",' ',$thetext); $thetext = str_replace("\n",' ',$thetext); $thetext = str_replace("\t",' ',$thetext); // and put the text into the output separated by tabs $therow .= $thetext . $separator; } // lop off the trailing tab, then append the end of row indicator $therow = substr($therow,0,strlen($therow)-1) . $endofrow; $filestring .= $therow; // grab the next row from the db $row = tep_db_fetch_array($result); } #$EXPORT_TIME=time(); $EXPORT_TIME = strftime('%Y%b%d-%H%I'); if ($dltype=="froogle"){ $EXPORT_TIME = "FroogleEP" . $EXPORT_TIME; } else { $EXPORT_TIME = "EP" . $EXPORT_TIME; } // now either stream it to them or put it in the temp directory if ($download == 'stream'){ //******************************* // STREAM FILE //******************************* header("Content-type: application/vnd.ms-excel"); header("Content-disposition: attachment; filename=$EXPORT_TIME.txt"); // Changed if using SSL, helps prevent program delay/timeout (add to backup.php also) // header("Pragma: no-cache"); if ($request_type== 'NONSSL'){ header("Pragma: no-cache"); } else { header("Pragma: "); } header("Expires: 0"); echo $filestring; die(); } else { //******************************* // PUT FILE IN TEMP DIR //******************************* $tmpfname = DIR_FS_DOCUMENT_ROOT . $tempdir . "$EXPORT_TIME.txt"; //unlink($tmpfname); $fp = fopen( $tmpfname, "w+"); fwrite($fp, $filestring); fclose($fp); echo "You can get your file in the Tools/Files under " . $tempdir . "EP" . $EXPORT_TIME . ".txt"; die(); } } // *** END *** download section ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo TITLE; ?></title> <link rel="stylesheet" type="text/css" href="includes/stylesheet.css"> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF"> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <table border="0" width="100%" cellspacing="2" cellpadding="2"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top" height="27"> <table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft"> <?php require(DIR_WS_INCLUDES . 'column_left.php');?> </table></td> <td class="pageHeading" valign="top"><?php echo "Easy Populate $curver - Default Language : " . $epdlanguage_name . '(' . $epdlanguage_id .')'; ?> <p class="smallText"> <?php if ($localfile or (is_uploaded_file($usrfl) && $split==0)) { //******************************* //******************************* // UPLOAD AND INSERT FILE //******************************* //******************************* if ($usrfl){ // move the file to where we can work with it $file = tep_get_uploaded_file('usrfl'); if (is_uploaded_file($file['tmp_name'])) { tep_copy_uploaded_file($file, DIR_FS_DOCUMENT_ROOT . $tempdir); } echo "<p class=smallText>"; echo "File uploaded. <br>"; echo "Temporary filename: " . $usrfl . "<br>"; echo "User filename: " . $usrfl_name . "<br>"; echo "Size: " . $usrfl_size . "<br>"; // get the entire file into an array $readed = file(DIR_FS_DOCUMENT_ROOT . $tempdir . $usrfl_name); } if ($localfile){ // move the file to where we can work with it $file = tep_get_uploaded_file('usrfl'); $attribute_options_query = "select distinct products_options_id from " . TABLE_PRODUCTS_OPTIONS . " order by products_options_id"; $attribute_options_values = tep_db_query($attribute_options_query); $attribute_options_count = 1; //while ($attribute_options = tep_db_fetch_array($attribute_options_values)){ if (is_uploaded_file($file['tmp_name'])) { tep_copy_uploaded_file($file, DIR_FS_DOCUMENT_ROOT . $tempdir); } echo "<p class=smallText>"; echo "Filename: " . $localfile . "<br>"; // get the entire file into an array $readed = file(DIR_FS_DOCUMENT_ROOT . $tempdir . $localfile); } // now we string the entire thing together in case there were carriage returns in the data $newreaded = ""; foreach ($readed as $read){ $newreaded .= $read; } // now newreaded has the entire file together without the carriage returns. // if for some reason excel put qoutes around our EOREOR, remove them then split into rows $newreaded = str_replace('"EOREOR"', 'EOREOR', $newreaded); $readed = explode( $separator . 'EOREOR',$newreaded); // Now we'll populate the filelayout based on the header row. $theheaders_array = explode( $separator, $readed[0] ); // explode the first row, it will be our filelayout $lll = 0; $filelayout = array(); foreach( $theheaders_array as $header ){ $cleanheader = str_replace( '"', '', $header); // echo "Fileheader was $header<br><br><br>"; $filelayout[ $cleanheader ] = $lll++; // } unset($readed[0]); // we don't want to process the headers with the data // now we've got the array broken into parts by the expicit end-of-row marker. array_walk($readed, 'walk'); } if (is_uploaded_file($usrfl) && $split==1) { //******************************* //******************************* // UPLOAD AND SPLIT FILE //******************************* //******************************* // move the file to where we can work with it $file = tep_get_uploaded_file('usrfl'); //echo "Trying to move file..."; if (is_uploaded_file($file['tmp_name'])) { tep_copy_uploaded_file($file, DIR_FS_DOCUMENT_ROOT . $tempdir); } $infp = fopen(DIR_FS_DOCUMENT_ROOT . $tempdir . $usrfl_name, "r"); //toprow has the field headers $toprow = fgets($infp,32768); $filecount = 1; echo "Creating file EP_Split" . $filecount . ".txt ... "; $tmpfname = DIR_FS_DOCUMENT_ROOT . $tempdir . "EP_Split" . $filecount . ".txt"; $fp = fopen( $tmpfname, "w+"); fwrite($fp, $toprow); $linecount = 0; $line = fgets($infp,32768); while ($line){ // walking the entire file one row at a time // but a line is not necessarily a complete row, we need to split on rows that have "EOREOR" at the end $line = str_replace('"EOREOR"', 'EOREOR', $line); fwrite($fp, $line); if (strpos($line, 'EOREOR')){ // we found the end of a line of data, store it $linecount++; // increment our line counter if ($linecount >= $maxrecs){ echo "Added $linecount records and closing file... <Br>"; $linecount = 0; // reset our line counter // close the existing file and open another; fclose($fp); // increment filecount $filecount++; echo "Creating file EP_Split" . $filecount . ".txt ... "; $tmpfname = DIR_FS_DOCUMENT_ROOT . $tempdir . "EP_Split" . $filecount . ".txt"; //Open next file name $fp = fopen( $tmpfname, "w+"); fwrite($fp, $toprow); } } $line=fgets($infp,32768); } echo "Added $linecount records and closing file...<br><br> "; fclose($fp); fclose($infp); echo "You can download your split files in the Tools/Files under /catalog/temp/"; } ?> </p> <table width="75%" border="2"> <tr> <td width="75%"> <FORM ENCTYPE="multipart/form-data" ACTION="easypopulate.php?split=0" METHOD=POST> <p> <div align = "left"> <p><b>Upload EP File</b></p> <p> <INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="100000000"> <p></p> <input name="usrfl" type="file" size="50"> <input type="submit" name="buttoninsert" value="Insert into db"> <br> </p> </div> </form> <FORM ENCTYPE="multipart/form-data" ACTION="easypopulate.php?split=1" METHOD=POST> <p> <div align = "left"> <p><b>Split EP File</b></p> <p> <INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="1000000000"> <p></p> <input name="usrfl" type="file" size="50"> <input type="submit" name="buttonsplit" value="Split file"> <br> </p> </div> </form> <FORM ENCTYPE="multipart/form-data" ACTION="easypopulate.php" METHOD=POST> <p> <div align = "left"> <p><b>Import from Temp Dir (<? echo $tempdir; ?>)</b></p> <p class="smallText"> <INPUT TYPE="text" name="localfile" size="50"> <input type="submit" name="buttoninsert" value="Insert into db"> <br> </p> </div> </form> <p><b>Download EP and Froogle Files</b></p> <!-- Download file links - Add your custom fields here --> <a href="easypopulate.php?download=stream&dltype=full">Download <b>Complete</b> tab-delimited .txt file to edit</a><br> <a href="easypopulate.php?download=stream&dltype=priceqty">Download <b>Model/Price/Qty</b> tab-delimited .txt file to edit</a><br> <a href="easypopulate.php?download=stream&dltype=category">Download <b>Model/Category</b> tab-delimited .txt file to edit</a><br> <a href="easypopulate.php?download=stream&dltype=froogle">Download <b>Froogle</b> tab-delimited .txt file</a><br> <!-- VJ product attributes begin //--> <?php if ($products_with_attributes == true) { ?> <a href="easypopulate.php?download=stream&dltype=attrib">Download <b>Model/Attributes</b> tab-delimited .txt file</a><br> <?php } ?> <!-- VJ product attributes end //--> <p><b>Create EP and Froogle Files in Temp Dir (<? echo $tempdir; ?>)</b></p> <a href="easypopulate.php?download=tempfile&dltype=full">Create Complete tab-delimited .txt file in temp dir</a><br> <a href="easypopulate.php?download=tempfile&dltype=priceqty"">Create Model/Price/Qty tab-delimited .txt file in temp dir</a><br> <a href="easypopulate.php?download=tempfile&dltype=category">Create Model/Category tab-delimited .txt file in temp dir</a><br> <a href="easypopulate.php?download=tempfile&dltype=froogle">Create Froogle tab-delimited .txt file in temp dir</a><br> <!-- VJ product attributes begin //--> <a href="easypopulate.php?download=tempfile&dltype=attrib">Create Model/Attributes tab-delimited .txt file in temp dir</a><br> <!-- VJ product attributes end //--> </td> </tr> </table> </td> </tr> </table> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <p> </p> <p> </p><p><br> </p></body> </html> <?php function ep_get_languages() { $languages_query = tep_db_query("select languages_id, code from " . TABLE_LANGUAGES . " order by sort_order"); // start array at one, the rest of the code expects it that way $ll =1; while ($ep_languages = tep_db_fetch_array($languages_query)) { //will be used to return language_id en language code to report in product_name_code instead of product_name_id $ep_languages_array[$ll++] = array( 'id' => $ep_languages['languages_id'], 'code' => $ep_languages['code'] ); } return $ep_languages_array; }; function tep_get_tax_class_rate($tax_class_id) { $tax_multiplier = 0; $tax_query = tep_db_query("select SUM(tax_rate) as tax_rate from " . TABLE_TAX_RATES . " WHERE tax_class_id = '" . $tax_class_id . "' GROUP BY tax_priority"); if (tep_db_num_rows($tax_query)) { while ($tax = tep_db_fetch_array($tax_query)) { $tax_multiplier += $tax['tax_rate']; } } return $tax_multiplier; }; function tep_get_tax_title_class_id($tax_class_title) { $classes_query = tep_db_query("select tax_class_id from " . TABLE_TAX_CLASS . " WHERE tax_class_title = '" . $tax_class_title . "'" ); $tax_class_array = tep_db_fetch_array($classes_query); $tax_class_id = $tax_class_array['tax_class_id']; return $tax_class_id; } function print_el( $item2 ) { echo " | " . substr(strip_tags($item2), 0, 10); }; function print_el1( $item2 ) { echo sprintf("| %'.4s ", substr(strip_tags($item2), 0, 80)); }; function ep_create_filelayout($dltype){ global $filelayout, $filelayout_count, $filelayout_sql, $langcode, $fileheaders, $max_categories; // depending on the type of the download the user wanted, create a file layout for it. $fieldmap = array(); // default to no mapping to change internal field names to external. switch( $dltype ){ case 'full': // The file layout is dynamically made depending on the number of languages $iii = 0; $filelayout = array( 'v_products_model' => $iii++, 'v_products_image' => $iii++, ); foreach ($langcode as $key => $lang){ $l_id = $lang['id']; // uncomment the head_title, head_desc, and head_keywords to use // Linda's Header Tag Controller 2.0 //echo $langcode['id'] . $langcode['code']; $filelayout = array_merge($filelayout , array( 'v_products_name_' . $l_id => $iii++, 'v_products_description_' . $l_id => $iii++, 'v_products_url_' . $l_id => $iii++, // 'v_products_head_title_tag_'.$l_id => $iii++, // 'v_products_head_desc_tag_'.$l_id => $iii++, // 'v_products_head_keywords_tag_'.$l_id => $iii++, )); } // uncomment the customer_price and customer_group to support multi-price per product contrib $filelayout = array_merge($filelayout , array( 'v_products_image' => $iii++, 'v_products_image_med' => $iii++, 'v_products_image_lrg' => $iii++, 'v_products_image_sm_1' => $iii++, 'v_products_image_xl_1' => $iii++, 'v_products_image_sm_2' => $iii++, 'v_products_image_xl_2' => $iii++, 'v_products_image_sm_3' => $iii++, 'v_products_image_xl_3' => $iii++, 'v_products_image_sm_4' => $iii++, 'v_products_image_xl_4' => $iii++, 'v_products_image_sm_5' => $iii++, 'v_products_image_xl_5' => $iii++, 'v_products_image_sm_6' => $iii++, 'v_products_image_xl_6' => $iii++, 'v_products_price' => $iii++, 'v_products_quantity' => $iii++, 'v_products_weight' => $iii++, #'v_customer_price_1' => $iii++, #'v_customer_group_id_1' => $iii++, #'v_customer_price_2' => $iii++, #'v_customer_group_id_2' => $iii++, #'v_customer_price_3' => $iii++, #'v_customer_group_id_3' => $iii++, #'v_customer_price_4' => $iii++, #'v_customer_group_id_4' => $iii++, 'v_manufacturers_name' => $iii++, #'v_products_ship_price' => $iii++, 'v_date_added' => $iii++, 'v_date_avail' => $iii++, )); // VJ product attribs begin $header_array = array( 'v_products_price' => $iii++, 'v_products_weight' => $iii++, 'v_date_avail' => $iii++, 'v_date_added' => $iii++, 'v_products_quantity' => $iii++, ); $languages = tep_get_languages(); global $attribute_options_array; $attribute_options_count = 1; foreach ($attribute_options_array as $attribute_options_values) { $key1 = 'v_attribute_options_id_' . $attribute_options_count; $header_array[$key1] = $iii++; for ($i=0, $n=sizeof($languages); $i<$n; $i++) { $l_id = $languages[$i]['id']; $key2 = 'v_attribute_options_name_' . $attribute_options_count . '_' . $l_id; $header_array[$key2] = $iii++; } $attribute_values_query = "select products_options_values_id from " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " where products_options_id = '" . (int)$attribute_options_values['products_options_id'] . "' order by products_options_values_id"; $attribute_values_values = tep_db_query($attribute_values_query); $attribute_values_count = 1; while ($attribute_values = tep_db_fetch_array($attribute_values_values)) { $key3 = 'v_attribute_values_id_' . $attribute_options_count . '_' . $attribute_values_count; $header_array[$key3] = $iii++; $key4 = 'v_attribute_values_price_' . $attribute_options_count . '_' . $attribute_values_count;
  8. It is possible to have articles on index.php (like the newsdesk 1.48 contribution does) between "Welcome Guest" and "New products for May"? Cheers, Andrew
  9. Yesssss! I had a working EP on my localhost. But the document root dir setting was different like the live shop: define('DIR_FS_DOCUMENT_ROOT', $DOCUMENT_ROOT); I replaced the original doc root address define('DIR_FS_DOCUMENT_ROOT', '/usr/local/www/data/www.eware.hu/catalog/'); with define('DIR_FS_DOCUMENT_ROOT', $DOCUMENT_ROOT); and PRESTO! YYEEAAHHH! :rolleyes:
  10. define('DIR_FS_DOCUMENT_ROOT', '/usr/local/www/data/www.eware.hu/catalog/'); $tempdir = "/temp/"; $tempdir2 = "/temp/"; filepermission of /temp/ is 777
  11. Hi Mibble! I have to make my EP work again. But I have that "nothing happened" thing, and I dont have time to go back 20-30 pages to find a solution. File uploaded. Temporary filename: /var/tmp/phplXpcNW User filename: EP2005May03-2008_modified.txt Size: 82532 My shop is on a FreeBSD server. OsC 2.2 Milestone with lots of contribs all working well now (except EP) What infos u need to help me or what settings I have to check? Cheers, Andrew
  12. Oh yeah! Its working! One more thing. No harm but I realised that your embedded wysiwyg editor couldnt handle preformatted html content. I'd like to add another wysiwyg editor which can. How do I remove your editor?
  13. Hi Steve! Can I change the default language_id from 1 to 2? DROP TABLE IF EXISTS newsdesk_categories_description; CREATE TABLE newsdesk_categories_description ( categories_id int(11) NOT NULL default '0', language_id int(11) NOT NULL default '1', categories_name varchar(32) NOT NULL default '', PRIMARY KEY (categories_id,language_id), KEY idx_categories_name (categories_name) ) TYPE=MyISAM; DROP TABLE IF EXISTS newsdesk_description; CREATE TABLE newsdesk_description ( newsdesk_id int(11) NOT NULL auto_increment, language_id int(11) NOT NULL default '1', newsdesk_article_name varchar(64) NOT NULL default '', newsdesk_article_description text, newsdesk_article_shorttext text, newsdesk_article_url varchar(255) default NULL, newsdesk_article_url_name varchar(255) default NULL, newsdesk_article_viewed int(5) default '0', newsdesk_image_text text, newsdesk_image_text_two text, newsdesk_image_text_three text, PRIMARY KEY (newsdesk_id,language_id), KEY newsdesk_article_name (newsdesk_article_name) ) TYPE=MyISAM AUTO_INCREMENT=1; and from 0 to 2 DROP TABLE IF EXISTS newsdesk_reviews_description; CREATE TABLE newsdesk_reviews_description ( reviews_id int(11) NOT NULL default '0', languages_id int(11) NOT NULL default '0', reviews_text text NOT NULL, PRIMARY KEY (reviews_id,languages_id) ) TYPE=MyISAM; Cheers, Andrew
  14. Hi! I only have 2 languages. I tried to modify the sql file to avoid any unnecessary insertion. But it give me an sql error. So I ask you to help me modify the sql file which will match my needings. - I need only 2 languages - all default language_id references should be "2" not "1" or "0" because it is my default language - I do not need any "test news" insertion the best thing would be a "blank" sql file I will add the news myself via admin (the original sql is good for testing locally and discover newsdesk features but for a live shop a blank would be better) Here is my modified sql file (I'm sure I missed something but I dont know what it is): My default language is hungarian (2) so I duplicated all english insertion and I leave them in english to avoid any disturbing content. I will translate them later. -- -- Table structure for table `newsdesk` -- DROP TABLE IF EXISTS newsdesk; CREATE TABLE newsdesk ( newsdesk_id int(11) NOT NULL auto_increment, newsdesk_image varchar(64) default NULL, newsdesk_image_two varchar(64) default NULL, newsdesk_image_three varchar(64) default NULL, newsdesk_date_added datetime NOT NULL default '0000-00-00 00:00:00', newsdesk_last_modified datetime default NULL, newsdesk_date_available datetime default NULL, newsdesk_status tinyint(1) NOT NULL default '0', newsdesk_sticky tinyint(1) NOT NULL default '1', PRIMARY KEY (newsdesk_id), KEY idx_newsdesk_date_added (newsdesk_date_added) ) TYPE=MyISAM AUTO_INCREMENT=4; -- -- Dumping data for table `newsdesk` -- INSERT INTO newsdesk (newsdesk_id, newsdesk_image, newsdesk_image_two, newsdesk_image_three, newsdesk_date_added, newsdesk_last_modified, newsdesk_date_available, newsdesk_status, newsdesk_sticky) VALUES (1, 'newsdesk_test_osc_sticky.gif', '', '', '2003-03-10 02:32:00', '2004-05-12 14:09:14', NULL, 1, 1), (2, 'newsdesk_test_osc_thanks.gif', '', '', '2003-03-10 02:40:20', '2004-05-26 18:38:18', NULL, 1, 0), (3, 'newsdesk_test_osc_action.gif', 'newsdesk_test_osc_cartoons.gif', 'newsdesk_test_osc_graphic.gif', '2003-03-10 23:40:39', '2004-05-19 18:46:08', NULL, 1, 0); -- -------------------------------------------------------- -- -- Table structure for table `newsdesk_categories` -- DROP TABLE IF EXISTS newsdesk_categories; CREATE TABLE newsdesk_categories ( categories_id int(11) NOT NULL auto_increment, categories_image varchar(64) default NULL, parent_id int(11) NOT NULL default '0', sort_order int(3) default NULL, date_added datetime default NULL, last_modified datetime default NULL, catagory_status tinyint(1) NOT NULL default '1', PRIMARY KEY (categories_id), KEY idx_categories_parent_id (parent_id) ) TYPE=MyISAM AUTO_INCREMENT=10; -- -- Dumping data for table `newsdesk_categories` -- INSERT INTO newsdesk_categories (categories_id, categories_image, parent_id, sort_order, date_added, last_modified, catagory_status) VALUES (1, NULL, 0, 1, '2003-03-10 02:27:32', '2004-05-12 11:29:55', 1), (2, NULL, 0, 2, '2003-03-10 02:28:09', '2004-05-12 14:42:55', 1), (3, NULL, 0, 4, '2003-03-10 02:28:34', '2004-05-12 14:44:12', 0), (4, NULL, 0, 5, '2003-03-10 02:28:58', '2004-05-12 14:43:59', 1), (5, NULL, 0, 6, '2003-03-10 12:02:57', '2004-05-12 14:43:39', 1), (6, NULL, 5, 1, '2003-03-10 12:03:28', '2004-05-12 12:22:14', 1), (7, NULL, 5, 2, '2003-03-10 23:20:06', '2004-05-12 12:23:41', 1), (8, NULL, 5, 3, '2003-03-10 23:36:12', '2004-05-12 12:25:20', 1), (9, NULL, 0, 3, '2004-05-12 14:42:03', '2004-05-12 14:44:30', 1); -- -------------------------------------------------------- -- -- Table structure for table `newsdesk_categories_description` -- DROP TABLE IF EXISTS newsdesk_categories_description; CREATE TABLE newsdesk_categories_description ( categories_id int(11) NOT NULL default '0', language_id int(11) NOT NULL default '1', categories_name varchar(32) NOT NULL default '', PRIMARY KEY (categories_id,language_id), KEY idx_categories_name (categories_name) ) TYPE=MyISAM; -- -- Dumping data for table `newsdesk_categories_description` -- INSERT INTO newsdesk_categories_description (categories_id, language_id, categories_name) VALUES (1, 1, 'image'), (1, 2, 'image'), (2, 1, 'one image'), (2, 2, 'one image'), (3, 1, 'off'), (3, 2, 'off'), (4, 1, 'sticky'), (4, 2, 'sticky'), (5, 1, 'nested top'), (5, 2, 'nested top'), (6, 1, 'nested down one'), (6, 2, 'nested down one'), (7, 1, 'nested down two'), (7, 2, 'nested down two'), (8, 1, 'nested down three'), (8, 2, 'nested down three'), (9, 1, 'no image'), (9, 2, 'no image'), -- -------------------------------------------------------- -- -- Table structure for table `newsdesk_configuration` -- DROP TABLE IF EXISTS newsdesk_configuration; CREATE TABLE newsdesk_configuration ( configuration_id int(11) NOT NULL auto_increment, configuration_title varchar(64) NOT NULL default '', configuration_key varchar(64) NOT NULL default '', configuration_value varchar(255) NOT NULL default '', configuration_description varchar(255) NOT NULL default '', configuration_group_id int(11) NOT NULL default '0', sort_order int(5) default NULL, last_modified datetime default NULL, date_added datetime NOT NULL default '0000-00-00 00:00:00', use_function varchar(255) default NULL, set_function varchar(255) default NULL, PRIMARY KEY (configuration_id) ) TYPE=MyISAM AUTO_INCREMENT=40; -- -- Dumping data for table `newsdesk_configuration` -- INSERT INTO newsdesk_configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES (1, 'Search Results', 'MAX_DISPLAY_NEWSDESK_SEARCH_RESULTS', '20', 'How many articles do you want to list?', 1, 1, NULL, '2003-02-16 02:08:36', NULL, NULL), (2, 'Page Links', 'MAX_DISPLAY_NEWSDESK_PAGE_LINKS', '5', 'Number of links to use for page-sets', 1, 2, NULL, '2003-02-16 02:08:36', NULL, NULL), (3, 'Display Headline', 'NEWSDESK_ARTICLE_NAME', '2', 'Do you want to display the headline? (0=disable; 1=enable)', 1, 3, '2004-05-10 13:28:31', '2003-02-16 02:08:36', NULL, NULL), (4, 'Display Summary', 'NEWSDESK_ARTICLE_SHORTTEXT', '0', 'Do you want to display the summary? (0=disable; \r\n\r\n1=enable)', 1, 4, '2004-05-10 13:28:38', '2003-02-16 02:08:36', NULL, NULL), (5, 'Display Content', 'NEWSDESK_ARTICLE_DESCRIPTION', '0', 'Do you want to display the content? (0=disable; \r\n\r\n1=enable)', 1, 5, '2004-05-10 13:28:43', '2003-02-16 02:08:36', NULL, NULL), (6, 'Display Date', 'NEWSDESK_DATE_AVAILABLE', '1', 'Do you want to display the date? (0=disable; 1=enable)', 1, 6, NULL, '2003-02-16 02:08:36', NULL, NULL), (7, 'Display URL', 'NEWSDESK_ARTICLE_URL', '4', 'Do you want to display the outside resource URL? (0=disable; \r\n\r\n1=enable)', 1, 7, '2004-05-26 18:50:41', '2003-02-16 02:08:36', NULL, NULL), (8, 'Display URL Name', 'NEWSDESK_ARTICLE_URL_NAME', '3', 'Do you want to display the outside resource URL Name (0=disable; 1=enable)', 1, 8, '2004-05-26 17:08:00', '2004-05-26 17:07:00', NULL, NULL), (9, 'Display Status', 'NEWSDESK_STATUS', '0', 'Do you want to display the status for the article? (0=disable; 1=enable)', 1, 9, '2004-05-10 13:28:52', '2003-02-16 02:08:36', NULL, NULL), (10, 'Display Image 1', 'NEWSDESK_IMAGE', '0', 'Do you want to display image "1" for the article? (0=disable; 1=enable)', 1, 10, '2004-05-10 13:28:57', '2003-02-16 02:08:36', NULL, NULL), (11, 'Display Image 2', 'NEWSDESK_IMAGE_TWO', '0', 'Do you want to display image "2" for the article? (0=disable; 1=enable)', 1, 11, '2004-05-10 13:29:01', '2003-02-16 02:08:36', NULL, NULL), (12, 'Display Image 3', 'NEWSDESK_IMAGE_THREE', '0', 'Do you want to display image "3" for the article? (0=disable; 1=enable)', 1, 12, '2004-05-10 13:29:06', '2003-02-16 02:08:36', NULL, NULL), (14, 'Location of Prev/Next Navigation Bar', 'NEWSDESK_PREV_NEXT_BAR_LOCATION', '3', 'Sets the location of the Prev/Next Navigation Bar (1-top, 2-bottom, 3-both)', 1, 14, NULL, '2003-02-16 02:08:36', NULL, NULL), (15, 'Display Main News Items', 'MAX_DISPLAY_NEWSDESK_NEWS', '3', 'How many articles do you want to display on the top page?', 2, 1, NULL, '2003-02-16 02:08:36', NULL, NULL), (16, 'Latest News Box Counts', 'LATEST_DISPLAY_NEWSDESK_NEWS', '5', 'How many articles do you want to display in the Latest News Box?', 2, 2, NULL, '2003-02-16 02:08:36', NULL, NULL), (17, 'Display Latest News Box', 'DISPLAY_LATEST_NEWS_BOX', '1', 'Do you want to display the Latest News Box? (0=disable; 1=enable)', 2, 3, NULL, '2003-02-16 02:08:36', NULL, NULL), (18, 'Display News Catagory Box', 'DISPLAY_NEWS_CATAGORY_BOX', '1', 'Do you want to display the News Catagory Box? (0=disable; 1=enable)', 2, 4, NULL, '2003-02-16 02:08:36', NULL, NULL), (19, 'Display View Counts', 'DISPLAY_NEWSDESK_VIEWCOUNT', '1', 'Do you want to display View Counts? (0=disable; 1=enable)', 2, 5, NULL, '2003-02-16 02:08:36', NULL, NULL), (20, 'Display Read More', 'DISPLAY_NEWSDESK_READMORE', '1', 'Do you want to display Read More? (0=disable; 1=enable)', 2, 6, NULL, '2003-02-16 02:08:36', NULL, NULL), (21, 'Display Summary', 'DISPLAY_NEWSDESK_SUMMARY', '1', 'Do you want to display the News Summary? (0=disable; 1=enable)', 2, 7, NULL, '2003-02-16 02:08:36', NULL, NULL), (22, 'Display Headline', 'DISPLAY_NEWSDESK_HEADLINE', '1', 'Do you want to display the News Headline? (0=disable; 1=enable)', 2, 8, NULL, '2003-02-16 02:08:36', NULL, NULL), (23, 'Display Date', 'DISPLAY_NEWSDESK_DATE', '1', 'Do you want to display the News Date? (0=disable; 1=enable)', 2, 9, NULL, '2003-02-16 02:08:36', NULL, NULL), (24, 'Display Image 1', 'DISPLAY_NEWSDESK_IMAGE', '1', 'Do you want to display image "1" for the article? (0=disable; 1=enable)', 2, 10, NULL, '2003-03-03 11:59:47', NULL, NULL), (25, 'Display Image 2', 'DISPLAY_NEWSDESK_IMAGE_TWO', '1', 'Do you want to display image "2" for the article? (0=disable; 1=enable)', 2, 11, '2003-03-03 12:08:55', '2003-03-03 11:59:47', NULL, NULL), (26, 'Display Image 3', 'DISPLAY_NEWSDESK_IMAGE_THREE', '1', 'Do you want to display image "3" for the article? (0=disable; 1=enable)', 2, 12, '2003-03-03 12:09:16', '2003-03-03 11:59:47', NULL, NULL), (27, 'Display Reviews', 'DISPLAY_NEWSDESK_REVIEWS', '1', 'Do you want to display News Reviews? (0=disable; 1=enable)', 3, 1, '2004-05-18 15:39:09', '2003-02-16 02:08:36', NULL, NULL), (28, 'New Reviews', 'MAX_DISPLAY_NEW_REVIEWS', '10', 'Maximum number of new reviews to display', 3, 2, NULL, '2003-02-16 02:08:36', NULL, NULL), (29, 'Display Headline', 'STICKY_ARTICLE_NAME', '1', 'Do you want to display the headline? (0=disable; 1=enable)', 4, 1, NULL, '2003-03-02 00:47:21', NULL, NULL), (30, 'Display Summary', 'STICKY_ARTICLE_SHORTTEXT', '1', 'Do you want to display the summary? (0=disable; 1=enable)', 4, 2, NULL, '2003-03-02 00:47:21', NULL, NULL), (31, 'Display Content', 'STICKY_ARTICLE_DESCRIPTION', '1', 'Do you want to display the content? (0=disable; 1=enable)', 4, 3, '2003-03-02 00:49:34', '2003-03-02 00:47:21', NULL, NULL), (32, 'Display View Counts', 'STICKY_NEWSDESK_VIEWCOUNT', '1', 'Do you want to display View Counts? (0=disable; 1=enable)', 4, 4, NULL, '2003-03-02 00:47:21', NULL, NULL), (33, 'Display Read More', 'STICKY_NEWSDESK_READMORE', '1', 'Do you want to display Read More? (0=disable; 1=enable)', 4, 5, NULL, '2003-03-02 00:47:21', NULL, NULL), (34, 'Display Date', 'STICKY_DATE_ADDED', '1', 'Do you want to display the date? (0=disable; 1=enable)', 4, 6, '2003-03-02 00:49:54', '2003-03-02 00:47:21', NULL, NULL), (35, 'Display URL', 'STICKY_ARTICLE_URL', '0', 'Do you want to display the outside resource URL? (0=disable; 1=enable)', 4, 7, '2004-05-26 17:13:50', '2003-03-02 00:47:21', NULL, NULL), (36, 'Display URL Name', 'STICKY_ARTICLE_URL_NAME', '1', 'Do you want to display the outside resource URL Name (0=disable; 1=enable)', 4, 8, '2003-03-02 00:51:00', '2003-03-02 00:50:00', NULL, NULL), (37, 'Display Image', 'STICKY_IMAGE', '1', 'Do you want to display image "1" for the article? (0=disable; 1=enable)', 4, 9, '2003-03-02 00:50:14', '2003-03-02 00:47:21', NULL, NULL), (38, 'Display Image 2', 'STICKY_IMAGE_TWO', '1', 'Do you want to display image "2"for the article? (0=disable; 1=enable)', 4, 10, NULL, '2003-03-03 23:10:34', NULL, NULL), (39, 'Display Image 3', 'STICKY_IMAGE_THREE', '1', 'Do you want to display image "3" for the article? (0=disable; 1=enable)', 4, 11, NULL, '2003-03-03 23:10:34', NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `newsdesk_configuration_group` -- DROP TABLE IF EXISTS newsdesk_configuration_group; CREATE TABLE newsdesk_configuration_group ( configuration_group_id int(11) NOT NULL auto_increment, configuration_group_title varchar(64) NOT NULL default '', configuration_group_description varchar(255) NOT NULL default '', sort_order int(5) default NULL, visible int(1) default '1', PRIMARY KEY (configuration_group_id) ) TYPE=MyISAM AUTO_INCREMENT=5; -- -- Dumping data for table `newsdesk_configuration_group` -- INSERT INTO newsdesk_configuration_group (configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible) VALUES (1, 'Listing Settings', 'Listing Page configuration options', 1, 1), (2, 'Frontpage Settings', 'Front Page configuration options', 1, 1), (3, 'Reviews Settings', 'Reviews configuration options', 1, 1), (4, 'Sticky Settings', 'Reviews configuration options', 1, 1); -- -------------------------------------------------------- -- -- Table structure for table `newsdesk_description` -- DROP TABLE IF EXISTS newsdesk_description; CREATE TABLE newsdesk_description ( newsdesk_id int(11) NOT NULL auto_increment, language_id int(11) NOT NULL default '1', newsdesk_article_name varchar(64) NOT NULL default '', newsdesk_article_description text, newsdesk_article_shorttext text, newsdesk_article_url varchar(255) default NULL, newsdesk_article_url_name varchar(255) default NULL, newsdesk_article_viewed int(5) default '0', newsdesk_image_text text, newsdesk_image_text_two text, newsdesk_image_text_three text, PRIMARY KEY (newsdesk_id,language_id), KEY newsdesk_article_name (newsdesk_article_name) ) TYPE=MyISAM AUTO_INCREMENT=4; -- -- Dumping data for table `newsdesk_description` -- INSERT INTO newsdesk_description (newsdesk_id, language_id, newsdesk_article_name, newsdesk_article_description, newsdesk_article_shorttext, newsdesk_article_url, newsdesk_article_url_name, newsdesk_article_viewed, newsdesk_image_text, newsdesk_image_text_two, newsdesk_image_text_three) VALUES (1, 1, 'Stickies are here!', 'Stickies have been implemented in v1.48.2<br />\r\n<br />\r\nIs this not a nifty feature?', '<b>Welcome to the Sticky area</b>', '', '', 0, '', '', ''), (1, 2, 'Stickies are here!', 'Stickies have been implemented in v1.48.2<br />\r\n<br />\r\nIs this not a nifty feature?', '<b>Welcome to the Sticky area</b>', '', '', 0, '', '', ''), (2, 1, 'NewsDesk version 1.48.2', '<b>NewsDesk version 1.48.2 RELEASED!</b><br />\r\n<br />\r\nWith the great help of a few brave souls we can all now enjoy a newer and more powerful, flexible, function rich (<i>too rich?</i>) NewsDesk <ul><li>Mulitple images</li><li>Review Approvals</li><li>RSS</li><li>HTML Bar Editing</li><li>Remove Images</li><li>Subtitles for Images</li><li>And of course Stickies</li></ul>I hope that you will enjoy your NewsDesk!', '<b>Welcome to NewsDesk version 1.48.2</b><i>Special thanks to those who helped with Beta Testing!</i>', 'www.wolfen.uklinux.net/product_info.php?cPath=1&products_id=1', 'Newsdesk', 0, '', '', ''), (2, 2, 'NewsDesk version 1.48.2', '<b>NewsDesk version 1.48.2 RELEASED!</b><br />\r\n<br />\r\nWith the great help of a few brave souls we can all now enjoy a newer and more powerful, flexible, function rich (<i>too rich?</i>) NewsDesk <ul><li>Mulitple images</li><li>Review Approvals</li><li>RSS</li><li>HTML Bar Editing</li><li>Remove Images</li><li>Subtitles for Images</li><li>And of course Stickies</li></ul>I hope that you will enjoy your NewsDesk!', '<b>Welcome to NewsDesk version 1.48.2</b><i>Special thanks to those who helped with Beta Testing!</i>', 'www.wolfen.uklinux.net/product_info.php?cPath=1&products_id=1', 'Newsdesk', 0, '', '', ''), (3, 1, '3 images !!!', '<s>3 images</s> !!!<u>NewsDesk version 1.48.2</u> now has the capability to use 3 images <br />\r\n<br />\r\nplus <sub>subtitles</sub>.<sup>Yippe</sup> Is life not grand?', '<b>NOW up to 3 images can be used!!!</b>', '', '', 0, 'action', 'cartoons', 'graphic'), (3, 2, '3 images !!!', '<s>3 images</s> !!!<u>NewsDesk version 1.48.2</u> now has the capability to use 3 images <br />\r\n<br />\r\nplus <sub>subtitles</sub>.<sup>Yippe</sup> Is life not grand?', '<b>NOW up to 3 images can be used!!!</b>', '', '', 0, 'action', 'cartoons', 'graphic'), -- -------------------------------------------------------- -- -- Table structure for table `newsdesk_reviews` -- DROP TABLE IF EXISTS newsdesk_reviews; CREATE TABLE newsdesk_reviews ( reviews_id int(11) NOT NULL auto_increment, newsdesk_id int(11) NOT NULL default '0', customers_id int(11) default NULL, customers_name varchar(64) NOT NULL default '', reviews_rating int(1) default NULL, date_added datetime default NULL, last_modified datetime default NULL, reviews_read int(5) NOT NULL default '0', approved tinyint(3) unsigned default '0', PRIMARY KEY (reviews_id) ) TYPE=MyISAM AUTO_INCREMENT=11; -- -- Dumping data for table `newsdesk_reviews` -- INSERT INTO newsdesk_reviews (reviews_id, newsdesk_id, customers_id, customers_name, reviews_rating, date_added, last_modified, reviews_read, approved) VALUES (1, 1, 2, 'test test', 5, '2003-03-11 01:26:31', NULL, 4, 1), (2, 3, 2, 'Carsten aka Moyashi', 4, '2003-03-11 01:29:02', NULL, 2, 1), (3, 2, 2, 'Carsten aka Moyashi', 5, '2003-03-11 01:29:53', NULL, 1, 1), (4, 2, 2, 'steve 241', 1, '2004-05-18 18:01:20', NULL, 1, 1), (5, 1, 2, 'steve 241', 2, '2004-05-18 16:25:15', '2004-05-18 16:49:55', 3, 1), (6, 1, 2, 'steve 241', 4, '2004-05-18 16:06:46', NULL, 2, 1), (7, 1, 2, 'steve 241', 3, '2004-05-18 16:09:34', NULL, 0, 1), (8, 2, 2, 'steve 241', 5, '2004-05-18 18:25:13', NULL, 1, 1), (9, 2, 2, 'steve 241', 3, '2004-05-18 18:37:50', NULL, 2, 1), (10, 3, 2, 'steve 241', 4, '2004-05-19 10:10:41', NULL, 1, 0); -- -------------------------------------------------------- -- -- Table structure for table `newsdesk_reviews_description` -- DROP TABLE IF EXISTS newsdesk_reviews_description; CREATE TABLE newsdesk_reviews_description ( reviews_id int(11) NOT NULL default '0', languages_id int(11) NOT NULL default '0', reviews_text text NOT NULL, PRIMARY KEY (reviews_id,languages_id) ) TYPE=MyISAM; -- -- Dumping data for table `newsdesk_reviews_description` -- INSERT INTO newsdesk_reviews_description (reviews_id, languages_id, reviews_text) VALUES (1, 1, 'Thanks to Emiliano for his \r\n\r\nefforts in beta testing and providing ideas and code to help make NewsDesk better'), (2, 1, 'hehe, after almost a week of effort I was able to finish this part of the mod. I hope that you all enjoy it!'), (3, 1, 'I wonder who will approve this review just to read it '), (4, 1, 'this is a test of the reviews section of the newsdesk'), (5, 1, 'this is a test to check the reviews function within the admin'), (6, 1, 'I think that more use can be made of the stickies area than is being done so far'), (7, 1, 'this is to further test the use of the reviews section of the newsdesk'), (8, 1, 'this is a test of the newsdesk reviews procedure and the if switch'), (9, 1, 'this is just a quick test of the review write for the newsdesk'), (10, 1, 'The use of and or availability of having 3 images is a useful addition to the newsdesk'); -- -------------------------------------------------------- -- -- Table structure for table `newsdesk_to_categories` -- DROP TABLE IF EXISTS newsdesk_to_categories; CREATE TABLE newsdesk_to_categories ( newsdesk_id int(11) NOT NULL default '0', categories_id int(11) NOT NULL default '0', PRIMARY KEY (newsdesk_id,categories_id) ) TYPE=MyISAM; -- -- Dumping data for table `newsdesk_to_categories` -- INSERT INTO newsdesk_to_categories (newsdesk_id, categories_id) VALUES (1, 4), (2, 2), (3, 1); Any help will be appreciated. Thx, Andrew
  15. I'd like to display users only from .hu domains. Other hits are not so important for me and increase the pageload time unnecessarily. Any help will be appreciated.
  16. Hi! I'd like to add only one function to my admin/customers site. The ability to listing only those customers who subscribed for a newsletter. Any help will be appreciated. Thx, Andrew :rolleyes:
  17. I hope someone can help with this "project". I have several suppliers for products like harddisk, vga cards etc. I'd like to make an excel script (for price comparison reason) which can insert prices from an xls file (with 2 columns: v_products_model, v_products_price) into an existing fully formatted EasyPopulate.txt file which already has the current datas from the shop. The new prices should place into a new column (next to the v_products_price column) with the proper order based on model number. And when I execute the script again for the 2nd and 3rd supplier it should insert a 2nd and 3rd column next to the 1st newly inserted price column (ofcourse next to the v_products_price column). The newly created columns will be named as: 1st supplier, 2nd supplier etc. Another function will be good if its possible to implement it: From these new columns the script will highlight the best price and the suppliers name in each row on 2 separate column after the EOEOR column. Hereby I can easily have the best price automatically by the script. Its will accelerate my work especially when I have hundreds of products from 4-5 supllier. Correction for the above image: This is how should look the fully formatted EP file after the script was executed and the prices imported into new columns. After this I will overwrite the v_products_price column's values with the best price's values then I will delete all the unnecessary columnes. Upload EP file. Presto! I have hundreds of updated prices in my shop with best prices from various suppliers in minutes. Thats the goal... I can use a hand on this cos I never wrote an excel macro before. If I'm not perfectly clear please let me know, I'll try to explain in other way. Ps.: It could be very handy to all EP users B)
  18. I had the same problem before. http://www.oscommerce.com/forums/index.php?sho...=64945&st=1480# I cant solve it so I start to make the EP files again and it works! Or you can comment out the $inactive = 'Inactive'; line. So the products goes automatically active. Im not an EP expert I just share my experiences.
  19. I have EP 2.74 and Ultrapics things working together. Made by me based on the modified EP 2.65 files to handle Ultrapics image paths. (I can share this easypopulate.php to the public if needed.) Everything working flawless except with an Adobe software list. When I upload the txt file all the prodacts goes to inactive thus the quantity column has a value 1 everywhere. So the products are not visible in the catalog. Another txt file with the same column headers works. I checked everything twice but the Adobe list wont work as it should. Or maybe I just to blind to see the problem. If I comment out the $inactive = 'Inactive'; line in easypopulate.php then all the products forced goes to visible. //**** Status Field Setting **** // Set the v_status field to "Inactive" if you want the status=0 in the system // Set the v_status field to "Delete" if you want to remove the item from the system <- THIS IS NOT WORKING YET! // If zero_qty_inactive is true, then items with zero qty will automatically be inactive in the store. global $active, $inactive, $zero_qty_inactive, $deleteit; $active = 'Active'; //$inactive = 'Inactive'; //$deleteit = 'Delete'; // not functional yet $zero_qty_inactive = false; My question is: will this setting set inactive products to active when I update the prices parexamle?
  20. Lot of us have the "nothing uploaded with no errors" thing with the well known message: File uploaded. Temporary filename: /var/tmp/phpXe32zZ User filename: EP2005Feb14-1432.txt Size: 18145 I have this since my isp installed a new server with register globals off for a safety reason on a shared server. I went through 10 pages back in this topic. I have a temp dir with 777. I tried the $tempdir = "/temp/"; $tempdir2 = "/temp/"; with and without a leading slash. and of course the jb fix: Here is the server info of my page: http://www.eware.hu/index_phpinfo.php I can post my easypopulate.php if needed. Please help me to solve this problem. :rolleyes: Mibble: please include my name in your answer if you referring to me. Thx
  21. I started over with a clean install and I added Ultrapics + the modified Easypopulate for ultrapics but nothing was uploaded. Im on a local win32 webserver. Any idea?
  22. Bump :-" and Can anybody give a hand on this? I tried to add the "27 Nov 2003 - WYSIWYG HTML ADDON" but I cant get it work. I have WYSIWYG HTMLArea MS2 v1.7 and EasyPopulate 2.74 installed before. Admin totally messed up some setting titles are duplicated or more. configuration/images: Title Value Action Small Image Width 100 Small Image Height 80 Info Heading Image Width 57 Info Heading Image Height 40 Info Subcategory Image Width 100 Info Subcategory Image Height 57 Info Calculate Image Size true Info Image Required true Info Enable Additional Images? Enable Info Enable Additional Images? Enable Info Enable Additional Images? Enable Info Enable PHP Image Manager? Enable Info Enable PHP Image Manager? Enable Info Enable PHP Image Manager? Enable Info Additional Thumb Width 140 Info Additional Thumb Width 140 Info Additional Thumb Width 140 Info Additional Thumb Height 120 Info Additional Thumb Height 120 Info Additional Thumb Height 120 Info Medium Image Width 200 Info Medium Image Width 200 Info Medium Image Width 200 Info Medium Image Height 200 Info Medium Image Height 200 Info Medium Image Height 200 Info Large Image Width (Pop-up) 0 Info Large Image Width (Pop-up) Info Large Image Width (Pop-up) Info Large Image Height (Pop-up) 0 Info Large Image Height (Pop-up) Info Large Image Height (Pop-up) Info configuration/WYSIWYG Editor 1.7 looks like this Title Value Action PRODUCT DESCRIPTIONS use WYSIWYG HTMLAREA? Enable PRODUCT DESCRIPTIONS use WYSIWYG HTMLAREA? Enable Info PRODUCT DESCRIPTIONS use WYSIWYG HTMLAREA? Enable Info PRODUCT DESCRIPTIONS use WYSIWYG HTMLAREA? Enable Info Product Description Basic/Advanced Version? Basic Info Product Description Basic/Advanced Version? Basic Info Product Description Basic/Advanced Version? Basic Info Product Description Basic/Advanced Version? Basic Info Product Description Layout Width 505 Info Product Description Layout Width 505 Info Product Description Layout Width 505 Info Product Description Layout Width 505 Info Product Description Layout Height 240 Info Product Description Layout Height 240 Info Product Description Layout Height 240 Info Product Description Layout Height 240 Info CUSTOMER EMAILS use WYSIWYG HTMLAREA? Enable Info Customer Email Basic/Advanced Version? Basic Info Customer Email Layout Width 505 Info DEFINE MAINPAGE use WYSIWYG HTMLAREA? Enable Info DEFINE MAINPAGE use WYSIWYG HTMLAREA? Enable Info DEFINE MAINPAGE use WYSIWYG HTMLAREA? Enable Info Customer Email Layout Height 140 Info Define Mainpage Basic/Advanced Version? Basic Info Define Mainpage Basic/Advanced Version? Basic Info Define Mainpage Basic/Advanced Version? Basic Info NEWSLETTER EMAILS use WYSIWYG HTMLAREA? Enable Info Newsletter Email Basic/Advanced Version? Basic Info Newsletter Email Layout Width 505 Info Define Mainpage Layout Width 605 Info Define Mainpage Layout Width 605 Info Define Mainpage Layout Width 605 Info Newsletter Email Layout Height 140 Info DEFINE MAINPAGE use WYSIWYG HTMLAREA? Enable Info Define Mainpage Basic/Advanced Version? Basic Info Define Mainpage Layout Height 300 Info Define Mainpage Layout Height 300 Info Define Mainpage Layout Height 300 Info Define Mainpage Layout Width 605 Info Define Mainpage Layout Height 300 Info INFORMATION PAGES UNLIMITED use WYSIWYG HTMLAREA? Enable Info INFORMATION PAGES UNLIMITED use WYSIWYG HTMLAREA? Enable Info INFORMATION PAGES UNLIMITED use WYSIWYG HTMLAREA? Enable Info GLOBAL - User Interface Font Type Times New Roman Info Information Pages Basic/Advanced Version? Basic Info Information Pages Basic/Advanced Version? Basic Info Information Pages Basic/Advanced Version? Basic Info GLOBAL - User Interface Font Size 12 Info Information Pages Layout Width 505 Info Information Pages Layout Width 505 Info Information Pages Layout Width 505 Info Information Pages Layout Height 240 Info Information Pages Layout Height 240 Info Information Pages Layout Height 240 Info GLOBAL - User Interface Font Colour Black Info CUSTOMER EMAILS use WYSIWYG HTMLAREA? Enable Info CUSTOMER EMAILS use WYSIWYG HTMLAREA? Enable Info CUSTOMER EMAILS use WYSIWYG HTMLAREA? Enable Info GLOBAL - User Interface Background Colour White Info Customer Email Basic/Advanced Version? Basic Info Customer Email Basic/Advanced Version? Basic Info Customer Email Basic/Advanced Version? Basic Info GLOBAL - ALLOW DEBUG MODE? 0 Info Customer Email Layout Width 550 Info Customer Email Layout Width 550 Info Customer Email Layout Width 550 Info Customer Email Layout Height 300 Info Customer Email Layout Height 300 Info Customer Email Layout Height 300 Info NEWSLETTER EMAILS use WYSIWYG HTMLAREA? Enable Info NEWSLETTER EMAILS use WYSIWYG HTMLAREA? Enable Info NEWSLETTER EMAILS use WYSIWYG HTMLAREA? Enable Info Newsletter Email Basic/Advanced Version? Basic Info Newsletter Email Basic/Advanced Version? Basic Info Newsletter Email Basic/Advanced Version? Basic Info Newsletter Email Layout Width 505 Info Newsletter Email Layout Width 505 Info Newsletter Email Layout Width 505 Info Newsletter Email Layout Height 140 Info Newsletter Email Layout Height 140 Info Newsletter Email Layout Height 140 Info GLOBAL - User Interface (GUI) Font Type Times New Roman Info GLOBAL - User Interface (GUI) Font Type Times New Roman Info GLOBAL - User Interface (GUI) Font Type Times New Roman Info GLOBAL - User Interface (GUI) Font Size 12 Info GLOBAL - User Interface (GUI) Font Size 12 Info GLOBAL - User Interface (GUI) Font Size 12 Info GLOBAL - User Interface (GUI) Font Colour Black Info GLOBAL - User Interface (GUI) Font Colour Black Info GLOBAL - User Interface (GUI) Font Colour Black Info GLOBAL - User Interface (GUI) Background Colour White Info GLOBAL - User Interface (GUI) Background Colour White Info GLOBAL - User Interface (GUI) Background Colour White Info GLOBAL - ALLOW DEBUG MODE? 0 Info GLOBAL - ALLOW DEBUG MODE? 0 Info GLOBAL - ALLOW DEBUG MODE? 0 Info I think I pasted wrong codes to the wrong places. Need help to solve this :'(
  23. I have WYSIWYG HTMLArea MS2 v1.7 and EasyPopulate 2.74 installed. Now I'd like to add Ultrapics to my shop. Which version should I use? It will be very nice if this mod can have a step by step intall guide, like the other contributions.
  24. Hi! Can you guide me (or just send back the necessary codes) how to make this mod to be compatible with this contribution: regions shipping module 4.0 No 818.
×
×
  • Create New...