Website integration discuz! NT Forum, website users and Forum users should be consistent and synchronized. (3) [part from Bub sharing, tech.bubufx.com]

Source: Internet
Author: User

Website members log on to the Forum synchronously, and change the password for Synchronous logon. However, after logging on to the Forum, the website also synchronizes the logon status, which requires the website to know the cookie information of the Forum, and make corresponding modifications to achieve this.

 

Specifically, in the forum

Forum-global-registration and access control

In the "authentication cookie domain" text box, enter ".bubufx.com"

 

In this way, the cookie after the Forum login is detected as follows:

 
Userid = 1 Password = login % 3d % 3 dtpp = 0ppp = 0 pmsound = 0 invisible = 0 Referer = index. aspxsigstatus = 0 expires = 1440 userinfotips =

Based on these cookies, you can log on to the Forum on the website page and synchronize them to the website.

If (! Cm. islogin () // when the Website member is not logged on, determine whether the forum member has logged on. If the Member is logged on, the member will be logged on, set this member to the logon status {try {If (request. cookies ["DNT"]! = NULL & request. Cookies ["DNT"]. Values ["userid"]! = NULL) {string uid = request. cookies ["DNT"]. values ["userid"]. tostring (); string cookiedomain = ".qzcd.net"; // your domain name discuzsession DS = websamplehelper. discuzsessionhelper. getsession (); discuz. toolkit. user user = NULL; user = Ds. getuserinfo (convert. toint32 (UID); If (user! = NULL) {// set the user name to the logon success status of [user. Username] }}catch {}}

 

In this way, website login synchronization, registration user synchronization, password modification synchronization, and Forum login synchronization are all implemented to the website. Then, register a user in the Forum and change the password, you can perform a redirection to synchronize data with the website. When registering a new user in the forum, you will jump to the website registration user interface. The password change page in the Forum will jump to the website's password change page, as shown below:

 

Jump when registering a user. In the register. aspx file, add

 
// Add later, jump to the master site to register templatebuilder. append ("<script language = \" javascript \ "type = \" text/JavaScript \ "> window. top. location. href = 'HTTP: // www.bubufx.com/reg.aspx'; </"); templatebuilder. append ("script> ");//

About

 
Base. oninit (E); templatebuilder. capacity = 220000;

CodeLater.

 

Jump when changing the password. In the usercpnewpassword. aspx file, add

// Add later, jump to the master site to register templatebuilder. append ("<script language = \" javascript \ "type = \" text/JavaScript \ "> window. top. location. href = 'HTTP: // www.bubufx.com/member/memberpass.aspx'; </"); templatebuilder. append ("script> ");//

About

 
Base. oninit (E); templatebuilder. capacity = 220000;

After the code.

 

So far, it is a complete solution to synchronize Forum members.

Bu shares original technologies. For more information, see:Http://tech.bubufx.com/infodetail_26.html

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.