Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

2 websites 1 database is possible?

+3 votes
asked Apr 27, 2017 in Q2A Core by sonsuz
I have two websites. I want to use a single database. Only the qa_options database will be different. Where do I change from website files?

2 Answers

+4 votes
answered Apr 27, 2017 by Scott

I'm not entirely sure of the purpose of what you're trying to achieve.

If you mean having two separate Q2A websites with different questions, you will want to look at the QA_MYSQL_USERS_PREFIX option in qa-config.php. On your second site, set a different table prefix but set the users prefix to the same as the first site. Example here.

If you mean both sharing the same users, questions, everything besides some options it's a bit more difficult. But in theory it could be done with a function override plugin for qa_load_options_results. That function takes the options from the database and sets them into the $qa_options_cache global variable. So in your override you can change whatever options you wish for your second site.

commented Apr 27, 2017 by sonsuz
moved Apr 28, 2017 by Scott
I did. It works fine. Only the options database is different.
commented Feb 10 by seen
i also changed the ^options and made a copy of it in database
now i have 2 websites in different language with one database
+2 votes
answered Apr 30, 2017 by ProThoughts
commented Apr 30, 2017 by sonsuz
Thank you for answering. but this solution just same users.
commented Apr 30, 2017 by ProThoughts
> Only the qa_options database will be different.
what is the purpose of this?
commented Apr 30, 2017 by sonsuz
i have to two domains. My first domain bought 10 years ago. http://www.simgesel.com but i buying new domain http://www.ruyadaruya.com . Same user, same posts, same answers . But xml or any mail script or any extensions have some problems,

sorry for my bad english