Coding:How to fetch user profile data with SSI.php from a SMF forum database Coding: Kā ielādēt lietotāja profila datus ar SSI.php no SMF foruma datubāze
Posted on 20. Posted on 20. Jul, 2009 by Dragos in Coding , MySQL , PHP Jūl, 2009 by Dragos in Kodēšana, MySQL, PHP
Even though SMF offers a way to integrate their forum into any website, they do not provide enough information on how to do some basic tasks, eg fetching a member's profile details from the database. Kaut SMF piedāvā veidu, kā integrēt savu forumu, kādā mājas lapā, tie nesniedz pietiekami daudz informācijas par to, kā darīt kādu uzdevumu izpilde, piemēram, fetching dalībnieka profils informācija no datu bāzes. Fortunately, Netbeans has a very helpful feature, the code Navigator which shows an instant preview of all functions available in an open file. Par laimi, NetBeans ir ļoti noderīgs līdzeklis, kods Navigator kas liecina tūlītējo priekšskatījumu visām funkcijām, kas pieejamas atvērt failu. So finding the function which does our job was pretty easy (though I couldn't find it on SMF's website). Tātad secinājums funkcija, kas nav mūsu uzdevums bija diezgan viegli (lai gan es nevarēju atrast to SMF tīmekļa vietnē).
Anyway, to fetch data from the SMF database, using SMF's functions, we need to include SSI.php into our website. Anyway, nolasīt datus no SMF datu bāzē, izmantojot SMF funkcijas, mums ir nepieciešams iekļaut SSI.php mūsu mājas lapā.
include_once('path/to/your/forum/SSI.php'); // replace path/to/your/forum with your path to the SMF forum include_once ( "path / to / jūsu / Forums / SSI.php '); / / Replace ceļš / uz / jūsu / forumu ar savu ceļu, lai SMF forumu $userData=ssi_fetchMember(1,''); //ssi_fetchMember() takes two parameters: first: the member id as an integer or more than one id passed in an array; second parameter: output method as string: 'echo' or ''; $ lietotāju datu = ssi_fetchMember (1 ,''); / / ssi_fetchMember () veic divus parametrus: pirmkārt: member id kā vesels skaitlis vai vairāk nekā vienu id pieņemts bloku; otrais parametrs: output metodi, kā string: "echo" vai ''; print_r($userData); //display the array containing the member's profile data print_r ($ lietotāju datu); / / displeja bloku, kurā dalībnieka anketu
Related posts: Related posts:












































