Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4215
Latest: Proxitane
New This Month: 6
New This Week: 1
New Today: 1
Stats
Total Posts: 42796
Total Topics: 7456
Most Online Today: 34
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 45
Total: 45

Author Topic: SMG Gallery 2.5.4 and deleted photos error log messages  (Read 6516 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: 16235
    • 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: 16235
    • 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: 16235
    • 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
5761 Views
Last post March 10, 2007, 11:24:42 pm
by bsmity
2 Replies
7024 Views
Last post May 09, 2008, 02:33:12 pm
by RoFus
3 Replies
6735 Views
Last post September 03, 2008, 07:51:15 am
by SMFHacks
6 Replies
624 Views
Last post January 05, 2022, 02:23:16 pm
by Michael Vail
1 Replies
232 Views
Last post August 21, 2022, 09:20:49 am
by SMFHacks

+- Recent Topics

Using SMF's Built-in Search Algorithm by shuban
March 27, 2023, 09:15:10 am

Permissions query by davejo
March 26, 2023, 04:43:48 am

prettyurls - TroubleShooting.wiki by SMFHacks
March 25, 2023, 01:49:35 pm

Download Gallery Option by SMFHacks
March 23, 2023, 09:34:02 am

Lost attachments by pete
March 22, 2023, 10:24:17 am

Additional Permissions by mickjav
March 18, 2023, 05:21:23 am

[Mod]Discord Web Hooks by SMFHacks
March 17, 2023, 08:48:30 am

Site upgrade to 2.1 by SMFHacks
March 12, 2023, 08:51:19 am

Theme/CSS design wanted by mickjav
March 11, 2023, 12:10:11 pm

Category Images by Anmer
March 10, 2023, 06:20:04 am

Powered by EzPortal