Coding:How to fetch user profile data with SSI.php from a SMF forum database Codificare: Cum să-i aducă datele utilizatorului, cu profil de SSI.php de la o bază de date forum SMF
Posted on 20. Postat la data de 20. Jul, 2009 by Dragos in Coding , MySQL , PHP Iulie, 2009 de către Dragos în codificare a mărfurilor, 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. Chiar dacă SMF oferă o modalitate de a integra forumul lor în orice site Web, ele nu furnizează suficiente informaţii cu privire la modul de a face anumite sarcini de bază, de exemplu, preluarea detalii profilul unui membru din baza de date. Fortunately, Netbeans has a very helpful feature, the code Navigator which shows an instant preview of all functions available in an open file. Din fericire, NetBeans are o caracteristică foarte util, codul Navigator ceea ce denotă o previzualizare instantanee a tuturor funcţiilor disponibile într-un fişier deschis. So finding the function which does our job was pretty easy (though I couldn't find it on SMF's website). Deci, funcţia de constatare, care face munca noastră a fost destul de uşor (deşi nu am putut găsi pe site-ul web al SMF).
Anyway, to fetch data from the SMF database, using SMF's functions, we need to include SSI.php into our website. Oricum, să-i aducă datelor din baza de date SMF, utilizând funcţii al SMF, avem nevoie de a include SSI.php în site-ul nostru.
include_once('path/to/your/forum/SSI.php'); // replace path/to/your/forum with your path to the SMF forum include_once cale ( '/ a / forum dvs. / / SSI.php'); / / Replace cale / către / dvs. / forum cu calea dumneavoastră la forum SMF $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 ''; $ UserData = ssi_fetchMember (1 ,''); / / ssi_fetchMember () are doi parametri: în primul rând: Member ID ca un număr întreg sau mai mult de un ID-ul a trecut într-o matrice; al doilea parametru: Metoda de ieşire ca string: "echo" sau ''; print_r($userData); //display the array containing the member's profile data print_r ($ UserData); / / display tablou care conţine profilul membrului de date
Related posts: Legate de posturi:












































