Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RN v2.20.00 - All Issues
Author Message
jimmo
Worker
Worker


Joined: Dec 08, 2005
Posts: 107

PostPosted: Tue Dec 02, 2008 8:03 am Reply with quote

Hi All!

I'm running RN 2.2 and am trying to configure a guestbook forum so that anonymous visitors can post.

When someone tries to post they get the following error:

Code:


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 ' '', '1228224451', '57afced4', '0', '0', '0', '0')' at line 1

INSERT INTO nuke_bbposts (topic_id, forum_id, poster_id, post_username, post_time, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig) VALUES ('89', '27', , '', '1228224451', '57afced4', '0', '0', '0', '0')

Line : 273
File : functions_post.php


It looks like the the poster_id is empty, which would explain the syntax error. However, I cannot explain why it is not being set. All users have the right to post and answer posts in this forum, so I am at a loss to figure out why

I googled a little and found some references that indicated the ANONYMOUS user id could be incorrect, but what I found said it should use "1", like I have:

./includes/constants.php:define('ANONYMOUS', 1);

I would appreciate any help.

Regards,

jimmo
 
View user's profile Send private message
fkelly
Former Moderator in Good Standing


Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY

PostPosted: Tue Dec 02, 2008 8:20 am Reply with quote

If you have access to phpmyadmin take a look at your users table and see if you have a record for anonymous in there. userid should be 1 and username should be anonymous. I vaguely recall seeing problems where that record was not present.
 
View user's profile Send private message Visit poster's website
Palbin
Site Admin


Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Tue Dec 02, 2008 10:31 am Reply with quote

Even if the record was missing that woul dnot stop you from setting the ID to 1. There must be a problem with your code as to why the 1 is not making it into the insert statement.

_________________
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. 
View user's profile Send private message
jimmo
PostPosted: Tue Dec 02, 2008 10:49 am Reply with quote

Thanks to both of you for the quick replies. I checked the database (shame on me for not thinking about that) and I discovered that the the ID of Anonymous is -1, not 1. Seems to me that could be the problem. What is bothering me is that I have not changed anything. Did I miss a step during the install (many moons ago)?
 
fkelly
PostPosted: Tue Dec 02, 2008 10:52 am Reply with quote

I'm just not seeing where his define statement is going to set poster_id (in the values clause) to 1. If the user table doesn't have an anonymous record you are going to have problems throughout. I have seen this problem before so that's why I mentioned it. I should say I have seen similar problems.
 
fkelly
PostPosted: Tue Dec 02, 2008 11:17 am Reply with quote

I vaguely recall a discussion on this some time back but it could have been in our issue tracking system (internal). Don't have time to go searching right now. I'm not sure that setting the value to 1 is going to solve your problem since even a -1 being inserted would put something into the values clause where it is needed to avoid the SQL error.

You could try though.

The whole idea of letting anonymous post may not be a good one. You are likely to wind up with tons of spam. Not that it shouldn't work but you may solve one problem only to wind up with a worse one.
 
jimmo
PostPosted: Tue Dec 02, 2008 1:30 pm Reply with quote

What you are saying makes sense, assuming that the code is pulling the correct ID. I guess I will just have to back track it a bit to see where it is coming from.

I'm running the site for a local sports club and they want the ability to have guests post. I will definitely need to keep my eye on it for a while to see what level of spam we get. If it gets too bad I can always disable it. Another possibility would be to create a user "guest" and have them login to make it (slightly) more difficult.
 
fkelly
PostPosted: Tue Dec 02, 2008 8:07 pm Reply with quote

Jimmo ... I run a site for a local sports club too (a bicycle club near Albany, NY). Based on 4 to 5 years at this, anonymous posting is just an invitation to spam. It is really not such a big deal for users to fill out a screen or two and request a registration. They can easily get an email address through hotmail, gmail. yahoo and many other sites.
 
jimmo
PostPosted: Wed Dec 03, 2008 5:35 am Reply with quote

I guess I am trying too hard to please too many people (not the first time). The bottom line is the extra work that I would end up doing personally when (not if) the forum starts filling up with spam. I have already had to clean up spam in one registered-only forum and that was a pain.

I'm going to discuss this with the president/board and see what they think. Considering they have no clue about it and I am doing all the work, they typically support my decision.

I definitely grateful for the feedback.
 
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 17077

PostPosted: Sat Dec 06, 2008 12:06 am Reply with quote

jimmo wrote:
Thanks to both of you for the quick replies. I checked the database (shame on me for not thinking about that) and I discovered that the the ID of Anonymous is -1, not 1. Seems to me that could be the problem. What is bothering me is that I have not changed anything. Did I miss a step during the install (many moons ago)?


Older versions of nuke used to use -1. Newer versions including RavenNuke(tm) always use +1. It could be you are using a module/block/forum-mod that is still using the -1. But, not only does the Anonymous user have to have an id of +1, it must also be the first record in the users table.
 
View user's profile Send private message
jimmo
PostPosted: Sat Dec 06, 2008 5:46 am Reply with quote

Thanks for your reply!

I am not aware of any module/mod that I explicitely installed that would use the -1 ID. Many moons ago, I installed a version of the original Nuke before going to RN. Maybe it is left over from that. I guess I could simply change the ID directly in the database and see what happens. BTW the anonymous use is the first entry in the nuke_users tables.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RN v2.20.00 - All Issues

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©