News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

SMF Media Gallery (SMG) - 2.0.5 is out! (December 2)

Started by SMGTeam, September 09, 2008, 03:14:05 PM

Previous topic - Next topic

psynx

hello,

i need help with this mod. i have this mod in my dilber mc theme. i am using smf 1.1.6 version. is there anyway i can modify my mgallery page? i mean instead of 1 column for the album, make it two or 3 columns? so if i have 12 albums showing on gallery page, it would be divided on 3 columns or 2? because if you have many albums showing on your gallery page you have to keep scrolling down until you see images or the recent pics added, random images and so on.

please let me know which files to edit and what code to find and modify. a step by step guide would be much appreciated since i am not 100% knowledgeable about coding. thank you so much in advance. Godbless!   

Soms

Quote from: Nao 尚 on November 22, 2008, 03:26:04 AM
Open mgconverter_sgl.php and replace line 499

global $mgalFunc, $context, $converter_url;


With:

global $mgalFunc, $context, $sourcedir;


Thanks a lot. That did the trick.

Nao 尚

@Soms> Good :)
@Chamaeleon> Please don't speak German on an English-speaking topic. Dragooon & I don't even speak it.
@Anyone> As a result, please disregard his message and solution. We are not approving it.
@Manu0372 and anyone using AEVAC>

Okay, the problem is that SMG checks for the link before accepting it... When I added support for AEVAC, I forgot to disable that check. So I rewrote the checkEmbedLink to account for AEVAC 3 & 4 installs. The problem with AEVAC 3 is that it doesn't return a list of sites it supports (which sucks), so we're bypassing the check for that version -- which means if you insert any kind of unsupported URL, it will still be included in SMG, but all you will see when visiting the item page is a (non-clickable) text link to that place... Seems okay enough for me.

This is *untested* on AEVAC 4 (it works as expected on AEVAC 3, which I use), so please bear with me if it doesn't work on your first attempt.

Open MGallery-Embed.php and search for:

function checkEmbedLink($link)
{
global $context;

// Checks whether it the link provided is supported or not
$embed = mgal_aevac_load();

foreach ($embed as $arr)
{
$pattern = '~^'.$arr['embed-pattern'].'(?:.*?)$~i'.($context['utf8'] ? 'u' : '');
if (preg_match($pattern, $link))
return $arr['id'];
}

return false;
}

// Generates thumbnail for site if possible
function generateVideoSiteThumb($link, $id_album)
{
global $embed_album;

// Load the video sites
$sites = mgal_aevac_load();
$cur_site = array();

// Load the site we are talking about here
$id = checkEmbedLink($link);
$embed_album = $id_album;

if (!$id)
return 0;

foreach ($sites as $site)
if ($site['id'] == $id)
$cur_site = $site;

if (empty($cur_site) || !isset($cur_site['thumb']))
return 0;

// Let's create the thumbnail
return $cur_site['thumb']($link, '`' . $cur_site['embed-pattern'] . '`i');
}


Replace with:

function checkEmbedLink($link, $force_own_list = false)
{
global $context, $sites, $modSettings, $sourcedir;

// If AEVAC is installed and we're checking the link instead of retrieving a site ID, load the site list from AEVAC 4, or just bypass for AEVAC 3
if (!$force_own_link && ((!empty($modSettings['aevac_enable']) && empty($context['aevac_disable'])) || file_exists($sourcedir . '/Subs-AEVAC.php')))
{
$path = $sourcedir .'/Subs-Aevac.php';
$realpath = str_replace('\\','/',realpath($path));

// AEVAC 4
if (file_exists($path) && $path == $realpath)
{
require_once($path);
if (empty($sites))
@include_once($sourcedir . '/Subs-Aevac-Generated-Sites.php');
if (empty($sites))
@include_once($sourcedir . '/Subs-Aevac-Sites.php');
}
// AEVAC 3 can't return the site list, so we'll just consider the test passed.
elseif (file_exists($sourcedir .'/Subs-AEVAC.php'))
return true;
}

if (empty($sites)) // AEVAC 4.0 not loaded?
$sites = mgal_aevac_load();

foreach ($embed as $arr)
{
$pattern = '~^'.$arr['embed-pattern'].'(?:.*?)$~i'.($context['utf8'] ? 'u' : '');
if (preg_match($pattern, $link))
return $arr['id'];
}

return false;
}

// Generates thumbnail for site if possible
function generateVideoSiteThumb($link, $id_album)
{
global $embed_album;

// Load the video sites
$sites = mgal_aevac_load();
$cur_site = array();

// Load the site we are talking about here
$id = checkEmbedLink($link, true);
$embed_album = $id_album;

if (!$id)
return 0;

foreach ($sites as $site)
if ($site['id'] == $id)
$cur_site = $site;

if (empty($cur_site) || !isset($cur_site['thumb']))
return 0;

// Let's create the thumbnail
return $cur_site['thumb']($link, '`' . $cur_site['embed-pattern'] . '`i');
}
I will not make any deals with you. I've resigned. I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.

Aeva Media rocks your life.


Dragooon


Nao 尚

@Nibogo> Remember, this is not an "official" Spanish translation... I'll need someone to proofread it before... (Heck, I even got someone to proofread the English version! ;D)

@Dragooon> You forgot to publish the changelog ;)

Version 1.5 RC 3.1                              November 23, 2008
-----------------------------------------------------------------
* Changed the [smg]123[/smg] tag into [smg id=123] and added many options...
+ ...Such as [smg id=123 type=link width=200 align=right caption="Hi, mom!"] (guess what it all means)
+ Added a (long and complicated...) alternative to downloading remote video thumbnails when all existing functions fail. (Damn you, safe mode!)
! [smg] tag no longer breaks page validation on non-SMG pages (thanks to PHP for output buffer control!)
! Make sure to call SMG's default stylesheet if using the [smg] tag in a non-SMG page
! Fixed ref attribute (instead of rel) in item page comments
! Mass Uploader wouldn't work correctly on Safari and Chrome browsers
! max_thumbs_per_page wasn't taken into account
* Replaced 'time' with 'date' in WhoRatedWhat template
! Fixed mgal_media_handler::$close error
! Fixed support for video sites that are specified only in AEVAC
! Fixed mgallery_gotolink warning message
I will not make any deals with you. I've resigned. I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.

Aeva Media rocks your life.

haderaschta

working great! thanks! and double-thanks for the safari-support  ;)
admin http://www.haderaschta.com [nofollow]

RustyBarnacle

So if I understand the instructions right, if I have SMF Gallery 1.45 Pro and want to convert, I need to install SMF Media Gallery and the converter, run the converter, and then install SMF Media Gallery again?

Dragooon

There is no SMF Gallery pro converter. Only SMF Gallery lite converter. And just for general note, you don't need to re-install SMG once conversion is complete.

RustyBarnacle

OK, I was hoping the lite converter would do pro as well but oh well.  The instructions on the first page say the converter will wipe out SMG which is why I asked.

Burke ♞ Knight

I do believe that means it will wipe out SMF Gallery Lite.

Nao 尚

Quote from: RustyBarnacle on November 23, 2008, 01:24:33 PM
OK, I was hoping the lite converter would do pro as well but oh well.
We might do it in the feature. I haven't looking into SGP for months, I don't remember exactly what feature set it has, so I'm not sure whether everything can be converted... Does SGP have any features that SMG doesn't have? I'm just asking.

Burke> No, SGL or Coppermine won't be wiped out. SMG's entries will be wiped out to make room for the converted data, obviously. We don't wipe out the originals because we want to be able to provide our mods as alternatives, we're not forcing anyone's hand here. Anyone is free to give SMG a try and then go back to either SGL or Coppermine if they're more comfortable with them -- no questions asked.
I will not make any deals with you. I've resigned. I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.

Aeva Media rocks your life.

Nao 尚

These bugs were found today in RC 3.1 and have been fixed, but the package hasn't been updated. We are recommending that you apply these changes manually if you experience any problems.

MGallery-Embed.php: (This will fix issues when fetching video site thumbnails, or when submitting video site links if AEVAC version 3 (not 4) is not installed.)

Search for $force_own_link, replace with $force_own_list.
A few lines below, replace

foreach ($embed as $arr)

With

foreach ($sites as $arr)

Subs-MGallery.php: (This will fix an issue with the smg tag)

Search for function smg_parse_bbc(&$message)

Inside it, replace the first line (global $context) with:

global $context, $smcFunc;

A few lines below, replace $context['is_smf2'] with isset($smcFunc)

MGallery.template.php (in your template folder): (This will fix the outdated embed link using the smg tag)

Replace

echo '<tr><td class="info smalltext">',$txt['mgallery_embed_bbc'],'</td><td class="info"><input id="bbc_embed" type="text" size="60" value="[smg]' . $item['id_media'] . '[/smg]" onclick="return selectText(this);" readonly="readonly" /></td></tr>';

With:

echo '<tr><td class="info smalltext">',$txt['mgallery_embed_bbc'],'</td><td class="info"><input id="bbc_embed" type="text" size="60" value="[smg id=' . $item['id_media'] . ']" onclick="return selectText(this);" readonly="readonly" /></td></tr>';


I know it isn't needed, but since I am quick to point out when Dragooon adds a bug (;D), I feel it's only logical that I take responsibility for these annoying bugs. I had very limited time to code this weekend, and these kinds of bugs should never have gone through the commit process. Really sorry.
I will not make any deals with you. I've resigned. I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.

Aeva Media rocks your life.

RustyBarnacle

There are so many features in each that I haven't done an exhaustive check, but I do prefer your mass upload to SGP's bulk add.

Nao 尚

Quote from: RustyBarnacle on November 23, 2008, 03:06:09 PM
There are so many features in each that I haven't done an exhaustive check, but I do prefer your mass upload to SGP's bulk add.
I certainly hope so... We put a lot of work into it ;) (Especially Dragooon.) We implemented SWFUpload, then dropped it because it didn't support Flash 10, then FancyUploader, which had a tendency to crash browsers at random, and then YUI Uploader, which seems to be fine for now... Phew ;)
I will not make any deals with you. I've resigned. I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.

Aeva Media rocks your life.

magarto

#1035
Is it possible to add links with the 5 (per example) last albums published by users in the home?
I mean:

Last message: "New member!!" ( 23 November 2008, 22:20:36 )
Last albums: "Album 1" ( magarto on 23 November 2008, 22:20:36 )
                     "Album 2" ( richard on 23 November 2008, 22:30:36 )
                     "Album 2" ( peter on 23 November 2008, 22:40:36 )

Thanks in advance

RustyBarnacle

I was also wonder, as it got lost in the shuffle, if there was a known TP block that worked for picking out random pics?  I know I posted before that it wasn't working for me but so many other people had bigger issues that I let it go.

psynx

Quote from: psynx on November 22, 2008, 04:47:29 AM
hello,

i need help with this mod. i have this mod in my dilber mc theme. i am using smf 1.1.6 version. is there anyway i can modify my mgallery page? i mean instead of 1 column for the album, make it two or 3 columns? so if i have 12 albums showing on gallery page, it would be divided on 3 columns or 2? because if you have many albums showing on your gallery page you have to keep scrolling down until you see images or the recent pics added, random images and so on.

please let me know which files to edit and what code to find and modify. a step by step guide would be much appreciated since i am not 100% knowledgeable about coding. thank you so much in advance. Godbless!

anyonce care to share ideas pls?

Nao 尚

We already have much more work than we'd like. Dragooon has school duties, and I have other projects to take care of at the same time (plus, now I'm considering taking over AEVAC since so many people have asked me and I'm still waiting for someone else to take it over... That doesn't seem likely, unfortunately. And I really want AEVAC to be updated again.)

So, basically: at least for now, we're not going to write code for *one* user. We consider requests from multiple users, but that's it.
I will not make any deals with you. I've resigned. I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.

Aeva Media rocks your life.

vulcan59

Hi there,

I need some help here.

I downloaded and did a manual install. I log into but couldn't get into admin. I got a function error with the message McGallery_AdminCP not found and pointing to the source as /forum/Sources/McGallery_AdminCP??  Same with a bunch of other error messages all pointing to /forum/Sources/some_file not found.

Could someone confirm - The 3 directories (mgal_data, Sources, & Themes) in the zip folder that I downloaded should be on "root" and and not in /forum/...

When I did put the files there, it seem to work but again a whole bunch of other errors came up. Kind of confuse here.  :'(

Any suggestions? 

 

Advertisement: