ZenphotoCMS Forum
Display random pics on a website ? - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Display random pics on a website ? (/thread-635.html)



Display random pics on a website ? - websat - 2006-07-01

Hi
I want to display a random pics from zenphoto gallery on my website, how i can do that ???




Display random pics on a website ? - thinkdreams - 2006-07-01

Websat-

Does your website run Wordpress, as there is a nifty plugin for Wordpress that allows you to display photos called Zenshow. Otherwise, you may have to code a routine to grab the random images from the database and display them. I have a random function that works within Zenphoto. Let me see if it can modified to work in your scenario.

Thinkdreams.




Display random pics on a website ? - websat - 2006-07-01

hi
Thanks for your answer, my website don't use wordpress, i made it myself using php (includes)




Display random pics on a website ? - thinkdreams - 2006-07-01

Cool. You should share it on the forums so others may benefit from your code.




Display random pics on a website ? - websat - 2006-07-01

ok, the main page is index.php who include with a menu other page named page-name.inc.php, the code for index.php is here: http://test.websat-telecom.com/index.php.txt
The code for the page where i want to have a random pic from zenphoto is here: http://test.websat-telecom.com/index.inc.php.txt

thanks for your help




Display random pics on a website ? - websat - 2006-07-03

nobody can help me ???




Display random pics on a website ? - thinkdreams - 2006-07-03

Patience please websat. We all have jobs, and are busy. I'm working with some ideas, but I have to work around my work schedule (8-5 M-F) and my personal responsibilities. We are all here on a voluntary basis. Others on the forum are under the same constraints I'm sure. So in other words, it may take time to get an answer to you, but if I don't someone else may have a quicker answer.




Display random pics on a website ? - thinkdreams - 2006-07-03

And those two links listed above to the php code of your website are not valid right now.




Display random pics on a website ? - websat - 2006-07-03

Ok, no problems thanks for your answer and your help, the links are now here:
The code for the index
http://www.websat-telecom.com/index.php.txt

The code for the page where i want to have a random pic from zenphoto is here: http://www.websat-telecom.com/index.inc.php.txt




Display random pics on a website ? - thinkdreams - 2006-07-03

I can probably give you a push in the right direction. Take a look at Zenshow, a plugin designed to pull random images from the Zenphoto DB within Wordpress. There is a function in the code that deals with random photos. You may be able to rework that code to your needs, as it is just a SQL query to the zenphoto DB. That would be my suggestion on where to start. You can obtain Zenshow from a link somewhere on the wiki.

That should get you started.




Display random pics on a website ? - websat - 2006-07-04

thanks for your help, i try this code for random.php:




Display random pics on a website ? - websat - 2006-07-04

ok, it's work now, thanks for your help..




Display random pics on a website ? - Danloreye - 2006-07-06

Will a wordpress widget of zenshow be released ?

I've designed one but i had to remove a line in the connect() function to allow the widget to be used.

this one:
header('Content-Type: text/html; charset=ISO-8859-1');