WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.9 R24 is now available!


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Droplets & Snippets »
  • Random Image folder
  • Print
Pages: [1]   Go Down

Author Topic: Random Image folder  (Read 9964 times)

Jaz

  • Guest
Random Image folder
« 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  :|

I currently have
Code: [Select]
    <?php RandomImage (&#39;/media/random_image/&#39;); ?>
but need it to be
Code: [Select]
    <?php RandomImage (&#39;/media/random_image/{value of PAGE_TITLE}/&#39;); ?>
Could someone suggest how I go about this please ?
« Last Edit: January 26, 2008, 06:54:55 PM by Jaz »
Logged

kweitzel

  • Guest
Re: Random Image folder
« Reply #1 on: January 28, 2008, 09:34:13 PM »
Try:

Code: [Select]
<?php RandomImage (&#39;/media/random_image/&#39;.PAGE_TITLE.&#39;/&#39;); ?>

cheers

Klaus
Logged

Jaz

  • Guest
Re: Random Image folder
« 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   :oops:

Thanks :-D
Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Droplets & Snippets »
  • Random Image folder
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2