Coding:How to fetch user profile data with SSI.php from a SMF forum database 符号化:どのようにSMFのフォーラムのデータベースからSSI.phpを持つユーザープロファイルデータをフェッチする
Posted on 20. 20日に掲載した。 Jul, 2009 by Dragos in Coding , MySQL , PHP 7月、2009 符号化 、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.にもかかわらず、SMFの任意のウェブサイトにはフォーラムを統合する方法を提供し、彼らはどのようにいくつかの基本的なタスクを実行するには、データベースからのメンバーのプロフィールの詳細を取得するなど、十分な情報を提供しないでください。 Fortunately, Netbeans has a very helpful feature, the code Navigator which shows an instant preview of all functions available in an open file.幸いにも、Netbeansのは非常に有益な機能は、コードのナビゲーターは、すべての機能を開いているファイルで使用可能なインスタントプレビューを示しています。 So finding the function which does our job was pretty easy (though I couldn't find it on SMF's website).だから、我々の仕事を非常に簡単だった場合は、関数を見つける(私SMFのウェブサイトに)それを見つけることができませんでした。
Anyway, to fetch data from the SMF database, using SMF's functions, we need to include SSI.php into our website.とにかく、SMFの機能を使用して、SMFのデータベースからデータを取得するために、我々のウェブサイトにSSI.phpを含める必要があります。
include_once('path/to/your/forum/SSI.php'); // replace path/to/your/forum with your path to the SMF forum include_once('パス/ /あなた/フォーラム/ SSI.php'); / /パスを変更する/に/は、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()2つのパラメータを取ります:最初:メンバーの整数または1つ以上のidが配列で渡されたIDを、第2パラメータ:文字列として出力方式:'エコー'または''; print_r($userData); //display the array containing the member's profile data print_r($ userDataです); / /配列には、メンバーのプロファイルデータを含んで表示
Related posts:関連記事:












































