Author |
Message |
jimmo
Worker
![Worker Worker](modules/Forums/images/ranks/3stars.gif)
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined: Dec 08, 2005
Posts: 107
|
Posted:
Tue Dec 02, 2008 8:03 am |
|
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 |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
fkelly
Former Moderator in Good Standing
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY
|
Posted:
Tue Dec 02, 2008 8:20 am |
|
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. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Palbin
Site Admin
![](modules/Forums/images/avatars/Dilbert/Dilbert_-_Dogbert_King.gif)
Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania
|
Posted:
Tue Dec 02, 2008 10:31 am |
|
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. |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
jimmo
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Dec 02, 2008 10:49 am |
|
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)? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
fkelly
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Dec 02, 2008 10:52 am |
|
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. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
fkelly
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Dec 02, 2008 11:17 am |
|
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. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
jimmo
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Dec 02, 2008 1:30 pm |
|
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. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
fkelly
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Dec 02, 2008 8:07 pm |
|
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. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
jimmo
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Dec 03, 2008 5:35 am |
|
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. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
Site Admin/Owner
![](modules/Forums/images/avatars/45030c033f18773153cd2.gif)
Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Sat Dec 06, 2008 12:06 am |
|
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. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
jimmo
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Dec 06, 2008 5:46 am |
|
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. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|