Recently the company's website to the mobile version, because with the forum to have interoperability, to achieve the sharing of members, because of Discuz unfamiliar, at first consider is directly read Discuz user table, and then make judgments and other operations, found too complex, and security is not good.
A period of time before the integration of the forum and the Mall, the use of the book Ucenter for integration, it is convenient, not only can realize the integration of users, but also to achieve integration interchange and other operations, but this integration is already in both the system has been pre-set, more convenient. It is very convenient to apply Ucenter to any custom Web site outside, in fact Ucenter has this powerful ability
When I was in a test environment built in this machine, I discuz! X2 Release 20111221; ucenter 1.6.0 Release 20110501;
Communication with Ecshop has been achieved.
Now we download a Ucenter full package we see there's advanced,advanced in there. This is an excuse for the documentation, example this is an example, uc_client this is the client.
We're now adding new apps to the Ucenter.
Application Type Select other
option to fill in with your own case, where the main URL of the application is the root of your home directory, which is Http://localhost/root
After submission there will be Ucenter configuration information for the application
I copied the examples into the Uctest directory and copied the uc_client to the examples directory.
Modify the contents of a config.inc.php file
Here is the contents of my configuration file
- <?php
- Define (' Uc_connect ', ' MySQL '); //Connection ucenter: Mysql/null, default is empty when Fscoketopen ()
- //MySQL is a directly connected database, for efficiency, it is recommended to use MySQL
- Database dependent (when MySQL is connected and no uc_dblink is set, the following variables need to be configured)
- Define (' uc_dbhost ', ' localhost '); //Ucenter Database host
- Define (' Uc_dbuser ', ' root '); //Ucenter database user name
- Define (' UC_DBPW ', ' 123456 '); //Ucenter database password
- Define (' uc_dbname ', ' discuz '); //Ucenter database name
- Define (' Uc_dbcharset ', ' GBK '); //Ucenter database Character set
- Define (' uc_dbtablepre ', ' discuz '. Pre_ucenter_ '); //Ucenter database table prefix
- Communication-related
- Define (' Uc_key ', ' example2 '); //Communication key with Ucenter, to be consistent with Ucenter
- Define (' Uc_api ', ' http://localhost/discuz/uc_server '); Ucenter URL address, which is dependent on this constant when calling the Avatar
- Define (' Uc_charset ', ' GBK '); //Ucenter's character set
- Define (' uc_ip ', '); ///Ucenter IP, set this value when Uc_connect is not in MySQL mode and the current application server resolves a domain name problem
- Define (' Uc_appid ', 3); //ID of the current app
- Application database connection parameters used by ucexample_2.php
- $dbhost = ' localhost '; //Database server
- $dbuser = ' root '; //database user name
- $DBPW = ' 123456 '; //Database password
- $dbname = ' ps_example '; //Database name
- $pconnect = 0; //Database Persistent connection 0 = off, 1 = open
- $tablepre = ' Example_ '; //table name prefix, the same database installation of multiple forums please modify here
- $dbcharset = ' GBK '; //MySQL character set, optional ' GBK ', ' big5 ', ' utf8 ', ' latin1 ', left blank for set according to forum character set
- Sync Login Cookie Settings
- $cookiedomain = "; //Cookie scope
- $cookiepath = '/'; //Cookie action path
- ?>
Many of these information if not filled, can be re-ucenter the application's ucenter configuration information:
Found in,
This will show ucenter the corresponding application communication is successful, the specific interface how to use see Example and document instructions
Ucenter integration of external sites, to achieve login and other operations