* User

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

20 Mar 10, 13:25:34

Login with username, password and session length

Select language:

* Recent Topics



Donate

Donate for PortaMx !
Your donation is safe and helps support the issues and causes you care most about.

* Stats

  • *Total Members: 1994
  • *Latest: Osiristi

  • *Total Posts: 9296
  • *Total Topics: 1346
  • *Online Today: 25
  • *Most Online: 157
(27 Aug 09, 03:54:53)
  • *Users: 1
  • *Guests: 17
  • *Spiders: 0
  • *Total: 18

* Themes

*

Author Topic: AEVA Gallery Block with options  (Read 1066 times)

0 Members and 1 Guest are viewing this topic.

Offline mikeymx5

  • Newbie
  • *
  • Posts: 17
  • Gender: Male
    • Houston Miata Club
AEVA Gallery Block with options
« on: 04 Jan 10, 03:24:02 »
Here is a block for the new AEVA gallery that replaced MGallery.
You can change the options if you want it to show multiple blocks I prefer a single large preview block.

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


   require_once($sourcedir . '/Aeva-Subs.php');
//   loadMGal_Settings();
   loadLanguage('Aeva');

// Random=0 or Latest = 1
      $blocktype = 1;

// "thumb" or "preview"
      $blockimagetype = preview;

//      $blockFolder = $boarddir . '/Themes/default/aeva';
//      $blockItemsFile = $scrollerFolder . '/imageScrollerItems.xml';

// How many pictures
      $blockMaxItems = 1; 
      $blockoffset = 0;
// width of block in percent
      $boxwidth = 100;

if ($blocktype = 1 ) {
//Random
$items = aeva_getMediaItems($blockoffset, $blockMaxItems, 'rand()', true, array(), 'm.type = "image" AND a.access LIKE "%-1%" AND a.passwd=""');
}
else {
//Latest
$items = aeva_getMediaItems($blockoffset, $blockMaxItems, 'm.id_media DESC', true, array(), 'm.type = "image" AND a.access LIKE "%-1%" AND a.passwd=""');

}

echo '
    <div style="align: center;">
        <div class="smalltext" style="text-align: center;   width: 100% ;  margin-left: auto ;  margin-right: auto ;"></div>';

   foreach($items as $item)
      echo '
   <div class="smalltext" style="display: inline; padding: 5px;float:left;text-align:center; align:center; width: 100%;  margin-left: auto ;  margin-right: auto ;">
      <a href="',$galurl,'sa=item;id=',$item['id'],'">',$item['title'],'</a><br />
      <a href="',$galurl,'sa=media;id=',$item['id'],'" title="',$item['title'],'" class="hs  " onclick="return hs.expand(this);"><img alt="" src="',$galurl,'sa=media;id=',$item['id'],';',$blockimagetype,'" 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" />' : '','
   </div>';

echo '
<br style="clear:both;" />
</div>';

Offline hartiberlin

  • Charter Member
  • *
  • Posts: 451
  • Gender: Male
    • Free energy research
Re: AEVA Gallery Block with options
« Reply #1 on: 04 Jan 10, 18:29:01 »
Can you please post a few demo links to
     
AEVA Gallery ?

Does it support picture slideshows via Adobe Flash ?

Many thanks.

Offline rockyrails

  • Newbie
  • *
  • Posts: 3
Re: AEVA Gallery Block with options
« Reply #2 on: 04 Jan 10, 20:17:17 »
I inserted the code in php block and only saw the block title on frontpage, no images. Any help would be awesome (switched to Aeva Gallery) and would love to have the new images or even random images on frontpage.
cheers RockyRails

Offline rockyrails

  • Newbie
  • *
  • Posts: 3
Re: AEVA Gallery Block with options
« Reply #3 on: 05 Jan 10, 05:42:50 »
Got it working (rebuilt all thumbs and preview files in AEVA - now I get an error message for each thumb or preview that loads when anyone hits the frontpage  :

http://www........../index.php?8: Use of undefined constant preview - assumed 'preview'File: /home3/......./public_html/........../Themes/default/PortaMx/PortaMx.template.php (portamx_below sub template - eval?)
Line: 15


Any help would be great - I love the gallery vertically using the thumbs

cheers

Offline feline

  • CO PortaMx corp.
  • Administrator
  • *
  • Posts: 2857
  • Gender: Female
Re: AEVA Gallery Block with options
« Reply #4 on: 05 Jan 10, 20:36:51 »
That is a undefined text string variable I think, but not from PortaMx...

Fel
Many are stubborn in relation to the path, a few in relation to the target.

Offline neverhurry

  • Full Member
  • ***
  • Posts: 176
  • Gender: Male
  • PortaMX fan
Re: AEVA Gallery Block with options
« Reply #5 on: 28 Jan 10, 09:58:35 »
Got it working (rebuilt all thumbs and preview files in AEVA - now I get an error message for each thumb or preview that loads when anyone hits the frontpage  :

http://www........../index.php?8: Use of undefined constant preview - assumed 'preview'File: /home3/......./public_html/........../Themes/default/PortaMx/PortaMx.template.php (portamx_below sub template - eval?)
Line: 15


Any help would be great - I love the gallery vertically using the thumbs

cheers

I have aeva gallery installed, and did the rebuilt all thumbs and preview files in AEVA gallery, but it still shows no text, no images, no error info, just a title bar with empty content. Could you pls link a demo here? Thanks.

Offline mikeymx5

  • Newbie
  • *
  • Posts: 17
  • Gender: Male
    • Houston Miata Club
Re: AEVA Gallery Block with options
« Reply #6 on: 28 Jan 10, 22:33:47 »
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, 3, 'RAND()'), false, '', 1);


   require_once($sourcedir . '/Aeva-Subs.php');
//   loadMGal_Settings();
   loadLanguage('Aeva');

// Random=1 or Latest = 0
      $blocktype = 1;

// "thumb" or "preview"
      $blockimagetype = preview;

//      $blockFolder = $boarddir . '/Themes/default/aeva';
//      $blockItemsFile = $scrollerFolder . '/imageScrollerItems.xml';

// How many pictures
      $blockMaxItems = 1; 
      $blockoffset = 0;
// width of block in percent
      $boxwidth = 100;

if ($blocktype = 1 ) {
//Random
$items = aeva_getMediaItems($blockoffset, $blockMaxItems, 'rand()', true, array(), 'm.type = "image" AND a.access LIKE "%-1%" AND a.passwd=""');
}
else {
//Latest
$items = aeva_getMediaItems($blockoffset, $blockMaxItems, 'm.id_media DESC', true, array(), 'm.type = "image" AND a.access LIKE "%-1%" AND a.passwd=""');

}

echo '
    <div style="align: center;">
        <div class="smalltext" style="text-align: center;   width: 100% ;  margin-left: auto ;  margin-right: auto ;"></div>';

   foreach($items as $item)
      echo '
   <div class="smalltext" style="display: inline; padding: 5px;float:left;text-align:center; align:center; width: 100%;  margin-left: auto ;  margin-right: auto ;">
      <a href="',$galurl,'sa=item;id=',$item['id'],'">',$item['title'],'</a><br />
      <a href="',$galurl,'sa=media;id=',$item['id'],'" title="',$item['title'],'" class="hs  " onclick="return hs.expand(this);"><img alt="" src="',$galurl,'sa=media;id=',$item['id'],';',$blockimagetype,'" 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" />' : '','
   </div>';

echo '
<br style="clear:both;" />
</div>';

I changed a few things not sure if they are in the original post.
You can see a demo at HoustonMiataclub.com

Offline neverhurry

  • Full Member
  • ***
  • Posts: 176
  • Gender: Male
  • PortaMX fan
Re: AEVA Gallery Block with options
« Reply #7 on: 28 Jan 10, 23:04:55 »
Thank you Mike, i tried again, no luck.  :-\

Offline mikeymx5

  • Newbie
  • *
  • Posts: 17
  • Gender: Male
    • Houston Miata Club
Re: AEVA Gallery Block with options
« Reply #8 on: 28 Jan 10, 23:29:32 »
Whats your website maybe i can can get a better idea of the error

Offline mikeymx5

  • Newbie
  • *
  • Posts: 17
  • Gender: Male
    • Houston Miata Club
Re: AEVA Gallery Block with options
« Reply #9 on: 28 Jan 10, 23:40:37 »
Also just to make sure you are not Using SMG Gallery with AEVA... for this to work you need to be using AEVA Gallery.

Try my original gallery block with options code from a later post. AEVA added back backward compatibility code so it should work but Im not 100% on that.

Offline mikeymx5

  • Newbie
  • *
  • Posts: 17
  • Gender: Male
    • Houston Miata Club
Re: AEVA Gallery Block with options
« Reply #10 on: 28 Jan 10, 23:42:30 »
This code for SMF Gallery not AEVA Gallery
Code: [Select]
global $sourcedir, $user_info, $ID_MEMBER, $context, $txt, $galurl, $galurl2, $scripturl, $settings, $db_prefix;

   require_once($sourcedir . '/Subs-MGallery.php');
   loadMGal_Settings();
   if(loadlanguage('MGallery') == false)
      loadLanguage('MGallery', 'english');
// Random=0 or Latest = 1
      $blocktype = 1;
// "thumb" or "preview"
      $blockimagetype = preview;

// How many pictures
      $blockMaxItems = 1;
// offset the array dont change
      $blockoffset = 0;


if ($blocktype = 1 ) {
//Random
$items = getMediaItems($blockoffset, $blockMaxItems, 'rand()', true, array(), 'm.type = "image" AND a.access LIKE "%-1%" AND a.passwd=""');
}
else {
//Latest
$items = getMediaItems($blockoffset, $blockMaxItems, 'm.id_media DESC', true, array(), 'm.type = "image" AND a.access LIKE "%-1%" AND a.passwd=""');

}

echo '
    <div style="align: center;">
        <div class="smalltext" style="text-align: center;   width: 100% ;  margin-left: auto ;  margin-right: auto ;"></div>';

   foreach($items as $item)
      echo '
   <div class="smalltext" style="display: inline; padding: 5px;float:left;text-align:center; align:center; width: 100%;  margin-left: auto ;  margin-right: auto ;">
      <a href="',$galurl,'sa=item;id=',$item['id'],'">',$item['title'],'</a><br />
      <a href="',$galurl,'sa=item;id=',$item['id'],'"><img alt="" src="',$galurl,'sa=media;id=',$item['id'],';',$blockimagetype,'" 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=viewalbum;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>';

echo '
<br style="clear:both;" />
</div>';

Offline neverhurry

  • Full Member
  • ***
  • Posts: 176
  • Gender: Male
  • PortaMX fan
Re: AEVA Gallery Block with options
« Reply #11 on: 29 Jan 10, 17:57:21 »
Mike, i got another code from here:

http://portamx.com/topic_1376.msg8172.html#msg8172

and it works! Anyway, thank you so much!  :)