osCmax v2.5 User Manual
Results 1 to 4 of 4

Easypopulate Wrecks my HTML

This is a discussion on Easypopulate Wrecks my HTML within the osCommerce 2.2 Modification Help forums, part of the osCommerce 2.2 Forums category; Hi guys, I did lots of Googling, searched this site and the OSC site before posting this, I know repeat ...

      
  1. #1
    New Member
    Join Date
    Sep 2005
    Posts
    7
    Rep Power
    0


    Default Easypopulate Wrecks my HTML

    Hi guys, I did lots of Googling, searched this site and the OSC site before posting this, I know repeat questions are annoying.
    After some struggles, I got EP to accept my text files. CHMODd the temp dir, added model numbers, etc.
    But I have lots of html in the item descriptions (thanks to the great WYSIWYG editor) and it gets wrecked when imported via EP.
    I turned off the "replace quotes" feature, and this causes it to hang up on ' marks during import. I tried search/replacing the ' marks with /', which still resulted in the same errors during upload.
    Is there a rewrite/code change in easypopulate.php or something that will allow me to upload product descriptions with all my html intact?
    Thanks.

  2. #2
    osCMax Developer

    michael_s's Avatar
    Join Date
    Jul 2002
    Location
    Phoenix, AZ
    Posts
    19,907
    Rep Power
    568


    Default RE: Easypopulate Wrecks my HTML

    You must replace single quotes with \' NOT /'

    Backslash is the escape character not forwardslash...
    Michael Sasek
    osCMax Developer


    osCmax Installation Service
    - Have our professionals install osCmax on your server - same day service!
    osCmax 2.5 User Manual - the must have beginners guide to osCmax v2.5

    Stay Up To Date with everything osCMax:
    Free osCmax Newsletters - Security notices, New Releases, osCMax News
    osCmax on Twitter - Up to the minute info as it happens. Know it first.

    osCmax Documentation

  3. #3
    New Member
    Join Date
    Sep 2005
    Posts
    7
    Rep Power
    0


    Default RE: Easypopulate Wrecks my HTML

    Thank you! You're a saint to answer all these questions. I run a forum myself so I know how it can be.
    Ok, so I ended up editing the easypopulate.php file, changing this:
    Code:
    $items[$i] = str_replace('\"\"',""",$items[$i]);
    					if ($replace_quotes){
    						$items[$i] = str_replace('\"',"&#34",$items[$i]);
    						$items[$i] = str_replace("\'","&#39",$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('""',"&#34",$items[$i]);
    					if ($replace_quotes){
    						$items[$i] = str_replace('"',"&#34",$items[$i]);
    						$items[$i] = str_replace("'","&#39",$items[$i]);
    to this (added a ; mark after the &#32 and &#34) -- even wrapped in the code tags, this forum is interpreting those strings into the actual " and ' characters

    Code:
    $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]);
    So now the pages render with tables intact, etc, but images are broken. Right click/properties on a broken image gives me the image URL with a %22 tacked on the end (there are no %22 strings in easypopulate.php) like so:

    Code:
    http://www.deepstealth.com/store/images/atulips.jpg%22/
    BUT viewing the source on the page shows the image url as having a #34 w/semicolon (again being rendered on this forum page as a space char below, although in the code it is the actual #34semicolon string)
    Code:
    <img width="230" hspace="10" height="153" alt="voice" src="../../../store/images/atulips.jpg"/>
    So I'm stumped as to where the %22 is coming from, and why properties and viewsource give different info on the same image.[/code]

  4. #4
    New Member
    Join Date
    Jun 2005
    Posts
    10
    Rep Power
    0


    Default Anyone figure this oue out yet?

    I am wondering if Anyone figure this oue out yet?

Similar Threads

  1. Help with HTML & PHP OSCommerce
    By genijan in forum osCommerce 2.2 Modification Help
    Replies: 1
    Last Post: 03-05-2005, 09:54 AM
  2. Really Simple HTML Help
    By braydonhouse in forum osCommerce 2.2 Modification Help
    Replies: 1
    Last Post: 02-22-2004, 06:25 AM
  3. HTML in emails
    By Anonymous in forum osCmax v1.7 Discussion
    Replies: 8
    Last Post: 12-05-2003, 08:09 AM
  4. HTML?
    By West in forum osCommerce 2.2 Modification Help
    Replies: 0
    Last Post: 05-05-2003, 03:28 PM
  5. HTML Newsletter
    By adrenalinez in forum osCommerce 2.2 Modification Help
    Replies: 0
    Last Post: 01-29-2003, 09:16 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •