Jump to content


  • Content count

  • Joined

  • Last visited

About iainsanderson

  • Birthday 07/15/1973

Profile Information

  • Real Name
    Iain Sanderson
  • Location
    South Of France
  • Interests
    I love looking after my daughter, not many dads get to do this fulltime. <br /><br />Music, Web, Powerboating.
  • Website
  1. iainsanderson

    Easy Populate & Products Attributes

    Hi is there anyway that I could change EP so that it could read the text file that I recieve, the text file contains data on stock availability, but it has different headings to that used in OSC. here is an example of the text file: **START IB 0702026174 BI hardback AU EVANS, WILLIAM CHARLES BC MMG CO UK EI 15REV ED IU 275ILLS PD 20011213 NP 600 RP 62.99 RI 62.99 RE 62.99 DI 286 x 229 PU ELSEVIER HEALTH SCIENCES YP 2001 RC Y RS ACADEMIC/SPECIALIST TI TREASE AND EVANS PHARMACOGNOSY DE Serves as the encyclopaedic reference work on pharmacognosy, the study of those natural substances, principally plants, that find a use in medicine. This book balances between classical and modern aspects of this branch of science, and covers the importance of complementary medicines, including herbal, homeopathic and aromatherapy. EA 9780702026171 RF R WE 1780 SG 1 GC O00 ** IB 0862726921 BI paperback AU BURTON, JOHN BC PSVW7 CO UK IL OLIVER, WILLIAM IU ILLUSTRATIONS, COLOUR PHOTOS PD 19911130 NP 192 RP 10.99 RI 10.99 RE 10.99 DI 225 x 123 PU KINGFISHER BOOKS LTD YP 1991 RC G RS GENERAL SR FIELD GUIDES TI FIELD GUIDE TO THE MAMMALS OF BRITAIN AND EUROPE DE A guide to over 160 species of mammals from Britain and Europe. Concise descriptions summarize the key physical features, behaviour and range of each main animal, as well as distinguishing similar species. Also included is information on life cycles and conservation status. EA 9780862726928 RF R WE 378 SG 3 GC C05 ** As you can see it is set out differently from the normal EP file and it has different headings. Each book is seperated by the ** Any ideas ? Iain
  2. iainsanderson

    [Contribution] STS v4

    Hi, I have installed the new 4.1 version with all the updates and the typo update, I have re-checked everything, but still get a blank page when I enable the sts. I have tried the test & full templates but still get a blank page. when I disable the sts everything is fine. Have I missed something ? This is my sts.php file: require (DIR_WS_FUNCTIONS.'sts.php'); class sts { var $sts_block, $template, $display_template_output, $display_debugging_output, $template_file, $template_folder; function sts (){ $this->update_from_url(); // Check for debug mode from URL // Use template output if enabled or in debug mode (=only for admin) if ((MODULE_STS_DEFAULT_STATUS == 'true') || ($this->display_debug_output == true)) { $this->display_template_output = true; } else { $this->display_template_output = false; return; } define('STS_TEMPLATE_DIR', DIR_WS_INCLUDES . 'sts_templates/' . $this->template_folder .'/'); define('STS_DEFAULT_TEMPLATE', STS_TEMPLATE_DIR . MODULE_STS_TEMPLATE_FILE); define('DIR_WS_TEMPLATE_IMAGES', STS_TEMPLATE_DIR . DIR_WS_IMAGES); // Initialisation of variables $this->template = array('debug' => '', 'headcontent' =>'', 'extracss' =>''); $this->version= "4.1"; $this->osc_version_required = "osCommerce 2.2-MS2"; // Actions to do first $this->check_version(PROJECT_VERSION); // Check if this STS is running under the correct osCommerce version // Find the right template to use according to actual page and parameters. Displays normal output if no template returned if ( !tep_not_null($this->find_template()) ) { $this->display_template_output = false; // If no template returned, do not use templates at all and exit return; } if ($this->read_template_file() == false) { $this->display_template_output = false; // If template file does not exist, do not use templates at all and exit return; } } //end constructor function check_version ($osc_version) { // Perform OSC version checking if ($osc_version != $this->osc_version_required) { die("STS4 was designed to work with OSC version [" . $this->osc_version_required . "]. This is version [" . $osc_version . " ]"); } } function update_from_url () { global $HTTP_GET_VARS, $sts_template_folder; //, $current_category_id; // Allow Debugging control from the URL if ($HTTP_GET_VARS['sts_debug'] == MODULE_STS_DEBUG_CODE ) { $this->display_debug_output = true; } /* $sts_template_id = $current_category_id; // *g* */ if (tep_not_null($HTTP_GET_VARS['sts_template'])) { $sts_template_folder = tep_db_prepare_input($HTTP_GET_VARS['sts_template']); } $template_folder_installed = explode (';', MODULE_STS_TEMPLATE_FOLDER); if ( !isset( $template_folder_installed[(int)$sts_template_folder] ) ) { // default $sts_template_folder = 0; $this->template_folder = $template_folder_installed[$sts_template_folder]; } else { $this->template_folder = $template_folder_installed[(int)$sts_template_folder]; } if (!tep_session_is_registered('sts_template_folder')) { tep_session_register('sts_template_folder'); } } function find_template (){ global $PHP_SELF; // Retrieve script name without path nor parameters $scriptbasename = basename ($PHP_SELF); // If script name contains "popup" then turn off templates and display the normal output // This is required to prevent display of standard page elements (header, footer, etc) from the template and allow javascript code to run properly // Do not add pages here unless it is from the standard osC and really should be there. If you have a special page that you don't want with template, // Create a module sts_mypagename.php that returns an empty string as template filename, it will automatically switch off STS for this page. if (strstr($scriptbasename, "popup")|| strstr($scriptbasename, "info_shopping_cart")) { $this->display_template_output = false; return; } // Check for module that will handle the template (for example module sts_index takes care of index.php templates) $check_file = 'sts_' . $scriptbasename; $modules_installed = explode (';', MODULE_STS_INSTALLED); if (!in_array($check_file, $modules_installed)) $check_file = 'sts_default.php'; include_once (DIR_WS_MODULES.'sts/' . $check_file); $classname=substr($check_file,0,strlen($check_file)-4); $this->script=new $classname; // Create an object from the module // If module existes but is disabled, use the default module. if ($this->script->enabled==false) { unset ($this->script); include_once (DIR_WS_MODULES.'sts/sts_default.php'); $this->script = new sts_default; // Create an object from the module } $this->template_file = $this->script->find_template(); // Retrieve the template to use return $this->template_file; } function start_capture () { // Start redirecting output to the output buffer, if template mode on. if ($this->display_template_output) { ob_start(); } } function stop_capture ($block_name='', $action='') { // Store captured output to $sts_capture if (!$this->display_template_output) return; // Do not process anything if we are not in using templates $block = ob_get_clean(); // Get content and clean the buffer if (!tep_not_null($block_name)) return; // Not need to continue if we don't want to save the buffer switch($action) { case 'box': $this->template[$block_name]= sts_strip_unwanted_tags($block, $block_name); break; default: $this->template[$block_name] = $block; } // switch } function restart_capture ($block_name='sts_empty', $action='') { // Capture buffer, save it and start a new capture if (!$this->display_template_output) return; $this->stop_capture($block_name, $action); $this->start_capture(); } function capture_fields (){ // If we use template, ask to module what file(s) to include for building fields if ($this->display_template_output) { $fields_arr= explode(';', 'general.php;'.$this->script->capture_fields ()); } return $fields_arr; } function read_template_file (){ // Purpose: Open Template file and read it // Generate an error if the template file does not exist and return 'false'. if (!file_exists($this->template_file)) { print 'Template file does not exist: ['.$this->template_file.']'; return false; } // We use templates and the template file exists // Capture the template, this way we can use php code inside templates $this->start_capture(); // Start capture to buffer require_once($this->template_file); // Includes the template, this way php code can be used in templates*/ $this->stop_capture('template_html'); return true; } // End read_template_file function replace (){ global $messageStack, $request_type; if (!$this->display_template_output) return; // Go out if we don't use template if (defined("STS_END_CHAR") == false) define ('STS_END_CHAR', ''); // An end char must be defined, even if empty. // Load up the <head> content that we need to link up everything correctly. Append to anything that may have been set in sts_user_code.php // Note that since v3.0, stylesheet is not defined here but in the template file, allowing different stylesheet for different template. $this->template['headcontent'] = $this->template['headcontent'].''; $this->template['headcontent'] = $this->template['headcontent'].'<meta http-equiv="Content-Type" content="text/html; charset=' . CHARSET . '">' . "\n"; $this->template['headcontent'] = $this->template['headcontent'].$this->template['headertags']; $this->template['headcontent'] = $this->template['headcontent'].'<base href="' . (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG . '">' . "\n"; $this->template['headcontent'] = $this->template['headcontent'].get_javascript($this->template['applicationtop2header'],'get_javascript(applicationtop2header)'); $this->script->replace($this->template); // Module can make tricks here, just before replacing, like using own content template // Add messages before the content if ($messageStack->size('header') > 0) { $this->template['content'] = $messageStack->output('header') . $this->template['content']; } // Manually replace the <!--$headcontent--> if present $this->template['template_html'] = str_replace('<!--$headcontent-->', $this->template['headcontent'], $this->template['template_html']); // Manually replace the <!--$extracss--> with template['extracss'] $this->template['template_html'] = str_replace('<!--$extracss-->', $this->template['extracss'], $this->template['template_html']); // Automatically replace all the other template variables if (STS_END_CHAR=='') { // If no end char defined for the placeholders, have to sort the placeholders. uksort($this->template, "sortbykeylength"); // Sort array by string length, so that longer strings are replaced first } foreach ($this->template as $key=>$value) { $this->template['template_html'] = str_replace('$' . $key . STS_END_CHAR , $value, $this->template['template_html']); } } // ***************************************** // Functions added for debug // ***************************************** function add_debug ($text, $br=true) { // STS v4.1: Add debug text to the STS PLUS debug variable. If $br=false, then no line break added $this->template['debug'].= $text . ($br ? "\n" : ''); } } //end class ?> End of file____________________________________________________________________________ _ When using the STS which page does it go to first ? If I know this I may beable to find out the problem. Thank in advance. Iain
  3. iainsanderson

    easy populate - Please Help

    Cheers Porblem sorted. Iain
  4. iainsanderson

    OScommerce and 2checkout

    I have now got pm2checkout v2.0 I have been able to place an order and go all the throught to 2checkout to pay. The order is then processed and once processed I select inform supplier that order was successful. This should then pass me back to my website, pm2checkout_process.php The problems are as follows: I get to pm2checkout_process.php and get error page cannot be displayed. Also no order details are stored in the database. Can someone please point me in the right direction. I am going to try 2.1b in the meantime.
  5. iainsanderson

    OScommerce and 2checkout

    I am in the middle of setting up a new website and have chosen OSC & 2checkout to work together. I have tried a number of different Mcheckout modules and had no luck. Does anyone have a working sample of osc & 2checkout when I say sample I mean the PMcheckout module I see it goes up to 2.1b has anyone got this to work ? Is anyone having similar problems ?
  6. iainsanderson

    easy populate - Please Help

    I have installed Easy Populate 2.81-MS2 and I am having problems loading data into the db I can download files ok, but when I try to import a catalog file i just get the following at the bottom of the page: File uploaded. Temporary filename: /tmp/phpTPpkRK User filename: New Upload.txt SIZE_EP895427 I have tried to load files that are far to big and still get the same. I have even tried deleting it and staring again, but still get the same problem.
  7. Hi All, I have installed the following mod: Down for Maintenance v1.0 I have also added the spider friendly lines of code. But I am getting the following problem: Warning: main(includes/functions/clean_html_comments.php): failed to open stream: No such file or directory in /home/iainsand/public_html/catalog/includes/application_top.php on line 522 Warning: main(includes/functions/clean_html_comments.php): failed to open stream: No such file or directory in /home/iainsand/public_html/catalog/includes/application_top.php on line 522 Warning: main(includes/functions/clean_html_comments.php): failed to open stream: No such file or directory in /home/iainsand/public_html/catalog/includes/application_top.php on line 522 Fatal error: main(): Failed opening required 'includes/functions/clean_html_comments.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/iainsand/public_html/catalog/includes/application_top.php on line 522 I have had a look for the file "clean_html_comments" but cannot find it? Any help will be greatly appreciated. Iain
  8. iainsanderson

    easy populate help needed

    Hi Jack, Thanks for helping, I was using version 2.79, which did not work for me, I then downgraded to 2.62 which now works fine dfor what I want it. The EP TEMP DIR was the problem, you are correct, I don't think as you say it was defined anywhere. Anyway many thanks for your help. Iain
  9. iainsanderson

    easy populate help needed

    I am not sure and being a newbie to osc, I am a bit hesitant in saying this. I am using 2.78-MS2 and I have been having alot of trouble uploading files, as you can see from the above threads. Everywhere I have looked it says maek sure the $tempdir setting are correct. Well I say.....I have looked everywhere for this line of code in my easypopulate.php file and it is no where to be seen, I am I missing something or what ? I read a document written by one of the forum users Daddyslipdisk and he said that the line of code should be just below the version information, well to my amazement its not.... Please please please, can someone set me straight on this. Other than the above its a great mod.
  10. iainsanderson

    easy populate help needed

    I have checked and I hadn't set them. I have now set them, but I am still getting the same problem
  11. iainsanderson

    easy populate help needed

    Ok, thank you for your help, I have now defined the table in databases.php and also built the table in phpmyadmin. I can now download ok, when Itry to upload the same file I am getting the following: Warning: move_uploaded_file(/home/iainsand/public_html/catalog/EP_TEMP_DIR/1010.xls): failed to open stream: No such file or directory in /home/iainsand/public_html/catalog/admin/includes/functions/easypopulate_functions.php on line 32 Warning: move_uploaded_file(): Unable to move '/tmp/php5pMc8G' to '/home/iainsand/public_html/catalog/EP_TEMP_DIR/1010.xls' in /home/iainsand/public_html/catalog/admin/includes/functions/easypopulate_functions.php on line 32 File uploaded. Temporary filename: /tmp/php5pMc8G User filename: 1010.xls SIZE_EP466 Warning: file(/home/iainsand/public_html/catalog/EP_TEMP_DIR1010.xls): failed to open stream: No such file or directory in /home/iainsand/public_html/catalog/admin/easypopulate.php on line 620 Warning: Invalid argument supplied for foreach() in /home/iainsand/public_html/catalog/admin/easypopulate.php on line 642 Cheers Iain
  12. iainsanderson

    easy populate help needed

    Hi All, I am new to osc and to easy populate. I need to use ep because I have alot of products and entering them by hand will take years. I have downloaded ep and it is on my live server. This may take sometime as I have a few problems, the first being how to build an import file ? I just need an example of one so that I can then add my products. when I try to download a text file, Download .txt file with TAB delimited to edit ( Model / Price / Quantity ) I get this message. 1146 - Table 'ebdbase.TABLE_PRODUCTS_GROUPS' doesn't exist SELECT customers_group_price, customers_group_id FROM TABLE_PRODUCTS_GROUPS WHERE products_id = 212 ORDER BY customers_group_id [TEP STOP] I am not sure what is happening, please help Thanks for all help in advance. Iain