Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+3 votes
in Q2A Core by


Before using Question2Answer,


1. I want to know whether Q2A is compatible with Cloudflare ?

2. How can I get the original ip address of the posters if I use cloudflare ?


Pl let me know.


Thank you.

4 Answers

+2 votes
Isn't cloudflare just a CDN? In which case "compatibility" doesn't make sense. You can store a bunch of external files (CSS, JS, images) on the CDN and edit the theme to point to those files.
+1 vote
Yes, you can use cloudflare. but about the IP's I think you should use $_SERVER['HTTP_CF_CONNECTING_IP'] to get real IP of users.
moved by
Thanks Scott.

Thank you towhid.


Which 'File & Line' should I edit use $_SERVER['HTTP_CF_CONNECTING_IP']
The relevant function is qa_remote_ip_address() in qa-base.php. You can modify the code there, but you're better off writing a little plugin that overrides that function, so you won't have to keep applying your mod to future versions.
+1 vote
It works fine for me... nothing special is required beyond the cloudflare side 'stuff'.


see: http://generousgenealogists.com/question2answer/index.php
+5 votes

I wrote a small plugin to show the poster's real IP address when using Cloudflare.