Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

EasyPopulate and Image Mod


Guest

Recommended Posts

Does anyone have a working copy of easypopulate.php that has been modified for the multiple image mod that I can take a gander at?

 

I've uncomment what i believe are the right sections, but am getting a parse error on line 1188.

 

Thanks, I'd like to compare the two.

Link to comment
Share on other sites

Actually the parsing error is on line 1627:

 

"Parse error: parse error in /home/smokeyci/smokeyci-www/adminx/easypopulate.php on line 1627"

 

 	 $query = "INSERT INTO products (

  	 products_image,

  	 products_mimage,

  	 products_bimage,

  	 #products_subimage1,

  	 #products_bsubimage1,

  	 #products_subimage2,

  	 #products_bsubimage2,

  	 #products_subimage3,

  	 #products_bsubimage3,

  	 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',";



	 // 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')

    	 ";

 

LINE 1627 IS THIS ONE:

 	 $query .=  . $v_products_mimage . '", "'

Link to comment
Share on other sites

Sure am. I know it's just syntax. It works like a charm before I un-comment the image stuff.

 

I wish I could light a candle and believe! It's driving me up a wall. :?

 

 

Love that contribution though... :)

Link to comment
Share on other sites

$query .=      . $v_products_mimage . '", "'

 

The . is a concatenation operator and should not appear between = and the $ variable. What you have here is akin to saying x=*3*2 rather than x=3*2. In case my explanation doesn't help, I think that the code should look like this:

 

$query .=      $v_products_mimage . '", "'

 

Hope this helps,

Matt

I love deadlines. I like the whooshing sound they make as they fly by. ---Douglas Adams

Link to comment
Share on other sites

No dice. it moved the parse error to line 1188. Still investigating....

 

(this one has had me stumped for quite awhile) I'd like to see a working copy of easypopulate.php uncommented for image mods. I know it's something stupid and easy. I'm just not familiar w/ php/mysql syntax, so I cant spot the easy stuff...

Link to comment
Share on other sites

I am having this same problem. Has anyone found a fix yet?

 

James

 

Add a semicolon at the end of the statement that you are uncommenting. It should look something like this:

$query .=  . 'blah blah' . 

 . ' blah blah ' .

 . 'blahblah';

 

Sorry for the problem....

 

Tim

Link to comment
Share on other sites

Tim,

 

Still getting the same error. Here is what my code looks like now. Anything else you see that needs changing?

 

// 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')

    	 ";

 

Thanks

 

James

Link to comment
Share on other sites

Remove the leading concatenation operator as well.

 

The fact that it moved the error means it did something.

 

so instead of

$query .= . v_blahblah...............

it looks like

$query .= v_blahblah...............

 

Tim

Link to comment
Share on other sites

I changed my code to look like this:

 

$query .=   $v_products_mimage . '", "'

    	 . $v_products_bimage . '", "'

    	 . $v_products_subimage1 . '", "'

    	 . $v_products_bsubimage1 . '", "'

    	 . $v_products_subimage2 . '", "'

    	 . $v_products_bsubimage2 . '", "'

    	 . $v_products_subimage3 . '", "'

    	 . $_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')

    	 ";

 

Now my parse error has moved to line 1188. I never touched that line so I think I did something wrong in the code above still. Anything stand out?

Link to comment
Share on other sites

James,

did you check the error log on your hosting account? It may tell you somethng. I have not got past the parse 1188 error myself. Email me your easypopulate.php and i'll take a look. I should get the same error as you.

 

[email protected]

Link to comment
Share on other sites

Shawn,

I am not getting any parse errors anymore, however when I download the the database file, there are no fields for the extra images. I will email you my easypopulatae file so you can compare it to yours.

 

James

Link to comment
Share on other sites

James emailed me his easypop.php. In the version he mailed me, there was one other section that needed to be uncommented. I am passed all parse errors now but when I download/export data from my DB, i have the same issue as James. None of the image fields are downloaded.

 

Tim, what might cause this?

Link to comment
Share on other sites

Shawn,

After I emailed the file to you I looked it over again and saw the section you mentioned. Even after uncommenting this, the multiple image fields are still not included in the download file. I can't find anything else related to the images that hasn't been uncommented. Is anyone else having the problem?

 

James

Link to comment
Share on other sites

Still no luck... :(

 

Does anyone have a WORKING copy of easypopulate.php adjusted for the image module contribution that i can look at? please please.

Link to comment
Share on other sites

I FIXED IT!!!!

 

There were a few things that needed changing, but after a little tinkering it works like a charm!

 

I am quite new to PHP, and i'm not sure if my way was the way Tim had it set up in the first place, but it works and I'm happy.

 

If anyone wants a copy of my updated file, email me and I will be happy to send it to you.

 

Thanks again Tim for this great mod, and your efforts in helping us solve our problems.

 

James

Link to comment
Share on other sites

Basically what I did was I went through the whole easypopulate.php file and found every instance where "products_image" occurred.

Now, in some places I noticed there was no reference to the other images. So all I did was add corosponding references to the other images (products_bimage, products_subimage1, etc...) right after "products_image".

 

There were quite a few places where I needed to do this, so I would wrather not post every bit of code I changed. If you would like a copy of my easypopulate.php file, let me know.

 

 

James

Link to comment
Share on other sites

Please email a copy to Tim, and I would appreciate a copy also. I am updating to add quantity pricing upload ability.

[no external urls in signatures please, kthanks]

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...