collapse

* User Info

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

* Who's Online

  • Dot Guests: 78
  • Dot Hidden: 0
  • Dot Users: 1
  • Dot Users Online:

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • Nucky: :D
    January 08, 2016, 10:53:07 am
  • ♦ Ninja ZX-10RR ♦: Merry Christmas to everyone :D
    December 25, 2015, 06:42:17 pm
  • Mark Parker: Yeah thanks for this awesome thing
    November 15, 2015, 03:10:44 am
  • Yahmez: Thanks for making simple portal... Many thanks.
    October 06, 2015, 09:16:18 pm
  • ♦ Ninja ZX-10RR ♦: Thank you for your kind words Phåråoh!
    September 26, 2015, 08:47:29 pm
  • Phåråoh: Good to see admin is still on top of things.  Some people don't take your VOLUNTEER work for granted.  We GREATLY appreciate it, whether it's a small thing or a major issue.
    September 26, 2015, 07:49:44 pm
  • ♦ Ninja ZX-10RR ♦: Kindly wait for replies in each topic, venting in the shoutbox is not going to help, I'm afraid. We are all volunteers and we might not be able to be online 24/7. Thank you for your understanding.
    September 13, 2015, 10:14:49 am
  • Cyberkid: >:( :| :'( :( no admin to fix this stuff
    September 13, 2015, 08:54:19 am
  • rentner: sorry be wrong
    August 19, 2015, 07:56:53 am
  • rentner: beta 2.1
    August 19, 2015, 07:56:32 am
  • ♦ Ninja ZX-10RR ♦: Lol thanks for considering me that much
    August 15, 2015, 01:22:47 pm
  • David: Eliana!! WADDUP, GURL!!!  SiNaN... glad y'all are still around!
    August 15, 2015, 11:27:21 am
  • ♦ Ninja ZX-10RR ♦: Welcome back :)
    August 15, 2015, 11:24:52 am
  • David: I missed y'all!!
    August 15, 2015, 11:23:22 am
  • Eliana Tamerin: People with colored usernames are staff, please abide by their requests.
    August 13, 2015, 04:43:00 pm
  • ♦ Ninja ZX-10RR ♦: Once again, this topic is *NOT* for support, anyway. Thank you for your understanding.
    August 13, 2015, 03:37:51 pm
  • ♦ Ninja ZX-10RR ♦: Please refrain from using such language in the shoutbox. Also, try to read the documentation, it should tell you that and more. [link]
    August 13, 2015, 03:36:48 pm
  • psewolf: Where are the settings on the admin panel?
    August 13, 2015, 02:00:32 pm
  • psewolf: I'm not making a whole damn topic to ask where the settings are on the admin panel.
    August 13, 2015, 02:00:15 pm
  • ♦ Ninja ZX-10RR ♦: Please don't spam the shoutbox, post a topic instead. Thank you.
    August 13, 2015, 01:30:02 am

* Recent Posts

Re: Visitors straight to forum by kast
[Today at 06:04:43 am]


Re: Visitors straight to forum by andy
[Today at 12:10:05 am]


Re: Visitors straight to forum by emanuele
[Yesterday at 09:25:59 am]


Re: Visitors straight to forum by andy
[Yesterday at 07:42:01 am]


Visitors straight to forum by kast
[Yesterday at 04:28:06 am]

Welcome to SimplePortal.net! You can download SimplePortal from the Downloads Area!

Author Topic: Simple AEVA album block  (Read 4543 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: 4873
  • 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: 4873
  • 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: 4873
  • 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: 4873
  • 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: 4873
  • 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: 4873
  • 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: 4873
  • 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: 731
  • Gender: Male
    • Outdoor Club Japan (OCJ) アウトドア・クラブ・ジャパン
  • SMF Version: 2.0.11
  • SP Version: 2.3.6
  • 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