Coding:How to fetch user profile data with SSI.php from a SMF forum database Coding: Hur hämta data användarprofil med SSI.php från SMF forum databas
Posted on 20. Skrivet den 20. Jul, 2009 by Dragos in Coding , MySQL , PHP Juli, 2009 av Dragos i Coding, 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. Även SMF erbjuder ett sätt att integrera sina forum på någon hemsida, så ger de inte tillräckligt med information om hur du gör några grundläggande uppgifter, t.ex. hämta en medlems profil information från databasen. Fortunately, Netbeans has a very helpful feature, the code Navigator which shows an instant preview of all functions available in an open file. Lyckligtvis har Netbeans en väldigt användbar funktion, den kod Navigator som visar en omedelbar förhandsgranskning av alla funktioner som finns i en fil. So finding the function which does our job was pretty easy (though I couldn't find it on SMF's website). Så hitta den funktion som gör vårt jobb var ganska lätt (även om jag inte kunde hitta det på SMF: s webbplats).
Anyway, to fetch data from the SMF database, using SMF's functions, we need to include SSI.php into our website. Anyway, för att hämta data från SMF databas, med SMF: s uppgifter, måste vi tänka på SSI.php till vår hemsida.
include_once('path/to/your/forum/SSI.php'); // replace path/to/your/forum with your path to the SMF forum include_once ( "sökväg / till / din / forum / SSI.php '); / / byt sökväg / till / din / forum med din väg till SMF forum $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 () tar två parametrar: id passerade först: det användar-ID som ett heltal eller mer än en i en matris, andra parameter: Utgång metod som sträng: "eko" eller ''; print_r($userData); //display the array containing the member's profile data print_r ($ userdata); / / visa matrisen innehåller medlemmens profil data
Related posts: Relaterade tjänster:












































