Coding:How to fetch user profile data with SSI.php from a SMF forum database Coding: Wie zum Benutzerprofil Daten mit SSI.php holen aus einer SMF-Forum Datenbank
Posted on 20. Gesendet am 20. Jul, 2009 by Dragos in Coding , MySQL , PHP Juli 2009 von Dragos in 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. Obwohl SMF ein Weg zu ihrem Forum in jede beliebige Website integriert bietet sie nicht genügend Informationen darüber, wie einige grundlegende Aufgaben zu erledigen, zB Abholen das Profil eines Mitgliedes Daten aus der Datenbank. Fortunately, Netbeans has a very helpful feature, the code Navigator which shows an instant preview of all functions available in an open file. Glücklicherweise hat Netbeans eine sehr hilfreiche Funktion, den Code Navigator, der eine sofortige Vorschau aller Funktionen, die in eine geöffnete Datei zeigt. So finding the function which does our job was pretty easy (though I couldn't find it on SMF's website). So finden die Funktion, die unsere Arbeit war nicht sehr einfach (obwohl ich konnte ihn nicht finden auf der Website des SMF).
Anyway, to fetch data from the SMF database, using SMF's functions, we need to include SSI.php into our website. Wie auch immer, um Daten aus der SMF-Datenbank zu holen, mit SMF Funktionen, müssen wir SSI.php in unsere Seite einbinden.
include_once('path/to/your/forum/SSI.php'); // replace path/to/your/forum with your path to the SMF forum include_once ( 'path / to / your / forum / SSI.php'); / / ersetzen path / to / your / forum mit Ihrem Weg in die 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 () nimmt zwei Parameter: erstens das Mitglied als Integer oder mehr als ein id id in einem Array übergeben; zweite Parameter: Output-Methode als String: 'echo' oder ''; print_r($userData); //display the array containing the member's profile data print_r ($ userdata); / / display das Array mit den Mitglieds-Profil-Daten
Related posts: In Verbindung stehende Pfosten:
- PHP Error: Call to a member function fetch_assoc() on a non-object in PHP Error: Aufruf einer Member-Funktion fetch_assoc () auf einem Nicht-Objekt in
- PHP: How to get creation time of file with PHP on Linux machines PHP: Wie man die Schaffung Zeitpunkt der Datei mit PHP auf Linux-Maschinen zu erhalten












































