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

Ehemm

Quote from: Dragooon on October 29, 2008, 08:03:08 AM
Hm, this seems to be one of the old issues. I have a new converter in testing and it hopefully works, would you like to test it? If so can you PM me?

check ur pm boss !

btw, i'm using SMF 1.1.6 and 1.0.2 SMF Media Gallery

:)

RCC_SaMiaM

I put this on a new server and I get the same problem with the BBC doe image not showing up.  I changed the permissions of MGalleryItem.php to 644 like I did before that fixed the prob, but it didn't work this time.

I had permission issues all over the place, and pathing issues as well.  Any particular permissions any of these files need to be (related to MGalleryItem.php)?  My gallery works fine, just can't like the images in posts again.

Nao 尚

See, Dragooon? I told you --> too many permissions kill permissions :P
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.

qubbah

Quote from: Dragooon on October 29, 2008, 12:46:37 AM
oops
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');
     $items = getMediaItems(0, 5, 'm.id_media DESC');
echo '
<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>';

How can we add the number of comment?

Selroth

Uninstalling SMG Beta 2, "Test Failed" on Execute Modification for ./Sources/Load.php.

SMF1.1.6.  Previously used Beta 1, uninstalled that before installing beta 2. 

Install-1.1.xml:
<file name="$sourcedir/Load.php">
<operation>
<search position="before"><![CDATA[a.filename, a.attachmentType,]]></search>
<add><![CDATA[ mem.mgal_total_items, mem.mgal_total_comments,]]></add>
</operation>
<operation>
<search position="before"><![CDATA[mem.lastLogin, mem.karmaGood,]]></search>
<add><![CDATA[ mem.mgal_total_items, mem.mgal_total_comments,]]></add>
</operation>
<operation>
<search position="before"><![CDATA['local_time' => timeformat(time() + ($profile['timeOffset'] - $user_info['time_offset']) * 3600, false),]]></search>
<add><![CDATA[
'mgallery' => array(
'total_items' => $profile['mgal_total_items'],
'total_comments' => $profile['mgal_total_comments'],
),]]></add>
</operation>
<operation>
<search position="after"><![CDATA[ if (empty($ID_MEMBER) && isset($_COOKIE[$cookiename]))]]></search>
<add><![CDATA[ // SMF Media Gallery changes
if (isset($_POST['SWFUploadCookie']))
{
$data = explode(';', $_POST['SWFUploadCookie']);
foreach ($data as $dat)
{
if (substr($dat, 1, strlen($cookiename)) == $cookiename)
$_COOKIE[$cookiename] = urldecode(substr($dat, strlen($cookiename) + 2));
elseif (substr($dat, 0, strlen($cookiename)) == $cookiename)
$_COOKIE[$cookiename] = urldecode(substr($dat, strlen($cookiename) + 1));
}
}
// End SMF Media Gallery changes

]]></add>
</operation>
</file>


Seems kinda wierd.  I don't know how uninstalls work, but I assume it takes everything between the <add> tags and removes it.  Everything it added appeared to be in that file.  It has the same owner and chmod as all the other files ("You", 777). 

Attached is my Load.php file in case you want a looksie.
Everything is built from imagination.

Dragooon

I am thinking that it conflicted with your google map mod. First uninstall that, then uninstall SMG, install Google map, then install SMG 1.5 b3.

Nao 尚

Quote from: Selroth on October 30, 2008, 01:13:07 AM
Uninstalling SMG Beta 2, "Test Failed" on Execute Modification for ./Sources/Load.php.
Mods need to be uninstalled in the opposite order in which you installed them... i.e. you must uninstall the last one you installed, before you can install the last one before it, etc, etc...
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


Selroth

Ah, yeah, that must be it.  I did load up a few other mods after installing beta 2.  Didn't know you had to do that (or maybe it's just good practice).  Don't suppose there's a way to remedy it so you can uninstall in any order you want?  May prevent some future headaches :)
Everything is built from imagination.

Dragooon

No, what basically happens is some mod might modify the same are some other mod does. Now when uninstalling that area doesn't remain the same and it is not able to perform the remove/replace operation leading to error or say conflict.

Selroth

I'm not entirely sure what you mean.

When installing, it finds a place in the file, and appends some new code into it.

When uninstalling, wouldn't it make sense to search for the new code, and simply remove it?  Since the code was installed, it should be safe to assume the code is there and after that who cares about position - we don't need to know the location of the code anymore to remove it.

I can understand if this isn't something that mod developers can help, but are the main SMF developers aware of this?  I'd be happy to toss them a note if I'm not insane just yet.

Anyway, that's old news.  New news:

SMG 1.5 RC1, SMF 1.1.6
When going into someone's profile and using the Gallery links, it works but I get these notices:
These up top:
Notice: Undefined index: mgallery in /mounted-storage/home48a/sub003/sc33400-FTPR/draconity/Sources/MGallery-Sub.php on line 1341

Notice: Undefined index: mgallery in /mounted-storage/home48a/sub003/sc33400-FTPR/draconity/Sources/MGallery-Sub.php on line 1342

Notice: Undefined index: mgallery in /mounted-storage/home48a/sub003/sc33400-FTPR/draconity/Sources/MGallery-Sub.php on line 1343

Notice: Undefined index: mgallery in /mounted-storage/home48a/sub003/sc33400-FTPR/draconity/Sources/MGallery-Sub.php on line 1344


And this on the bottom (including some of the site's debug info if you want it):
Notice: Undefined index: b348 in /mounted-storage/home48a/sub003/sc33400-FTPR/draconity/Themes/default/languages/MGallery.english.php (main_below sub template - eval?) on line 660
Templates: 3: index (dilbermc), Profile (default), MGallery (default).
Sub templates: 6: init, main_above, profile_above, mgallery_profile_summary, profile_below, main_below.
Language files: 4: index.english (default), Modifications.english (default), Profile.english (default), MGallery.english (default).
Files included: 10 - 613KB. (show./index.php, ./Settings.php, ./Sources/QueryString.php, ./Sources/Subs.php, ./Sources/Errors.php, ./Sources/Load.php, ./Sources/Security.php, ./Sources/Profile.php, ./Sources/MGallery-Sub.php, ./Sources/Subs-MGallery.php)
Queries used: 21.
Everything is built from imagination.

Dragooon

ok I see what you mean, I'll fix those undefined indexes in SMG 1.5 RC 2.

EDIT : For a fix for profile errors
Open Profile.php
Find
'website' => array(
'title' => !isset($user_profile[$memID]['websiteTitle']) ? '' : $user_profile[$memID]['websiteTitle'],
'url' => !isset($user_profile[$memID]['websiteUrl']) ? '' : $user_profile[$memID]['websiteUrl'],
),

Add after
'mgallery' => array(
'total_items' => @$user_profile['mgal_total_items'],
'total_comments' => @$user_profile['mgal_total_comments'],
),

dimdom

Keeps getting better. :)

I use it in a Greek forum (utf-8). When i create an album, the greek characters displays well in SMF media gallery, but when i open it with my ftp client (filezilla, fluently support for Greek) instead of the albums names i see ασδ_ασασφσδφασδφα...


And related to that: I have imported albums from coppermine (in greek, utf-8 again) (no errors at all during the process, excellent work from the converter) and after the cnversion, all i see is ƒΞ΄Ο†Ξ±ΟƒΞ in all text (users name, albums names, comments etc).


I know that there must be a solution but I am not an expert to figure it out myself... ::)



Examples:



COPPERMINE THAT USED FOR CONVERSION: http://www.authorway.com/gallerysmf/index.php
SMF MEDIA GALLERY after the conversion: http://www.authorway.com/SMF/index.php?action=mgallery

ernest

i have some trouble with the mod, i currently using smf media gallery v 1.0.2 all seems fine, but it seems there are a trouble with permission, i am using Profil Moderator Managment mod and now my mod cant use the gallery, is there any solution to this matter?

Dragooon


dimdom

And this when a user hits "unapprove"

The database value you're trying to insert does not exist: id_mem
/home/mysite/public_html/forum/Sources/Subs-MGallery.php
3343

By the way, is there a way for users NOT to be able to unapprove their pictures?

And a way for users NOT to be able to set permissions for their albums (but use only global permissions set by admin?)

ernest

i manage to fix it myself, it seems just a permission conflict.

Dragooon

Quote from: dimdom on October 30, 2008, 12:06:46 PM
And this when a user hits "unapprove"

The database value you're trying to insert does not exist: id_mem
/home/mysite/public_html/forum/Sources/Subs-MGallery.php
3343

By the way, is there a way for users NOT to be able to unapprove their pictures?

And a way for users NOT to be able to set permissions for their albums (but use only global permissions set by admin?)
Find
$options = array(
'id' => $item_data['id_media'],
'approved' => $approval,
in MGallery.php
and add after
'skip_log' => true,

Just don't give them auto approve item permission if you don't want them to unapprove.

Nao 尚

Your SMG install is empty... I can't test like that :P
I'm the guy in charge with UTF conversions. The Coppermine system is (normally) using UTF and nothing else. If your SMF install is using UTF too, then the conversion shouldn't occur at all... Maybe your database is NOT using the same encoding as your SMF..? I don't see any other reason why it should happen...

Quote from: dimdom on October 30, 2008, 12:06:46 PM
By the way, is there a way for users NOT to be able to unapprove their pictures?
It is a matter of freedom. If they can auto-approve, no reason they couldn't auto-unapprove... Imagine they'd like to hide a picture or its comments for some time. It's their upload--it's their right.

QuoteAnd a way for users NOT to be able to set permissions for their albums (but use only global permissions set by admin?)
Not for now... (And probably not ever, I guess. Go ahead, program it yourself and submit your code if you'd like.)
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.

dimdom

QuoteYour SMG install is empty... I can't test like that :P
I'm the guy in charge with UTF conversions. The Coppermine system is (normally) using UTF and nothing else. If your SMF install is using UTF too, then the conversion shouldn't occur at all... Maybe your database is NOT using the same encoding as your SMF..? I don't see any other reason why it should happen...

Yes, I have just delete it....sorry!

Well, yes, I agree with you.. but, the encoding used in coppermine sql was wrong from the begining (latin1_swedish_ci) insted of the correct utf8_general_ci collation. But somehow, despite the fact that in coppermine sql tables data is shown like that: σφσδφασδφα...
the coppermine front end shows the greek characters corectlly...

I am trying to find a way to import this data to the new sql tables  (added by SMG) in smf database (utf8_general_ci collation) and SMG to display them correctlly like in coppermine...

I guess that it I have to change something in characters encoding in one of SMGs phps...

Advertisement: