PDA

View Full Version : Addon: Secret Image


austriaka
12-21-2006, 10:23 PM
CHANGES:
2009-03-22 Modified version for Switchy users (http://www.pixelpost.org/forum/showthread.php?p=65192#post65192)
2007-11-22 Version Check added
2006-12-22 Download file updated (I forgot to remove a debugging part -sorry)

Description:
SECRET IMAGE ADDON reveals a "secret" image by a simple mouseover. You can use this addon for showing the raw image before processing or to show any other image instead.

http://uhlig.at/tmp/screenshot1.jpghttp://uhlig.at/tmp/screenshot2.jpg

Installation:
Drop the admin_secret.php into addons folder.
Create two little grafic elements for the "secret" grafic (one for normal, one for highlight) and save them as .gif-files.
Upload new "secret" grafics in admin addons area

http://uhlig.at/tmp/admin_screenshot1.jpg

Use it:
Upload the secret image along when uploading a new image.
Edit the secret image in a submenu of image edit.

http://uhlig.at/tmp/admin_screenshot2.jpg

http://uhlig.at/tmp/admin_screenshot3.jpg

Adjustments: (optional)
Change the title of the secret grafic in admin_secret.php (line 2)
Switch off/on the JavaScript fade effect (line 3)
Change the values of the JavaScript fade effect (lines 4 and 5)

Prefix for secret image:
"o_" (Don't care about it unless you want to upload secret images with FTP.)

NEW TAGS (for use in image_template.html):
<ATTRIBUT_NAME> - Main image must have attribute "name" for the JavaScript working! Put this tag after <img src="images/<IMAGE_NAME>" !
<SECRET_LINK> - The Secret grafic with mouseover, place it wherever you want in the image_template.html

No changes to database are made.

Download Secret Image (http://www.pixelpost.org/extend/addons/secret-image/download/)

The idea came from here: http://movie.leova.com/index.php?x=secret
Thanks to klimin_a_s (http://photoblog.birsk.info/) for testing and for forcing me to the image size correction

You can look at the live action at http://blog.uhlig.at


You like this addon?
https://www.paypal.com/en_US/i/btn/x-click-but04.gif (https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=karin%40uhlig%2eat&item_name=Donation%20for%20Pixelpost%20Stuff&item_number=pixelpost&no_shipping=0&no_note=1&tax=0&currency_code=EUR&bn=PP%2dDonationsBF&charset=UTF%2d8)
have fun with it!
KArin

Vernon.Trent
12-21-2006, 10:35 PM
very very cool :-)
thanks for sharing!

klimin_a_s
12-22-2006, 02:14 AM
Good work!

fredxeric
01-11-2007, 03:46 AM
Instead of uploading gif file in the addons sections on the pp admin console it is possible to upload a jpeg file?

austriaka
01-11-2007, 05:43 AM
Instead of uploading gif file in the addons sections on the pp admin console it is possible to upload a jpeg file?
sorry, in this version not.
If you want to hack the script, you can change ".gif" into ".jpeg" in lines
16, 17, 39 (2x), 40 (2x), 155 (2x)

KArin

GeoS
01-12-2007, 08:21 AM
@austriaka: Try to define image filename at the beginning of addon code. IMHO image file also should be outside addon dir as it isnt addon (but that is only small sugestion) :P
Anyway - great work :)

austriaka
01-12-2007, 08:34 AM
You mean name of the "secret" image (gif, the mousover grafic) or attribute "name" of the photo to be changable?

Secret Image file is saved in thumbnail folder because this has writing permission

KArin

KArin

irishblue
01-12-2007, 04:09 PM
Thanks for the add-on!

The admin area works well. But I have a problem though... my secret link doesn't work.. Did I paste the tags wrongly?
<a href="index.php?showimage=<IMAGE_PREVIOUS_ID>"><img id="image" src="./images/<IMAGE_NAME>" <ATTRIBUT_NAME> alt="<IMAGE_TITLE>" title="<IMAGE_PREVIOUS_TITLE>" width="<IMAGE_WIDTH>" height="<IMAGE_HEIGHT>" /></a>
<br /><SECRET_LINK>


Also, I noticed that you'll need to be logged in to the admin area prior to uploading the add-on, else it'll return a "fatal error". Thought you'd like to know :)

austriaka
01-12-2007, 04:53 PM
my secret link doesn't work.. Did I paste the tags wrongly?
<a href="index.php?showimage=<IMAGE_PREVIOUS_ID>"><img id="image" src="./images/<IMAGE_NAME>" <ATTRIBUT_NAME> alt="<IMAGE_TITLE>" title="<IMAGE_PREVIOUS_TITLE>" width="<IMAGE_WIDTH>" height="<IMAGE_HEIGHT>" /></a>
<br /><SECRET_LINK>

Looks correct. Please give me the link to your blog, otherwise I cannot say anything

Also, I noticed that you'll need to be logged in to the admin area prior to uploading the add-on, else it'll return a "fatal error". Thought you'd like to know :)
???
You mean uploading the addon file by FTP?
What did the "fatal error" say furtheron?

KArin

GeoS
01-12-2007, 11:03 PM
[QUOTE=austriaka;41423]You mean name of the "secret" image (gif, the mousover grafic) or attribute "name" of the photo to be changable?/QUOTE]

Secret image filenames (both normal and mouseover) can a variable at the beginning of addon script.

[QUOTE=austriaka;41423]
Secret Image file is saved in thumbnail folder because this has writing permission
/QUOTE]

Thats good idea :D

austriaka
01-15-2007, 03:06 PM
Secret image filenames (both normal and mouseover) can a variable at the beginning of addon script.
Yes, I can do that if you like. Is there any reason for not being at the end of the script?

KArin

fredxeric
01-15-2007, 08:51 PM
sorry, in this version not.
If you want to hack the script, you can change ".gif" into ".jpeg" in lines
16, 17, 39 (2x), 40 (2x), 155 (2x)

KArin

I did uplaod jpeg file instead of a gif and it work well without any changes

austriaka
01-15-2007, 09:02 PM
I did uplaod jpeg file instead of a gif and it work well without any changesPHP is great ;-)
No idea why and how this is working. The secret image shows as a .gif at your site...
One hint: perhaps you should reduce the image kB size of the secret photos, because it takes quite a long time for them to load

KArin

fredxeric
01-15-2007, 11:05 PM
PHP is great ;-)
No idea why and how this is working. The secret image shows as a .gif at your site...
One hint: perhaps you should reduce the image kB size of the secret photos, because it takes quite a long time for them to load

KArin


The problem with the gif files is the color when I save as gif the color looks bad, so that why I chose the jpeg format instead.

I will try to reduce the small of those image.

irishblue
08-07-2007, 02:44 PM
This is a great addon! :)
Is it possible to get this to work with the auto image resize addons at:
http://www.pixelpost.org/forum/showthread.php?t=6766
I tried adding a new image with the image resize on, but it only resizes the actual image but not the secret one.

Dennis
08-07-2007, 08:24 PM
The resize addon is not aware of the secret image. That is why.

dakwegmo
08-07-2007, 08:56 PM
The resize addon is not aware of the secret image. That is why.

That's because it's a secret. shh!

Dennis
08-08-2007, 05:52 AM
Ow did I spoiled it now for the rest of us?

nden
11-05-2007, 12:51 PM
Hi,

This is great add-on I must say.

But I have a question: Is there a way I can use TEXT as link, instead using .gif grafic?

Thanks

fredxeric
11-05-2007, 03:28 PM
The addon as not been created to enable text link... I have try so many time in the past and I never get any good result.

austriaka
11-05-2007, 08:56 PM
But I have a question: Is there a way I can use TEXT as link, instead using .gif grafic?
Thanks
This would need a change of the core files where the <SECRET_LINK> Tag is replaced. If you have a little PHP knowledge it should not be too difficult.
Or create a little gif with the text?

nden
11-18-2007, 07:32 PM
Thanks for reply austriaka

Ya, I figured out the way to imply this nice addon.

austriaka
11-22-2007, 09:55 AM
I just updated the Secret Image Addon. No version change because the code didn't change, but now NEW there is a check for updates in the Addon page.
Download it here:
http://www.pixelpost.org/extend/addons/secret-image/download/

irishblue
10-07-2008, 03:57 AM
is there a way to preload the secret image?
the secret image takes a while to load hence majority of users don't see it when they mouseover the icon and think nothing's there as seen in my site:
http://www.stephyk.com

i found a hack in here that preloads the next image but not the current one's secret image:
http://www.pixelpost.org/forum/showthread.php?t=6129

any idea how I can do it?

austriaka
10-07-2008, 07:25 AM
yes, you can use the little Javascript dwilkinsjr posted in the mentioned thread. Just replace the tag "<PRELOAD_IMAGE_NAME>" by "o_<IMAGE_NAME>"

<script type="text/javascript">
if (document.images)
{
img1 = new Image();
img1.src = "images/o_<IMAGE_NAME>";
}
</script>

Place the code sniplet at the end of the html source in your image_template.html (after the html of the image).
You do not need the Image Pre-Loader Addon at all since this retreives only the filename of the next image.

irishblue
10-08-2008, 06:01 AM
thanks for the quick reply. works like a charm now!
very much appreciated :)

austriaka
03-22-2009, 11:28 AM
When using a template which has separate definitions for landscape and portrait orientated photos (vertical and horizontal tables) like Switchy for example, you will encounter problems with the Secret Image Addon.

You have one table for horizontal view and one for vertical view.
Depending on which orientation the image has, the one table is set invisible and the other visible (by css).
Now it happens that the image with name "mainimage" is in the page twice, even if not visible.
Firefox changes the image in the first occurance (which is the horizontal view) but not again in the second.
InternetExplorer seems to be more tolerant in having the same name twice.

Here is a modified version of Secret Image Addon for those who are using a template which has the image layout part twice, depending on image orientation:

http://uhlig.at/downloads/secret_image_hvtables.zip

Please use these Addon Tags instead of <ATTRIBUTE_NAME> and <SECRET_LINK>:
<ATTRIBUTE_NAME1> and <SECRET_LINK1> in the horizontal table
<ATTRIBUTE_NAME2> and <SECRET_LINK2> in the vertical table

Have fun with it!

cLin
03-28-2009, 01:13 AM
Has anyone figured out how to incorporate the auto resize addon into this so that both images are the same size if I use auto resize?