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

Nao 尚

Hmmm, everything's possible with RSS I guess. Although it's not in the barebones SMG. Off the top of my head, I can't see any other way than using Foxy!'s RSS feature coupled with a XML parser.
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.

Angelotus

Hmm ok, thanks for your reply. I also asked in the devforum how to intergrate one SMF to another on another domain, maybe that gives me an answer as well.

Nao 尚

What dev forum? If you're talking about smf-media, I don't remember seeing your post there.
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.

Arantor

He asked in the coding board here, but since it seems more tied to SMG, we strongly suggested he keep it here.
Holder of controversial views, all of which my own.


sportin3

I am in need of the manual installation instructions for 1.5.6  I would like to install the version of the gallery but I can no longer find the parse file to do the manual removal of the original.

Tiribulus

Quote from: sportin3 on November 21, 2009, 11:11:41 AM
I am in need of the manual installation instructions for 1.5.6  I would like to install the version of the gallery but I can no longer find the parse file to do the manual removal of the original.

Why would you want to do that?

Nao 尚

v1.5.6 is not supported anymore anyway. And by support I also mean 'distributed' ;)
If you have a problem with v2.0, feel free to ask.
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.

sportin3

Ok, I was able to manually uninstall the 1.5.6 version.

When I try to install the 2.0.3 version through the package manager I get this error.

Fatal error: Call to undefined function db_extend() in /home/sportin3/public_html/Packages/temp/db_mgallery.php on line 122

Looking at that file, Line 122 and 123 are loading extra functions for SMF 2.

What do I need to do to get this to in stall in 1.1.10

Arantor

db_extend is a 2.0 only function. Do you, by any chance, have any mods written by 2by2host installed?
Holder of controversial views, all of which my own.


sportin3

Quote from: Arantor on November 21, 2009, 03:17:25 PM
db_extend is a 2.0 only function. Do you, by any chance, have any mods written by 2by2host installed?

Yes, I do have a couple.

Arantor

Ah, yes, thought so.

Basically, SMG detects what version you're using by checking whether $smcFunc() exists, which is a 2.0 only construct. In the spirit of 'reuse of code', 2by2host mods create $smcFunc themselves, which confuses this mod.

Your choices are to uninstall their mods before installing SMG (then put them back after), or to modify the installer to check for something else.


@Nao, this is an issue that likely isn't going to go away. Might want to check for function_exists('db_extend') instead of whether $smcFunc is defined. Either that, or do the inverse, and check for $func being defined as a 1.1 only construction.
Holder of controversial views, all of which my own.


sportin3

Thank you for the information.

I will look at it from both directions and see which one makes more sense to me.

Thanks again!

Nao 尚

@Arantor> I don't like the idea of having to *fix* my mod for doing something very logical that is unfortunately broken by another mod that goes against logic. SMG uses its own variable for that, $mgalFunc, which basically either recreates a clone of $smcFunc, or simply copies $smcFunc when it exists. That way, it doesn't overwrite anything special.

I've fixed it for Aeva Media (coming in a few weeks), but in the meantime I don't even want to hear about this problem... And I won't fix it for SMG. It even breaks version 1.0 which has been around (and popular enough) for over a year. I think *they* should make sure to be compatible with existing mods, or at least contact me and discuss 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.

Arantor

Nao: I know. But I think you're going to keep getting issues where that's happening. Several authors have been told not to do that before though and most haven't listened.
Holder of controversial views, all of which my own.


sportin3

Ok, I uninstall-ed the  mod call twitter and facebook then installed the SMF Gallery mod. Everything went well except for one file that failed the pretest. "sources/load.php. I did a manual edit of this file but it I get an error when I replace the original.

Here is the line of code it does not like.


Find: [Select]
'local_time' => timeformat(time() + ($profile['timeOffset'] - $user_info['time_offset']) * 3600, false),

Add After: [Select]
      'mgallery' => array(
         'total_items' => $profile['mgal_total_items'],
         'total_comments' => $profile['mgal_total_comments'],
      ),

Here is what my code looks like in load.php. (I included some code before and some code after)

// If we're always html resizing, assume it's too large.
   if ($modSettings['avatar_action_too_large'] == 'option_html_resize' || $modSettings['avatar_action_too_large'] == 'option_js_resize')
   {
      $avatar_width = !empty($modSettings['avatar_max_width_external']) ? ' width="' . $modSettings['avatar_max_width_external'] . '"' : '';
      $avatar_height = !empty($modSettings['avatar_max_height_external']) ? ' height="' . $modSettings['avatar_max_height_external'] . '"' : '';
   }
   else
   {
      $avatar_width = '';
      $avatar_height = '';
   }

   $localTime = '';
   if(!empty($modSettings['timezones_enable']))
      $localTime = local_userTime($user);
   else
      $localTime = timeformat(time() + ($profile['timeOffset'] - $user_info['time_offset']) * 3600, false);
         'mgallery' => array(
         'total_items' => $profile['mgal_total_items'],
         'total_comments' => $profile['mgal_total_comments'],
      ),


   // What a monstrous array...
   $memberContext[$user] = array(
      'username' => &$profile['memberName'],
      'name' => &$profile['realName'],
      'id' => &$profile['ID_MEMBER'],
      'is_guest' => $profile['ID_MEMBER'] == 0,
      'is_buddy' => $profile['buddy'],

Note: If I remove that section of code the site loads fine. If I leave the code in, it knocks the whole site down.

Nao 尚

'kay... How many mods have you installed? Dozens? You know the more mods you install, the more issues you'll have in the end...?

Although, you probably installed your thing manually and you didn't make it correctly, because the line above my code is NOT the same as in the install script. Double check: my version ends with a comma (,), yours ends with a semi-colon (;).
Anyway-- the actual line is in the $memberContext[$user] declaration just below.
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.

Tiribulus

Quote from: Nao/Gilles on November 21, 2009, 06:47:38 PM
'kay... How many mods have you installed? Dozens? You know the more mods you install, the more issues you'll have in the end...? >>>

This cannot be overstated. Especially where more than one mod replaces the same piece of code and the bigger the piece the worse it is. Unless you really know what you're looking at and can combine the code correctly (which I can't many times) or you get somebody who can to look at it, those mods won't work together.

Even with the few times I've tried to help somebody with something I thought was simple and I could fix, there have been times when I saw that they didn't notice that another mod had already changed the piece in question and I didn't do it.

Oh, well, sorry for the sidetrack, but this is a great point you are making.

sportin3

You are correct. I do have a large number of mods installed. I have been going back and taking some of the less than useful one out.

I did notice that the original code used a comma but when I tried to change it I got another error. In your last line you mention "just below". Do you mean that that line of code gets inserted in the array below. I noticed that it looks out of place where it was at but did not try to move it into the array below.

I will say this. I have have made a lot of manual mods to files that would not go with the package manager but I did not install if it was messing with the same section of code as another mod already changed unless it was just adding a single word in an array (forgive me I am not a coder and a hacker at best - Im sure there is a word for what I just said)  :-[

sportin3

Update: I moved that code down into the array below and it worked like a charm.

Thanks for the help.

micropitt

I know this is probably a stupid thing and I apologize up front for asking a stupid question. I installed Media Gallery on my 1.1.10 SMF Board. Everything seemed to be ok with the installation, I can setup albums and so on. However, this only works when I'm loged in as Admin. As soon as I log in as a regular user I'm not able to access the Gallery, means I don't have the Gallery Button on top. I use the SMF Core Theme as default and the user is not allowed to change Themes. I would be thankful for any tips, hints or ideas.
   

Advertisement: