Indexhibit
Index + Exhibit

Login:

Created by
Daniel Eatock
Jeffery Vaska
And You

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

 

Indexhibit version: 2.0
Thread is resolved.

fidy
FRANCE
2 year(s) ago
Permalink Post

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
FRANCE
2 year(s) ago
Permalink Post

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

fidy
FRANCE
2 year(s) ago
Permalink Post

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
FRANCE
2 year(s) ago
Permalink Post

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

me lolcat

fidy
FRANCE
2 year(s) ago
Permalink Post

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

arggh

me stupidcat

arsondpi
GREECE
2 year(s) ago
Permalink Post

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
FRANCE
2 year(s) ago
Permalink Post

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.