In the process of switching servers. I'm 95% there but having an issue with my random image script.
It works perfectly on my production server - I upgraded the production site to 1.4.4.8 before copying everything to the new server. When I went to the new server I installed 1.4.5 not realizing a newer version was released the next day.
Anyway, I haven't switched production to 1.4.5 so I'm not sure if it's a version issue or a server issue - or something else...
This is the script I'm using:
It's built to pull a random image from a dynamic gallery based on tags...
If you past that link in the browser and load it - it loads a random image so I know it's working...but when it's on the site nothing displays...no error just no image.
The random.php script:
I don't understand what your saying...that exact code works on 1.4.4.8 on a different server so I'm trying to figure out why it's not working on the new server. Been using the same code for years now w/o issue.
I got the @readfile code from here:
http://www.zenphoto.org/news/random-image-for-external-site
and I got the random.php file from this site too...
`
I'm no PHP whiz just did some searching years ago and found this...was able to get it to work exactly how I wanted and now it's not. Was just wondering if something changed from 1.4.4.8 to 1.4.5 that would cause it to not display or if it was a server issue...
I'm open to other options though...
I mis-spoke earlier...not using tags to display images...the virtual gallery is create based on tags...this random file references the virtual gallery.
That @readfile() may be prohibited on the test site. Often servers will prohibit file I/O on urls. Anyway, this is not a good way to get random images within your own site. It's stated purpose is to fetch random images from an external site, e.g. for you to use it on site A to get images from site B.
For theme use, your simplest solution is to create a dynamic album from the tags and get random images from that album via the getRandomImageAlbum() that acrylian mentions.
Yeah perhaps the new server is the issue. I have a ticket in with them too...they had to change some setting around for me to install zenphoto so hopefully it's another setting they can enable.
In the meantime I've used the getrandomimageAlbum() function to accomplish what I want.
This pulls a random image from a dynamic gallery (gallery based on tags) and displays the image, with link, sized to 200px wide.
`