Free Press Release Submission




MB Publishing Webmaster Resource ::
 Forum FAQForum FAQ   SearchSearch   UsergroupsUsergroups   ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin 


User Error

 
Post new topic   Reply to topic    MB Publishing Webmaster Resource Forum Index -> Php Nuke Version 6.5
View previous topic :: View next topic  
Author Message
Colocation
Site Admin
Site Admin


Joined: Jan 07, 2004
Posts: 404

PostPosted: Thu Nov 11, 2004 7:58 am    Post subject: User Error Reply with quote

When logged out of a particular nuke site this error appears for a forum topic.

Code:
Could not obtain user vote data for this topic

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax near '' at line 4

SELECT vote_id FROM nuke_bbvote_voters WHERE vote_id = 15 AND vote_user_id =

Line : 744
File : /usr/www/virtual/widjets/www.widjets.com/modules/Forums/viewtopic.php


When logged in there is no error.
Back to top
View users profile Send private message Visit posters website Yahoo Messenger
Humpa
Site Admin
Site Admin


Joined: Feb 05, 2004
Posts: 23

PostPosted: Thu Nov 11, 2004 10:47 am    Post subject: Reply with quote

Turn off debug mode.

Or, find the line mentioned in the error with "AND vote_user_id = "
Find that and put single quotes around the variable after "AND vote_user_id = "
Back to top
View users profile Send private message Visit posters website
Colocation
Site Admin
Site Admin


Joined: Jan 07, 2004
Posts: 404

PostPosted: Thu Nov 11, 2004 11:05 am    Post subject: Constants Reply with quote

I found that the DEBUG mode is switched off in /includes/constants.php

That solved the error which now reads:

Quote:
Could not obtain user vote data for this topic


Which presumably means that the poll is a registered user one only?
Back to top
View users profile Send private message Visit posters website Yahoo Messenger
Colocation
Site Admin
Site Admin


Joined: Jan 07, 2004
Posts: 404

PostPosted: Fri Nov 12, 2004 10:41 am    Post subject: Code Reply with quote

I found this:

Code:
      $sql = "SELECT vote_id
         FROM " . VOTE_USERS_TABLE . "
         WHERE vote_id = $vote_id
            AND vote_user_id = " . $userdata['user_id'];
      if ( !($result = $db->sql_query($sql)) )
      {
         message_die(GENERAL_ERROR, "Could not obtain user vote data for this topic", '', __LINE__, __FILE__, $sql);
      }


Is there not single quotes already?

Surely the poll needs to be visable regardless of being logged in or out?
Back to top
View users profile Send private message Visit posters website Yahoo Messenger
Humpa
Site Admin
Site Admin


Joined: Feb 05, 2004
Posts: 23

PostPosted: Fri Nov 12, 2004 11:06 am    Post subject: Reply with quote

I have no idea as to the actual purpose of this piece of code. Not sure at all about what the real problem is. I am not familar with the Forums code, so I do not know what this code is actually doing.

Adding the single quotes is not the solution - at least I assume it is not the solution. But, adding the single quotes will get rid of this particular error. I don't know if the code is functioning correctly, for I dont know what it is supposed to do in the first place.

But, to add the single quotes you have to know some php code or you will not know how to add in the single quotes.
Here is that bit of code with single quotes inserted:
Code:
$sql = "SELECT vote_id
         FROM " . VOTE_USERS_TABLE . "
         WHERE vote_id = $vote_id
            AND vote_user_id = '" . $userdata['user_id']."'";
Back to top
View users profile Send private message Visit posters website
Colocation
Site Admin
Site Admin


Joined: Jan 07, 2004
Posts: 404

PostPosted: Fri Nov 12, 2004 11:23 am    Post subject: Working Reply with quote

That fixed the problem.

The problem was this.

In the forums where a user had set up a poll, the above error was being displayed. Essentially, restricting access to a guest user. The poll was visable to a logged-in user however.

Thanks, works great now.
Back to top
View users profile Send private message Visit posters website Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    MB Publishing Webmaster Resource Forum Index -> Php Nuke Version 6.5 All times are GMT + 1 Hour
Page 1 of 1

 

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
Home | News Feeds | Release Archive | Web Marketing | Weight Loss | Publish Your Links | Press Release Topics | Free Downloads | Press FAQs | AvantGO | Amazon Store
Webmaster Forums | Search Releases | Press Topics | Feedback | Submit Press Release | Webmaster Surveys | Recommend | Top | Account | PM | Prweb | Free Link Submission | Add Downloads | New Media | Audio School | TOS

The comments are property of their posters, all the rest 2004 - 2008 by MB
Audana Ltd
You can syndicate our news using the file backend.php
Web site engine's code is Copyright © 2003 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 1.205 Seconds. -