Home :: Forums :: Register :: Sign In :: Links :: Downloads :: Shop
You are not signed in. Please sign in. If you have not registered, please click here.

Rating system Help please

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb   More...
#1Sat May 22, 2004 9:49 am   Rating system Help please
stealthusa
CZ Addict
stealthusa has been a member for over 4 year's 4 Year Member
usa.gif ohio.gif
Occupation: Self-Employed
Age: 42
Fav. Sports Team: Cowboys
Website: www.simplifynuke.com
Status: Offline
Joined: Jan 23, 2004
0.19 posts per day
Posts: 353
Points: 14,459
 Yahoo Messenger  ICQ Number
hello i just installed this Rating system and looks like everything is ok but when you click on a users name to go to there profile you get this message

Could not obtain rating information

DEBUG MODE

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 'AND p.post_id = r.post_id LIMIT 1' at line 1

SELECT p.post_id FROM nuke_bbposts p, nuke_bbrating r WHERE p.poster_id = AND p.post_id = r.post_id LIMIT 1

Line : 344
File : /home/stealths/public_html/html/includes/usercp_viewprofile.php

so here is the code they said to add to the usercp_viewprofile.php


define('RATING_PATH', $phpbb_root_path.'mods/rating/');
include (RATING_PATH.'functions_rating.'.$phpEx);
$rating_config = get_rating_config('1');
if ( $rating_config[1] == 1 )
{
   // Rated posts by this user
   $sql = 'SELECT p.post_id FROM '.POSTS_TABLE.' p, '.RATING_TABLE.' r WHERE p.poster_id = '.$profiledata['user_id'].' AND p.post_id = r.post_id LIMIT 1';
   if ( !($result = $db->sql_query($sql)) )
   {
      message_die(GENERAL_ERROR, 'Could not obtain rating information', '', __LINE__, __FILE__, $sql);
   }
   if ( $row = $db->sql_fetchrow($result) )
   {
      $u_link = append_sid('ratings.'.$phpEx.'?type=p&postedby='.$profiledata['user_id']);
      $l_link = sprintf($lang['Rated_posts_by'], $profiledata['username']);
      $template->assign_block_vars('rating', array(
         "L_LINK" => $l_link,
         "U_LINK" => $u_link
         )
      );
   }

   // If not anonymous
   if ( $profiledata['rating_status'] != 1 )
   {
      // Ratings by this user
      $sql = 'SELECT user_id FROM '.RATING_TABLE.' WHERE user_id = '.$profiledata['user_id'].' LIMIT 1';
      if ( !($result = $db->sql_query($sql)) )
      {
         message_die(GENERAL_ERROR, 'Could not obtain rating information', '', __LINE__, __FILE__, $sql);
      }
      if ( $row = $db->sql_fetchrow($result) )
      {
         $u_link = append_sid('ratings.'.$phpEx.'?type=p&ratedby='.$profiledata['user_id']);
         $l_link = sprintf($lang['Ratings_by'], $profiledata['username']);
         $template->assign_block_vars('rating', array(
            "L_LINK" => $l_link,
            "U_LINK" => $u_link
            )
         );
      }
   }
}




_________________
Image
Back to top Reply with quote
#2Sun May 23, 2004 2:46 pm   re: Rating system Help please
Taut
PayPal Donation
Asst. Admin
 Codezwiz Site Donator
Taut has been a member for over 5 year's 5 Year Member
usa.gif california.gif
Occupation: Entrepreneur
Fav. Sports Team: SF Giants
Website: admins101.com
Status: Offline
Joined: May 27, 2003
2.68 posts per day
Posts: 5504
Points: 481,695
   
re-upload your table sql...it may just have been corrupted during the transfer




_________________
My life is spent in one long effort to escape from the commonplace of existence.
Back to top Reply with quote
#3Sun May 23, 2004 4:11 pm   
stealthusa
CZ Addict
stealthusa has been a member for over 4 year's 4 Year Member
usa.gif ohio.gif
Occupation: Self-Employed
Age: 42
Fav. Sports Team: Cowboys
Website: www.simplifynuke.com
Status: Offline
Joined: Jan 23, 2004
0.19 posts per day
Posts: 353
Points: 14,459
 Yahoo Messenger  ICQ Number
ok that worked the only thing is i don't see anything to do anything with LOL




_________________
Image
Back to top Reply with quote
#4Sun May 23, 2004 6:16 pm   re: Rating system Help please
Taut
PayPal Donation
Asst. Admin
 Codezwiz Site Donator
Taut has been a member for over 5 year's 5 Year Member
usa.gif california.gif
Occupation: Entrepreneur
Fav. Sports Team: SF Giants
Website: admins101.com
Status: Offline
Joined: May 27, 2003
2.68 posts per day
Posts: 5504
Points: 481,695
   
have you read what the mod actually does before adding it to your site?




_________________
My life is spent in one long effort to escape from the commonplace of existence.
Back to top Reply with quote
#5Sun May 23, 2004 6:33 pm   
stealthusa
CZ Addict
stealthusa has been a member for over 4 year's 4 Year Member
usa.gif ohio.gif
Occupation: Self-Employed
Age: 42
Fav. Sports Team: Cowboys
Website: www.simplifynuke.com
Status: Offline
Joined: Jan 23, 2004
0.19 posts per day
Posts: 353
Points: 14,459
 Yahoo Messenger  ICQ Number
yes it is to let your members vote for topics and post.




_________________
Image
Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb   More...
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
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 cannot attach files in this forum
You cannot download files in this forum