jedigunz Posted June 29, 2013 Posted June 29, 2013 (edited) Two Mods im having problems with 1) Register With Facebook Connect v2 2)Advanced Referral System v2 so lets start with #1 im sure ive followed these steps correctly,.. but when i click the facebook login button on my website is says "" Modern-Earth Error Something went wrong with the facebook login! > Back "" so ive looked into the authenticate.php to find this line and see where the error is,. $uid = $facebook->getUser(); $uq=$db->query("SELECT userid FROM users WHERE facebookid=$uid && $uid>0"); if ($db->num_rows($uq)==0) { die("<h3>{$set['game_name']} Error</h3> Something went wrong with the facebook login!<br> <a href=login.php>> Back</a>"); } also the script did say it would show the button as register if you have not registered with your facebook account yet ,. and it shows as login :confused: any ideas of what i could do to resolve this ,.. ?? ,. Also im running an email validation modification but the files dont seem to clash in anyway so i dont see why that would be the problem but i could be wrong,. Edited June 29, 2013 by jedigunz forgot to mention Quote
KyleMassacre Posted June 29, 2013 Posted June 29, 2013 Well, Cronus would be the person to talk to like I told you in IRC. To me it looks like that it cannot find your facebook id, do you have it in there? So run this sql: update users set facebookid = your facebook id here where userid = 1; I am going to assume your id #1 on your own game Quote
jedigunz Posted June 29, 2013 Author Posted June 29, 2013 yeah im ID 1 and SQL doesnt run right :( cronus isnt replying and its been like almost a day Quote
KyleMassacre Posted June 29, 2013 Posted June 29, 2013 maybe you didnt run the sql right, what error did you get? Quote
jedigunz Posted June 29, 2013 Author Posted June 29, 2013 #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 'facebook id here where userid = 1' at line 1 and a day is long,... your living in a different world,.. im paying money for a product that isnt functioning ,.. just a day is a day to long loool Quote
Guest Posted June 29, 2013 Posted June 29, 2013 Common sense also is needed when using MCC >.<. "facebook id here" obviously isn't an ID, you have you put YOUR id there. Quote
jedigunz Posted June 29, 2013 Author Posted June 29, 2013 how would i put my id there,.. what you mean in the authenticate.php ,.. it connects to something else its not for editing otherwise everyone would have my ID lool Quote
Dominion Posted June 29, 2013 Posted June 29, 2013 how would i put my id there,.. what you mean in the authenticate.php ,.. it connects to something else its not for editing otherwise everyone would have my ID lool Kyle's query should have been edited before you run it. Not really sure why people would see your ID... Quote
KyleMassacre Posted June 29, 2013 Posted June 29, 2013 ok lets try this: update users set facebookid = <facebook id here> where userid = 1; ok so now in the sql above replace "<facebook id here>" with your actual facebook id number before you run the query. I dont have facebook so i dont know what the ids look like but it should look similar to this: update users set facebookid = 5284528343 where userid = 1; Quote
jedigunz Posted June 29, 2013 Author Posted June 29, 2013 right ,. this has worked with enterring the ID into the database manually on my admin account ,.. now ive made a fake facebook account to test out the register,. it goes through the stage of accepting the application but i think its not picking up the ID of the facebook account to enter into my database ,.. as i said my account now logs in using facebook ,. but new account will be having to enter into the database manually for their facebook ID ... hmm,., this is tricky,.. any suggestions ?? Quote
sniko Posted June 29, 2013 Posted June 29, 2013 Perhaps investigate here. I assume you have an app id, right? Quote
jedigunz Posted June 29, 2013 Author Posted June 29, 2013 yeah i have an app id ,.. im just lost with where i need to create the code to add into the users field,... Quote
Guest Posted June 29, 2013 Posted June 29, 2013 yeah i have an app id ,.. im just lost with where i need to create the code to add into the users field,... The code is grabbed from the facebook app Quote
jedigunz Posted June 29, 2013 Author Posted June 29, 2013 from which file and where ??? ,. as thats what the script isnt doing Quote
KyleMassacre Posted June 29, 2013 Posted June 29, 2013 what this mod does is it sends a request to facebook and grabs the players facebook id upon registration and automatically adds it into the users table via the facebook reg file that came with the mod. A user can not just have a facebook and log into the game until they have either registered using the facebook register on your game or added their id through preferences. this module is not smart enough to magically realize you have a facebook and automatically add it in with out doing a thing. If you follow the instructions that cronus gives you its really simple to install. Quote
jedigunz Posted June 29, 2013 Author Posted June 29, 2013 ive followed each step correctly and double checked each step,... preferences for a non connected account states Unable to load the registration form for this ID. You may have previously blocked this app on Facebook. Go to your Facebook privacy settings to unblock this app. (Error: Invalid 'client_id'.) when nothing has been blocked and the facebook application is open to the public ,. but ,.. the facebook button is not working to set-up a facebook registration which i thought that it did if you where not logged in to facebook or not already registered,. so using the fbregister.php actually does work to setup and login to an account,. :) ,.. ill have to add that somewhere for it to run smoothly ,... so how could i resolve this problem within the preferences ??? Quote
jedigunz Posted June 30, 2013 Author Posted June 30, 2013 so moving on to number #2 ,.. the advanced referral system ,.. now as i have an email validation mod installed ,.. ive had to place the code into the validate.php instead of the register.php ,.. so originally the validate part looks like this if($_POST['ref']) { $q=$db->query("SELECT * FROM users WHERE userid={$_POST['ref']}"); $r=$db->fetch_row($q); } $db->query("INSERT INTO users (username, login_name, userpass, level, money, crystals, donatordays, user_level, energy, maxenergy, will, maxwill, brave, maxbrave, hp, maxhp, location, gender, signedup, email, bankmoney, lastip, lastip_signup) VALUES( '{$username}', '{$username}', md5('{$_POST['password']}'), 1, $sm, 0, 0, 1, 12, 12, 100, 100, 5, 5, 100, 100, 1, '{$_POST['gender']}', unix_timestamp(), '{$_POST['email']}', -1, '$IP', '$IP')"); $i=$db->insert_id(); $db->query("INSERT INTO userstats VALUES($i, 10, 10, 10, 10, 10)"); if($_POST['ref']) { require "global_func.php"; $db->query("UPDATE users SET crystals=crystals+2 WHERE userid={$_POST['ref']}"); event_add($_POST['ref'],"For refering $username to the game, you have earnt 2 valuable crystals!",$c); $db->query("INSERT INTO referals VALUES('', {$_POST['ref']}, $i, unix_timestamp(),'{$r['lastip']}','$IP')"); } it asks me to place just one section of this with the following $db->query( "INSERT INTO `users` (`username`, `login_name`, `userpass`, `level`, `money`, `crystals`, `donatordays`, `user_level`, `energy`, `maxenergy`, `will`, `maxwill`, `brave`, `maxbrave`, `hp`, `maxhp`, `location`, `gender`, `signedup`, `email`, `bankmoney`, `lastip`, `lastip_signup`, `pass_salt`,`referrer_id`) VALUES('{$e_username}', '{$e_username}', '{$e_encpsw}', 1, $sm, 0, 0, 1, 12, 12, 100, 100, 5, 5, 100, 100, 1, '{$e_gender}', " . time() . ",'{$e_email}', -1, '$IP', '$IP', '{$e_salt}','{$_POST['ref']}')"); now im woundering is it because i havnt removed the bottom part of the script,.. it hasnt asked me to do this but it might be why if($_POST['ref']) { require "global_func.php"; $db->query("UPDATE users SET crystals=crystals+2 WHERE userid={$_POST['ref']}"); event_add($_POST['ref'],"For refering $username to the game, you have earnt 2 valuable crystals!",$c); $db->query("INSERT INTO referals VALUES('', {$_POST['ref']}, $i, unix_timestamp(),'{$r['lastip']}','$IP')"); } ive tried just adding the , '{$e_salt}','{$_POST['ref']}' instead of replacing the whole script which it requests but it doesnt want to know that either ,.. any suggestions ? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.