collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 394
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

Thanks for having an interest with our portal. If you have any requests for features, have a look at the Feature Requests board.

Author Topic: Simple AEVA album block  (Read 10640 times)

0 Members and 1 Guest are viewing this topic.

Offline CasN

  • Semi Newbie
  • *
  • Posts: 6
  • Gender: Male
  • SMF Version: 1.1.11
  • SP Version: 2.3.2
Simple AEVA album block
« on: May 19, 2010, 06:26:01 AM »
Was experimenting with Aeva and the side blocks, this gives a simple overview of the 5 albums last mainatined
Code: [Select]
$query="SELECT distinct id_album,name FROM smf_aeva_albums,smf_aeva_media where smf_aeva_albums.id_album=smf_aeva_media.album_id order by time_added limit 5";
$result = mysql_query($query);;
while ($row = mysql_fetch_array($result)) {
   $linkurl= "index.php?action=media;sa=album;in=".$row['id_album'];
   echo "<a href=$linkurl >".$row['name']."</a> \n\n";
}

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Simple AEVA album block
« Reply #1 on: May 19, 2010, 08:50:43 AM »
Great work if this satisfies your need. Cheers!
 
I have a few comments that I think will make this even better
1) This code will work for SMF 1.X, but not for 2.x. It will not be difficult to change it for SMF 2.X when you need to.
2) It is a good plan to close the database connection as soon as possible. Many viewers may want to see your website at the same time. In SMF 1.X, this is done with mysql_free_result.
3) The ";;" is not necessary.  Then again, it isn't hurting anything.
 
Code: [Select]
// code for SMF version 1.1.11
$query="SELECT distinct id_album,name FROM smf_aeva_albums,smf_aeva_media where smf_aeva_albums.id_album=smf_aeva_media.album_id order by time_added limit 5";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result)) {
   $linkurl= "index.php?action=media;sa=album;in=".$row['id_album'];
   echo "<a href=$linkurl >".$row['name']."</a> \n\n";
}
mysql_free_result($request);
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline CasN

  • Semi Newbie
  • *
  • Posts: 6
  • Gender: Male
  • SMF Version: 1.1.11
  • SP Version: 2.3.2
Re: Simple AEVA album block
« Reply #2 on: May 31, 2010, 02:48:47 AM »
Thanks for the feedback, you are right on all points. The ';;' was a typo. Closing indeed is better, just need to use the correct one ($result opposite $request).


Also found a block for scrolling the pics. Found it on TinyPortal but works equally great on Simple portal:
Code: [Select]
// Configurable Graphics block
// for use with Aeva multimedia mod for SMF
// by BlueSteel 18th April 2010
// @TinyPortal : http://www.tinyportal.net/index.php?topic=32504.0
// Scrolling Options - on/off direction, speed, delay
// Item display options Random/Newest, number of item to display,selectable albums
// Marquee script Variables
$marq_offon = 1;       
// 0=off 1=on
$marq_behavior = "scroll";         
// what should marquee do "scroll"
$marq_direction = "up";           
// "left" , "right" , "up", "down"
$marq_height = "200px";           
// size of viewable block area
$marq_scrolldelay = 10;           
// delay iteritions
$marq_scrollamount = 1;         
// how many pixels to scroll block each iteration
$marq_onmouseover = "this.stop()";
// what to do on mouseover
$marq_onmouseout = "this.start()"; 
// what to do on mouseout

// Aeva script variables
//       - Gets items : array aeva_getMediaItems(int start, int limit, string sort, bool all_albums, array albums, string custom)
$aeva_start = 0;                   
// where item number to start at
$aeva_limit = 25;                 
// maximum number of items to display
$aeva_sort = 'RAND()'; 
// sort see Aeva-Subs.php for values I use 'RAND()' or 'm.time_added DESC' DESC or ASC for sorting order
$aeva_all_albums = true;           
// all albums .. true or false
$aeva_albums = array();           
// for a single album put eg: array(10) for an array of albums eg: array(3,5,7) for all albums eg:array()
$aeva_custom ='m.id_media';       
// aeva custom string
// - Creates HTML for viewing items : string aeva_listItems(array items, bool in_album = false, string align, int per_line)
$aeva_in_album = false;           
// unknown paramiter .. set to false by default for now
$aeva_align = 'center';           
// allign items 'left' 'center' 'right'
$aeva_per_line = 1;               
// number of colums to display at once eg: 1 for single .. 3 for 3 items accrossglobal
$sourcedir;   require_once($sourcedir . '/Aeva-Subs.php');   
// -------------------------------------
// Don't edit anything below this line
// -------------------------------------
// Start marquee routine if set to do so
if ($marq_offon == 1){   
echo '<marquee behavior=',$marq_behavior,' direction=',$marq_direction,' height=',$marq_height,' scrolldelay=',$marq_scrolldelay,' scrollamount=',$marq_scrollamount,' onmouseover=',$marq_onmouseover,' onmouseout=',$marq_onmouseout,' >';
}
// end marquee routine
// start actual block to be displayed   
echo '<div style="width: 100% height:',$marq_height,'; overflow: hidden;">';   
echo aeva_listItems(aeva_getMediaItems($aeva_start,$aeva_limit,$aeva_sort,$aeva_all_albums,$aeva_albums,$aeva_custom),$aeva_in_album,$aeva_align,$aeva_per_line);   
echo '</div>';
// end actual block to be displayed
//start marquee routine   
if ($marq_offon == 1){
echo'</marquee>';
}
//end scrolling routine

Offline eyeseven

  • Semi Newbie
  • *
  • Posts: 10
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Simple AEVA album block
« Reply #3 on: September 19, 2010, 09:39:26 AM »
Do you have Album Block for rc3?

thanks! :)

Offline eyeseven

  • Semi Newbie
  • *
  • Posts: 10
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Simple AEVA album block
« Reply #4 on: September 20, 2010, 04:17:06 PM »
please, any code for rc3 recent album list,, please please pleasse...

Offline headsortailsuk

  • Semi Newbie
  • *
  • Posts: 11
  • Gender: Male
    • The Late Bay
  • SMF Version: 2 RC2
  • SP Version: 2.3.2
Re: Simple AEVA album block
« Reply #5 on: November 04, 2010, 04:53:21 AM »
I too am looking for a block that will display only the contents of a particular album for SMF 2 RC3, SP 2.3.2.

Are there any about?

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Simple AEVA album block
« Reply #6 on: November 04, 2010, 07:14:15 AM »
Code: [Select]
function ab_album_AEVA($album=0, $order='random', $start=0, $count=5)
{
 global $sourcedir, $scripturl, $settings;
 include_once($sourcedir . '/Aeva-Subs.php');
 if ( is_int($album) && !($album==0) )
 {
  $aeva_albums = array($album);
  $aeva_all_albums = true;
 }
 else
 {
  $aeva_all_albums=TRUE;
  $aeva_albums = array();
 }
 if ( $order === 'random' )
  $aeva_order = 'RAND()';
 else
  $aeva_order = 'DESC';
 
  echo preg_replace('~<div class="highslide-maincontent">.*?</div>.*?</div>~', '',
          aeva_listItems(
     aeva_getMediaItems($start, $count, $aeva_order, $aeva_all_albums, $aeva_albums),
     false, '', 5)
  )
  ;
 
}
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline headsortailsuk

  • Semi Newbie
  • *
  • Posts: 11
  • Gender: Male
    • The Late Bay
  • SMF Version: 2 RC2
  • SP Version: 2.3.2
Re: Simple AEVA album block
« Reply #7 on: November 04, 2010, 07:38:27 AM »
Many thanks, how do I go about specifying which album to display?

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Simple AEVA album block
« Reply #8 on: November 04, 2010, 08:31:58 AM »
Code: [Select]
ab_album_AEVA(1);
or
Code: [Select]
ab_album_AEVA(array(1,3,5));
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline headsortailsuk

  • Semi Newbie
  • *
  • Posts: 11
  • Gender: Male
    • The Late Bay
  • SMF Version: 2 RC2
  • SP Version: 2.3.2
Re: Simple AEVA album block
« Reply #9 on: November 04, 2010, 09:52:57 AM »
Do I add that or replace? I've tried replace the existing ab_album_AEVA... but it fails.

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Simple AEVA album block
« Reply #10 on: November 04, 2010, 01:18:18 PM »
You will be using php to do this, so it will be a good idea to learn a little about programming with php:
http://w3schools.com/php/default.asp
http://www.php.net/docs.php
 
1) Create a new php file.  Call it ab_album_AEVA.php. Save the file in your Sources directory.
2) put the following in a custom php block:
Code: [Select]
global $sourcedir;              // make sure to use SMF's global sourcedir variable.
include_once($sourcedir . '/ab_album_AEVA.php');    // load the file you need
ab_album_AEVA(1);          // call the function you want to use.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline headsortailsuk

  • Semi Newbie
  • *
  • Posts: 11
  • Gender: Male
    • The Late Bay
  • SMF Version: 2 RC2
  • SP Version: 2.3.2
Re: Simple AEVA album block
« Reply #11 on: November 08, 2010, 05:46:24 AM »
Many thanks for your help.

When I enter your code into the custom php block I get

'Syntax error in block code. Please check the code.'

Any ideas?

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Simple AEVA album block
« Reply #12 on: November 08, 2010, 10:13:08 AM »
when you preview the block -- what error message do you get?
My first guess would be -- put the attached file in your Sources/ directory.
 
But -- note -- I have not tested this with the AEVA 1.4
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline headsortailsuk

  • Semi Newbie
  • *
  • Posts: 11
  • Gender: Male
    • The Late Bay
  • SMF Version: 2 RC2
  • SP Version: 2.3.2
Re: Simple AEVA album block
« Reply #13 on: November 08, 2010, 10:26:32 AM »
On preview I get:-

Code: [Select]
Fatal error: Call to undefined function ab_album_AEVA() in /usr/virtual/latebay.co.uk/htdocs/Sources/PortalBlocks.php(3332) : eval()'d code on line 3

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Simple AEVA album block
« Reply #14 on: November 08, 2010, 11:01:40 AM »
Your error message means that the function was not defined.
You can either put the function definition (given in http://simpleportal.net/index.php?topic=5550.msg38908#msg38908) in a file (as in the 3-line block example) or you can put it straight into the block.
 
Which would you prefer.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline Morph

  • Semi Newbie
  • *
  • Posts: 14
  • Gender: Male
  • AngelinaBelle Fan!
    • NKGCommunity
  • SMF Version: 1.1.12
  • SP Version: 2.3.3
Re: Simple AEVA album block
« Reply #15 on: March 01, 2011, 01:53:24 PM »
I know i wrote a similar thing in another topic, but now i see this and maybe i could have more help :)
the question is: ".....and if i would like to hide some albums? i'd like to show in the block only pictures from predefined albums"
Any idea?  :whistle:

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Simple AEVA album block
« Reply #16 on: March 01, 2011, 02:14:00 PM »
the question is: ".....and if i would like to hide some albums? i'd like to show in the block only pictures from predefined albums"

That's the idea of that function. You supply the list of albums. The function takes care of the rest.
 
Mind you -- I have not tested this code with the latest version of AEVA.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline Morph

  • Semi Newbie
  • *
  • Posts: 14
  • Gender: Male
  • AngelinaBelle Fan!
    • NKGCommunity
  • SMF Version: 1.1.12
  • SP Version: 2.3.3
Re: Simple AEVA album block
« Reply #17 on: March 01, 2011, 02:22:25 PM »
instead i have the latest version and SMF 1.1.13, so maybe a little different, in fact it does not work :)

Offline andy

  • On Leave
  • *
  • Posts: 861
  • Gender: Male
    • Outdoor Club Japan (OCJ) アウトドア・クラブ・ジャパン
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
  • Elkarte Version: None
Re: Simple AEVA album block (latest albums list)
« Reply #18 on: November 27, 2012, 09:26:10 AM »
Does anyone know how to display latest albums (list)?

Everything Ive found only displays photos but I would like to display a list of recent albums. It is shown as a list at the bottom of the media page but I would like to put it in a block in another place like the column of the forum page. This way people can see straight away there are new event photos rather than have to go to the gallery page and scroll down to the bottom of the page.
I cant find the code that displays this in the aeva media files...

Or perhaps the way most blocks work now by displaying an image, but it would be the icon photo for the album or default one with link. Just a simple url linked list would be good though with a variable for number of days to set as recent or latest.




Everyone is a volunteer here so please try and make a small donation to keep the Simple Portal website running