TalkPTC

The MarketPlace => Mods and Addons => Aurora Free Addons => Topic started by: Ayman on October 14, 2011, 12:58:36 PM

Title: How To Integrate SMF Forum With Your PTC Site ?
Post by: Ayman on October 14, 2011, 12:58:36 PM
- Original Poster of this idea is our members Omega C. (http://www.talkptc.com/index.php?action=profile;u=2012) and rights are reserved to him
- This is for aurora based sites but idea can be modified for other sites too
- The integration works only on SMF 1.1.x series as the current api is for it , for SMF 2 there's no official api yet , but there's some modified one i'm testing now
- Here are the details :

1) Download SMF api file from here : http://download.simplemachines.org/?tools
file named : SMF 1.1.x API

2) Upload it to the directory called forum in your site cpanel where you have the SMF forum installed

3) Find this file : members/join.php ( take a backup copy of it first )
find this line :
Code: [Select]
$sql=$Db1->query("UPDATE stats SET new_members=new_members+1 WHERE date='$today_date'");

add after it :
Code: [Select]
// smf api   
$username = $_POST['uUsername'];
$email = $_POST['uEmail'];   
$passwd = $_POST['uPassword'];
require_once("forum/smf_1-1_api.php");
         smf_registerMember($username, $email, $passwd, $extra_fields = array(), $theme_options = array());   
// api end         

4) Find this file : members/login.php ( take a backup copy of it first )
find this line :
Code: [Select]
header("Location: setcookies.php?".iif(isset($returnTo),"view=$returnTo","view=account&ac=main")."".iif("$id","&id=$id").iif($ptype,"&ptype=$ptype").iif($step,"&step=$step")."".iif(isset($ac),"&ac=$ac")."&sid=$sessid&sid2=$sessid2&siduid=$userid");

add after it :
Code: [Select]
// smf api               
include_once ("forum/smf_1-1_api.php");
$cookiename = $smf_settings['cookiename'];
$username = $form_user;
$password = $form_pwd;
unset($_COOKIE[$cookiename]);
smf_setLoginCookie(3600, $username, $password, $encrypted = false);
smf_authenticateUser();               
// smf api end     


5) find this file : public_html/logout.php ( it will be in home directory , back it up  )
find the following line :
Code: [Select]
$Db1->sql_close();

add after it :
Code: [Select]
include_once ("forum/smf_1-1_api.php");
$cookiename = $smf_settings['cookiename'];
$username = $_POST['username'];
$password = $_POST['password'];
setcookie($cookiename);
smf_setLoginCookie(3600, $username, $password, $encrypted = false);
smf_authenticateUser();

- That's all now the forum is integrated to your site  :)
Title: Re: How To Integrate SMF Forum With Your PTC Site ?
Post by: ammad on April 17, 2013, 10:09:18 AM
Thanks and after adding it how to integrate database members join site can automatic login to forum?  :thinking:
Title: Re: How To Integrate SMF Forum With Your PTC Site ?
Post by: Ayman on April 21, 2013, 07:44:55 AM
Thanks and after adding it how to integrate database members join site can automatic login to forum?  :thinking:

Isn't that the idea from integrated forum ?
So with this members will be registered , logged in or out automatically
Title: Re: How To Integrate SMF Forum With Your PTC Site ?
Post by: emvspeed on April 21, 2013, 08:02:28 AM

is there any cost of it such as maintenance in SMF forum?
Title: Re: How To Integrate SMF Forum With Your PTC Site ?
Post by: ammad on April 21, 2013, 12:19:13 PM
Doesnt seem its working members complained login page dissapeared you couldnt login luckily i backedup files dont know why it happnened!
Also logout page showed this
Warning: include_once(forum/smf_1-1_api.php) [function.include-once]: failed to open stream: No such file or directory in /home/upospbut/public_html/clixpalace.com/logout.php on line 18

Warning: include_once() [function.include]: Failed opening 'forum/smf_1-1_api.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/upospbut/public_html/clixpalace.com/logout.php on line 18

Warning: Cannot modify header information - headers already sent by (output started at /home/upospbut/public_html/clixpalace.com/logout.php:18) in /home/upospbut/public_html/clixpalace.com/logout.php on line 22

Fatal error: Call to undefined function smf_setLoginCookie() in /home/upospbut/public_html/clixpalace.com/logout.php on line 23
Title: Re: How To Integrate SMF Forum With Your PTC Site ?
Post by: Ayman on April 23, 2013, 08:01:01 AM
Hello , are you sure you uploaded smf api inside your forum folder ? also this is for smf 1.1x wont work on smf 2 versions as mentioned in topic
Title: Re: How To Integrate SMF Forum With Your PTC Site ?
Post by: ammad on April 24, 2013, 06:55:11 PM
Hello , are you sure you uploaded smf api inside your forum folder ? also this is for smf 1.1x wont work on smf 2 versions as mentioned in topic

How can i install SMF 1.1.x by Softaculous
 
Title: Re: How To Integrate SMF Forum With Your PTC Site ?
Post by: Ayman on April 25, 2013, 08:29:20 AM
How can i install SMF 1.1.x by Softaculous

You can't install it from there , It needs to be manually installed
Download it from here : http://download.simplemachines.org/index.php?archive;version=67 ( SMF 1.1.16 - install ) then upload it to your forum directory and remove all previous forum related files , Then do the install either on new database or current smf database
Title: Re: How To Integrate SMF Forum With Your PTC Site ?
Post by: Ayman on April 25, 2013, 08:30:28 AM
 is there any cost of it such as maintenance in SMF forum?

Integration guide is free as i posted it above , You would only pay if you asked a coder to do it for you that's all 2 or 3$ max
Title: Re: How To Integrate SMF Forum With Your PTC Site ?
Post by: ammad on April 25, 2013, 03:54:22 PM
Ok i have installed it !
I have some questions what about members who joined before this forum was created they wont have account in forum ?
Title: Re: How To Integrate SMF Forum With Your PTC Site ?
Post by: Ayman on April 27, 2013, 08:50:30 AM
- Nop in the free integration version members who joined before will not be added to the database , they will need to register in forum
Title: Re: How To Integrate SMF Forum With Your PTC Site ?
Post by: mugensiz on January 21, 2014, 02:08:16 PM
Work great for me
easy to install
Title: Re: How To Integrate SMF Forum With Your PTC Site ?
Post by: asifshabir on February 28, 2014, 09:14:27 PM
can the same be done for phpbb forum ..
could u pls provide us the modifications for phpbb fourm.

thanks
Title: Re: How To Integrate SMF Forum With Your PTC Site ?
Post by: asifshabir on April 10, 2014, 02:01:13 PM
I have installed the forum . works gr8 .

New users can easily navigate into forum ,but existing users can't, How to copy old user data into forum table.

Thanks for your support
Title: Re: How To Integrate SMF Forum With Your PTC Site ?
Post by: Ayman on April 10, 2014, 08:05:36 PM
I have installed the forum . works gr8 .

New users can easily navigate into forum ,but existing users can't, How to copy old user data into forum table.

Thanks for your support

Hello , The free version of the forum doesn't support registering for old members , This feature is part of SDR 3.x versions or the next SDR 2E

Regards
ayman
Title: Re: How To Integrate SMF Forum With Your PTC Site ?
Post by: asifshabir on April 25, 2014, 08:11:25 PM
I have installed smf forum with my website. it works fine. But the problem is external spammers get registered to the forum and spam the forum. How can i disable external registration/ so that only site members can use the forum.

Thanks for help
Title: Re: How To Integrate SMF Forum With Your PTC Site ?
Post by: Aurora on April 26, 2014, 09:20:22 PM
you can disable registration but that means your members won't be able to register either so make sure all the members that joined before you integrated the forum already have an account

Admin > Members > Registration > Settings > Change method of registration for new members to Registration Disabled


Title: Re: How To Integrate SMF Forum With Your PTC Site ?
Post by: asifshabir on April 27, 2014, 12:09:51 AM
i have exported all the users to forum db. only they need to change the password to access the forum.

will the disable registration work in this scenario ?

thanks