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

Akyhne


SgtMic

There is nothing more deadly than a US Marine and his rifle.
A close second is a US Marine and his K-BAR.
2/5 Fox Co.  (BlackHearts)
FAST Co. 5th Plt. (FIDO)

LinK187

Hey guys... since smf did their server switchermaroo I haven't received topic replies. I just thought today, wtf, no replies in smg? So i came and checked it out and sure enough I had like 7 pages to catch up on.

Here's the posts I would have made tho:

Quote from: NaoWe don't own Link. Zelda does.

Somebody need rescuing?

Quote from: RanterToday one of my users discovered what seems to be an opportunity for improvement in SMF Media Gallery 1.5.5.

I have it installed and working as expected on an SMF 1.1.8 instance. The user had uploaded a new graphic image file, copied the BBC embed code, then pasted it into a reply in an existing thread. The embedded thumbnail appeared as expected in the post preview, but attempting to post her reply failed, producing a dire warning about database errors.

I was able to replicate the error by attempting to use the same BBC embed code in a quick reply. I saw a valid preview, posting produced the same database error message.

Looking at the error message I noted that it included a portion of the title of the post, but that the title was truncated at the location of an apostrophe character (single quote) in the word "Won't" in the title of the topic.

I aborted my attempt to reply, reloaded the topic in my browser, modified the topic by removing the perfectly legitimate apostrophe character from the contraction "Won't" in the title, and thereafter I was able to include the BBC embed code of the previously uploaded image.

The topic in question is here:
http://aintnogod.com/atheist/index.php/topic,3144.0.html

At least in my instance of SMF as modded, it seems SMG 1.5.5 has difficulty adding an embedded gallery graphic to an existing topic that has a single quote character in the topic title.

I have experienced this. The error you received was "hacking attempt" right? For some reason posting a ' in the topic title causes this. I've yet to figure out why :\

Dragooon

That issue was fixed in the SVN. It will make it in 1.5.6 or 1.6 b1.

SgtMic

Quote from: Dragooon on March 22, 2009, 12:33:00 AM
That issue was fixed in the SVN. It will make it in 1.5.6 or 1.6 b1.

How about the .gif issue in admin?
There is nothing more deadly than a US Marine and his rifle.
A close second is a US Marine and his K-BAR.
2/5 Fox Co.  (BlackHearts)
FAST Co. 5th Plt. (FIDO)

KahneFan

Could it be possible to allow user optioned ratings? For example, if I have users who want to post pics, but don't want them rated, they can choose so. And if other members want their pics rated, they can choose so. (upon loading a pic)
#eric_on_twit| (video) Creating Themes for SMF | Reset Your Forum
NOTE: No PM's for support please.

Dragooon

Quote from: SgtMic on March 22, 2009, 01:30:49 AM
Quote from: Dragooon on March 22, 2009, 12:33:00 AM
That issue was fixed in the SVN. It will make it in 1.5.6 or 1.6 b1.

How about the .gif issue in admin?
I'll look at it, it has been on the bugtracker but I never got a change to look at it.

Quote from: KahneFan on March 22, 2009, 01:43:14 AM
Could it be possible to allow user optioned ratings? For example, if I have users who want to post pics, but don't want them rated, they can choose so. And if other members want their pics rated, they can choose so. (upon loading a pic)
Hm I can probably look at it, don't think its hard.

KahneFan

Quote from: Dragooon on March 22, 2009, 01:55:14 AM
Hm I can probably look at it, don't think its hard.

Thanks for the quick reply. That would be great :D
#eric_on_twit| (video) Creating Themes for SMF | Reset Your Forum
NOTE: No PM's for support please.

Xavi-Nena

Apply Filter: Only show the error messages of this URL  http://corsotalk.com/index.php?action=tpadmin;sa=blocks
Apply Filter: Only show the errors with the same message
2: Invalid argument supplied for foreach()
File: /home/anypupco/public_html/a-corsotalk/Themes/default/languages/MGallery.english.php (main sub template - eval?)
Line: 2773

Im getting this error in my error log...any suggestions? Im attaching file in question.

Dragooon


Kyrsten

I have tried to install this mod and now I am having problems.

I uploaded all of the files for version 1.5.5 then as instructed on manual instructions page for SMF version 2.0 RC1 which is what I am using for the forums, I edited the files with the code indicated where it was indicated and now I am getting the following error when I try to access my forum to actually complete the install itself:

Parse error: syntax error, unexpected ';', expecting ')' in /home/collwod0/public_html/smf/Sources/Subs.php on line 3865

This is what the code looks like at that section according to the php editor to locate the correction section of lines:

'logout' => array(
'title' => $txt['logout'],
'href' => $scripturl . '?action=logout;%1$s=%2$s',
'show' => !$user_info['is_guest'],
'sub_buttons' => array(
),
'is_last' => true,
),
$load_menu_js = false;
// Now we put the buttons in the context so the theme can use them.
$menu_buttons = array();
foreach ($buttons as $act => $button)


line #3865 is the $load_menu line speicifcally

I am sure the fix is something easy to someone who is very familiar with php but I am quite the newbie to say the least so any help is appreciated!

Dragooon

Use this code
         'logout' => array(
            'title' => $txt['logout'],
            'href' => $scripturl . '?action=logout;%1$s=%2$s',
            'show' => !$user_info['is_guest'],
            'sub_buttons' => array(
            ),
            'is_last' => true,
         ),
);
      $load_menu_js = false;
      // Now we put the buttons in the context so the theme can use them.
      $menu_buttons = array();
      foreach ($buttons as $act => $button)

Kyrsten

#2972
Thank you for your reply.  I did exactly that and replaced the code now I get this message:

Parse error: syntax error, unexpected ';', expecting ')' in /home/collwod0/public_html/smf/Sources/Subs.php on line 3865

and this is what the code now looks like:

         'logout' => array(
            'title' => $txt['logout'],
            'href' => $scripturl . '?action=logout;%1$s=%2$s',
            'show' => !$user_info['is_guest'],
            'sub_buttons' => array(
            ),
            'is_last' => true,
         ),
);
      $load_menu_js = false;
      // Now we put the buttons in the context so the theme can use them.
      $menu_buttons = array();
      foreach ($buttons as $act => $button)


line 3865 is now );


I also tried inserting an extra blank line after the ); as I notice that is how it is in the virgin upgrade file and that did not help either.

Dragooon


Kyrsten

Quote from: Dragooon on March 23, 2009, 05:50:58 AM
Can you post the whole function?

arg every time I try to reply with the entire code I get this message from the forums here:

Fatal error: Maximum execution time of 30 seconds exceeded in /home/sites/simplemachines.org/security/Sources/Load.php(199) : runtime-created function on line 3

Kyrsten

Did I follow the install steps incorrectly?  Should I have uploaded the files, then installed the mod, then manually edited the code in the files as instructed?

Dragooon

Don't post the whole file, post only the function. Make sure to avoid <?php and ?> tags. Or attach it.

Kyrsten

#2977

// All the buttons we can possible want and then some, try pulling the final list of buttons from cache first.
if (($buttonData = cache_get_data('menu_buttons-' . implode('_', $user_info['groups']) . '-' . $user_info['language'], $cacheTime)) === null || time() - $cacheTime <= $modSettings['settings_updated'])
{
$buttons = array(
'home' => array(
'title' => $txt['home'],
'href' => $scripturl,
'show' => true,
'sub_buttons' => array(
),
),
'help' => array(
'title' => $txt['help'],
'href' => $scripturl . '?action=help',
'show' => true,
'sub_buttons' => array(
),
),
'search' => array(
'title' => $txt['search'],
'href' => $scripturl . '?action=search',
'show' => $context['allow_search'],
'sub_buttons' => array(
),
),
'admin' => array(
'title' => $txt['admin'],
'href' => $scripturl . '?action=admin',
'show' => $context['allow_admin'],
'sub_buttons' => array(
'featuresettings' => array(
'title' => $txt['modSettings_title'],
'href' => $scripturl . '?action=admin;area=featuresettings',
'show' => allowedTo('admin_forum'),
),
'packages' => array(
'title' => $txt['package'],
'href' => $scripturl . '?action=admin;area=packages',
'show' => allowedTo('admin_forum'),
),
'errorlog' => array(
'title' => $txt['errlog'],
'href' => $scripturl . '?action=admin;area=logs;sa=errorlog;desc',
'show' => allowedTo('admin_forum') && !empty($modSettings['enableErrorLogging']),
),
'permissions' => array(
'title' => $txt['edit_permissions'],
'href' => $scripturl . '?action=admin;area=permissions',
'show' => allowedTo('manage_permissions'),
),
),
),
'moderate' => array(
'title' => $txt['moderate'],
'href' => $scripturl . '?action=moderate',
'show' => $context['allow_moderation_center'],
'sub_buttons' => array(
'modlog' => array(
'title' => $txt['modlog_view'],
'href' => $scripturl . '?action=moderate;area=modlog',
'show' => !empty($modSettings['modlog_enabled']),
),
'poststopics' => array(
'title' => $txt['mc_unapproved_poststopics'],
'href' => $scripturl . '?action=moderate;area=postmod;sa=posts',
'show' => $modSettings['postmod_active'],
),
'attachments' => array(
'title' => $txt['mc_unapproved_attachments'],
'href' => $scripturl . '?action=moderate;area=attachmod;sa=attachments',
'show' => $modSettings['postmod_active'],
),
'reports' => array(
'title' => $txt['mc_reported_posts'],
'href' => $scripturl . '?action=moderate;area=reports',
'show' => true,
),
),
),
'profile' => array(
'title' => $txt['profile'],
'href' => $scripturl . '?action=profile',
'show' => $context['allow_edit_profile'],
'sub_buttons' => array(
'summary' => array(
'title' => $txt['summary'],
'href' => $scripturl . '?action=profile',
'show' => true,
),
'account' => array(
'title' => $txt['account'],
'href' => $scripturl . '?action=profile;area=account',
'show' => allowedTo(array('profile_identity_any', 'profile_identity_own', 'manage_membergroups')),
),
'profile' => array(
'title' => $txt['forumprofile'],
'href' => $scripturl . '?action=profile;area=forumprofile',
'show' => allowedTo(array('profile_extra_any', 'profile_extra_own')),
),
),
),
'pm' => array(
'title' => $txt['pm_short'],
'href' => $scripturl . '?action=pm',
'show' => $context['allow_pm'],
'sub_buttons' => array(
'pm_read' => array(
'title' => $txt['pm_menu_read'],
'href' => $scripturl . '?action=pm',
'show' => allowedTo('pm_read'),
),
'pm_send' => array(
'title' => $txt['pm_menu_send'],
'href' => $scripturl . '?action=pm;sa=send',
'show' => allowedTo('pm_send'),
),
),
),
'calendar' => array(
'title' => $txt['calendar'],
'href' => $scripturl . '?action=calendar',
'show' => $context['allow_calendar'],
'sub_buttons' => array(
'view' => array(
'title' => $txt['calendar_menu'],
'href' => $scripturl . '?action=calendar',
'show' => allowedTo('calendar_post'),
),
'post' => array(
'title' => $txt['calendar_post_event'],
'href' => $scripturl . '?action=calendar;sa=post',
'show' => allowedTo('calendar_post'),
),
),
'mgallery' => array(
'title' => $txt['mgallery_gallery'],
'href' => $scripturl . '?action=mgallery',
'show' => allowedTo('mgallery_access'),
'sub_buttons' => array(),
),
'mlist' => array(
'title' => $txt['members_title'],
'href' => $scripturl . '?action=mlist',
'show' => $context['allow_memberlist'],
'sub_buttons' => array(
'mlist_view' => array(
'title' => $txt['mlist_menu_view'],
'href' => $scripturl . '?action=mlist',
'show' => true,
),
'mlist_search' => array(
'title' => $txt['mlist_search'],
'href' => $scripturl . '?action=mlist;sa=search',
'show' => true,
),
),
),
'login' => array(
'title' => $txt['login'],
'href' => $scripturl . '?action=login',
'show' => $user_info['is_guest'],
'sub_buttons' => array(
),
),
'register' => array(
'title' => $txt['register'],
'href' => $scripturl . '?action=register',
'show' => $user_info['is_guest'],
'sub_buttons' => array(
),
'is_last' => true,
),
         'logout' => array(
            'title' => $txt['logout'],
            'href' => $scripturl . '?action=logout;%1$s=%2$s',
            'show' => !$user_info['is_guest'],
            'sub_buttons' => array(
            ),
            'is_last' => true,
         ),
);

      $load_menu_js = false;
      // Now we put the buttons in the context so the theme can use them.
      $menu_buttons = array();
      foreach ($buttons as $act => $button)
if (!empty($button['show']))
{
$button['active_button'] = false;

// Make sure the last button truely is the last button.
if (!empty($button['is_last']))
{
if (isset($last_button))
unset($menu_buttons[$last_button]['is_last']);
$last_button = $act;
}

// Go through the sub buttons if there are any.
if (!empty($button['sub_buttons']))
foreach ($button['sub_buttons'] as $key => $subbutton)
{
if (empty($subbutton['show']))
unset($button['sub_buttons'][$key]);
}

// If this still has some sub buttons then we need to tell the template to load the menu javascript file.
if (!empty($button['sub_buttons']))
$load_menu_js = true;

$menu_buttons[$act] = $button;
}
$buttonData = array($menu_buttons, $load_menu_js);

if (!empty($modSettings['cache_enable']) && $modSettings['cache_enable'] >= 2)
cache_put_data('menu_buttons-' . implode('_', $user_info['groups']) . '-' . $user_info['language'], $buttonData, $cacheTime);
}

list($context['menu_buttons'], $context['load_menu_js']) = $buttonData;

// Logging out requires the session id in the url.
if (isset($context['menu_buttons']['logout']))
$context['menu_buttons']['logout']['href'] = sprintf($context['menu_buttons']['logout']['href'], $context['session_var'], $context['session_id']);

// Figure out which action we are doing so we can set the active tab.
// Default to home.
$current_action = 'home';

if (isset($context['menu_buttons'][$context['current_action']]))
$current_action = $context['current_action'];
elseif ($context['current_action'] == 'search2')
$current_action = 'search';
elseif ($context['current_action'] == 'theme')
$current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';
elseif ($context['current_action'] == 'register2')
$current_action = 'register';
elseif (in_array($context['current_action'], array('login2', 'reminder')))
$current_action = 'login';

$context['menu_buttons'][$current_action]['active_button'] = true;

// Only load the menu javascript stuff when we have to.
$context['load_menu_js'] = false;

if (!$user_info['is_guest'] && $context['user']['unread_messages'] > 0 && isset($context['menu_buttons']['pm']))
$context['menu_buttons']['pm']['title'] .= ' [<strong>'. $context['user']['unread_messages'] . '</strong>]';
}

// Generate a random seed and ensure it's stored in settings.
function smf_seed_generator()
{
global $modSettings;

// Never existed?
if (empty($modSettings['rand_seed']))
{
$modSettings['rand_seed'] = microtime() * 1000000;
updateSettings(array('rand_seed' => $modSettings['rand_seed']));
}

if (@version_compare(PHP_VERSION, '4.2.0') == -1)
{
$seed = ($modSettings['rand_seed'] + ((double) microtime() * 1000003)) & 0x7fffffff;
mt_srand($seed);
}

// Change the seed.
updateSettings(array('rand_seed' => mt_rand()));
}



lines 3670 thru 3933


could it be a php.ini problem??

I am running OSCommerce on the site, but it is seperated in its own folder away from smf, and it seems to have no issues this far

Nao 尚

Quote from: Dragooon on March 22, 2009, 01:55:14 AM
Quote from: KahneFan on March 22, 2009, 01:43:14 AM
Could it be possible to allow user optioned ratings? For example, if I have users who want to post pics, but don't want them rated, they can choose so. And if other members want their pics rated, they can choose so. (upon loading a pic)
Hm I can probably look at it, don't think its hard.
With 1.6: create a user album, create a permission profile where readers can't rate pics. Upload your pics there. Doesn't seem that hard to me...

@Exif problem: to-do: do not store Exif date if it's < 1971. I hardly see how a picture taken back in 1970 could have a Exif date anyway ;) Unless it's been entered manually...
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 尚

rev 8000
! If Exif year is set to 1970, it's broken, so skip Exif date

--> here's hoping this will fix the Exif problem...?
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.

Advertisement: