Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to: random images
#11
(2014-12-15, 04:42:28)shawn_a Wrote: I am pretty sure it does support callback or callout functions that allow random selection of a galleries images from a gallery. perhaps i am thinking of thumbs

http://get-simple.info/forums/showthread...9#pid44559

But I also remember reading something else, either way using your own code with galleries is still easier than pulling files from filesystem, as you can setup galleries and pull random from those instead.

It links to a gallery, so you can post one thumb in any size which links to a gallery, or you can post a thumb which links to a gallery via fancybox-popup. I don't want an image link, I only want a random image. But correct me if I'm wrong, I searched for this info in the thread and Mvlcek's own info-pages, but could not find what I want.

(2014-12-13, 02:44:46)Lars Wrote: This should work...

<?php
global $args;
$dir1=$args[0];
$dir=GSDATAUPLOADPATH.$args[0];
$files1 = scandir($dir);
$a=rand(2,count($files1)-1);
echo "<img src='".get_site_url(false)."data/uploads/".$dir1."/".$files1[$a]."' width='100%'>"
?>
Thanks, that works.
Reply


Messages In This Thread
How to: random images - by datiswous - 2014-12-11, 21:26:57
RE: How to: random images - by Lars - 2014-12-12, 19:24:30
RE: How to: random images - by datiswous - 2014-12-12, 22:57:18
RE: How to: random images - by lesh - 2014-12-13, 01:57:44
RE: How to: random images - by datiswous - 2014-12-12, 19:52:57
RE: How to: random images - by Lars - 2014-12-12, 20:29:17
RE: How to: random images - by shawn_a - 2014-12-13, 02:01:07
RE: How to: random images - by datiswous - 2014-12-15, 04:37:44
RE: How to: random images - by Lars - 2014-12-13, 02:44:46
RE: How to: random images - by shawn_a - 2014-12-15, 04:42:28
RE: How to: random images - by datiswous - 2014-12-15, 06:33:23



Users browsing this thread: 1 Guest(s)