Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4255
Latest: andreios
New This Month: 3
New This Week: 1
New Today: 0
Stats
Total Posts: 43259
Total Topics: 7518
Most Online Today: 202
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 3
Guests: 102
Total: 105

Author Topic: SMG Gallery 2.5.4 and deleted photos error log messages  (Read 7559 times)

0 Members and 1 Guest are viewing this topic.

guest3817

  • Guest
SMG Gallery 2.5.4 and deleted photos error log messages
« on: October 05, 2009, 05:46:45 am »
Hi

I have SMF gallery 2.5.4 installed. I recently cleared out a lot of pictures from the gallery. Now I'm getting errors(in the error log0 such as the one below when the site is visited by webspiders.

Type of error: General
URL http://www.xxx.co.uk/forum/index.php?action=gallery;sa=view;id=230
No picture selected.

Is there any way to avod the generation of these errors or will they eventually stop happening when the spiders stop trying to visit these deleted items?

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: SMG Gallery 2.5.4 and deleted photos error log messages
« Reply #1 on: October 05, 2009, 06:40:31 am »
Fixed for Gallery 2.5.5



Hotfix for SMF 1.1.x
Open Sources/Gallery.php
Around Line 891
Find
Code: [Select]
// Get the picture ID
$id = (int) $_REQUEST['id'];
if (empty($id))
fatal_error($txt['gallery_error_no_pic_selected']);

// Show top Tabs
TopButtonTabs();

$dbresult = db_query("
SELECT
ID_PICTURE, USER_ID_CAT, ID_CAT
FROM {$db_prefix}gallery_pic
WHERE ID_PICTURE = $id  LIMIT 1", __FILE__, __LINE__);
$row = mysql_fetch_assoc($dbresult);
if (mysql_num_rows($dbresult) == 0)
{
fatal_error($txt['gallery_error_no_pic_selected']);
}
Change to
Code: [Select]
// Get the picture ID
$id = (int) $_REQUEST['id'];
if (empty($id))
fatal_error($txt['gallery_error_no_pic_selected'],false);

// Show top Tabs
TopButtonTabs();

$dbresult = db_query("
SELECT
ID_PICTURE, USER_ID_CAT, ID_CAT
FROM {$db_prefix}gallery_pic
WHERE ID_PICTURE = $id  LIMIT 1", __FILE__, __LINE__);
$row = mysql_fetch_assoc($dbresult);
if (mysql_num_rows($dbresult) == 0)
{
fatal_error($txt['gallery_error_no_pic_selected'],false);
}



Fix for SMF 2.0

Open Sources/Gallery2.php
Around line 934
Find
Code: [Select]
// Get the picture ID
$id = (int) $_REQUEST['id'];
if (empty($id))
fatal_error($txt['gallery_error_no_pic_selected']);

// Show top Tabs
TopButtonTabs();

$dbresult = $smcFunc['db_query']('', "
SELECT
id_picture, user_id_cat, id_cat
FROM {db_prefix}gallery_pic
WHERE id_picture = $id  LIMIT 1");
$row = $smcFunc['db_fetch_assoc']($dbresult);
if ($smcFunc['db_num_rows']($dbresult) == 0)
{
fatal_error($txt['gallery_error_no_pic_selected']);
}
Change to
Code: [Select]
// Get the picture ID
$id = (int) $_REQUEST['id'];
if (empty($id))
fatal_error($txt['gallery_error_no_pic_selected'],false);

// Show top Tabs
TopButtonTabs();

$dbresult = $smcFunc['db_query']('', "
SELECT
id_picture, user_id_cat, id_cat
FROM {db_prefix}gallery_pic
WHERE id_picture = $id  LIMIT 1");
$row = $smcFunc['db_fetch_assoc']($dbresult);
if ($smcFunc['db_num_rows']($dbresult) == 0)
{
fatal_error($txt['gallery_error_no_pic_selected'],false);
}
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

guest3817

  • Guest
Re: SMG Gallery 2.5.4 and deleted photos error log messages
« Reply #2 on: October 05, 2009, 07:28:10 am »
Excellent thanks. Worked a treat.

guest3817

  • Guest
Re: SMG Gallery 2.5.4 and deleted photos error log messages
« Reply #3 on: October 06, 2009, 10:06:57 am »
Hi

back again I'm afraid. I'm also seeing errors like the following in the error log
caused by http://www.xxxx.co.uk/forum/index.php?action=gallery;sa=prev;id=162

"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 'AND p.user_id_cat = AND p.approved = 1 AND p.id_picture > 162

ORDER BY p.id_' at line 7
File: /home/xxxx/public_html/xxx/forum/Sources/Gallery2.php
Line: 10748 "

Which I think is also related to Spider accessing deleted photos . I didnt notice these before amongst the other error messages

There was also one occurence of this error message caused by the same spider at the same time the ORDER By p.id error was generated(from the error log)

" Type of error: General
http://www.xxxx.co.uk/forum/index.php?action=reporttm;topic=322.9;msg=1138

The board you specified doesn't exist"

I think this might have been a topic created by posting an image and that was subsequently deleted.

Any help would be greatly appreciated.



guest3817

  • Guest
Re: SMG Gallery 2.5.4 and deleted photos error log messages
« Reply #4 on: October 08, 2009, 06:42:21 am »
Any ideas? Its not a big thing but I've been getting about 10 errors a day which I have to clear out.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: SMG Gallery 2.5.4 and deleted photos error log messages
« Reply #5 on: October 08, 2009, 08:50:23 am »
Will check it out either friday  and this weekend been sick for the last couple days
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

guest3817

  • Guest
Re: SMG Gallery 2.5.4 and deleted photos error log messages
« Reply #6 on: October 08, 2009, 09:54:49 am »
OK no worries. Hope your feeling better.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: SMG Gallery 2.5.4 and deleted photos error log messages
« Reply #7 on: October 13, 2009, 09:38:08 pm »
Fixed the error with next/previous links error in latest release.

2.5.5
!Fixed when viewing non existent pictures not to log an error
!Fixed database error for spiders following old previous/next links
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

guest3817

  • Guest
Re: SMG Gallery 2.5.4 and deleted photos error log messages
« Reply #8 on: October 14, 2009, 01:32:43 am »
Excellent thanks again.

 

Related Topics

  Subject / Started by Replies Last post
4 Replies
6000 Views
Last post March 10, 2007, 11:24:42 pm
by bsmity
2 Replies
16526 Views
Last post May 09, 2008, 02:33:12 pm
by RoFus
3 Replies
7584 Views
Last post September 03, 2008, 07:51:15 am
by SMFHacks
6 Replies
1358 Views
Last post January 05, 2022, 02:23:16 pm
by Michael Vail
1 Replies
586 Views
Last post August 21, 2022, 09:20:49 am
by SMFHacks

+- Recent Topics

No thumbnails on new uploads by SMFHacks
March 27, 2024, 02:10:41 pm

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

an idea for new mod (( content type with different display )) by SMFHacks
February 27, 2024, 01:36:27 pm

[Mod] RSS Feed Poster by SMFHacks
February 27, 2024, 11:57:18 am

find duplicate pictures by fvlog19
February 14, 2024, 02:22:40 pm

Error uploading video. by SMFHacks
February 08, 2024, 02:04:16 pm

Gallery icon as last added image by fvlog19
February 01, 2024, 01:04:56 pm

Powered by EzPortal