在theme.html裡,你要的位置加入:
<!-- 檢查使用者及顯示登入畫面 -->
<div id="nav"><div class="spacer"></div>
<div class="row">
<span class="left">
<{if $xoops_isuser}>
<img src="<{$xoops_imageurl}>arrow4.jpg" alt="">歡迎 <a href="<{$xoops_url}>/user.php"><{$xoops_uname}></a>
<{else}>
<form style="margin-top: 0px;" action="<{$xoops_url}>/user.php" method="post"><img src="<{$xoops_imageurl}>bullet.jpg" alt="">使用者名稱:<input type="text" name="uname" size="12" value="<{$block.unamevalue}>" maxlength="25">密碼:<input type="password" name="pass" size="12" maxlength="32"><input type="hidden" name="xoops_redirect" value="<{$xoops_requesturi}>"><input type="hidden" name="op" value="login"><input type="submit" value="登入"></form>
<{/if}></span>
<span class="right">
<{if $xoops_isuser}>
<img src="<{$xoops_imageurl}>arrow2.jpg" alt=""><a href="<{$xoops_url}>/user.php?op=logout">登出</a>
<{else}>
<{/if}>
</span>
</div><div class="spacer"></div></div>
<!-- 登入使用者區塊結束 -->
--------------
自己玩 theme:
<{$xoops_isadmin}> 檢查是否為admin,用法如<{$xoops_isuser}>
以下供參考:
<{$xoops_isuser}> - 1 if user is logged in, 0 if anonymous user
<{$xoops_uname}> - User name
<{$user_method}> - Logged in user's preferred notification method
<{$xoops_isadmin}> - 1 if admin, 0 if not (Admin rights to System module is the deciding factor - no other modules are considered)
<{$xoops_userid}> - User's ID
<{$xoops_charset}> - Charset used on the page, e.g. ISO-8859-1
<{$xoops_langcode}> - language code used for page (e.g. en for English)
<{$xoops_sitename}> - Site Name
<{$xoops_slogan}> - Site Slogan
<{$xoops_pagetitle}> - Page Title
<{$xoops_version}> - Xoops Version
<{$xoops_theme}> - Name of theme folder
<{$xoops_themecss}> - URL to theme's css file
<{$SCRIPT_NAME}> - path to file name requested from xoops root (e.g. modules/news/index.php)
<{$xoops_imageurl}> - URL to theme folder
<{$xoops_requesturi}> - requested url (e.g. /modules/news/article.php?storyid=1)
<{$xoops_rootpath}> - path to xoops root
<{$xoops_upload_url}> - URL to xoops uploads directory
<{$xoops_url}> - URL to xoops root