collapse

* User Info

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

* Who's Online

  • Dot Guests: 67
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • AngelinaBelle: For Documentation navigation, I really like to use the "<<" icon to turn that menu into a "navigation left panel", because I can read it better that way.
    April 21, 2014, 04:12:13 PM
  • oNLy1: Nakroma, please use the forum for support - ask all the questions (dumb or not) they will get answered
    April 18, 2014, 08:03:49 PM
  • Nakroma: i know this is just another question but im too dumb for it, where can I actualy get into the GENERAL SETTINGS page? im dumb sorry ;-;
    April 18, 2014, 04:27:39 PM
  • Nakroma: ahh okey, i get it. thanks
    April 18, 2014, 04:16:18 PM
  • [SiNaN]: Please don't get me wrong; I didn't mean that. You need to use the navigation menu right above the yellow Documentation bar you describe to navigate through different sections of documentation.
    April 18, 2014, 04:12:37 PM
  • Nakroma: okey I am dumb, could someone point out where at the top of the site it is? with a screenshot or something? if you mean the yellow Documention bar, thats not clickable for  me :|
    April 18, 2014, 03:57:34 PM
  • [SiNaN]: I wouldn't say it's hidden, lol. And it's extensive enough, thanks to Angelina.
    April 18, 2014, 02:28:55 PM
  • oNLy1: Documentation [link] (hidden at top of site)
    April 18, 2014, 12:48:01 PM
  • Nakroma: am I dumb or is there actually no tutorial? [link]
    April 18, 2014, 08:29:41 AM
  • AngelinaBelle: Welcome Gusto Prod.  Please visit [link] for info on creating an SMF forum
    April 17, 2014, 12:04:00 PM
  • GUSTO PROD: hi all give me creat new forum free
    April 16, 2014, 12:21:54 PM
  • AngelinaBelle: Hello w1ck3d! Welcome to Simple Portal. Unfortunately, there are not Russian speakers here very often.  Aplogies
    April 14, 2014, 07:49:26 AM
  • w1ck3d: тест
    April 14, 2014, 02:50:12 AM
  • Underdog: How to use Simple Portal for SMF: [link]
    April 02, 2014, 07:52:45 PM
  • Underdog: Thariq, please post questions in the forum. thank you.
    April 02, 2014, 07:51:40 PM
  • Thariq: how to create portal/site
    April 02, 2014, 06:30:42 AM
  • Ali çelen: forum nasıl oluştırıcam
    March 30, 2014, 10:59:08 PM
  • Ali çelen: sa
    March 30, 2014, 10:58:54 PM
  • AngelinaBelle: processor -- I think your customization will probably be just fine.
    February 14, 2014, 07:18:41 PM
  • AngelinaBelle: noumankhan: Welcome to SimplePortal.  Please read the documentation above. If you have questions about how to make a forum, please seek help at [link]
    February 14, 2014, 07:16:45 PM

* Team Blog

* Recent Posts

Re: add font to type shoutbox by AngelinaBelle
[Today at 02:11:44 PM]


Re: SimplePortal article by AngelinaBelle
[Today at 02:09:22 PM]


Re: add font to type shoutbox by abvs
[Today at 02:08:30 PM]


Re: SimplePortal article by Shayco
[Today at 12:40:04 PM]


Re: add font to type shoutbox by AngelinaBelle
[Today at 12:22:02 PM]

If you're interested in helping other members with support requests, consider joining the Community Support Helpers group.

Author Topic: Simple AEVA album block  (Read 3202 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, 04: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: 4720
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Simple AEVA album block
« Reply #1 on: May 19, 2010, 06: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, 12: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, 07: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, 02: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, 02: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: 4720
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Simple AEVA album block
« Reply #6 on: November 04, 2010, 05: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, 05:38:27 AM »
Many thanks, how do I go about specifying which album to display?

Offline AngelinaBelle

  • Support
  • *
  • Posts: 4720
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Simple AEVA album block
« Reply #8 on: November 04, 2010, 06: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, 07: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: 4720
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Simple AEVA album block
« Reply #10 on: November 04, 2010, 11:18:18 AM »
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, 04: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: 4720
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Simple AEVA album block
« Reply #12 on: November 08, 2010, 09: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, 09: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: 4720
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Simple AEVA album block
« Reply #14 on: November 08, 2010, 10: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, 12: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: 4720
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Simple AEVA album block
« Reply #16 on: March 01, 2011, 01: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, 01: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: 578
  • Gender: Male
    • Outdoor Club Japan (OCJ) アウトドア・クラブ・ジャパン
  • SMF Version: 2.0.5
  • SP Version: 2.3.5
Re: Simple AEVA album block (latest albums list)
« Reply #18 on: November 27, 2012, 08: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