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

* Navigator

Expand - Collapse

* Statistic

  • *Total Posts: 14942
  • *Total Topics: 2271
  • *Online Today: 12
  • *Most Online: 292
(2016 November 12, 09:37:31 am)

AEVA Gallery Block with options

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

previous topic - next topic

0 Members and 0 Guests are viewing this topic.

mikeymx5

2010 January 04, 03:24:02 am
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, 06:29:01 pm
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, 08:17:17 pm
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 am
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, 08:36:51 pm
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 am
Quote from: rockyrails ,  2010 January 05, 05:42:50 am
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, 10:33:47 pm
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, 11:04:55 pm
Thank you Mike, i tried again, no luck.  :-\

mikeymx5

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

mikeymx5

#9
2010 January 28, 11:40:37 pm
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, 11:42:30 pm
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, 05:57:21 pm
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, 06:38:22 pm
Quote from: mikeymx5 ,  2010 January 28, 10:33:47 pm
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 am
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, 08:57:16 pm
Quote from: mikeymx5 ,  2010 January 28, 10:33:47 pm
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, 10:31:08 pm
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>';

justdownload.us

#15
2010 September 15, 12:51:20 pm
it helps me a lot for this code!!

tnx man!!
DOn't BeLiEve tHat yOu kNow EverYthiNg!!

kinsella

#16
2010 September 26, 10:36:14 pm
I have this block working, almost fully.  It does pull images from an Aeva album, the first album only, there are 3 total, and displays them randomly.
I would like to have the block pull from an album I choose, in this case album 3. And not randomly, but according to upload date.
I have changed the variables according to the posts above.  No matter what I change, the block still pulls from the first album and displays them randomly.

So, what do i need to change to have the block pull from a specific album and have them display according to upload date.

Here is the code that I am using currently.

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 = 0;

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

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

// How many pictures
      $blockMaxItems = 9;
      $blockoffset = 0;
// width height of pic block
      $boxwidth = 100;
      $boxheight = 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;padding: 5px;margin-left: auto;margin-right: auto;">';

   foreach($items as $item)
      echo '
  <div class="smalltext" style="max-width:',$boxwidth,'px; max-height:',$boxheight,'px; align:center; padding: 5px; text-align:center; margin-left: auto; margin-right: auto; float:left; clear: none;">
     <a href="',$galurl,'sa=album;id=',$item['id_album'],'">
      <img width="100" height="100" alt="" src="',$galurl,'sa=media;id=',$item['id'],';',$blockimagetype,'" alt="" /></a><br />
      ',$item['is_new'] ? '<br />
     ' : '','
   </div>
   ';

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

Thanks for your time.

b4pjoe

#17
2010 September 30, 06:40:46 pm
I use this to pull images from gallery number 10. No idea on making them display by upload date.

Code Select
echo aeva_listItems(aeva_getMediaItems(0, 16, 'RAND()', true, array(10)), true, 'center', 0);

kinsella

#18
2010 October 03, 09:16:24 pm
thanks b4pjoe.  that did the trick.   O0

davidw72

#19
2010 October 12, 10:36:24 pm
Quote from: mikeymx5 ,  2010 May 10, 10:31:08 pm
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>';



Mike, Please post the code you're using now on your site... I really like it and would like to use it! Awesome job on your site... I'm still trying to duplicate a lot of your blocks and I need that one and the calendar to be complete. Once I get the blocks down I want to use a different theme. Really good site and I'm in Cypress and work at Greenway... so I'll buy you lunch! ;)

DirtRider

#20
2010 October 14, 08:17:11 am
Random Gallery Images

Code Select
global $sourcedir;
loadLanguage('Aeva');
@include_once($sourcedir . '/Aeva-Subs.php');
echo preg_replace('~<div class="highslide-

maincontent">.*?</div>.*?</div>~', '', aeva_listItems

(aeva_getMediaItems(0, 5, 'RAND()'), false, '', 5));


New Media Images, Left or Right Block

Code Select
global $sourcedir;
   require_once($sourcedir . '/Aeva-Subs.php');
   echo preg_replace('~;thumb" width="d+" height="d+~', '" width="150', str_replace('"><tr>', '" cellspacing="8" style="width: 100%;"><tr>', aeva_listItems(aeva_getMediaItems(0, 5, 'm.id_media DESC'), false, '', 1)));


"The real question is not whether machines think but whether men do. "


Garry1953

#21
2010 October 16, 10:53:50 pm
DirtRider

Handy code.
Thanks

mikeymx5

#22
2010 October 25, 05:28:18 pm
Quote from: davidw72 ,  2010 October 12, 10:36:24 pm

Mike, Please post the code you're using now on your site... I really like it and would like to use it! Awesome job on your site...


What one...

I was using AEVAs simple code up to a day ago

Code Select
global $sourcedir;
   require_once($sourcedir . '/Aeva-Subs.php');
   echo preg_replace('~;thumb" width="d+" height="d+~', '" width="300', str_replace('"><tr>', '" cellspacing="8" style="width: 100%;"><tr>', aeva_listItems(aeva_getMediaItems(0, 6, 'rand()', true, array(), 'm.type = "image" AND a.access LIKE "%-1%" AND a.passwd=""'), false, '', 3)));

//'rand()',
//'m.id_media DESC',


Before that I was using the code I had posted here
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>';


Im now using GallerySlideshow Plus 1.2.5  (.5 because I edited half the code to my liking)
You can down load it here http://simpleportal.net/index.php?topic=4688.0
use this block code
Code Select
/* PHOTO GALLERY PLUS v1.2 - Intended for use with  *** Simple Portal ***
    visit: http://askusaquestion.net/index.php/board,36.0.html for SMF support of this adapted version.
    Slideshow is a javascript class for Mootools 1.2 to stream and animate the presentation of images on your website.
    Copyright (c) 2008 by Aeron Glemann (http://www.electricprism.com/aeron/).  (Freeware)
    This package was adapted to work with SMF and no part of the original script was modified in any way.
    PHOTO GALLERY PLUS is an alternative to viewing pictures on a SMF website and is intended as a package add-on for Simple Portal.

    Respected applications and developers concerning this modification:
        Aeva Media    - Developed by Nao/Gilles (c) Noisen.com / SMF-Media.com
   Simple Portal - Developed by The Simple Portal Team - v2.3.1 (c)2008-2009   (http://simpleportal.net/)
   Slideshow     - Developed by Aeron Glemann  (c)2008 (http://www.electricprism.com/aeron/)                                          */



/* >>>>>>>START - User supplied info<<<<<<< */

/* Enter total number of pics to view for forum */
$total_pics = 15;

/* Set 'true' for recent display and 'false' for random display in forum photos */
$type0 = true;

/* Enter total number of pics to view for aeva */
$total_pics_aeva = 6;

/* Set 'true' for recent display and 'false' for random display in aeva media */
$type1 = true;

/* Enter topic id to view pics from
- set to 0 for whole forum
- board id in next version */
$topic_id = 0;

/* Settings for Forum or Aeva Pics:
1 - Strictly Forum Photo Attachments
2 - Strictly Aeva Photo Gallery
3 - Use both Forum and Aeva Pics */
$gallery_type = 2;

/* Other specific settings can be adjusted in: / slideshow / settings.php    */

/* >>>>>>>END - User supplied info<<<<<<<  */


global $boarddir;
   /*  Grab the photo viewer file. */
   if (file_exists('slideshow/photo_viewer.php'))
{
require_once('slideshow/photo_viewer.php');
$gallery_type = (int)$gallery_type;
photo_gallery_v1a($total_pics, $total_pics_aeva, $type0, $type1, $topic_id, $gallery_type);
}
else
   {
      echo 'You do not have PHOTO GALLERY PLUS installed... Please install the necessary package! ... ';
      echo 'Visit askusaquestion.net for support.';
      return;
   }


Forum attachments doesnt work on my site but because I dont use them I did not try to trouble shoot the packages code.

DirtRider

#23
2010 November 03, 06:48:36 am
I am looking for the block code to only show specified galleries can anyone help with this  O0 this is the code I am using in my PHP Block now

Code Select
global $sourcedir;
loadLanguage('Aeva');
@include_once($sourcedir . '/Aeva-Subs.php');
echo preg_replace('~<div class="highslide-

maincontent">.*?</div>.*?</div>~', '', aeva_listItems

(aeva_getMediaItems(0, 5, 'RAND()'), false, '', 5));
"The real question is not whether machines think but whether men do. "


b4pjoe

#24
2010 November 03, 06:58:13 am
Quote from: DirtRider ,  2010 November 03, 06:48:36 am
I am looking for the block code to only show specified galleries can anyone help with this  O0 this is the code I am using in my PHP Block now

Code Select
global $sourcedir;
loadLanguage('Aeva');
@include_once($sourcedir . '/Aeva-Subs.php');
echo preg_replace('~<div class="highslide-

maincontent">.*?</div>.*?</div>~', '', aeva_listItems

(aeva_getMediaItems(0, 5, 'RAND()'), false, '', 5));



I use this. 10 is the album number.

Code Select
     echo aeva_listItems(aeva_getMediaItems(0, 16, 'RAND()', true, array(10)), true, 'center', 0);