![]() |
|
How to include Random image or video into HTML page ?? - 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: How to include Random image or video into HTML page ?? (/thread-2659.html) |
How to include Random image or video into HTML page ?? - bill61 - 2008-04-13 hi can anyone help me How to include Random image or video into HTML page ?? regards How to include Random image or video into HTML page ?? - acrylian - 2008-04-13 http://www.zenphoto.org/support/topic.php?id=2697&replies=5#post-16054 How to include Random image or video into HTML page ?? - bill61 - 2008-04-13 hi acrylian i did not get 100% i am not that good with php files. my zendphoto folder are inside my site folder directory_path. i need to have a box of random images and another one for video. the page is html so what is the html code should i use to execute the random image or video from the zendphoto?? regards How to include Random image or video into HTML page ?? - acrylian - 2008-04-13 You need a php file, meaning a file with .php as suffix to execute php functions. On a .html page that will not work because the server won't recognize it as php. You can just rename your .hml file to .php. That does not really matter. Try adding the code here http://www.zenphoto.org/2008/01/hacks/#zenphoto-as-plugin I hope that helps a little more. How to include Random image or video into HTML page ?? - bill61 - 2008-04-13 hi acrylian how about if i create a php file like: How to include Random image or video into HTML page ?? - acrylian - 2008-04-13 No. Why don't you just rename your .html file? That does not make any difference for the html part of that file. How to include Random image or video into HTML page ?? - bill61 - 2008-04-13 hi if i rename the file to php is that all i have to insert into the box where i want the random image to show: define('ZENFOLDER', 'zp-core'); $randomImage = getRandomImages(); regards How to include Random image or video into HTML page ?? - acrylian - 2008-04-13 the define and the require_once should be on top of the file, the other code should go where you want the random image. How to include Random image or video into HTML page ?? - bill61 - 2008-04-13 hi acrylian so inside the php file the script should looks like: on top: How to include Random image or video into HTML page ?? - bill61 - 2008-04-13 hi acrylian sorry, inside the php file the script should looks like: How to include Random image or video into HTML page ?? - acrylian - 2008-04-13 Your post before your last should work. How to include Random image or video into HTML page ?? - bill61 - 2008-04-14 hi acrylian the script working 100% but to include Random images or videos into my home website is a nughtmare. unfortanatly, i can not change the file name from html into php. this is how the site was developed. can u find me another solution for this html issue pls? regards How to include Random image or video into HTML page ?? - acrylian - 2008-04-14 No, sorry. How to include Random image or video into HTML page ?? - bill61 - 2008-04-14 hi acrylian ok, i will give it another shot and try something else. first i need to meke sure of this bellow: define('ZENFOLDER', 'zp-core'); (for this one what folder they mean in this) define('WEBPATH', 'zenphoto'); (for this one what path they mean in this) require_once(WEBPATH . "/" . ZENFOLDER . "/template-functions.php"); (for this one what folder they mean in this) How to include Random image or video into HTML page ?? - acrylian - 2008-04-14 [i]define('ZENFOLDER', 'zp-core'); (for this one what folder they mean in this)[/i] [i]define('WEBPATH', 'zenphoto'); (for this one what path they mean in this)[/i] [i]require_once(WEBPATH . "/" . ZENFOLDER . "/template-functions.php"); (for this one what folder they mean in this)[/i] How to include Random image or video into HTML page ?? - bill61 - 2008-04-14 hi acrylian nothing seems to work hope in the next version they take care of how or a simple way to " include Random image or video into HTML pages" thanks How to include Random image or video into HTML page ?? - acrylian - 2008-04-14 As I said above php code does not work on .html pages. You need to use a .php file. This is not a zenphoto issue. How to include Random image or video into HTML page ?? - AlexWilson - 2008-04-14 try
in your .htaccess file Or even ` AddType application/x-httpd-php .html ` to make it just process PHP for a specific file. Alternatively, you can put rewrite rule in .htaccess to internally redirect the call to the .html URL to your .php version.
If you can't change your .htaccess, or your host doesn't let use AddType or rewrites, then you might be stuck. The only other thing I could think of would be to get the HTML page to redirect to the PHP pages -- either with a meta refresh tag or some document.location JavaScript. And as an absolute last option, you can have a random image picked and displayed solely by JavaScript. This would requiring you updating the page each time you want to change the list of possible images it picks from, though. Lots of options How to include Random image or video into HTML page ?? - bill61 - 2008-04-24 hi AlexWilson thanks for your reply i am not that familiar with php. however, the htaccess file for my website i can open it from my ftp no problems. can u pls guide me step by step how to go in this process to get the random working on my html page. the : zenphoto folder in this case named : mediabox. also is it possible to have random for specific folders in the album?? thanks |