Discuz! NT3.6 integration with the website (Operating User Information) Solution

Source: Internet
Author: User

Because the website needs to add a forum, Discuz is used! NT3.6.

Unfortunately, the official forum has been closed. Only version 3.6 has the source code, and Version 3.9 does not have the source code, which is difficult to operate ,:

Http://download.comsenz.com/DiscuzNT/3.6/

 

First, I need to solve the following scenarios:

The main site http://h31bt.com needs to call the Forum BBS user information, rather than separately establish a set of user information, the Forum domain name is bbs.h31bt.com, two are not in the same file directory of the host, so we need to solve the cross-origin problem,

I would like to record how to solve this problem.

 

The following is a solution of mine, which does not use third-party sdks.

1. Place the downloaded and compiled forum in the Forum folder on the server and access it with the bbs. domain name.

2. Operate the ASP.net code of the main site and introduce four DLL files to the project:

 Discuz.Forum;

Copy the corresponding DLL to the BIN directory of the website and add the reference;

 

3. Some code used to obtain user information:

            Discuz.Config.GeneralConfigInfo config === (userid == -=== Users.GetUserExtCredits(userid, );

The user's information is read from the local COOKIES. If no information is found, userid returns-1, which is directly transferred to the Forum for user login.

 

4. Update the user's credit information and compare the user's edited content. If you want to reward the user for some points, you need to perform the following operations:

UserInfo us = uss = Users.GetUserExtCredits(userid, , );

The UserInfo user information class allows you to operate on user points, levels, and other information.

 

5. The above Code also requires some content to ensure the success of cross-domain COOKIES;

Set config \ general. config to <CookieDomain/> <CookieDomain> domainname. XXX </CookieDomain>.

6. Copy the config folder under the Forum and the DNT. config file to the directory folder of the main site;

 

7. Because the source code is downloaded using the. net4.0 framework compiled by VS2010, the management background reports insecure HTML statements and directly fails. The changes must be made:

Force requestValidationMode = "2.0" in web. config under the Forum"

 

 

Summary:

1. Currently, the main site can obtain the user credit information and operate related user classes to enable user logon and registration;

2. Because 3.9 of the original code does not exist, it is a pity that the QQ integrated login code in it cannot be used;

Problems:

1. because the server is located in the United States, the time difference is 13 hours. After a user is registered, the main site fails to obtain the user information, and 1 is returned. However, after 13 hours, you can obtain the user information.

Whether the source code has time difference needs to be analyzed;

2. if the forum is set up on another server in the future, you need to consider how to call it. If the database master site cannot be accessed, you need to consider other methods.

If you have any experience in this area, I would like to discuss and exchange them here. Thank you.

 

 

 

 

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.