1. Question2Answer DLE INTEGRATION

Question2Answer DLE INTEGRATION

  |   6
QUESTION2ANSWERS is an advanced Q&A script ( open source = FREE )
In this tutorial i'll describe how to use it with dle users database for flawless integration!
and the needed files for it.
SEE:
http://www.question2answer.org
First of all follow the steps on how to install http://www.question2answer.org from the website.
STEP 1:
in qa-config.php make sure to enable

define('QA_EXTERNAL_USERS', true);

and continue with the installation as in the tutorial.
STEP 2:
rename qa-external-example folder to qa-external and replace qa-external-users.php with the one attached to this post witch is modified to work with dle.
open up qa-external-users.php in a text editor and
FIND:
include_once('/home/yourwebsite/public_html/engine/api/api.class.php');

REPLACE WITH:
change the path to the full path of your dle intallation!
the example above is the path for linux server witch is most common
else
if on windows it will look something like
include_once('c:\\path\\to\\mysite\\engine\\api\\api.class.php');

ATTENTION!
I have not tested it on windows but should be no different is just a question of giving the right path!

FIND:

http://your.domain.com/noavatar.png

replace with url of q&a and make put the noavatar.png or other image in the root of q&a installation.

RECOMMENDATION!
install Q2A in a subdomain of your dle installation for example:
DLE = http://www.dle-installation.com;
Q2A = http://q2a.dle-installation.com;

that's about it now you can run it.
Login to dle and then visit the q&a installation it will automatically log you in as admin and any registered user as user!

ADVANCED SETTINGS AUTOMATIC REDIRECT (best option):
Using the above method is nice but when users want to login to q&a they will be redirected to dle to login, after that they will have to go again manually to the url of Q&A witch is not ideal so a couple of tweaks to some dle files will get them redirected automatically.
ADVICE! try the whole thing first before making the following changes!
when the user clicks the login link in q&a the parameter
do=question2answer
gets passed to dle with this we can capture it and redirect users automatically after successful login.
ADVANCED INSTALLATION
STEP 1:
open /engine/init.php
FIND:
$tpl->set( '{all-pm}', $member_id['pm_all'] );

AFTER ADD

if($do == 'question2answer') $tpl->set( '{question2answer}', '<input name="question2answer" type="hidden" id="question2answer" value="question2answer" />' );
else $tpl->set( '{question2answer}', '');

STEP 2:
open /mytheme/login.tpl (the following is based on the default template and changes slightly on custom templates)
FIND:
<li><a href="{stats-link}">Statistics</a></li>

AFTER ADD:
<li><a href="http://q2a.dle-installation.com ">Question2Answer</a></li>

little TIP use a SUBDOMAIN. eg http://q2a.dle-installation.com (this is how i installed it)
FIND:
 <input name="login" type="hidden" id="login" value="submit" /><br />

ABOVE add:
{question2answer}

STEP 3:
open engine/modules/sitelogin.php
FIND:
?>

ABOVE ADD:

if($is_logged AND isset($_POST['question2answer'])){
$question2answer = "http://q2a.dle-installation.com";
@header ( 'Location: ' . $question2answer );
}

change to your domain name for q&a

That's it!
tested on 9.6 sure will work with several versions below.

Hope someone finds this post useful!
[attachment=240]

Login Required!Only registered users can download files. Please register or Login
Dear visitor, you are browsing our website as Guest.
We strongly recommend you to register and login to view hidden contents.

Details

+5

Comments 6

jopaulmj
jopaulmj
V.I.P.
Commented By jopaulmj on June 26, 2012 (12:49 pm)
Interesting need demo its a request pm me
5 26Forum topics : 0Forum replies : 0Forum likes : 0
TMPretox
TMPretox
Members
Commented By TMPretox on June 26, 2012 (5:07 pm)
http://www.question2answer.org/qa/ Demo
N/A 4Forum topics : 4Forum replies : 6Forum likes : 0
steven
steven
V.I.P.
Commented By steven on June 27, 2012 (8:48 am)
Just look at the website stated above, there more themes available then the standard one. PS fb login will not work
3 22Forum topics : 6Forum replies : 123Forum likes : 5

<?php
echo base64_decode("WW91IGdvdCBtb25leT8=");
CrasHandBurN
Commented By CrasHandBurN on June 30, 2012 (6:40 pm)
There is a ready module _http://rezer.net/module/proposal/download.html and works perfectly with DLE 9.6
N/A 3Forum topics : 0Forum replies : 1Forum likes : 0

<?php
echo base64_decode("Um9jayduJ3JvbGxh");
cereal005
cereal005
Members
Commented By cereal005 on March 23, 2014 (1:25 am)
Arhive is broken! I can't download it
N/A 1Forum topics : 0Forum replies : 0Forum likes : 0
noobos
noobos
DLE TEAM
Commented By noobos on April 7, 2014 (10:11 am)
The problem was fixed...

Thank you for report and we apologize taking too long to response
16 302Forum topics : 12Forum replies : 1036Forum likes : 170
Information!Would you like to leave your comment? Please Login to your account to leave comments. Don't have an account? You can create a free account now.