To use this website completely, it is necessary to store cookies on your computer.
 

* Navigator

Expand - Collapse

* Statistic


  • *Total Posts: 16431
  • *Total Topics: 2522
  • *Online Today: 10
  • *Most Online: 292
(12. Nov 2016, 09:37:31)
  • *Users: 0
  • *Guests: 0
  • *Spiders: 2
  • *Total: 2

  • *Google (2)

* Calendar

Mo
Tu
We
Th
Fr
Sa
Su
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Birthdays
Apr 23: klein.michael (41)
Apr 24: Poet1960 (57)

Aeva Media - Random Image PHP Code

Started by DirtRider, 10. Nov 2010, 05:25:10

previous topic - next topic

0 Members and 0 Guests are viewing this topic.

DirtRider

10. Nov 2010, 05:25:10
I have the following code to show random media images in a PHP block. However what I need is to be able to show only selected media galleries and not all.

Code Select
global $sourcedir;
loadLanguage('Aeva');
@include_once($sourcedir . '/Aeva-Subs.php');
echo preg_replace('~<div class="highslide-

maincontent">.*?</div>.*?</div>~', '', aeva_listItems

(aeva_getMediaItems(0, 5, 'RAND()'), false, '', 5));
"The real question is not whether machines think but whether men do. "


b4pjoe

#1
10. Nov 2010, 07:27:41
Change the number (10)) in the last line to whatever album number you want it to use. If you want to show more than one gallery change (10)) to something like (2,8)) to show random images from gallery 2 and 8. Change 16 to the number of images you want it to display.

Code Select
global $sourcedir;
loadLanguage('Aeva');
@include_once($sourcedir . '/Aeva-Subs.php');
echo preg_replace('~<div class="highslide-

maincontent">.*?</div>.*?</div>~', '', aeva_listItems

(aeva_getMediaItems(0, 16, 'RAND()', true, array(10)), true, 'center', 0));

DirtRider

#2
10. Nov 2010, 09:15:32
Wow thank you so much this is what I needed  O0  :) :)
"The real question is not whether machines think but whether men do. "


DirtRider

#3
10. Nov 2010, 20:09:37
BTW Nao just gave me this code now for it as well said it is a better one to use  O0

Code Select
global $sourcedir;
loadLanguage('Aeva');
@include_once($sourcedir . '/Aeva-Subs.php');
echo aeva_listItems(aeva_getMediaItems(0, 16, 'RAND()', true, array(1)), true, 'center', 0);
"The real question is not whether machines think but whether men do. "


b4pjoe

#4
11. Nov 2010, 00:02:25
I would go with what Nao says. ;)