SimplePortal

Customization => Blocks and Modifications => Block Requests => Topic started by: roomeat on December 30, 2009, 01:37:56 AM

Title: Aeva Media Block
Post by: roomeat 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.
 :) :)
Title: Re: Aeva Media Block
Post by: Darknico 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 ;)
Title: Re: Aeva Media Block
Post by: roomeat 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 :)
Title: Re: Aeva Media Block
Post by: Darknico 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..
Title: Re: Aeva Media Block
Post by: roomeat 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
Title: Re: Aeva Media Block
Post by: locutusweb 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:

Title: Re: Aeva Media Block
Post by: Darknico 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:
Title: Re: Aeva Media Block
Post by: Old Fossil 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.
Title: Re: Aeva Media Block
Post by: tfs 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 (http://smf-media.com/community/index.php?topic=1511.0), and lucked into something that works for now.  :)
Title: Re: Aeva Media Block
Post by: Old Fossil 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)
Title: Re: Aeva Media Block
Post by: ccbtimewiz on January 20, 2010, 11:30:41 AM
No need for all those globals. :)
Title: Re: Aeva Media Block
Post by: sunbloquer 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?
Title: Re: Aeva Media Block
Post by: ccbtimewiz 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();
Title: Re: Aeva Media Block
Post by: sunbloquer on January 20, 2010, 04:30:27 PM
Very thanks ccbtimewiz tomorrow i ll try

Good  ;D 8)
Title: Re: Aeva Media Block
Post by: amlucent 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?
Title: Re: Aeva Media Block
Post by: curlin 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  ;)
Title: Re: Aeva Media Block
Post by: Chen Zhen 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
Title: Re: Aeva Media Block
Post by: curlin 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
Title: Re: Aeva Media Block
Post by: Chen Zhen 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
Title: Re: Aeva Media Block
Post by: curlin 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.

Title: Re: Aeva Media Block
Post by: vyache on January 31, 2010, 11:03:52 PM
I get issues with permissions, as admin the pictures don show for some reason...

using 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();
Title: Re: Aeva Media Block
Post by: Chen Zhen on February 01, 2010, 02:27:58 PM
     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.

It works for me.
 Here is the whole code block that is set to 4 random pics:
Code: [Select]
function show_aeva_media_block()
{
   global $sourcedir;
// Set amount visible
$visible = "4";
   // 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.
   $images = aeva_listItems(aeva_getMediaItems(0, $visible, 'RAND()'), true, '', 0);
$show = '<div id="aeva_pics" style="width: 100%;" overflow="visible">'. $images. '</div>';
echo $show;
return;
}   
// show the contents
show_aeva_media_block();


UD
Title: Re: Aeva Media Block
Post by: curlin on February 01, 2010, 02:39:57 PM
     Just re-entered the script you just posted and changed the "4" to a "1" and it is left aligned again  :(
Title: Re: Aeva Media Block
Post by: Chen Zhen on February 01, 2010, 02:43:17 PM
     Just re-entered the script you just posted and changed the "4" to a "1" and it is left aligned again  :(

Why would you change it to 1??

That only shows 1 picture. The purpose of what was written there was to show a few (4 in the example) in a horizontal view as opposed to wiz's original post which shows them vertically.

UD

Title: Re: Aeva Media Block
Post by: curlin on February 01, 2010, 02:50:38 PM
   What i wanted from this block script was to show the most recent image (1) centered in a block. If i use 2 or 4, i have to increase the size of all portal blocks from 200 to 250 because it creates a bottom scrollbar. Go easy on me as i'm just learning.
Title: Re: Aeva Media Block
Post by: Chen Zhen on February 01, 2010, 04:17:36 PM
   What i wanted from this block script was to show the most recent image (1) centered in a block. If i use 2 or 4, i have to increase the size of all portal blocks from 200 to 250 because it creates a bottom scrollbar. Go easy on me as i'm just learning.


Just add a center tag.
Try this...

Code: [Select]
function show_aeva_media_block()
{
   global $sourcedir;
// Set amount visible
$visible = "4";
   // 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.
   $images = aeva_listItems(aeva_getMediaItems(0, $visible, 'RAND()'), true, '', 0);
$show = '<div id="aeva_pics" style="width: 100%;" overflow="visible"><center>'. $images. '</center></div>';
echo $show;
return;
}   
// show the contents
show_aeva_media_block();

But change the 4 to a 1 or 2 if that's all you want.

UD
Title: Re: Aeva Media Block
Post by: curlin on February 01, 2010, 04:32:01 PM
     You the man  :applause:

                      Thanks
Title: Re: Aeva Media Block
Post by: ccbtimewiz on February 01, 2010, 10:25:38 PM
Better:

Code: [Select]
function show_aeva_media_block()
{
global $sourcedir;

// Set amount visible
$visible = 4;

// 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.
$images = aeva_listItems(aeva_getMediaItems(0, $visible, 'RAND()'), true, '', 0);

echo '
<div id="aeva_pics" style="width: 100%;" overflow="visible">
<div align="center">'. $images. '</div>
</div>';
}

show_aeva_media_block();
Title: Re: Aeva Media Block
Post by: curlin on February 01, 2010, 10:42:14 PM
 :applause: and you too CCB
Title: Re: Aeva Media Block
Post by: chep on February 04, 2010, 12:28:14 AM
Your mileage may vary. With the code listed below it brought my site to a complete crawl. I would recommend paying attention to performance after enabling it. Page load times during peak hours was between 5-10 seconds. Up from an average of .05 seconds. I monitored this from the status.php

Code: [Select]
loadLanguage('Aeva');
@include_once($sourcedir . '/Aeva-Subs.php');
echo aeva_listItems(aeva_getMediaItems(0, 1, 'RAND()'), false, '', 1);
Title: Re: Aeva Media Block
Post by: ccbtimewiz on February 04, 2010, 01:51:15 AM
Did the version I rewrote work better in your environment?
Title: Re: Aeva Media Block
Post by: Succubus Evaligan on February 04, 2010, 01:56:08 AM
I hope that Simple Portal have this by default in their next release. :thumbsup:
Title: Re: Aeva Media Block
Post by: Stigmartyr on February 07, 2010, 06:25:43 AM
How can I get the thumbs to display horizontally?  I like the vertical display for my columns, but in the forums I wanted to list a few horizontally across the top.  Everything I've tried just displays them vertically :(

I also want to display from a specified folder.  Usually there is an 'array' code I can put the album number in there..

Thank you!
Title: Re: Aeva Media Block
Post by: rgecy on February 07, 2010, 10:35:05 AM
The vertical code is working great.  Thanks for the help.

How can I get it to display just the most recent images?

Thanks,

Robert
Title: Re: Aeva Media Block
Post by: chep on February 09, 2010, 12:37:57 AM
Did the version I rewrote work better in your environment?

Not really. The performance problem was in the SQL query that is part of AEVA Media. Since the release of Version 1 came out I installed it just a few days ago. Nao calls this function out in his release notes of AEVA Media Version 1 final and he addressed this performance issue. The performance is much better with that release.
Title: Re: Aeva Media Block
Post by: Stigmartyr on February 09, 2010, 12:41:55 AM
Can a certain album be specified with that code above?
Title: Re: Aeva Media Block
Post by: Succubus Evaligan on February 09, 2010, 01:26:44 AM
Now with the oficial release of Aeva Media v1.0 Final (not more alpha or beta). I hope that we can have now a Aeva Mod for the Simple Portal or we can wait until the developers add this feature to support Aeva Media in the next release of Simple Portal.
Title: Re: Aeva Media Block
Post by: Stigmartyr on February 10, 2010, 04:00:24 PM
Can someone help me modify the block code attached below?  I want it to display items horizontally rather than vertically.  I don't know if it means a new code or a modification of the one I have.
Title: Re: Aeva Media Block
Post by: gmoneyluv on February 19, 2010, 11:13:08 AM
Hey Folks,

Not sure if i should start a new thread but i'm having issues with the Aeva 1.0 and the gallery block.

I used the code at the start of this thread and still no luck.

See here http://www.ontarioclimbing.com/forum/index.php (http://www.ontarioclimbing.com/forum/index.php)
Any help???
Title: Re: Aeva Media Block
Post by: gmoneyluv on February 19, 2010, 07:53:54 PM
Ok! Getting closer! Applied the solutions above and they worked but i'm getting a missing picture icon and when i click on the missing picture i get a 406 Not Acceptable error (see attachment).

Any ideas?

Here is web address to my site.
http://www.ontarioclimbing.com/forum/index.php?www (http://www.ontarioclimbing.com/forum/index.php?www)
     
Title: Re: Aeva Media Block
Post by: Chen Zhen on February 22, 2010, 02:06:22 AM

I have put together a neat little slide-show package that will display Aeva photos and/or SMF forum photos (image attachments) in a portal block.

CLICK HERE (http://askusaquestion.net/index.php/topic,904.0.html)  to view the relevant thread. You might have to login/register to download files.

Specific settings for what you want displayed are done in the block itself and also the settings.php file of the package provided in that thread.

UD
Title: Re: Aeva Media Block
Post by: gmoneyluv on February 22, 2010, 11:09:02 AM
Hey Underdog!

Any way this can be tweaked for folks running SMF 1.1.11?

It won't load on my site... :(
Title: Re: Aeva Media Block
Post by: Chen Zhen on February 22, 2010, 07:20:30 PM
Hey Underdog!

Any way this can be tweaked for folks running SMF 1.1.11?

It won't load on my site... :(

That version will not work with SMF 1.1.11 ... I will have to add another function to read the db for the recent/random image attachments and update the install file. I will do it some time this week and when I finish I will post a reply in that thread and update the attached install package from the first post.

UD
Title: Re: Aeva Media Block
Post by: saosangmo on February 23, 2010, 11:08:26 AM
Thank for this hack, it works very well. But I want to display items vertically. How to?

-saosangmo
Title: Re: Aeva Media Block
Post by: Chen Zhen on February 23, 2010, 04:18:25 PM
Thank for this hack, it works very well. But I want to display items vertically. How to?

-saosangmo

Look here: http://simpleportal.net/index.php?topic=4198.msg27750#msg27750

but change the 0 to a 1

Title: Re: Aeva Media Block
Post by: saosangmo on February 23, 2010, 08:04:36 PM
thank for your support. it works very well.
-saosangmo
Title: Re: Aeva Media Block
Post by: gmoneyluv on February 23, 2010, 09:40:05 PM
thanks for all your work underdog. Looking forward to the 1.1.11 version! :) 
Title: Re: Aeva Media Block
Post by: Chen Zhen on February 26, 2010, 10:23:26 PM
thanks for all your work underdog. Looking forward to the 1.1.11 version! :)

You're very welcome.

The thread has been updated with the new version.
I also added random display for forum photos.

UD
Title: Re: Aeva Media Block
Post by: Stigmartyr on March 07, 2010, 10:55:39 AM
Ok! Getting closer! Applied the solutions above and they worked but i'm getting a missing picture icon and when i click on the missing picture i get a 406 Not Acceptable error (see attachment).

Any ideas?

Here is web address to my site.
http://www.ontarioclimbing.com/forum/index.php?www (http://www.ontarioclimbing.com/forum/index.php?www)
   

Is the gallery's folder writable?
Title: Re: Aeva Media Block
Post by: mrtrc266 on March 16, 2010, 03:34:14 PM
For SMF Media Gallery there is a really neat block code to use for your portal. Anyone willing to port this to Aeva Media?

Original post here http://simpleportal.net/index.php?topic=1654.msg12017;topicseen#msg12017

Code: [Select]
    global $sourcedir, $context, $txt, $galurl, $scripturl, $settings;
    if(!file_exists($sourcedir . '/Subs-MGallery.php'))
    {
        echo $txt['sp-mgallery_error'];
        return false;
    }
$parameters[1] = 0;
    $limit = empty($parameters[0]) ? 1 : (int) $parameters[0];
    $type = empty($parameters[1]) ? 'm.id_media DESC' : 'RAND()';
    require_once($sourcedir . '/Subs-MGallery.php');
    loadMGal_Settings();
    loadLanguage('MGallery', sp_languageSelect('MGallery'));
    $items = getMediaItems(0, $limit, $type);
    echo '
    <hr />
<div style="text-align: center; line-height: 1.4em;">The Latest Gallery Submission</div>
<hr />
<table style="border: 0; margin: 0 auto;">';

    foreach ($items as $item)
      echo '
  <tr>
    <td>
      <div class="smalltext" style="text-align: center; line-height: 1.4em; border: 1px #000000 solid; padding: 5px;">
      <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'], ';preview" alt="" /></a><br />
      ', $txt['mgallery_views'], ': ', $item['views'], '<br />
      ', $txt['mgallery_posted_by'], ': <a href="', $scripturl, '?action=profile;u=', $item['poster_id'], '">', $item['poster_name'], '</a><br />
      ', $txt['mgallery_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" />' : '', '
      </div>
    </td>  </tr>';
    echo '
</table>';

$parameters[1] = 1;
    $limit = empty($parameters[0]) ? 5 : (int) $parameters[0];
    $type = empty($parameters[1]) ? 'm.id_media DESC' : 'RAND()';
    require_once($sourcedir . '/Subs-MGallery.php');
    loadMGal_Settings();
    loadLanguage('MGallery', sp_languageSelect('MGallery'));
    $items = getMediaItems(0, $limit, $type);
    echo '
    <hr />
<div style="text-align: center; line-height: 1.4em;">A selection of Random Images from the Gallery</div>
<hr />
<table style="border: 0; margin: 0 auto;">
  <tr style="width:150px; height:150px;">';
    foreach ($items as $item)
      echo '
    <td>
      <div class="smalltext" style="text-align: center; line-height: 1.4em; border: 1px #000000 solid; padding: 5px;width:125px;height:160px;">
      <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['mgallery_views'], ': ', $item['views'], '<br />
      ', $txt['mgallery_posted_by'], ': <a href="', $scripturl, '?action=profile;u=', $item['poster_id'], '">', $item['poster_name'], '</a><br />
      ', $txt['mgallery_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" />' : '', '
      </div>
    </td>';
    echo '
  </tr>
</table>';
$parameters[1] = 1;


    $limit = empty($parameters[0]) ? 5 : (int) $parameters[0];

    $type = empty($parameters[1]) ? 'm.id_media DESC' : 'RAND()';



    require_once($sourcedir . '/Subs-MGallery.php');

    loadMGal_Settings();

   

    loadLanguage('MGallery', sp_languageSelect('MGallery'));



    $items = getMediaItems(0, $limit, $type);



    echo '
<table style="border: 0; margin: 0 auto;">

  <tr style="width:150px; height:150px;">';



    foreach ($items as $item)

      echo '

    <td>

      <div class="smalltext" style="text-align: center; line-height: 1.4em; border: 1px #000000 solid; padding: 5px;width:125px;height:160px;">

      <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['mgallery_views'], ': ', $item['views'], '<br />

      ', $txt['mgallery_posted_by'], ': <a href="', $scripturl, '?action=profile;u=', $item['poster_id'], '">', $item['poster_name'], '</a><br />

      ', $txt['mgallery_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" />' : '', '

      </div>

    </td>';



    echo '

  </tr>

</table>';
$parameters[1] = 1;


    $limit = empty($parameters[0]) ? 5 : (int) $parameters[0];

    $type = empty($parameters[1]) ? 'm.id_media DESC' : 'RAND()';



    require_once($sourcedir . '/Subs-MGallery.php');

    loadMGal_Settings();

   

    loadLanguage('MGallery', sp_languageSelect('MGallery'));



    $items = getMediaItems(0, $limit, $type);



    echo '
<table style="border: 0; margin: 0 auto;">

  <tr>';



    foreach ($items as $item)

      echo '

    <td style="width:150; height:150;">

      <div class="smalltext" style="text-align: center; line-height: 1.4em; border: 1px #000000 solid; padding: 5px;width:125px;height:160px;">

      <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['mgallery_views'], ': ', $item['views'], '<br />

      ', $txt['mgallery_posted_by'], ': <a href="', $scripturl, '?action=profile;u=', $item['poster_id'], '">', $item['poster_name'], '</a><br />

      ', $txt['mgallery_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" />' : '', '

      </div>

    </td>';



    echo '

  </tr>

</table>';
Title: Re: Aeva Media Block
Post by: [SiNaN] on March 18, 2010, 10:01:17 AM
What does that block code supposed to do and look?
Title: Re: Aeva Media Block
Post by: mrtrc266 on March 19, 2010, 09:42:24 AM
What does that block code supposed to do and look?

It show the latest image (large) on top and then 15 random images below
http://www.monsters-mansion.com/testsmf2/
Title: Re: Aeva Media Block
Post by: [SiNaN] on March 20, 2010, 01:06:50 PM
Try this:

Code: [Select]
global $sourcedir;
require_once($sourcedir . '/Aeva-Subs.php');
echo '<h2>Latest Image</h2>';
echo preg_replace('~;thumb" width="\d+" height="\d+~', '" width="500', str_replace('"><tr>', '" cellspacing="8" style="width: 100%;"><tr>', aeva_listItems(aeva_getMediaItems(0, 1, 'm.id_media DESC'), false, '', 1)));
echo '<h2>Random Images</h2>';
echo aeva_listItems(aeva_getMediaItems(0, 12, 'RAND()'), false, '', 4);
Title: Re: Aeva Media Block
Post by: mrtrc266 on March 20, 2010, 01:32:14 PM
PERFECT!!! Thank you very much!

http://monsters-mansion.com/index.php
Title: Re: Aeva Media Block
Post by: [SiNaN] on March 21, 2010, 04:06:28 AM
You're welcome. ;)
Title: Re: Aeva Media Block
Post by: Renegd98 on March 21, 2010, 10:23:40 AM
Nice block code...
Title: Re: Aeva Media Block
Post by: esem on March 21, 2010, 12:10:07 PM
How to show the 3 latest image (small) in row, with title and autor name only ?
Title: Re: Aeva Media Block
Post by: [SiNaN] on March 22, 2010, 12:10:34 PM
This would do it:

Code: [Select]
global $sourcedir;
require_once($sourcedir . '/Aeva-Subs.php');
echo aeva_listItems(aeva_getMediaItems(0, 3, 'm.id_media'), false, '', 3);

Though, I don't have the time to make it hide the details other than title and author. You may want to ask that from the author of the mod.
Title: Re: Aeva Media Block
Post by: avenger on March 25, 2010, 11:16:16 AM
thank you
Title: Re: Aeva Media Block
Post by: MultiformeIngegno on March 25, 2010, 12:26:09 PM
This would do it:
It displays the first images, not the latest...
Title: Re: Aeva Media Block
Post by: avenger on March 25, 2010, 01:01:56 PM

I have put together a neat little slide-show package that will display Aeva photos and/or SMF forum photos (image attachments) in a portal block.

CLICK HERE (http://askusaquestion.net/index.php/topic,904.0.html)  to view the relevant thread. You might have to login/register to download files.

Specific settings for what you want displayed are done in the block itself and also the settings.php file of the package provided in that thread.

UD


hey underdog, ur code is great! like the slideshow...

can u do something like this with it?

http://spaceforaname.com/gallery-customized.html (http://spaceforaname.com/gallery-customized.html)

cheers!
Title: Re: Aeva Media Block
Post by: Chen Zhen on March 25, 2010, 09:35:13 PM

I have put together a neat little slide-show package that will display Aeva photos and/or SMF forum photos (image attachments) in a portal block.

CLICK HERE (http://askusaquestion.net/index.php/topic,904.0.html)  to view the relevant thread. You might have to login/register to download files.

Specific settings for what you want displayed are done in the block itself and also the settings.php file of the package provided in that thread.

UD


hey underdog, ur code is great! like the slideshow...

can u do something like this with it?

http://spaceforaname.com/gallery-customized.html (http://spaceforaname.com/gallery-customized.html)

cheers!



The settings.php file from the package I put together will allow you to edit how the slideshow looks so one can choose a view with 1 large photo and several thumbnails such as the one in the link you provided. 
Title: Re: Aeva Media Block
Post by: avenger on March 26, 2010, 01:01:49 AM
wow! really.....Bad that i'm not PHP fluent...But I'll give it my best try

thanks!
Title: Re: Aeva Media Block
Post by: avenger on March 26, 2010, 04:26:33 AM
ok, after a bit of struggling with PHP,  :(  I'm stuck! all i was able to do with it was speed up the show... can anyone help me with this...i have attached a pic of what i get,

it says to define number of columns etc in the php, changing that doesn't make anything happen...btw I'm now refering to the help sites

if any of you could help with this it would be great!

cheers!
Title: Re: Aeva Media Block
Post by: Chen Zhen on March 27, 2010, 10:37:24 AM
ok, after a bit of struggling with PHP,  :(  I'm stuck! all i was able to do with it was speed up the show... can anyone help me with this...i have attached a pic of what i get,

it says to define number of columns etc in the php, changing that doesn't make anything happen...btw I'm now refering to the help sites

if any of you could help with this it would be great!

cheers!

Hmm... At the bottom of that settings.php file there is a list of globals that needs to be either omitted or remark tags placed around it.
Even after testing this myself, any changes made here do not seem to take effect... This is something I will have to fix and then I will release a new version.  Thank you for discovering this issue.
For now, admins will have to use it as is (no thumbnails display).

UD
Title: Re: Aeva Media Block
Post by: avenger on March 27, 2010, 11:15:41 AM
Thanks underdog,
Hope it will be some time around soon :)
Title: Re: Aeva Media Block
Post by: awiwi on April 03, 2010, 01:05:13 AM
I leave the code with an image at a time but random

Code: [Select]
function show_aeva_media_block()
{
   global $sourcedir;

   // Set amount visible
   $visible = 1;

   // 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.
   $images = aeva_listItems(aeva_getMediaItems(0, $visible, 'RAND()'), true, '', 1, false, '', 1);

   echo '
      <div id="aeva_pics" style="width: 100%;" overflow="visible">
         <div align="center">'. $images. '</div>
      </div>';
}

show_aeva_media_block();

I hope you learn
Title: Re: Aeva Media Block
Post by: esem on April 09, 2010, 07:00:08 AM
Is it possible to exclude a particular album to display random?
Title: Re: Aeva Media Block
Post by: b4pjoe on April 11, 2010, 08:39:51 PM
Try this:

Code: [Select]
global $sourcedir;
require_once($sourcedir . '/Aeva-Subs.php');
echo '<h2>Latest Image</h2>';
echo preg_replace('~;thumb" width="\d+" height="\d+~', '" width="500', str_replace('"><tr>', '" cellspacing="8" style="width: 100%;"><tr>', aeva_listItems(aeva_getMediaItems(0, 1, 'm.id_media DESC'), false, '', 1)));
echo '<h2>Random Images</h2>';
echo aeva_listItems(aeva_getMediaItems(0, 12, 'RAND()'), false, '', 4);

This code works great. Just wondering though if there is a way to limit it to one specific album instead of it grabbing images from all albums?
Title: Re: Aeva Media Block
Post by: DaRKeN on May 01, 2010, 01:20:22 AM
Is it possible to exclude a particular album to display random?

What I need is to display 8 or 10 images but of a particular album, that is just there. Any ideas?


Thanks!
Title: Re: Aeva Media Block
Post by: roomeat on May 01, 2010, 04:42:16 AM

I have put together a neat little slide-show package that will display Aeva photos and/or SMF forum photos (image attachments) in a portal block.

CLICK HERE (http://askusaquestion.net/index.php/topic,904.0.html)  to view the relevant thread. You might have to login/register to download files.

Specific settings for what you want displayed are done in the block itself and also the settings.php file of the package provided in that thread.

UD


Thanks for the mod underdog.. but I am having some troubles.
I downloaded and installed the mod, added the code to a php block and when I try to preview it all I get is a error.


Parse error: syntax error, unexpected T_STRING in /var/www/vhosts/ozsportsbikes.com/httpdocs/Sources/PortalBlocks.php(3332) : eval()'d code on line 61


Any ideas what I have done wrong?
Title: Re: Aeva Media Block
Post by: roomeat on May 01, 2010, 04:43:52 AM
OH.. And line 3332 contains this:

   eval($content);
Title: Re: Aeva Media Block
Post by: roomeat on May 01, 2010, 04:46:02 AM
oops.. its looking at line 61.. so that line is:

   void sp_quickSearch()
      // !!!
Title: Re: Aeva Media Block
Post by: DaRKeN on May 01, 2010, 01:02:59 PM
Nothing. For more, changing the code, do not use a single album that I choose  :'(


Help Me please  :angel:
Title: Re: Aeva Media Block
Post by: z_dane on May 03, 2010, 10:32:12 AM
Any idea to remove remark posted by xxxx in album xxxx.
I just want the picture appear in the list
Title: Re: Aeva Media Block
Post by: Chen Zhen on May 03, 2010, 11:45:42 PM
Thanks for the mod underdog.. but I am having some troubles.
I downloaded and installed the mod, added the code to a php block and when I try to preview it all I get is a error.


Parse error: syntax error, unexpected T_STRING in /var/www/vhosts/ozsportsbikes.com/httpdocs/Sources/PortalBlocks.php(3332) : eval()'d code on line 61


Any ideas what I have done wrong?

Make sure you are adding a PHP block (not HTML) and that it is the proper one for your SMF version.


Title: Re: Aeva Media Block
Post by: roomeat on May 04, 2010, 02:23:42 PM
Have checked and it is correct.. but still those errors.
SMF2.0 RC3
Title: Re: Aeva Media Block
Post by: Chen Zhen on May 15, 2010, 10:37:35 PM
Have checked and it is correct.. but still those errors.
SMF2.0 RC3

I have just tested this on a smf 2 rc3 install and it works fine with no errors in the smf log.  I can't seem to duplicate your errors.

It does need to be edited for w3c compliance., which I will do for the next version release.
Title: Re: Aeva Media Block
Post by: dtek on May 19, 2010, 12:14:34 PM
I need to pick the album I want to display images from.  How can I do that?
Title: Re: Aeva Media Block
Post by: marinaofpiraeus on December 06, 2010, 08:22:51 AM
Hello. How can I display the images ordered by latest comments?
Title: Re: Aeva Media Block
Post by: FrizzleFried on May 21, 2012, 02:45:22 AM
Unfortunately Underdog's gallery mod is not available as his site is now down.  Does anyone have it they can send me?

Thanks!
Title: Re: Aeva Media Block
Post by: andy on May 21, 2012, 06:24:47 AM
Im using the aeva mod/custom code from this site - forgot where but if you search you will find it. It might be an old thread but it does work... Im using it!

Vertical block:
http://outdoorclubjapan.com/index.php?page=introduction
Title: Re: Aeva Media Block
Post by: FrizzleFried on May 21, 2012, 09:55:51 AM
I was hoping to find a vertical scrolling gallery block.... it sounded like that is what Underdog's code was.  I tried using the SCROLLING code around here somewhere with a number of the gallery codes around here but nothing has worked thus far.

Title: Re: Aeva Media Block
Post by: andy on May 21, 2012, 10:12:50 AM
I tried one a while back but deleted it ... I just checked, and the one Im using now is the standard gallery block in SP.



Title: Re: Aeva Media Block
Post by: Old Fossil on May 21, 2012, 06:20:02 PM
There are two versions of Aeva Media block available.

One I use which is static and shows images at Random

OR

One which scrolls which is used by the folks at Pixel Mansion.

As an FYI Underdog has had a few problems with his hosts ( who doesn't).

Title: Re: Aeva Media Block
Post by: FrizzleFried on May 22, 2012, 12:55:53 PM
There are two versions of Aeva Media block available.

One I use which is static and shows images at Random

OR

One which scrolls which is used by the folks at Pixel Mansion.

As an FYI Underdog has had a few problems with his hosts ( who doesn't).

Um... where do I find the scrolling one?

 8)
Title: Re: Aeva Media Block
Post by: andy on May 22, 2012, 01:16:35 PM
This works... it was posted on Simple Portal but from ...another place.

I tested an original copy and it works.

http://simpleportal.net/index.php?topic=6575.msg44705#msg44705
Title: Re: Aeva Media Block
Post by: FrizzleFried on May 22, 2012, 01:42:10 PM
This works... it was posted on Simple Portal but from ...another place.

I tested an original copy and it works.

http://simpleportal.net/index.php?topic=6575.msg44705#msg44705

What would be PERFECT if it worked right.  Unfortunately it scrolls 2 or 3 images down... then resets and SNAPS back to the top and scrolls down 2 or 3 images then SNAPS BACK to the top.

:(

EDIT: Nevermind... it's now working... strange. 

Anyway... stupid question time...

Does including "scrollers" like this slow down a server/browser/anything?

I ask because I have two other scrolling blocks.

EDIT: THANKS by the way ... I appreciate the help!
Title: Re: Aeva Media Block
Post by: andy on May 22, 2012, 03:53:59 PM
Depends on your hosting account quality.

When I use too many things the server starts to restrict scripts so the site slows down. Worst case is when it cuts them off and the site goes down. Sometime I get a message from SMF at similar times saying it couldnt connect to the database.

So try it and see - if your site goes too slow or uses too many resources and stops ... cut back.
Never good to have too much running I think. And these days people using smart phones so could impact them too.


Title: Re: Aeva Media Block
Post by: FrizzleFried on May 22, 2012, 05:31:21 PM
Between you and I...

... I don't care about smart phone users.  :)

Forums are for computers.  ;)

But yeah... I get your drift.

Title: Re: Aeva Media Block
Post by: FrizzleFried on May 23, 2012, 03:36:23 PM
Well now poo...

I just updated to the 2.x version of Aeva media...

...now my static block shows a scroll bar... the reason?  The 2.x version includes a pop up when you hover over the name of the file... that pop up is being seen as part of the block so it adds a scroll bar because the block isn't long enough by the size of the pop up...

Any way to disable the pop up so it doesn't create a scroll bar...

I noticed it does the same thing for the scrolling block too... but after a second or so the scroll bar goes away.
Title: Re: Aeva Media Block
Post by: FrizzleFried on May 23, 2012, 03:47:48 PM
Welp,

I just tried every block code in this thread and they ALL do it... vertical or horizontal.

I am attaching two photos to show what is happening.

The 2nd photo shows the POPUP box that appears... it is blank normally until you hover over an image.

Title: Re: Aeva Media Block
Post by: andy on May 24, 2012, 02:42:35 AM
On my site the scroll bars disappear once it starts moving.

You have to also remember  that aeva media is technically obsolete. It is not being updated.
I guess eventually someone will build a new gallery when smf 3.0 comes out in, well, maybe 2 years, maybe less.

Maybe Menalto gallery 3 will be integrated/bridged - it is much better.

Title: Re: Aeva Media Block
Post by: FrizzleFried on May 24, 2012, 11:45:29 AM
I've asked this question before but managed a work-around without having to get the answer.

Can someone please post the code to set a block a SPECIFIC length.  I could fix this issue by simply forcing the block to be 50px or so larger than it is by default.  There has GOT to be a way to set blocks a specific length... right?

Any/all help is appreciated.

:)

Title: Re: Aeva Media Block
Post by: movedgoalposts on May 24, 2012, 01:37:34 PM
can you set the block size with the height style i.e wrap your block with something like
Code: [Select]
<div style="height: 100px;">
blocky stuff goes here
</div>
Title: Re: Aeva Media Block
Post by: FrizzleFried on May 24, 2012, 02:06:51 PM
That works for an HTML block... but these are PHP blocks... is there a PHP equivalent?
Title: Re: Aeva Media Block
Post by: Chen Zhen on May 29, 2012, 09:46:51 PM
That works for an HTML block... but these are PHP blocks... is there a PHP equivalent?

FrizzleFried,

While using php, just echo the necessary html.

ie. same as example above
Code: [Select]
echo '<div style="height: 100px;">
block content goes here
</div>';
Title: Re: Aeva Media Block
Post by: USFA on April 21, 2014, 07:50:11 PM
Wonder has anyone used any other media manager since this one does not work on 2.0.7 tried and it fails install.

Thanks
Title: Re: Aeva Media Block
Post by: Old Fossil on April 21, 2014, 07:54:51 PM
Are you talking about the portal block or the aeva media mod itself?
Title: Re: Aeva Media Block
Post by: USFA on April 21, 2014, 09:21:13 PM
Hi there,
I am able to adapt most items to the portal, but would like to be able to use the
aeva media mod or any other mod that would show media in a forum like this one..

Title: Re: Aeva Media Block
Post by: Old Fossil on April 21, 2014, 09:28:34 PM
Your reply did not answer my question.
Title: Re: Aeva Media Block
Post by: USFA on April 22, 2014, 09:52:09 AM
Your reply did not answer my question.
Hi There,
LOL I thought I did ?
Maybe I am not understanding what you are asking  ;D

I do not know of a block for AEVA ?

I was able to install Aeva by getting another DL, and it installed.


But now I have no idea how to use the Aeva , as SMF says very little in the way of directions in using it.

You are referring to a Aeva block ?
No idea what that is .


USFA


Title: Re: Aeva Media Block
Post by: Old Fossil on April 22, 2014, 06:07:45 PM
For aeva media ( mod) related support you shold be asking at www.simplemachines.org

As with the block the search function will help.
Title: Re: Aeva Media Block
Post by: AngelinaBelle on April 23, 2014, 09:36:33 AM
There is a problem getting support for AEVA media -- its author is no longer supporting it, at least not at simplemachines.org, and probably not supporting it anywhere else, as he is busy working on WEDGE (a fork of SMF), and has reportedly incorporated AEVA functionality into WEDGE.

Your best bet may be to search at this site for some AEVA custom blocks, pick them apart to see how they are done, and decide which features you want to use as you develop your own custom block.
Title: Re: Aeva Media Block
Post by: USFA on April 23, 2014, 01:51:37 PM
For aeva media ( mod) related support you shold be asking at www.simplemachines.org

As with the block the search function will help.

Hi there, you are right I should be asking over there. But being the developer ended support 2 years ago, I thought maybe someone here had the same issues.
I removed Aeva and went with another similar option, thanks You !
Title: Re: Aeva Media Block
Post by: AngelinaBelle on April 24, 2014, 02:10:39 PM
USFA -- I hope that will work well for you.  Getting support for AEVA can, indeed, be a problem.
SimplePortal 2.3.8 © 2008-2024, SimplePortal