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

tk2012

I got the same error that Sunking got on page 1.

Then, I looked in my error log and found 1 Critical Error. 

I'm using v2.0 b3.1
default theme

the error info is below:

http://www.motorstorm-rpms.org/community/index.php?action=mgallery;sa=useralbums;do=add

The database value you're trying to insert does not exist: width

Function: mgal_db_insert

File: /var/www/html/community/Sources/Subs-MGallery.php  (line 136)


Here is the code:
116:  }
117:
118: function mgal_db_insert($table, $columns, $data, $file, $line, $ignore = false) {
119: // Funtion used for inserting some data to some table
120: global $context, $db_prefix, $mgalFunc, $smcFunc;
121: if(empty($table) || empty($columns) || empty($data))
122: return false;
123: $insert = $ignore ? 'INSERT IGNORE' : 'INSERT';
124: if($context['is_smf2']) {
125: $columns_2 = array();
126: // OK Convert them to a proper SMF 2.0 compatible format
127: $count = count($columns);
128: foreach($columns as $k => $v)
129: $columns_2[$v] = is_int($data[$k]) ? 'int' : 'string';
130: $data_2 = array();
131: // Convert the data now
132: foreach($data as $v) {
133: $data_2[] = $v;
134: }   
135:
==>136: return $smcFunc['db_insert']($ignore ? 'IGNORE' : '', $table, $columns_2, $data_2, null);
137: }
138: // OK this seems to be SMF 1.1, well, do it this way then
139: $table = str_replace('{db_prefix}', $db_prefix, $table);
140:
141: $query_data = array_combine($columns, $data);
142: $insert_columns = array();
143: $insert_data = array();
144: // Just so that we get the things at the right place
145: foreach($query_data as $c => $d) {
146: $insert_columns[] = $c;
147: $insert_data[] = "'$d'";
148: }
149: // Insert it!
150: $mgalFunc['db_query'](
151: "".$insert." INTO ".$table."
152: (".implode(',',$insert_columns).")
153: VALUES
154: (".implode(',',$insert_data).")", array(),$file, $line, true);
155:
156: }


ianus

Greetings!

This seems to be a very nice mod and I would like to test (and use) it.
But before installation ... some questions.

Prologue:
I have two mods running, the Integrate Lightbox and YouTube BBCode.
In this combination the YouTube mod isn't working under some circumstances.
(Description: Re: YouTube BBCode v2.3 (see alsoRe: Integrate Lightbox))

Your mod seems to offer both features, include videos and resize images with lightbox.

So, the questions.
- Have somebody notice problems with integration of videos in the gallery while using the lightbox feature for gallery images?
- Is it possible to show images hosted with .imageshack.us inside the gallery (like videos hosted on youtube)?
- Is it necessary to have all three mod installed or
-- will the lightbox feature work also for images which are included inside a post?
--  is it possible to use the "include video" feature inside a post?

The first question is crucial and hopefully somebody have some knowledge and can give an answer.
Thanks in advance.
ianus

Dragooon

Quote from: tk2012 on September 13, 2008, 01:15:03 AM
I got the same error that Sunking got on page 1.

Then, I looked in my error log and found 1 Critical Error. 

I'm using v2.0 b3.1
default theme

the error info is below:

http://www.motorstorm-rpms.org/community/index.php?action=mgallery;sa=useralbums;do=add

The database value you're trying to insert does not exist: width

Function: mgal_db_insert

File: /var/www/html/community/Sources/Subs-MGallery.php  (line 136)


Here is the code:
116:  }
117:
118: function mgal_db_insert($table, $columns, $data, $file, $line, $ignore = false) {
119: // Funtion used for inserting some data to some table
120: global $context, $db_prefix, $mgalFunc, $smcFunc;
121: if(empty($table) || empty($columns) || empty($data))
122: return false;
123: $insert = $ignore ? 'INSERT IGNORE' : 'INSERT';
124: if($context['is_smf2']) {
125: $columns_2 = array();
126: // OK Convert them to a proper SMF 2.0 compatible format
127: $count = count($columns);
128: foreach($columns as $k => $v)
129: $columns_2[$v] = is_int($data[$k]) ? 'int' : 'string';
130: $data_2 = array();
131: // Convert the data now
132: foreach($data as $v) {
133: $data_2[] = $v;
134: }  
135:
==>136: return $smcFunc['db_insert']($ignore ? 'IGNORE' : '', $table, $columns_2, $data_2, null);
137: }
138: // OK this seems to be SMF 1.1, well, do it this way then
139: $table = str_replace('{db_prefix}', $db_prefix, $table);
140:
141: $query_data = array_combine($columns, $data);
142: $insert_columns = array();
143: $insert_data = array();
144: // Just so that we get the things at the right place
145: foreach($query_data as $c => $d) {
146: $insert_columns[] = $c;
147: $insert_data[] = "'$d'";
148: }
149: // Insert it!
150: $mgalFunc['db_query'](
151: "".$insert." INTO ".$table."
152: (".implode(',',$insert_columns).")
153: VALUES
154: (".implode(',',$insert_data).")", array(),$file, $line, true);
155:
156: }


I'll see to that issue

Quote from: ianus on September 13, 2008, 01:56:31 AM
Greetings!

This seems to be a very nice mod and I would like to test (and use) it.
But before installation ... some questions.

Prologue:
I have two mods running, the Integrate Lightbox and YouTube BBCode.
In this combination the YouTube mod isn't working under some circumstances.
(Description: Re: YouTube BBCode v2.3 (see alsoRe: Integrate Lightbox))

Your mod seems to offer both features, include videos and resize images with lightbox.

So, the questions.
- Have somebody notice problems with integration of videos in the gallery while using the lightbox feature for gallery images?
- Is it possible to show images hosted with .imageshack.us inside the gallery (like videos hosted on youtube)?
- Is it necessary to have all three mod installed or
-- will the lightbox feature work also for images which are included inside a post?
--  is it possible to use the "include video" feature inside a post?

The first question is crucial and hopefully somebody have some knowledge and can give an answer.
Thanks in advance.
ianus

1) I haven't so far :)
2) Currently no, might be later but not now
3) Gallery is a standalone, it has no dependencies.
4) No, It is only for the gallery and not for posts
5) Not as of now.

kith

Quote from: kith on September 10, 2008, 08:04:13 PM
Just installed this on SMF 2 Beta 4
Also have the thumbnail issue but will try the fix above.

If I add an icon when I create an album all is fine.
If I go to change an icon after the album is created I get an error

The database value you're trying to insert does not exist: id_album

Any idea why?



Any ideas guys?
Have uninstalled for now but would love to use this.

Mouthrax

Hi,

Love the mod thank you :)

Could you please please look at a button to copy an image code as BBcode [img][/img] like you have in photobucket for instance?

It would really make my day as I have a forum that sees a lot of the images being put into the gallery posted into the forum.

Thanks
Dean

Dragooon

Quote from: kith on September 13, 2008, 06:32:06 AM
Quote from: kith on September 10, 2008, 08:04:13 PM
Just installed this on SMF 2 Beta 4
Also have the thumbnail issue but will try the fix above.

If I add an icon when I create an album all is fine.
If I go to change an icon after the album is created I get an error

The database value you're trying to insert does not exist: id_album

Any idea why?



Any ideas guys?
Have uninstalled for now but would love to use this.
I'll see to it.

Quote from: Mouthrax on September 13, 2008, 08:59:57 AM
Hi,

Love the mod thank you :)

Could you please please look at a button to copy an image code as BBcode [img][/img] like you have in photobucket for instance?

It would really make my day as I have a forum that sees a lot of the images being put into the gallery posted into the forum.

Thanks
Dean
Nice suggestion, I'll add it later.

qubbah

Quote from: Dragooon on September 10, 2008, 01:43:16 PM
OK I have fixed this in revision 71(Which'll be SMF Media gallery 1.0.1 later).
To fix this on your installation
Open MGallery.php
Find
$media = new mgal_media_handler;
$media->init($path);

$stats = $media->getStat();
$mime = $media->getMimeType();
$file_name = $filename;

$media->close();
// Send it
header('Pragma: ');
if (!$context['browser']['is_gecko'])
header('Content-Transfer-Encoding: binary');
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 525600 * 60) . ' GMT');
header('Accept-Ranges: bytes');
//header('Connection: close');
//header('Cache-Control: ');
if($file = fopen($path, 'rb')) {
header('Content-type:'.$mime);
header('Content-Length: '.$stats[7]);
header('Content-Disposition: inline; filename='.$file_name);
while(!feof($file))
echo fread($file, 8192);
fclose($file);
} else {
die('Something went wrong...');
}

(It'll  be at the end)
And replace it with
$media = new mgal_media_handler;
$media->init($path);
$mime = $media->getMimeType();
$file_name = $filename;
$media->close();
// Send it
header('Pragma: ');
if (!$context['browser']['is_gecko'])
header('Content-Transfer-Encoding: binary');
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 525600 * 60) . ' GMT');
header('Accept-Ranges: bytes');
//header('Connection: close');
//header('Cache-Control: ');
if($file = file_get_contents($path)) {
header('Content-Type: '.$mime);
header('Content-Disposition: inline; filename='.$file_name);
echo $file;
} else {
die('Something went wrong...');
}


is this change for both in theme and sources folder?

Dragooon

There is only one MGallery.php in Sources folder :).

qubbah

hehe... sorry, miss looking.. there only one file named MGallery.

4fit?

#69
Nice mod.  Any chance of adding in an automatic resize of images that are dimensionally too large?

Also, whenever, I upload an mp3 file, the page seems to process for a couple minutes and then gives the message below.  Any ideas?  I've got the max size set to 15000kb and the file is not even 1/3rd of that.

"There was a error in uploading, please try again or contact the administrator"

4b11l


Quote from: Dragooon on September 11, 2008, 09:32:54 PM
Quote from: 4b11l on September 11, 2008, 02:40:01 PM
No is next to all 3 of those.
The folders are in the right place.
Then the image sizes won't be detectable making the size limit and proper resizes almost useless.
You can ask your host to install GD2(It is pretty common module installed on almost every host).

And does the grey box also appears in default theme?

The gray box doesn't seem to appear in the default theme. Any ideas why?

djrem

Quote from: 4fit? on September 13, 2008, 03:00:54 PM
Nice mod.  Any chance of adding in an automatic resize of images that are dimensionally too large?

Also, whenever, I upload an mp3 file, the page seems to process for a couple minutes and then gives the message below.  Any ideas?  I've got the max size set to 15000kb and the file is not even 1/3rd of that.

"There was a error in uploading, please try again or contact the administrator"

CHMODed the upload folder to 777 ?

4fit?

#72
Just realized something else.  Apostrophes in the album titles cause an SQL error to be generated.  If they are manually escaped it shows as 3 forward slashes (ex: Members\\\'s Rides).  It is also doing the 3 forward slash thing when a manually-escaped apostrophe is used in the description field.  This is probably happening in the media title/description areas as well, but I haven't tested that.

4fit?

Quote from: djrem on September 13, 2008, 03:45:15 PM
CHMODed the upload folder to 777 ?
Made no difference.  Same error received.  However, it lets me upload images into a CHMOD 755 folder just fine.

4fit?

As a enhancement, would it be possible to add support for embedding videos from StreetFire.net?

Bugpac ™

I have installed in default theme on 1.1.6, it doesnt seem to be working, there is no gallery in the menu...But it did create a spce between 2 other buttons...

Dragooon

Quote from: 4fit? on September 13, 2008, 03:00:54 PM
Nice mod.  Any chance of adding in an automatic resize of images that are dimensionally too large?

Also, whenever, I upload an mp3 file, the page seems to process for a couple minutes and then gives the message below.  Any ideas?  I've got the max size set to 15000kb and the file is not even 1/3rd of that.

"There was a error in uploading, please try again or contact the administrator"
Make sure that the upload_max_filesize of php settings is also that large. Since if it is not above 15 Megs, It won't work. It really doesn't have any issues with gallery. About the resize image, I'll see thanks :).

Quote from: Bugpac ™ on September 13, 2008, 05:19:09 PM
I have installed in default theme on 1.1.6, it doesnt seem to be working, there is no gallery in the menu...But it did create a spce between 2 other buttons...
Make sure you use "English" as your language or copy strings from Modifications.english.php to Modifications.<your lang>.php

Quote from: 4fit? on September 13, 2008, 04:10:31 PM
As a enhancement, would it be possible to add support for embedding videos from StreetFire.net?
I'll see.

Quote from: 4fit? on September 13, 2008, 03:53:11 PM
Just realized something else.  Apostrophes in the album titles cause an SQL error to be generated.  If they are manually escaped it shows as 3 forward slashes (ex: Members\\\'s Rides).  It is also doing the 3 forward slash thing when a manually-escaped apostrophe is used in the description field.  This is probably happening in the media title/description areas as well, but I haven't tested that.
I'll see.

Quote from: 4b11l on September 13, 2008, 03:20:43 PM

Quote from: Dragooon on September 11, 2008, 09:32:54 PM
Quote from: 4b11l on September 11, 2008, 02:40:01 PM
No is next to all 3 of those.
The folders are in the right place.
Then the image sizes won't be detectable making the size limit and proper resizes almost useless.
You can ask your host to install GD2(It is pretty common module installed on almost every host).

And does the grey box also appears in default theme?

The gray box doesn't seem to appear in the default theme. Any ideas why?
Not really, I think you should ask the theme author.

Dragooon

Quote from: kith on September 13, 2008, 06:32:06 AM
Quote from: kith on September 10, 2008, 08:04:13 PM
Just installed this on SMF 2 Beta 4
Also have the thumbnail issue but will try the fix above.

If I add an icon when I create an album all is fine.
If I go to change an icon after the album is created I get an error

The database value you're trying to insert does not exist: id_album

Any idea why?



Any ideas guys?
Have uninstalled for now but would love to use this.
I have fixed that issue and several others as well in 1.0.1. I am planning on releasing it later today.

Dragooon

Uploaded 1.0.1
This fixed all the issues reported so far.

Marcus Forsberg

Hi again!

I don't want to stress you, but when will that converter from SMF Gallery be finnished?
My users really want this new gallery as soon as possible :)

Advertisement: