Adding a bit of JavaScript Adding a bit of JavaScript
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Adding a bit of JavaScript

Started by phill104, October 25, 2007, 12:09:04 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

phill104

I would like to add a little javascript manifier* to coppermine but I'm not quite sure how to do it or where to put the code.

In plain HTML I would use the code

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

and to show the image

<div>
<img src="test.jpg" style="width:640px; height: 480px;" onmouseover="TJPzoom(this);">
</div>


For the script to run properly the image needs to be in a div tag.

Is it possible to do the above in PHP and where would I put the resulting code?

I'm guessing you have a $height and $width variable.

*The script puts a little magnifying glass over the image. I would like this to appear on the intermediate image.
It is a mistake to think you can solve any major problems just with potatoes.

just_some_guy

Maybe try the {IMAGE} token on theme.php.

Look in theme.php and fined the array in which the {IMAGE} is defined. I think this may contain the Slide Show artribute too.
I tried this when I put some JavaScript on. Then add your onmouseover to that.

May not be best practice. Make sure to backup your files.
Tambien, Hablo EspaƱol      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

Sami

Create a custom theme and put this

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

under template.html

and add theme_html_picture function from themes\sample\theme.php to themes\your-theme\theme.php and change the way you want
‍I don't answer to PM with support question
Please post your issue to related board

phill104

Cheers guys.

It's almost working properly
It is a mistake to think you can solve any major problems just with potatoes.