Jump to content
Sign in to follow this  
tooth

image code translation

Recommended Posts

Hi,

 

I can't seem to get my head wrpped around this code convertion...I am trying to make this a contrib when it is finished.

 

This is supposed to be simple and easy to do image effect, and it works in any other php site that I have implemented it into, but not this shop for some reason...

 

place this in the head

 

<script type="text/javascript" src="image.js"></script>

 

then call it by simply adding class="image" to the src like <img src="/img/pic.jpg" class="image" width="600" height="802">

 

So to make this work in the catalog I need to convert the above to work in the following code - I don't now how to convert it...please help.

 

<a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'] , $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_name'] . '</a>

 

Thank you in advance,

Tooth

Share this post


Link to post
Share on other sites

Alter this code:

 

SUBCATEGORY_IMAGE_HEIGHT)

to:

 

SUBCATEGORY_IMAGE_HEIGHT, 'class="image" ')


If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Share this post


Link to post
Share on other sites

Hi Jim,

 

Thank you for the tip - unfortunately it still does not want to work...I am not new to PHP, but I also do not know everything [i am always learning]. It always works on every other site that I implement it to. This is the first time that i have had to work with code like that...I wonder why it does not work, it is supposed to be simple, in most cases 60 seconds of work.

 

Tooth.

Share this post


Link to post
Share on other sites

<right-click> on the page where the code is supposed to show up, then choose "View source".

 

Examine the HTML source for the images.

 

Does it not have the code you said you needed with the images?

:unsure:


If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Share this post


Link to post
Share on other sites

...everything is for sure up on the server as I double checked. I have installed this effect on many sites before without issue...

 

When I view page source the exicuted code shows this <img src="images/hotsellers.jpg" border="0" alt="widget" title=" widget " width="110" height="110" vspace=0 class=ch5>

 

But...

 

Looking at another site I set up 8 months ago the source for an exicuted page looks like this <img class="image" src="img/tooth1.jpg" alt="" width="500" height="375" border="0" />

 

Oooops! My Bad - I think I need the class place in the beginning not the end...where should I do that, in what part of the code.

 

Thanks in advance Jim...

 

Regards,

Tooth

Share this post


Link to post
Share on other sites

It doesn't matter where the class is "order wise", first or last.

 

If the code you needed to show for the image isn't there, you must be editing the wrong file because the code mod I posted will do what you asked.


If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Share this post


Link to post
Share on other sites

I am editing the index, there is no mistaking that...on the server viewing through ftp the changes are in the code. I am trying to implement an effect on the catalog item image. I believe that the code I am editing is the correct code as when I delete the entire line from the page the image i want to affect disapeared - then I added the original line back and the image re appeared. So, I am possitive that I am editing and uploading the correct file as well as editing the correct line and place.

 

I don't know why it is not working as it always works without issue in other sites that i maintain...I also did a basic test in a regular staic page today and the regular code works, except with this cart, I converted it doing as you wrote nothing happens. I checked the paths, I uploaded all files needed numerous times and double checked the line needed in the head. Because I have done this process many times before, you would think that it should always be simple. I dunno??

 

Thanks,

Tooth

Edited by tooth

Share this post


Link to post
Share on other sites

I have no idea what it is you're trying to accomplish, but you've posted two different classes:

 

<img src="images/hotsellers.jpg" border="0" alt="widget" title=" widget " width="110" height="110" vspace=0 class=ch5>

<img class="image" src="img/tooth1.jpg" alt="" width="500" height="375" border="0" />

Obviously they both can't be correct.


If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Share this post


Link to post
Share on other sites

Maybe if you PM'd me the link to the page I could better assist.

 

Or is it one of those, "I could tell you, but I'd have to kill you" deals?

:unsure:

 

:lol:


If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Share this post


Link to post
Share on other sites

...yep! That is absolutly obvious!

 

The lines are from two different unrelated websites...the second line works, the first line is what shows in the excicuted page after adding what you wrote. I have never writen PHP code like that - I only do basics. In the html example that I showed in the begining of this thread, all is well.

 

To be sure that I was editing the correct line I deleted it and published it - no image - added the line back and published - it shows up...then I edited it the way you told me too and published then that is the line in the exicuted source. I know what i am editing is the correct line.

 

Here is a link to this very simple effect...try it. http://www.netzgesta.de/instant/

Share this post


Link to post
Share on other sites

Jim,

 

Could it be that the flollowing line is over riding and placing the "class=ch5" instead of my hard coded class="image"

. tep_image(DIR_WS_IMAGES . $categories['categories_image'] , $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) .

 

I know that this is the correct line, I know that the call to the js file is in the head, I know that all files have been uploaded to the root...I also know that I saved all changes and uploaded the correct file. i don't know where else to narrow this down to figure it out.

 

Thanks again for all your help thus far...

 

Tooth

Share this post


Link to post
Share on other sites

I can't be of any more help without a link to the actual site you're working on.


If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Share this post


Link to post
Share on other sites

The link you sent was incomplete.


If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Share this post


Link to post
Share on other sites

If anyone else has any ideas, please feel free to jump in - better yet, see if you can get it working on TEP...It works for other website quite nicely, it is a great effect. It will change regular images on the fly into a poleriod looking photo...it will be great to use to dress up any catalog without editing every image manually to look the same. The site posted has the free source...please let me know if you are able to figure this out. I have been awake all day and all night trying to get this going.

 

Thanks in advance...

 

Best regards,

Tooth

Share this post


Link to post
Share on other sites
...resolved, thanks Jim.

:)

 

Tooth

 

...and so, what was it? I'm having similar problems with one particular line of code (similar to what you were battling with). I'm bashing my head against this wall and just can't figure it out. Looking at your posts I reckon you and I are in the same boat as this whole osc, php, etc.. development thing. What I'm trying to do is normally a simple edit, I've done hundreds of times, but for some frustrating reason nothing I'm throwing at it is working. The code in your posts looks very similar to mine so I believe I'm on the right path - just happy to have seen your posts and then got to the end, a dead end.

 

Your help will be most appreciated, as I'm sure it will be by future developers.

 

Thanks!!

;)


Never underestimate the power of stupid people, especially in groups.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×