News:

Want to get involved in developing SMF, then why not lend a hand on our github!

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

mattchewone

5.   Execute Modification   ./Sources/Load.php   Test failed
   1.   Replace   ./Sources/Load.php   Test successful
   2.   Replace   ./Sources/Load.php   Test failed

What does this mean and how can i fix it?

Owdy

#3121
Okay what this MOD does to database? Now my Ajax chat is also broken. Opera gives error:

XML parsing failed: syntax error (Line: 3, Character: 0)

Reparse document as HTML
Error:XML declaration not at beginning of document
Specification:http://www.w3.org/TR/REC-xml/
  1:
  2:
  3: <?xml version="1.0" encoding="UTF-8"?>
  4: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  5: <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fi" lang="fi" dir="ltr">
  6:
^
I havent touch that script for months.
Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

Dragooon

Owdy - Can you send me admin access? It only creates tables and modifies the member table.

Owdy

Sorry Dragoon, i dont know you, i cant trust admin acces to strangers. Okay, so after installing this mod my Chat is broken, message quick edit is broken. I unistalled this mod and upgraded to latest DEV edition, didnt help. :(
Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

Dragooon

Quote from: Owdy on April 17, 2009, 11:53:58 AM
Sorry Dragoon, i dont know you, i cant trust admin acces to strangers. Okay, so after installing this mod my Chat is broken, message quick edit is broken. I unistalled this mod and upgraded to latest DEV edition, didnt help. :(
Thats fine, I can understand. I replied to your topic.

Nao 尚

Quote from: Owdy on April 17, 2009, 11:53:58 AM
Sorry Dragoon, i dont know you, i cant trust admin acces to strangers.
Given how much your server seems to be broken, what worse could he do to 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.

Dragooon

Quote from: Nao 尚 on April 17, 2009, 12:07:49 PM
Quote from: Owdy on April 17, 2009, 11:53:58 AM
Sorry Dragoon, i dont know you, i cant trust admin acces to strangers.
Given how much your server seems to be broken, what worse could he do to it? ;)
Wipe the DB out?

Owdy

#3127
This is fixed. I dont understand how, but it was my themes Modifications.finnish-utf8.php http://www.simplemachines.org/community/index.php?topic=305189.msg2020053#msg2020053

Quote from: Nao 尚 on April 17, 2009, 12:07:49 PM
Quote from: Owdy on April 17, 2009, 11:53:58 AM
Sorry Dragoon, i dont know you, i cant trust admin acces to strangers.
Given how much your server seems to be broken, what worse could he do to it? ;)
My server is fine thank you. This isnt personally to anyone, but i dont give admin acces to my site to people i dont know. You can do that if you want ;)


edit: chat is fixed also. So it wasnt this mods fault, it was my own language modifications.
Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

Sudhakar Arjunan

Quote from: Owdy on April 17, 2009, 12:25:52 PM
This is fixed. I dont understand how, but it was my themes Modifications.finnish-utf8.php http://www.simplemachines.org/community/index.php?topic=305189.msg2020053#msg2020053

Quote from: Nao 尚 on April 17, 2009, 12:07:49 PM
Quote from: Owdy on April 17, 2009, 11:53:58 AM
Sorry Dragoon, i dont know you, i cant trust admin acces to strangers.
Given how much your server seems to be broken, what worse could he do to it? ;)
My server is fine thank you. This isnt personally to anyone, but i dont give admin acces to my site to people i dont know. You can do that if you want ;)


edit: chat is fixed also. So it wasnt this mods fault, it was my own language modifications.


Great owdy,

you have fixed it. Great.

Could we have a link to see your forum.
Working on New Mods & Themes for SMF... Will update soon... My Blog page
My Smf forum : Discuss ITAcumens :: My SMF Forum

Nao 尚

Quote from: Dragooon on April 17, 2009, 12:20:57 PM
Wipe the DB out?
If you did that, you would definitely qualify for that coffee making job we were talking about the other day  O:)
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.

PRaDiUS

Hey, thanks bro!
There was no way I was going to figure that out on my own.
My forum would be dull and boring without SMG!
So, thanks again!


Quote from: Dragooon on April 17, 2009, 01:22:51 AM
@PRaDiUS - OK After some looking, can you try these code changes? Make sure to install SMG 1.5.6
Open MGallery-SUb.php
Find
$request = $mgalFunc['db_query']('
SELECT
a.id_album, a.name, a.album_of AS id_member, a.approved, IFNULL(mem.realName, a.member_name) AS member_name,
a.num_items, a.passwd, a.icon, a.description, a.parent
FROM {db_prefix}mgallery_albums AS a
LEFT JOIN {db_prefix}members AS mem ON (mem.ID_MEMBER = a.album_of)
WHERE {_query_see_album}
AND a.type = {string:type}' . (!mgalAllowedTo('moderate') ? '
AND (a.approved = 1 OR a.album_of = ' . $user_info['id'] . ')' : '') . '
ORDER BY a.album_of ASC, {string:sort_by} {string:sort_order}
LIMIT {int:start},{int:per_page}',
array('type' => 'user', 'sort_by' => $sort_by, 'sort_order' => $sort_order, 'start' => $start, 'per_page' => $per_page),__FILE__,__LINE__);
$context['mgallery_user_albums'] = array();
while ($row = $mgalFunc['db_fetch_assoc']($request))
{
$context['mgallery_user_albums'][$row['id_album']] = $row;
$context['mgallery_user_albums'][$row['id_album']]['icon'] = !empty($row['icon']) && $row['icon'] > 0 ? '<img alt="" src="'.$galurl.'sa=media;id='.$row['id_album'].';icon" />' : '';
// Sub user-albums
$sub_albums = array();
if ($mgalSettings['show_sub_albums_on_index'] == '1') {
$sub_user_albums = $mgalFunc['db_query']('
SELECT a.id_album, a.name, a.approved
FROM {db_prefix}mgallery_albums AS a
WHERE a.parent = {int:parent}' . (!mgalAllowedTo('moderate') ? '
AND (a.approved = 1 OR a.album_of = ' . $user_info['id'] . ')' : '') . '
AND {_query_see_album}',
array('parent' => $row['id_album']),__FILE__,__LINE__);
while ($sub = $mgalFunc['db_fetch_assoc']($sub_user_albums))
$sub_albums[] = $sub['id_album'];
$mgalFunc['db_free_result']($sub_user_albums);
}
$context['mgallery_user_albums'][$row['id_album']]['sub_albums'] = $sub_albums;
$context['mgallery_user_albums'][$row['id_album']]['description'] = $mgalFunc['parse_bbc']($row['description']);
}
$mgalFunc['db_free_result']($request);

Replace with
// Load all the user albums..
getAlbums(false, true, false, false, 0, 'a.type = \'user\'');

// Another query for sorintg...
$request = $mgalFunc['db_query']('
SELECT
a.id_album
FROM {db_prefix}mgallery_albums AS a
WHERE {_query_see_album}
AND a.type = {string:type}' . (!mgalAllowedTo('moderate') ? '
AND (a.approved = 1 OR a.album_of = ' . $user_info['id'] . ')' : '') . '
AND a.child_level = 0
ORDER BY a.album_of ASC, {string:sort_by} {string:sort_order}
LIMIT {int:start}, {int:per_page}',
array('type' => 'user', 'sort_by' => $sort_by, 'sort_order' => $sort_order, 'start' => $start, 'per_page' => $per_page),__FILE__,__LINE__);
$context['mgallery_user_albums'] = array();
while ($row = $mgalFunc['db_fetch_assoc']($request))
$context['mgallery_user_albums'][$row['id_album']] = $context['mgallery_albums'][$row['id_album']];
$mgalFunc['db_free_result']($request);


Open Subs-MGallery.php
Find
a.approved, a.directory, a.icon, f.filesize, f.width, f.height, a.a_order
Replace with
a.approved, a.directory, a.icon, f.filesize, f.width, f.height, a.a_order, a.passwd
Find
'order' => $row['a_order'],
'overall_total' => 0,

Add after

'passwd' => $row['passwd'],


Open MGallery.template.php
Find
function smg_show_sub_albums($alb)
{
global $context, $galurl, $settings, $txt, $mgalFunc;

$ret = '';
foreach ($context['mgallery_user_albums'][$alb]['sub_albums'] as $sub_album)
{
$album = &$context['mgallery_user_albums'][$sub_album];
$ret .= smg_locked_album($album['passwd'], $album['id_album'], $album['id_member'], $album['num_items'] . ' ' . $txt['mgallery_items'])
. ' <a href="' . $galurl.'sa=album;id=' . $album['id_album'] . '"' . (!$album['approved'] ? ' class="unapp"' : '') . '>' . $album['name'] . '</a>';
if (!empty($album['sub_albums']))
$ret .= ' (' . smg_show_sub_albums($album['id_album']) . ')';
$ret .= ', ';
}
return rtrim($ret, ', ');
}

function template_mgallery_viewUserAlbums()
{
global $txt, $context, $scripturl, $galurl;

// The Albums!
echo '
<div class="catbg item_heading">', $context['show_general_albums_link'] ? '
<b><a href="'.$galurl.'">'.$txt['mgallery_albums'].'</a></b> -' : '', '
<b>'.$txt['mgallery_user_albums'].'</b>
</div>';

echo '
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="tborder">
<tr class="windowbg">
<td colspan="4">',$txt['mgallery_pages'], ': ', $context['mgallery_page_index'],'</td>
</tr>
<tr class="titlebg2">
<td width="8%">',$txt['mgallery_icon'],'</td>
<td>',$txt['mgallery_name'],'</td>
<td>',$txt['mgallery_items'],'</td>
</tr>';

$current_owner = 0;
foreach ($context['mgallery_user_albums'] as $album)
{
if (!empty($album['parent']))
continue;
if ($album['id_member'] != $current_owner)
{
$current_owner = $album['id_member'];
echo '
<tr class="catbg item_heading">
<td colspan="3">', $txt['mgallery_owner'], ': ', smg_profile($album['id_member'], $album['member_name']), '</td>
</tr>';
}
echo '
<tr class="windowbg">
<td align="center">',$album['icon'], '</td>
<td', !$album['approved'] ? ' class="unapp"' : '', '>
<div class="mg_large"><a href="'.$galurl.'sa=album;id='.$album['id_album'].'">'.$album['name'].'</a>',
smg_locked_album($album['passwd'], $album['id_album'], $album['id_member']), '</div>
<div class="mg_desc">'.$album['description'].'</div></td>
<td>'.$album['num_items'].'</td>
</tr>';
if (!empty($album['sub_albums']))
echo '
<tr class="windowbg"><td colspan="4">', $txt['mgallery_sub_albums'], ': ', smg_show_sub_albums($album['id_album']), '</td></tr>';
}
echo '
</table>';
}


Replace with
function smg_show_sub_albums($alb)
{
global $context, $galurl, $settings, $txt, $mgalFunc;

$ret = '';
foreach ($context['mgallery_albums'][$alb]['sub_albums'] as $sub_album)
{
$album = &$context['mgallery_albums'][$sub_album];
$ret .= smg_locked_album($album['passwd'], $album['id'], $album['owner']['id'], $album['num_items'] . ' ' . $txt['mgallery_items'])
. ' <a href="' . $galurl.'sa=album;id=' . $album['id'] . '"' . (!$album['approved'] ? ' class="unapp"' : '') . '>' . $album['name'] . '</a>';
if (!empty($album['sub_albums']))
$ret .= ' (' . smg_show_sub_albums($album['id_album']) . ')';
$ret .= ', ';
}
return rtrim($ret, ', ');
}

function template_mgallery_viewUserAlbums()
{
global $txt, $context, $scripturl, $galurl;

// The Albums!
echo '
<div class="catbg item_heading">', $context['show_general_albums_link'] ? '
<b><a href="'.$galurl.'">'.$txt['mgallery_albums'].'</a></b> -' : '', '
<b>'.$txt['mgallery_user_albums'].'</b>
</div>';

echo '
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="tborder">
<tr class="windowbg">
<td colspan="4">', $txt['mgallery_pages'], ': ', $context['mgallery_page_index'], '</td>
</tr>
<tr class="titlebg2">
<td width="8%">', $txt['mgallery_icon'], '</td>
<td>', $txt['mgallery_name'], '</td>
<td>', $txt['mgallery_items'], '</td>
</tr>';

$current_owner = 0;
foreach ($context['mgallery_user_albums'] as $album)
{
if ($album['id_member'] != $current_owner)
{
$current_owner = $album['id_member'];
echo '
<tr class="catbg item_heading">
<td colspan="3">', $txt['mgallery_owner'], ': ', smg_profile($album['owner']['id'], $album['owner']['name']), '</td>
</tr>';
}
echo '
<tr class="windowbg">
<td align="center">', $album['icon']['src'], '</td>
<td', !$album['approved'] ? ' class="unapp"' : '', '>
<div class="mg_large"><a href="'.$galurl.'sa=album;id='.$album['id'].'">'.$album['name'].'</a>',
smg_locked_album($album['passwd'], $album['id'], $album['owner']['id']), '</div>
<div class="mg_desc">'.$album['description'].'</div></td>
<td>'.$album['num_items'].'</td>
</tr>';
if (!empty($album['sub_albums']))
echo '
<tr class="windowbg"><td colspan="4">', $txt['mgallery_sub_albums'], ': ', smg_show_sub_albums($album['id']), '</td></tr>';
}
echo '
</table>';
}


This should help fix the issue.

          [ RGXbox.com ]

Dragooon


PRaDiUS

So far, so good! I've messed with everything and it seems error free. I've only made a couple new user albums since I made the change. But it seems to be counting them and adding them in the correct order now.

One thing I noticed is that after I made the change... You know how in user albums section it will show the users name then the albums said user has made underneath their name. Like...

ThaKiLLa
- Album 1
- Album 2
- etc.
PRaDiUS
- Album 1
- Album 2
- etc.

Since the names have been removed the list now goes...

- Album 1
- Album 2
- etc.
- Album 1
- Album 2
- etc.

But, I actually like it better this way. Because I have it set up so that only moderators can add user albums - to show screenshots of new xbox games... and it does not really matter to my members which moderator added them. So this works out great for me.

Example here - http://rgxbox.com/index.php?action=mgallery;sa=vua

Bottom line is, I like it better this way by not listing the user names on the user album index.
And so far it seems to be counting the albums and adding them correctly.


Thank you very much!

Oh, where can I go into the script and change the name "user albums" to "Game Albums"?
I was assuming somewhere in the source Subs, but I can't find it.

          [ RGXbox.com ]

Dragooon

Mgallery.english.php in languages folder.

Nao 尚

Good job on your work on SMG these days, Dragooon! (You know what I mean. I don't have time to test it myself but it's nice to see you're back in full gear!)
I'm working hard on Noisen, too -- more specifically, on setting up my playlist system which I will then do my best to re-use as faithfully as possible in SMG.
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.

tridirk

Well try as I might... I couldn't get it to work on either of my two forums.  So I uninstalled it.

I'll check back in a few months and maybe you will have an idiot proof version for guys like me that aren't code experts.

Thanks....again for your time.
Learning SMF..... Thanks for your help!

Dragooon

Quote from: tridirk on April 18, 2009, 11:57:37 PM
Well try as I might... I couldn't get it to work on either of my two forums.  So I uninstalled it.

I'll check back in a few months and maybe you will have an idiot proof version for guys like me that aren't code experts.

Thanks....again for your time.
What were your issues?

Quote from: Nao 尚 on April 18, 2009, 06:09:53 PM
Good job on your work on SMG these days, Dragooon! (You know what I mean. I don't have time to test it myself but it's nice to see you're back in full gear!)
I'm working hard on Noisen, too -- more specifically, on setting up my playlist system which I will then do my best to re-use as faithfully as possible in SMG.
Thanks, good luck with your work.

LinK187

Quote from: mattchewone on April 17, 2009, 07:23:34 AM
5.   Execute Modification   ./Sources/Load.php   Test failed
   1.   Replace   ./Sources/Load.php   Test successful
   2.   Replace   ./Sources/Load.php   Test failed

What does this mean and how can i fix it?

Procede but edit those files that failed manually.

tridirk

Quote from: Dragooon on April 19, 2009, 01:57:15 AM
Quote from: tridirk on April 18, 2009, 11:57:37 PM
Well try as I might... I couldn't get it to work on either of my two forums.  So I uninstalled it.

I'll check back in a few months and maybe you will have an idiot proof version for guys like me that aren't code experts.

Thanks....again for your time.
What were your issues?

Pictures wouldn't show, either by the conversion from Gallery lite or a new install.  We had several posts back and forth about it.  I posted some screen shots...etc.
Learning SMF..... Thanks for your help!

Dragooon

Quote from: tridirk on April 19, 2009, 02:13:24 PM
Quote from: Dragooon on April 19, 2009, 01:57:15 AM
Quote from: tridirk on April 18, 2009, 11:57:37 PM
Well try as I might... I couldn't get it to work on either of my two forums.  So I uninstalled it.

I'll check back in a few months and maybe you will have an idiot proof version for guys like me that aren't code experts.

Thanks....again for your time.
What were your issues?

Pictures wouldn't show, either by the conversion from Gallery lite or a new install.  We had several posts back and forth about it.  I posted some screen shots...etc.
Anything when you run Maintenance > Find errors? What are the permissions of mgal_data folder and MGallery.php? And where wouldn't the pictures show?

Advertisement: