Welcome, Guest. Please login or register.
Did you miss your activation email?
May 27, 2012, 06:25:27 AM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
155555 Posts in 21715 Topics by 7737 Members
Latest Member: gx-world
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Random Image folder  (Read 1361 times)
Jaz

Offline Offline

Posts: 18


« on: January 26, 2008, 06:53:16 PM »

Hi,

Just wondering if this is possible.  I have been using the RandomImage snippet successfully on one of my sites and am now re-developing another site using WB.  Is it possible to code the RandomImage call so that it uses a variable in the directory name (I want to use a different set of images on each page).

I basically need some help coding the call in index.php so that the photo source directory name includes the page title as a subdirectory added to it - then in my random_image directory I will have subdirectories named the same as each page.  My PHP is pretty crappy so I'm not sure how to add this. Sorry if this is a bit confusing I've tried to explain what I mean in code below  undecided

I currently have
Code:
    <?php RandomImage ('/media/random_image/'); ?>

but need it to be
Code:
    <?php RandomImage ('/media/random_image/{value of PAGE_TITLE}/'); ?>

Could someone suggest how I go about this please ?
« Last Edit: January 26, 2008, 06:54:55 PM by Jaz » Logged
kweitzel
Forum administrator
*****
Offline Offline

Posts: 6977


WWW
« Reply #1 on: January 28, 2008, 09:34:13 PM »

Try:

Code:
<?php RandomImage ('/media/random_image/'.PAGE_TITLE.'/'); ?>

cheers

Klaus
Logged

WebsiteBaker Org e.V. - for WebsiteBaker

Jaz

Offline Offline

Posts: 18


« Reply #2 on: February 06, 2008, 03:24:28 AM »

God how embarrassing that is such a simple solution - must have been having a blonde day   embarassed

Thanks grin
Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!