Author Topic: Tiny Portal Snippet Block  (Read 3221 times)

Smoothbrain

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
Tiny Portal Snippet Block
« on: December 09, 2008, 03:16:17 PM »
Hello, I am new here so please excuse me if I post in the wrong section.  I am using the SMF Media Gallery on a site and have previously used a Tiny Portal block to show a random picture from SMF Gallery Lite.  Here is the link to the block snippet:
http://www.tinyportal.net/index.php/topic,10971.0.html

I was wondering if it would be easy to modify this snippet so that it would work for SMG.  Thanks heaps in advance for any and all advice.

Nao

  • Developer
  • Hero Member
  • *
  • Posts: 3623
  • Karma: 22
    • View Profile
    • NOISEN!
Re: Tiny Portal Snippet Block
« Reply #1 on: December 09, 2008, 04:40:26 PM »
Such a block has already made available in several places. And it's much shorter I believe. (I do not use any portal.)
« Everyone knows rock attained perfection in 1974. It's a scientific fact. » (Homer Simpson)
Beta Tester & Translator for SMF,
Developer for Aeva Media and its Foxy! add-on.
No PM support! Or I'll eat you with salad and garlic sausage.

iainsherriff

  • Jr. Member
  • *
  • Posts: 76
  • Karma: 0
    • View Profile
    • UK Lows
    • Email
Re: Tiny Portal Snippet Block
« Reply #2 on: December 10, 2008, 04:28:09 AM »
SMF 2.0 RC1/SMG 1.5.6 + slideshow



www.uklows.com

Smoothbrain

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile

RustyBarnacle

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
    • View Profile
Re: Tiny Portal Snippet Block
« Reply #4 on: February 05, 2010, 07:44:32 PM »
I feel like a noob.  I can only find TP code for SMF Media Gallery.  Does anyone know where I can find the code for Aeva Media?

Nao

  • Developer
  • Hero Member
  • *
  • Posts: 3623
  • Karma: 22
    • View Profile
    • NOISEN!
Re: Tiny Portal Snippet Block
« Reply #5 on: February 06, 2010, 04:22:00 AM »
I remember someone from the TP team saying they would update it for Aeva Media at some point.
I also added official Aeva Media support to PrettyURLs, by the way. :)
« Everyone knows rock attained perfection in 1974. It's a scientific fact. » (Homer Simpson)
Beta Tester & Translator for SMF,
Developer for Aeva Media and its Foxy! add-on.
No PM support! Or I'll eat you with salad and garlic sausage.

tfs

  • Beta tester
  • Sr. Member
  • *
  • Posts: 350
  • Karma: 2
    • View Profile
Re: Tiny Portal Snippet Block
« Reply #6 on: February 06, 2010, 12:12:27 PM »
I'm using this in a custom PHP block in Simple Portal...

Code: [Select]
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, 6, 'RAND()'), false, '', 1);
}

// Run the function.;
show_aeva_media_block();

The 6 returns 6 images.  I forget what the 0 and the 1 do.

Nao

  • Developer
  • Hero Member
  • *
  • Posts: 3623
  • Karma: 22
    • View Profile
    • NOISEN!
Re: Tiny Portal Snippet Block
« Reply #7 on: February 06, 2010, 12:50:50 PM »
0 = where to start from in the item list (offset)
6 = number of items to take
false = show album name (otherwise true)
'' = alignment override
1 = number of items per horizontal line
« Everyone knows rock attained perfection in 1974. It's a scientific fact. » (Homer Simpson)
Beta Tester & Translator for SMF,
Developer for Aeva Media and its Foxy! add-on.
No PM support! Or I'll eat you with salad and garlic sausage.

RustyBarnacle

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
    • View Profile
Re: Tiny Portal Snippet Block
« Reply #8 on: February 06, 2010, 08:02:55 PM »
Thanks!  That code worked in TP error free as well.

reko

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
    • View Profile
Re: Tiny Portal Snippet Block
« Reply #9 on: April 09, 2010, 12:14:11 AM »
is there anyway to get it to display 1 picture then display another pic in its place like a slideshow?