TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

April 19, 2024, 05:00:09 AM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,164
  • Total Topics: 21,219
  • Online today: 266
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 185
  • Total: 185

[Block] SMF Media Gallery Random Picture

Started by Petee, December 14, 2008, 06:02:31 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

juanporro

Now going back to that PM?................. should I send it?

juanporro

Also as Bec mentioned, is it possible to get the code to post three pics instead of one? If not it is ok with me I am very pleased with just being able to see one.

Petee

Here is a block they posted over at the smf-media site. 

2, 'rand()');  this part of the code says to pull 2 random pictures. Change it to suit your needs.

global $sourcedir, $context, $txt, $galurl, $scripturl, $settings;

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

if (loadlanguage('MGallery') == false)
  loadLanguage('MGallery', 'english');

$items = getMediaItems(0, 2, 'rand()');

echo '
<center><table border="0">
  <tr>';

foreach ($items as $item)
  echo '
    <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 alt="" 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></center>';

juanporro

#33
Ok one more thing.

Do you guys know how to take away the outline from the thumbnail?

The first code had a clean picture and the one with multiple pictures puts a rather ugly outline to the thumbnail.

Thanks

IchBin


NenaGb

do you have any idea how to display a gallery slideshow in a block code? i know you have to purchase the slideshow code for smf media gallery which I have done, but I was under the impression the slideshow when purchased gave you this effect only to find out i was mistaken and it does not do that at all. I would love it if there was a way to actually display the slideshow in a block.

Lesmond

You would be best asking that over at http://smf-media.com

Quote from: NenaGb on April 21, 2009, 05:54:38 AM
do you have any idea how to display a gallery slideshow in a block code? i know you have to purchase the slideshow code for smf media gallery which I have done, but I was under the impression the slideshow when purchased gave you this effect only to find out i was mistaken and it does not do that at all. I would love it if there was a way to actually display the slideshow in a block.

NenaGb

Quote from: Lesmondâ„¢ on April 21, 2009, 07:03:19 AM
You would be best asking that over at http://smf-media.com

Quote from: NenaGb on April 21, 2009, 05:54:38 AM
do you have any idea how to display a gallery slideshow in a block code? i know you have to purchase the slideshow code for smf media gallery which I have done, but I was under the impression the slideshow when purchased gave you this effect only to find out i was mistaken and it does not do that at all. I would love it if there was a way to actually display the slideshow in a block.

already did and was told he was not interested in looking into it any further at this time. i was a bit disappointed because naturally with a slideshow you would want to be able to feature it on a page or post or w/in a block but that is not an option they offer to work on at time time. :)

ehsizzup

nice job.  ive been looking for this for a while.

can this block be changed to show pictures from one album only?



WillyP

#39
To do that I would try changing the url in the script to the url of the album you want...  ;) just a guess, I haven't tried that.

Nice block, just installed and it works great! See it here if you want a demo. (no, not the picture of the day block, scroll down... :coolsmiley: )