MyBB Community Forums

Full Version: ezGallery 2.0.1 - Photogallery for MyBB
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Doesn't work, get this when clicking on Next or Previous.

Quote:MyBB SQL Error

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY c.ID_COMMENT DESC' at line 5
Query:
SELECT c.ID_PICTURE, c.ID_COMMENT, c.date, c.comment, c.ID_MEMBER, m.postnum, m.username, m.avatar FROM mybb_gallery_comment as c LEFT JOIN mybb_users AS m ON (c.ID_MEMBER = m.uid) WHERE c.ID_PICTURE = ORDER BY c.ID_COMMENT DESC
You're doing it wrong(lol, meme reference).

EDIT: Keep in mind that this modification is not optimal. For example; if you press Next when there are no images left then you will receive a Database Error.
Next & Previous buttons Update 1
Find:
function ViewPicture()
{
	global $context, $db, $mybb, $gallerySettings ,$lang, $config, $parser, $parser_options, $plugins;

	isAllowedTo('view');

Put this below:
	//Prevent user from going to a page that does not exist.
	$DbResult = $db->query("
	SELECT 
		* 
	FROM ".TABLE_PREFIX."gallery_pic 
	ORDER BY ID_PICTURE DESC");
	
	$dbRows = $db->fetch_array($DbResult);
	
	if ($_GET["id"] > $dbRows["ID_PICTURE"])
	{
		header("Location: ezgallery.php?action=view&id=" . $dbRows["ID_PICTURE"]);
	}
VBGAMER45, any way to incorporate this (prev/next) functionality into the standard? It would make your plugin that much better. Thanks!
VBGAMER45 has not been active for 1 month.

Just download the ezgallery.php file and replace it and you're done.

EDIT: I'll be doing some updates to this plugin, come with suggestions. Smile
(2011-11-16, 05:56 PM)Cyphocx Wrote: [ -> ]VBGAMER45 has not been active for 1 month.

Just download the ezgallery.php file and replace it and you're done.

EDIT: I'll be doing some updates to this plugin come with suggestions. Smile

Oh, thank you. The latest EZGALLERY.PHP that you attached... Does it incorporate the new functionality, or do we still need to find & replace? Also, are you able to fix the issue where you get a DB error when no images are left?
(2011-11-16, 06:07 PM)Jayfore Wrote: [ -> ]
(2011-11-16, 05:56 PM)Cyphocx Wrote: [ -> ]VBGAMER45 has not been active for 1 month.

Just download the ezgallery.php file and replace it and you're done.

EDIT: I'll be doing some updates to this plugin come with suggestions. Smile

Oh, thank you. The latest EZGALLERY.PHP that you attached... Does it incorporate the new functionality, or do we still need to find & replace? Also, are you able to fix the issue where you get a DB error when no images are left?
The new features are implemented in that file.

And yes the DB error is fixed also. Smile
(2011-11-16, 06:18 PM)Cyphocx Wrote: [ -> ]
(2011-11-16, 06:07 PM)Jayfore Wrote: [ -> ]
(2011-11-16, 05:56 PM)Cyphocx Wrote: [ -> ]VBGAMER45 has not been active for 1 month.

Just download the ezgallery.php file and replace it and you're done.

EDIT: I'll be doing some updates to this plugin come with suggestions. Smile

Oh, thank you. The latest EZGALLERY.PHP that you attached... Does it incorporate the new functionality, or do we still need to find & replace? Also, are you able to fix the issue where you get a DB error when no images are left?
The new features are implemented in that file.

And yes the DB error is fixed also. Smile

All right! Thanks so much!

Spoke to soon... Just deactivated, updated this file, and reactivated. I get this error:

Warning [2] require_once(./global.php) [function.require-once]: failed to open stream: No such file or directory - Line: 5 - File: inc/plugins/ezgallery.php PHP 5.2.17 (Linux)
You sure that you didn't modify anything?

Cause according to that error your global.php file is missing(It should be in the forum root folder).
(2011-11-16, 06:50 PM)Cyphocx Wrote: [ -> ]You sure that you didn't modify anything?

Cause according to that error your global.php file is missing(It should be in the forum root folder).

Yup, it's there... 644 permissions. The minute I put my old ezgallery.php back, it works fine again. My site will not even come up with the new file in place.
(2011-11-16, 07:17 PM)Jayfore Wrote: [ -> ]
(2011-11-16, 06:50 PM)Cyphocx Wrote: [ -> ]You sure that you didn't modify anything?

Cause according to that error your global.php file is missing(It should be in the forum root folder).

Yup, it's there... 644 permissions. The minute I put my old ezgallery.php back, it works fine again. My site will not even come up with the new file in place.
It must be interfering with another plugin.

I am using a freshly installed MyBB, so I am pretty sure it's something you've done.