collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 401
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

Installation errors? Mod incompatibilities? Upgrade problems? Make your way over to the Install and Upgrade Support board for all your solutions!

Author Topic: Media Gallery  (Read 26778 times)

0 Members and 1 Guest are viewing this topic.

Offline Soms

  • Newbie
  • Posts: 3
Media Gallery
« on: September 17, 2008, 03:25:31 AM »
Is it possible to add a feature to be able to display random pictures using the photos in the (new) SMF Media Gallery instead of the (old) SMF Gallery? Or at least give the choice of choosing between the two or using both?

Keep up the good work!

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Media Gallery
« Reply #1 on: September 17, 2008, 03:28:12 AM »
Thats a great idea!!! :D

I am sure that either myself or one of the other devs/customizers will make this block when we get some time.
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline cme1st2302

  • Full Member
  • ***
  • Posts: 117
  • Gender: Male
    • East Coast Astro
  • SMF Version: 1.1.11
  • SP Version: 2.3.2
Re: Media Gallery
« Reply #2 on: September 18, 2008, 12:20:34 AM »
 :wave: I too would be very interested in this block.   :wave:

BTW - thanks for creating such a great tool!!!
Admin

He who waits for perfect conditions sees nothing!!
SMF Version: 1.1.11
SimplePortal Version: 2.3.1

Offline sevacycles

  • Newbie
  • Posts: 4
Re: Media Gallery
« Reply #3 on: September 18, 2008, 05:07:24 PM »
I would like to see this aswell.


Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Media Gallery
« Reply #4 on: September 18, 2008, 06:51:32 PM »
Use this code with a php block, for now:

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');

$request = db_query("
SELECT m.id_media, m.id_member, IFNULL(mem.realName, m.member_name) AS member_name,  m.id_thumb, m.title, m.description, m.views, m.rating, m.voters,
a.id_album, a.name, IFNULL(lm.time, 0) <  m.log_last_access_time AS is_new, m.time_added, m.type
FROM {$db_prefix}mgallery_media AS m
INNER JOIN {$db_prefix}mgallery_albums AS a ON (a.id_album = m.album_id)
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.id_member)
LEFT JOIN {$db_prefix}mgallery_log_media AS lm ON (lm.id_member = $ID_MEMBER AND lm.id_media = m.id_media)
WHERE $user_info[mgallery_query_see_album]
AND m.approved = 1
ORDER BY RAND()
LIMIT 1", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request)) {
$item = array(
'id' => $row['id_media'],
'id_album' => $row['id_album'],
'album_name' => $row['name'],
'item_title' => $row['title'],
'member_name' => $row['member_name'],
'member_id' => $row['id_member'],
'rating' => $row['voters'] != 0 ? ($row['rating']/$row['voters']) : 0,
'voters' => $row['voters'],
'id_thumb' => $row['type'] == 'embed' ? 2 : $row['id_thumb'],
'desc' => $row['description'],
'time_added' => $row['time_added'],
'is_new' => !empty($row['is_new']) && !$user_info['is_guest'],
'views' => $row['views']
);
}
mysql_free_result($request);

echo '
<div class="smalltext" style="text-align: center; line-height: 1.4em; border: 1px #000000 solid; padding: 5px;">
<a href="',$galurl,'sa=viewitem;id=',$item['id'],'">',$item['item_title'],'</a><br />
<a href="',$galurl,'sa=viewitem;id=',$item['id'],'"><img alt="" src="',$galurl,'sa=getmedia;id=',$item['id_thumb'],'" alt="" /></a><br />
',$txt['mgallery_views'],' : ',$item['views'],'<br />
',$txt['mgallery_posted_by'],' : <a href="',$scripturl,'?action=profile;u=',$item['member_id'],'">',$item['member_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>';

It will show a random item.

Note: I didn't had GD module on my local, so didn't test this if it works or not. Would be glad to hear some feedback.
And slowly, you come to realize... It's all as it should be...

Offline Jakki

  • Semi Newbie
  • *
  • Posts: 48
  • Gender: Female
  • Peaceful living is the way to go.
    • roundablock
Re: Media Gallery
« Reply #5 on: September 18, 2008, 08:39:25 PM »
Just letting you know that I have put the code in and it seems to be working just fine..thanks.
 :)

Offline sevacycles

  • Newbie
  • Posts: 4
Re: Media Gallery
« Reply #6 on: September 19, 2008, 05:17:47 AM »
Looks good to me.

Offline Manu

  • Translator
  • *
  • Posts: 203
  • Gender: Female
  • Angel by Day, Devil by Night
    • Arsenie Official Forum
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Media Gallery
« Reply #7 on: November 10, 2008, 06:36:38 PM »
When you are in the Media Gallery and you use the link for going back to the forum, you will end up in the portal.

I'm not good in php but I found out how to change it.

Search in Source/MGallery.php
Code: [Select]
// Start the linktree
$context['linktree'] = array();
$mgalFunc['add_linktree']($scripturl,$context['forum_name']);
$mgalFunc['add_linktree']($galurl2, $txt['mgallery_title'] );

Replace it with
Code: [Select]
// Start the linktree
$context['linktree'] = array(array('url' => $scripturl . '?action=forum', 'name' => 'Forum'));
$mgalFunc['add_linktree']($galurl2, $txt['mgallery_title'] );

After this change your link tree will be as it is in the whole forum. ;)

Test in SMF 1.1.7
SMF Media Gallery 1.5 RC 2
Sometimes I'm an angel, sometimes I'm a devil, but I am always 100% woman and if you have a problem with me, learn to deal with it!

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Media Gallery
« Reply #8 on: November 11, 2008, 07:21:37 AM »
Hmmm. It's too bad that we need another edit for an external file. Thanks Manu.
And slowly, you come to realize... It's all as it should be...

Offline mrtrc266

  • Jr. Member
  • **
  • Posts: 91
  • Gender: Male
    • Monsters Mansion
  • SMF Version: 2 RC3
  • SP Version: 2.3.1
Re: Media Gallery
« Reply #9 on: November 25, 2008, 03:13:44 PM »
Looks like its workin good but the thumbs are little red X's ? Any idea on how to fix that?

Thanks in advance

www.monsters-mansion.com

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Media Gallery
« Reply #10 on: February 02, 2009, 06:21:22 AM »
This feature is implemented.
And slowly, you come to realize... It's all as it should be...

Offline tfs

  • Jr. Member
  • **
  • Posts: 64
Re: Media Gallery
« Reply #11 on: August 01, 2009, 05:28:02 PM »
It would be a nice option to allow filtering of the media.  I'd like to show random photos, but half of my gallery is MP3's.  I don't care to have those show up.

Offline Old Fossil

  • Beta Tester
  • *
  • Posts: 796
  • Gender: Male
  • SMF Version: 2.0.4
  • SP Version: 2.3.5
Re: Media Gallery
« Reply #12 on: September 07, 2009, 01:39:31 AM »
As far as I know only the photos do show.

Daily backups mean less headaches

Block Set Up

I may be no coding expert but I am willing to help where I can.

I eat Spammers for breakfast