collapse collapse

* User Info

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

* Who's Online

  • Dot Guests: 145
  • Dot Hidden: 1
  • Dot Users: 1

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {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
  • phantomm: and from what I see only patch is broken, full install package is fine
    October 21, 2016, 03:44:44 PM

* Recent Posts

Re: Occasional Chat/Shout box Issue by Skhilled
[Today at 04:52:48 AM]


Re: Occasional Chat/Shout box Issue by OpoWolfie
[January 06, 2019, 04:54:46 AM]


Re: Where is the code for these elements, where are they stored? by Chen Zhen
[January 04, 2019, 10:50:07 AM]


Re: Have a block only show on threads? by danmsmith018f
[January 03, 2019, 05:46:35 AM]


Re: Occasional Chat/Shout box Issue by OpoWolfie
[January 03, 2019, 05:33:09 AM]

Blocks speak! Do you have an interest in getting more blocks - or even making your own? The Blocks Board is for you!

Author Topic: Aeva Media Block  (Read 53504 times)

0 Members and 1 Guest are viewing this topic.

Offline roomeat

  • Jr. Member
  • **
  • Posts: 51
    • Ozsportsbikes
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Aeva Media Block
« on: December 30, 2009, 01:37:56 AM »
Hey guys.
I have updated my test site to use Aeva Media (Replaces SMF Gallery and Aeva) but the gallery block no longer works.
Could someone make a new one.. or alter the existing to work with Aeva Media.
 :) :)

Offline Darknico

  • Translator
  • *
  • Posts: 25
  • Gender: Male
    • Darknico.com
  • SMF Version: 2.0.10
  • SP Version: 2.3.6
Re: Aeva Media Block
« Reply #1 on: December 30, 2009, 05:43:21 AM »
Aeva Media is now Alpha Version... But I modify the function ;)

Open the file sources/PortalBlocks.php

Search:
Code: [Select]
if (file_exists($sourcedir . '/MGallery.php'))
$mod = 'smf_media_gallery';

Add After:
Code: [Select]
elseif (file_exists($sourcedir . '/Aeva-Gallery.php'))
$mod = 'aeva_media_gallery';


Search:
Code: [Select]
elseif ($mod == 'smf_gallery')
{
if (loadLanguage('Gallery', '', false) === false)

Add Before:
Code: [Select]
elseif ($mod == 'aeva_media_gallery')
{
require_once($sourcedir . '/Aeva-Subs.php');

aeva_loadSettings();
if (loadLanguage('Aeva', '', false) === false)
loadLanguage('Aeva', 'english', false);

$items = aeva_getMediaItems(0, $limit, $type ? 'RAND()' : 'm.id_media DESC');
}


Search:
Code: [Select]
elseif ($mod == 'smf_gallery')
{
echo '
<a href="', $scripturl, '?action=gallery;sa=view;id=', $item['id'], '">', $item['title'], '</a><br />

Add Before:
Code: [Select]
if ($mod == 'aeva_media_gallery')
{
echo '
<a href="', $galurl, 'sa=item;id=', $item['id'], '">', $item['title'], '</a><br />
<a href="', $galurl, 'sa=item;id=', $item['id'], '"><img src="', $galurl, 'sa=media;id=', $item['id'], ';thumb" alt="" /></a><br />
', $txt['aeva_views'], ': ', $item['views'], '<br />
', $txt['aeva_posted_by'], ': <a href="', $scripturl, '?action=profile;u=', $item['poster_id'], '">', $item['poster_name'], '</a><br />
', $txt['aeva_in_album'], ': <a href="', $galurl, 'sa=album;id=', $item['id_album'], '">', $item['album_name'], '</a>', $item['is_new'] ?
'<br /><img alt="" src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new.gif" border="0" />' : '';
}



Test in my site with Aeva Media 1.0 Alpha 2 and work ;)
« Last Edit: January 15, 2010, 09:26:55 AM by Darknico »
Italian SMF - Supporto Italiano per la board SMF - Venite a trovarci!





Offline roomeat

  • Jr. Member
  • **
  • Posts: 51
    • Ozsportsbikes
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Aeva Media Block
« Reply #2 on: December 30, 2009, 07:18:30 AM »
Cool.. Thank You :)
Had to do a little searching as my PortalBlocks.php is not quite the same as yours for some reason.. but got it working anyhow :)

Offline Darknico

  • Translator
  • *
  • Posts: 25
  • Gender: Male
    • Darknico.com
  • SMF Version: 2.0.10
  • SP Version: 2.3.6
Re: Aeva Media Block
« Reply #3 on: December 30, 2009, 07:22:57 AM »
Quote
Had to do a little searching as my PortalBlocks.php is not quite the same as yours for some reason

mmmm...I test with SMF 1.1.11
You use 2.0 RC2..
Italian SMF - Supporto Italiano per la board SMF - Venite a trovarci!





Offline roomeat

  • Jr. Member
  • **
  • Posts: 51
    • Ozsportsbikes
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Aeva Media Block
« Reply #4 on: December 30, 2009, 07:43:14 AM »
Ahhh yes.. I am using 2.0 RC2

Well the code changes work for me anyhow :D :D

Offline locutusweb

  • Semi Newbie
  • *
  • Posts: 49
  • Gender: Male
  • The sky ain't the limit
    • Locutus Web Services
  • SMF Version: 2.0.7
  • SP Version: 2.3.5
Re: Aeva Media Block
« Reply #5 on: January 15, 2010, 08:47:26 AM »
Add After:
Code: [Select]
elseif (file_exists($sourcedir . '/Aeva-Gallery.php'))
$mod = 'aeva_media_gallery'

This should be:
Add After:
Code: [Select]
elseif (file_exists($sourcedir . '/Aeva-Gallery.php'))
$mod = 'aeva_media_gallery';

(Please note the ";" at the end)

Darknico: your modification works like a charm on SMF 2.0 RC2 and SP 2.3.1!  :applause:

Conquer the skies with the Gelderse Soaring Club

Offline Darknico

  • Translator
  • *
  • Posts: 25
  • Gender: Male
    • Darknico.com
  • SMF Version: 2.0.10
  • SP Version: 2.3.6
Re: Aeva Media Block
« Reply #6 on: January 15, 2010, 09:28:09 AM »
Quote
(Please note the ";" at the end)

Ooops!! :-[
I correct the post ;)

Quote
Darknico: your modification works like a charm on SMF 2.0 RC2 and SP 2.3.1!  :applause:

hehe :nervous-happy:
Italian SMF - Supporto Italiano per la board SMF - Venite a trovarci!





Offline Old Fossil

  • Beta Tester
  • *
  • Posts: 796
  • Gender: Male
  • SMF Version: 2.0.4
  • SP Version: 2.3.5
Re: Aeva Media Block
« Reply #7 on: January 15, 2010, 03:34:50 PM »
Darn I almost had it sorted.

Can someone please make it easier for those of us on 2.0 to adapt this edit for our forums.
Daily backups mean less headaches

Block Set Up

I may be no coding expert but I am willing to help where I can.

I eat Spammers for breakfast

Offline tfs

  • Jr. Member
  • **
  • Posts: 64
Re: Aeva Media Block
« Reply #8 on: January 19, 2010, 06:30:26 PM »
I'm displaying a PHP block with this...

Code: [Select]
global $sourcedir, $user_info, $ID_MEMBER, $context, $txt, $galurl, $galurl2, $scripturl, $settings, $db_prefix;
loadLanguage('Aeva');
@include_once($sourcedir . '/Aeva-Subs.php');
echo aeva_listItems(aeva_getMediaItems(0, 4, 'RAND()'), false, '', 1);

Don't ask me what it does.  I copied code from a couple of people in a thread at smf-media.com, and lucked into something that works for now.  :)

Offline Old Fossil

  • Beta Tester
  • *
  • Posts: 796
  • Gender: Male
  • SMF Version: 2.0.4
  • SP Version: 2.3.5
Re: Aeva Media Block
« Reply #9 on: January 19, 2010, 06:49:42 PM »
Hey tfs thanks for the reply.

I had a look at the link which was a big help.

There is now a gallery on my portal.

 8) 8)
Daily backups mean less headaches

Block Set Up

I may be no coding expert but I am willing to help where I can.

I eat Spammers for breakfast

Offline Kaede Akamatsu

  • Hero Member
  • *****
  • Posts: 2179
  • Gender: Male
  • $("div.content:dd").hide();
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
  • Elkarte Version: None
Re: Aeva Media Block
« Reply #10 on: January 20, 2010, 11:30:41 AM »
No need for all those globals. :)

Offline sunbloquer

  • Semi Newbie
  • *
  • Posts: 6
  • Gender: Male
    • KayakFishingCanarias
  • SMF Version: 2 RC2
  • SP Version: 2.3.1
Re: Aeva Media Block
« Reply #11 on: January 20, 2010, 01:59:37 PM »
Hi, I'm new and my English is not very good.

Where to perform this modification to include AEVA block?
SMF 2.0 RC2
SimplePortal 2.3.1

Offline Kaede Akamatsu

  • Hero Member
  • *****
  • Posts: 2179
  • Gender: Male
  • $("div.content:dd").hide();
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
  • Elkarte Version: None
Re: Aeva Media Block
« Reply #12 on: January 20, 2010, 02:42:48 PM »
Make a new PHP block and insert the following code:

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, 4, 'RAND()'), false, '', 1);
}

// Run the function.;
show_aeva_media_block();

Offline sunbloquer

  • Semi Newbie
  • *
  • Posts: 6
  • Gender: Male
    • KayakFishingCanarias
  • SMF Version: 2 RC2
  • SP Version: 2.3.1
Re: Aeva Media Block
« Reply #13 on: January 20, 2010, 04:30:27 PM »
Very thanks ccbtimewiz tomorrow i ll try

Good  ;D 8)
« Last Edit: January 21, 2010, 05:15:26 AM by sunbloquer »
SMF 2.0 RC2
SimplePortal 2.3.1

Offline amlucent

  • Jr. Member
  • **
  • Posts: 65
  • Gender: Male
    • The Good Old Days [Old] Guild
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Aeva Media Block
« Reply #14 on: January 29, 2010, 10:26:05 AM »
Make a new PHP block and insert the following code:

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, 4, 'RAND()'), false, '', 1);
}

// Run the function.;
show_aeva_media_block();

I have figured out I can change the

echo aeva_listItems(aeva_getMediaItems(0, 4, 'RAND()'), false, '', 1);

from 4 to whatever number of items I wish to display however I would like it to show new addtions to the gallery.  I suppose I need to change "RAND" to something else?  what does the false mean out of curiosity. 

Also, a bit picky but the images appear left aligned instead of centered in the block, can I change that?

Offline curlin

  • Jr. Member
  • **
  • Posts: 52
  • Gender: Male
    • Thoroughbred Junkie
  • SMF Version: 2 RC2
  • SP Version: 2.3.1
Re: Aeva Media Block
« Reply #15 on: January 29, 2010, 01:30:25 PM »
Quote
Also, a bit picky but the images appear left aligned instead of centered in the block, can I change that?/quote]

     Oh yeah, i've been trying to figure this out for awhile now. Please  ;)
Hoss Talk At Thoroughbred Junkie

Offline Chen Zhen

  • The Underdog
  • Operations Manager
  • *
  • Posts: 1342
  • Gender: Male
  • Kinesis
    • WebDev
  • SMF Version: 2.1
  • EhPortal Version: 1.22
Re: Aeva Media Block
« Reply #16 on: January 29, 2010, 10:57:22 PM »
I have figured out I can change the

echo aeva_listItems(aeva_getMediaItems(0, 4, 'RAND()'), false, '', 1);

from 4 to whatever number of items I wish to display however I would like it to show new addtions to the gallery.  I suppose I need to change "RAND" to something else?  what does the false mean out of curiosity. 

Also, a bit picky but the images appear left aligned instead of centered in the block, can I change that?

... change the '1' at the end of that line to a '0' and it will display horizontally as well.

Using this as a base, I am going to try to throw some javascript in and have it show up like a proper slideshow with arrows on either side to view more pics in a nice flowing manner.. maybe 4 at a time.
Maybe an option to click random or recent.
Hmph... another project to add on the list.

UD

Offline curlin

  • Jr. Member
  • **
  • Posts: 52
  • Gender: Male
    • Thoroughbred Junkie
  • SMF Version: 2 RC2
  • SP Version: 2.3.1
Re: Aeva Media Block
« Reply #17 on: January 31, 2010, 02:20:57 AM »
    I changed the 1 to a 0 and nothing happened. Still left aligned and yes, i did refresh  :P
Hoss Talk At Thoroughbred Junkie

Offline Chen Zhen

  • The Underdog
  • Operations Manager
  • *
  • Posts: 1342
  • Gender: Male
  • Kinesis
    • WebDev
  • SMF Version: 2.1
  • EhPortal Version: 1.22
Re: Aeva Media Block
« Reply #18 on: January 31, 2010, 05:38:57 AM »
    I changed the 1 to a 0 and nothing happened. Still left aligned and yes, i did refresh  :P

Oops, my apologies.. Also change false to true.

Like this:
Code: [Select]
$per_row = "4";
$images = aeva_listItems(aeva_getMediaItems(0, $per_row, 'RAND()'), true, '', 0);

UD

Offline curlin

  • Jr. Member
  • **
  • Posts: 52
  • Gender: Male
    • Thoroughbred Junkie
  • SMF Version: 2 RC2
  • SP Version: 2.3.1
Re: Aeva Media Block
« Reply #19 on: January 31, 2010, 01:57:26 PM »
    I changed the 1 to a 0 and nothing happened. Still left aligned and yes, i did refresh  :P

Oops, my apologies.. Also change false to true.

Like this:
Code: [Select]
$per_row = "4";
$images = aeva_listItems(aeva_getMediaItems(0, $per_row, 'RAND()'), true, '', 0);

UD

     Hmmmmm - that code looks different than what is provided above and using the above code and changing false to true, does nothing still.

     Until i can get it the way i want ( "1" most recent media image centered ), i changed it to 2 images and had to expand the size of all blocks to 250 wide and it looks good now though i would prefer to keep my blocks at 200. At 200, it created a bottom scroll bar with two images.

« Last Edit: January 31, 2010, 02:24:02 PM by curlin »
Hoss Talk At Thoroughbred Junkie