custom image plugin : how to refresh page clicking the image?

fidy / 2012-11-11 23:55:51   

well greetings!

i'm kinda new on the forum but i used indexhibit for a few now!
my question is simple :

the "random image" exhibit format provides you a random image each time you refresh the page!

I used this code to embed the refresh option inside the website:

refresh

looks like this fidyradaody.fr

but you have to click on this separate button to refresh the page, it would be better if the image changes when clicking it!

I went down the format.random_image.php (/ndzxsite/plugin)
but i have no clue where to begin this!

any ideas ?

regards

Fidy

fidy / 2012-11-11 23:58:47   

my bad the example is here :
fidyradaody.fr/index.php/travaux/

fidy / 2012-11-12 13:13:40   

let me see if i got it :

... gives the "clickable" image
linked to javascript:history.go(0) which means "reload"

does not change (cause its the random image selection)

well actually still not working though... (gives me error on line 45 of the format.random_image.php) i'm looking for some misspelling or something.

but thanks! i'll have a closer look at that line 45

fidy / 2012-11-12 13:15:20   

... = a href tag
can't keep up with embed html and question about html in the same message...

me lolcat

fidy / 2012-11-12 13:31:50   

still couldn't make it work though... don't get what's wrong

arggh

me stupidcat

arsondpi / 2012-11-12 15:59:20   

fidy it's my fault!!!

I'm deleting the previous post as it had syntax errors...
find line 45 in the format.random_image.php file and change it from:

$s .= "<img src='" . $OBJ->vars->images[0][$rand]['media_path'] . "' />";

to:

$s .= "<a href='javascript:history.go(0)'><img src='" . $OBJ->vars->images[0][$rand]['media_path'] . "' /></a>";

fidy / 2012-11-25 18:42:00   

Hey arsdonpi!

i'm back on this and that new code works pretty well!

check that out :

fidyradaody.fr/index.php/portfolio/

Thanks a lot!

what was the thing missing ? (still couldn't figure out XD)

Follow my new issue here :

indexhibit.org/forum/thread/17542/

This thread has been closed, thank you.