| « prev next » |
著者: Jian Shuo Wang。 出版される: 2006年2月1日。 札: movabletype (11)
版権: この放棄およびリンクを保つ限りこの仕事を再分配して自由である。
Permlink: http://home.wangjianshuo.com/ja/20060201_added_commenter_profile_page_to_movabletype.htm
十分に注意深い場所を点検すればcommenterの名前のほかの小さいアイコンを見る。 それは最近追加された機能- Commenterのプロフィールである:
アイコンのリンクはcommenterのプロフィールのページに導く、従ってどんなコメントを彼/彼女が前に掲示したあることがか理解する。
表示名前だけに基づいているので、同じ表示名前の人々が同じ人であることが常に当然だと思ってはいけない。 あなたの名前をなら余りに共通、選べば固有の名前を見つけたら。
コードか。
次に私が使用したコードがある。 それは私がないそれを他のために実行可能にさせる使いきった時間ので、非常に某大である。 それはちょうどこのblogの必要性に合った。 私は私がblogの記入項目をwrittingようにそれを書いた。 私が試みる何を表現することを完了される時、コードは完了する。 コードから取ることができるが取りなさいあなたのMovableTypeに直接取り組むとそれが期待してはいけないものは何でもそう。 技術の原料を好まない人々のため、投稿のtechieのために残念再度。
<か。php機能はdirify ($s) {$s = strtolower ($s); ##の小文字。 $s = strip_tags ($s); ##はhtmlの札を取除く。 $s = preg_replace (「! 及び[^; \ s] +;! 」、"、$s); ##はhtmlの実体を取除く。 $s = preg_replace (「! [^ \ w \ s]! 」、"、$s); ##は非単語またはスペース木炭を取除く。 $s = preg_replace (「! \ s+! 」、「_」、$s); ##の変更スペースは下線に焦げる。 帰り$s; } $mt_blog_users = 「http://home.wangjianshuo.com/users/」; $mt_blog_archive = 「http://home.wangjianshuo.com/archives/」; $file = 「mtconfig.cgiのfile>の<Location」; $cfg =配列(); ($fp =ファイル($file)) {foreach ($line) {ファイルを通した//の調査として$fp (! ereg (「^ \ s* \ #」、$line)) {//は挽肉料理の記号にはじまってラインを無視する(preg_match (」/^ \ s* ([^] +) [] (。*) (\ r|n)か。$ 「、$line、$regs)) {$key =トリム($regs [1]); $value =トリム($regs [2]); $cfg [$key] = $value; }}}}他に{ダイス(「コンフィギュレーション・ファイル$file」を開けることない); } $db = mysql_connect ($cfg [「DBHost」]、$cfg [「DBUser」]、$cfg [「DBPassword」])またはダイス(「私はMySQLに接続できない。」); mysql_select_db ($cfg [「データベース」]); $query = 「選り抜きcomment_author、comment_countによるcomment_author ORDER著mt_commentのグループからのcomment_countとして計算(comment_author)」; $result = mysql_query ($query); $comment_author_previous = ""; $comment_author_next = ""; 間($row = mysql_fetch_array ($result)) {($row [「comment_author」の] == $user) {$comment_author_previous = $comment_author_previous_temp; } ($comment_author_previous_tempの== $user) {$comment_author_next = $row [「comment_author」]; } $comment_author_previous_temp = $row [「comment_author」]; }エコーの「<small><a href='$ mt_blog_users$comment_author_next.htm'> 「$comment_author_next</a> |」; エコー」 <a href='http://home.wangjianshuo.com/scripts/mt-user/mt-all-user.php'>Commenters</a> 「; エコー「| <a href='$ mt_blog_users$comment_author_previous.htm'>$comment_author_previous」 </a></small> "; $userか$user = 「Jian Shuo Wang」; $query = comment_entry_ymdとして「選り抜きentry_id、entry_title、comment_id、comment_url、entry_excerpt、comment_text、comment_entry_id、date_format (entry_created_on、「%Y%m%d」)、comment_hourminとしてdate_format (comment_created_on、「%h%i」)、mt_commentからのcomment_created_on、mt_entryところcomment_entry_id = entry_idおよびcomment_author = comment_id DESCの限界300による「$user」順序」; $comment_url = ""; $comment_count = 0; $html = ""; $result = mysql_query ($query); 間($row = mysql_fetch_array ($result)) {$comment_entry_id = $row [「comment_entry_id」]; $html = $html。 「<p>」。 (nl2br ($row [「comment_text」]))。 「$userによってで< href='http://home.wangjianshuo.com/users/」 <p><small>Posted。 $row [「comment_id」]。 」 .htm」 target=_blank> "。 $row [「comment_created_on」]。 「<aのtarget=_blank href=$mt_blog_archiveの</a>」。 $row [「comment_entry_ymd」]。 」 _ 「。 dirify ($row [「entry_title」])。 」 .htm# "。 $row [「comment_hourmin」]。 「>」。 $row [「entry_title」]。 「</a></small><hr>」; $comment_urlか$comment_url = $row [「comment_url」]; $comment_count = $comment_count + 1; }エコー「<h1>$user</h1><a href='$のcomment_url」 target=_blank>$comment_url</a>」; エコーは「<b>$comment_count</b>のコメント」を掲示した; エコー$html; mysql_free_result ($result); mysql_close (); か。>
「Prev: 北京は冷たい。 生命は暖かい
次に」: 私はusbケーブルを必要とする