TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

April 18, 2024, 01:32:24 AM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,164
  • Total Topics: 21,219
  • Online today: 180
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 160
  • Total: 160

Aeva random pics from specific album

Started by Rus, December 25, 2010, 12:06:04 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Rus

I found this code in another thread but couldn't find anything about limiting the pics to one album vs all albums.  Anyone know how to limit this to one album.


function show_aeva_media_block()
{
   global $sourcedir;

   // Load the language file
   loadLanguage('Aeva');

   // Grab the file.
   if (file_exists($sourcedir . '/Aeva-Subs.php'))
      require_once($sourcedir . '/Aeva-Subs.php');
   // If it doesn't exist, tell them this and stop running.
   else
   {
      echo '<b>You don\'t have Aeva installed! Unable to continue!</b>';
      return;
   }

   // Use aeva functions to show the media.
   echo aeva_listItems(aeva_getMediaItems(0, 1, 'RAND()'), false, 1);
}

// Run the function.;
show_aeva_media_block();

IchBin

Have no idea how Aeva works. You'll need to post the code for the function it calls for those of us who don't have that mod to see if it's even possible to do what you're asking.

Post the code from these two functions.
aeva_listItems() and aeva_getMediaItems()

Rus

Thanks for the offer.  I got a reply on SMF to use this code instead, replacing all of the code above:


global $sourcedir;
     loadLanguage('Aeva');
     require_once($sourcedir . '/Aeva-Subs.php');
     echo aeva_listItems(aeva_getMediaItems(0, 1, 'RAND()', true, array(85)), true, 'center', 0);


Where 85 is the specific album number