Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
in Q2A Core by
I would like to disable facebook login for some specific addresses. I know how to read the ip addresses and how to compare them. but how to disable the facebook login in the code is what i know. Any tips?
Q2A version: 1.5.4

1 Answer

0 votes
selected by
Best answer
What you can do is in facebook plugin qa-facebook-layer.php file

you can write your condition either with

if (strlen(qa_opt('facebook_app_id')) && strlen(qa_opt('facebook_app_secret'))) condition or wrap this condition with your condition
Thanks, but how then can i disable the facebook plugin? I know the condition, but I am looking for something like this:
if (...)

what is the right statement to replace $facebookEnabled=false ?
You see, I am not trying to see if facebook login is disabled, i wanna make it disabled upon some known condition.
Again I would say refer my answer with your condition.
Got it now, thank you.
You are welcome
from what I understood for such a combination of conditions:
if (strlen(qa_opt('facebook_app_id')) && strlen(qa_opt('facebook_app_secret')) && 10<0){
facebook login should not be displayed(as 10 is not less than 0), but it still does! I made that change exactly where you mentioned in the qa-facebook-layer.php file, but it does not help!
But what is 10 and 0 ? I mean from where you are getting the value? Value must be come from the system to determine whether it is available or not.
10<0 It is a false statement which makes the entire statement false. you say if the condition is false the facebook login won't show, isnt it? that's not true! besides why waste time on chit chat? if you know the answer why dont you be generous and share it with us in more clear way? if you dont that's understandable