Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4257
Latest: Alex998.
New This Month: 1
New This Week: 0
New Today: 0
Stats
Total Posts: 43293
Total Topics: 7522
Most Online Today: 118
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 86
Total: 86

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

+- Recent Topics

Rate own images by fvlog19
April 11, 2024, 10:56:53 am

Tidy Child Boards on 2.1.4 by SMFHacks
April 04, 2024, 03:54:12 pm

Problems SMF 2.0.19 > 2.1.4 SMF Gallery Pro - Recents Images to overall header by Michel68
March 30, 2024, 12:41:08 pm

Can't DROP 'id_member'; check that column/key exists Datei: by SMFHacks
March 30, 2024, 11:58:20 am

No thumbnails on new uploads by Tonyvic
March 29, 2024, 06:26:18 am

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

Powered by EzPortal