collapse

* User Info

 
 
Welcome, Guest. Please login or register.
Did you miss your activation email?

* Who's Online

  • Dot Guests: 33
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • ♦ Ninja ZX-10RR ♦: Por favor esta shoutbox no es para support ;)
    July 30, 2015, 01:02:07 am
  • Elliott: Sigo teniendo el mismo problema ayuda el ShoutBox de Simple Portal no se actualiza, escribo un mensaje y tengo que actualizar todo la pagina para que se actualice y vea el mensaje que escribi!
    July 29, 2015, 11:48:43 pm
  • sonkalem: Merhaba
    July 14, 2015, 02:27:54 pm
  • [SiNaN]: Hey! Glad to see that people find our little and simple mod useful. :)
    July 10, 2015, 08:38:39 am
  • berkcet: thanks for the wonderful mod! [SiNaN] adamın dibisin
    July 09, 2015, 12:34:40 pm
  • xpress: Please am using Simple portal mod. And in the board news updates. Whenever I make a post using BBC of [img] the image always heavy and makes my website to load slow. Is there anyway I can reduce it to 300px width and 300 height. May be by css or any other method!
    July 09, 2015, 04:27:56 am
  • Burke Knight: LOL!
    July 05, 2015, 03:35:00 pm
  • andy: Shoutbox IS for support... moral support  ;D
    July 05, 2015, 11:18:48 am
  • {OCS}MasterSeal: THANKS AGAIN FOR SP!
    June 22, 2015, 09:47:08 am
  • angeljs: Thanks :)
    June 20, 2015, 08:28:30 am
  • ♦ Ninja ZX-10RR ♦: Unfortunately I am only a Support Apprentice and I don't have access to it, so I cannot approve it. But I will let my Support coach know ;)
    June 19, 2015, 06:30:47 pm
  • angeljs: Yes. that was it. I managed to edit the post, but now can't make any more new ones as it's back in the moderation queue again! :(
    June 19, 2015, 05:06:05 pm
  • ♦ Ninja ZX-10RR ♦: There should be...? Maybe the post is waiting for approval, don't know.
    June 18, 2015, 03:26:04 pm
  • angeljs: Ok, thanks. I just need to know how to edit my posts as I can't find any edit button
    June 18, 2015, 03:13:00 pm
  • ♦ Ninja ZX-10RR ♦: Newbies cannot post in some sections due to antispam I think, especially if they post links. Feel free to open a topic somewhere, a mod will move it :)
    June 18, 2015, 02:53:02 pm
  • angeljs: I know the shoutbox isn't for support, but I can't post in the support forums! Where can I find help with this website?
    June 18, 2015, 10:36:07 am
  • Jazzpa: Thank you Chen!
    June 12, 2015, 08:31:09 am
  • Chen Zhen: Your thread has been approved and a solution posted.
    June 11, 2015, 11:05:45 pm
  • Jazzpa: How long does it take approve a thread/question over here?
    June 11, 2015, 12:25:01 pm
  • {OCS}MasterSeal: AGAIN. I'm here to spam...errr I mean THANK YOU FOR SP!!!
    May 29, 2015, 02:57:41 am
Welcome to SimplePortal.net! You can download SimplePortal from the Downloads Area!

Author Topic: Simple AEVA album block  (Read 4034 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

  • Support
  • *
  • Posts: 4885
  • 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

  • Support
  • *
  • Posts: 4885
  • 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

  • Support
  • *
  • Posts: 4885
  • 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

  • Support
  • *
  • Posts: 4885
  • 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

  • Support
  • *
  • Posts: 4885
  • 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

  • Support
  • *
  • Posts: 4885
  • 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

  • Support
  • *
  • Posts: 4885
  • 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

  • Support
  • *
  • Posts: 708
  • Gender: Male
    • Outdoor Club Japan (OCJ) アウトドア・クラブ・ジャパン
  • SMF Version: 2.0.10
  • SP Version: 2.3.6
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