因為作 綠光森林粉絲專屬首頁 的關係,想要把會員的簽名檔 放到首頁.
(不一定是好的方法 不過...可以參考看看^^" )
在官網問的問題
http://www.simplemachines.org/community/index.php?topic=59206.0在 ssi.php 加入...(用 ssi_welcome改的) ^^"
如果是訪客 顯示一段文字..如果是會員 顯示簽名檔
// Display Signature
function ssi_signature($output_method = 'echo')
{
global $context, $txt, $scripturl;
if ($output_method == 'echo')
{
if ($context['user']['is_guest'])
echo '歡迎來到綠光森林專屬首頁! 加入會員可以擁有專屬的首頁喔!';
else
{
if (!empty($context['user']['signature']))
echo $context['user']['signature'];
}
}
// Don't echo... then do what?!
else
return $context['user'];
}
在首頁的最上面 加入..
<?php
require(dirname(__FILE__) . '/club/ssi.php');
// Get member data (loadMemberData has to be called prior to loadMemberContext)
loadMemberData($context['user']['id']);
loadMemberContext($context['user']['id']);
// Append all the new info to $context['user']...
$context['user'] = array_merge($context['user'], $themeUser[$context['user']['id']]);
?>
然後 在你想要顯示的地方 加入...
<?php ssi_signature(); ?>
這樣就可以了!
第一次這樣玩 請多多指教!! ^^"
要試試結果..可以看看 綠光森林粉絲專屬首頁的測試頁...
http://www.greenforest.fans.pro/200.php