To use this website completely, it is necessary to store cookies on your computer.
 

* Statistic

  • *Total Posts: 16418
  • *Total Topics: 2549
  • *Online Today: 8
  • *Most Online: 292
(2016 November 12, 09:37:31)
  • *Users: 0
  • *Guests: 0
  • *Spiders: 1
  • *Total: 1

  • *Yahoo!

AEVA Gallery Block with options

Started by mikeymx5, 2010 January 04, 03:24:02

previous topic - next topic

0 Members and 0 Guests are viewing this topic.

mikeymx5

2010 January 04, 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>';

hartiberlin

#1
2010 January 04, 18:29:01
Can you please post a few demo links to
     
AEVA Gallery ?

Does it support picture slideshows via Adobe Flash ?

Many thanks.

rockyrails

#2
2010 January 04, 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

rockyrails

#3
2010 January 05, 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

feline

#4
2010 January 05, 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.

neverhurry

#5
2010 January 28, 09:58:35
Quote from: rockyrails ,  2010 January 05, 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


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.

mikeymx5

#6
2010 January 28, 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

neverhurry

#7
2010 January 28, 23:04:55
Thank you Mike, i tried again, no luck.  :-\

mikeymx5

#8
2010 January 28, 23:29:32
Whats your website maybe i can can get a better idea of the error

mikeymx5

#9
2010 January 28, 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.

mikeymx5

#10
2010 January 28, 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>';

neverhurry

#11
2010 January 29, 17:57:21
Mike, i got another code from here:

https://www.portamx.com/topic_1376.msg8172.html#msg8172

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

b4pjoe

#12
2010 April 11, 18:38:22
Quote from: mikeymx5 ,  2010 January 28, 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


Quote from: neverhurry ,  2010 January 28, 09:58:35
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.


I get the same thing here. SMF 2.0 RC3 with AEVA 1.1b.....no text, no images, no error info, just a title bar with empty content. Any ideas?

b4pjoe

#13
2010 April 11, 20:57:16
Quote from: mikeymx5 ,  2010 January 28, 22:33:47
I changed a few things not sure if they are in the original post.
You can see a demo at HoustonMiataclub.com


Tried changing

Code Select
//   @include_once($sourcedir . '/Aeva-Subs.php');
//   echo aeva_listItems(aeva_getMediaItems(0, 3, 'RAND()'), false, '', 1);


to

Code Select
   @include_once($sourcedir . '/Aeva-Subs.php');
   echo aeva_listItems(aeva_getMediaItems(0, 3, 'RAND()'), false, '', 1);


and I get thumbnails but would like just to have one random full size image. Also, is there a way to limit it to a certain gallery?

mikeymx5

#14
2010 May 10, 22:31:08
You see the problem with the code above is that it allows the random image block to show all pictures.. txt files, music files, and what ever else you have in the gallery.

My code just makes is more specific.

I did make a few updates, but I am no longer working on this as Im now working on a Java slide show style galleryblock.
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 = thumb;

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

// How many pictures
      $blockMaxItems = 6; 
      $blockoffset = 0;
// width height of pic block
      $boxwidth = 215;
      $boxheight = 215;

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;padding: 5px;margin-left: auto;margin-right: auto;">';

   foreach($items as $item)
      echo '
   <div class="smalltext" style="width:',$boxwidth,'px;height:',$boxheight,'px;align:center;padding: 5px;text-align:center;margin-left: auto;margin-right: auto;float:left;">
      <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>';