2007-02-05, 09:25 AM
|
#2
|
|
开源爱好者
注册日期: 2006-06-19
帖子: 286
精华: 0
现金: 71 金币
资产: 34462 金币
声望: 11 
|
回复: 关于首页调用新帖
|
<!-- 最新回覆主題列表 -->
<if condition="$vboptions['shownewpost']">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<if condition="$show['threadicons']">
<td class="thead" colspan="2"> </td>
<else />
<td class="thead"> </td>
</if>
<td class="thead" width="100%">
<if condition="$show['threadratings']"><span style="float:$stylevar[right]">$vbphrase[rating] $sortarrow[voteavg]</span></if>
$vbphrase[newpostslist]
</td>
<td class="thead" width="150" align="center" nowrap="nowrap"><span style="white-space:nowrap">$vbphrase[thread_starter]</span></td>
<td class="thead" width="150" align="center" nowrap="nowrap"><span style="white-space:nowrap">$vbphrase[last_post] $sortarrow[lastpost]</span></td>
<td class="thead" align="center" nowrap="nowrap"><span style="white-space:nowrap">$vbphrase[replies] $sortarrow[replycount]</span></td>
<td class="thead" align="center" nowrap="nowrap"><span style="white-space:nowrap">$vbphrase[views] $sortarrow[views]</span></td>
</tr>
$forumhome_latestthreadslist
</table>
<br>
</if>
<!-- 最新回覆主題列表 -->
<?xml version="1.0" encoding="UTF-8" ?>
- <product productid="latestthreadslist" active="1">
<title>深藍首頁最新主題列表</title>
<description>台灣深藍vBulletin技術論壇 twvbb.com</description>
<version>2.1</version>
<url>http://www.twvbb.com/vbb/showthread.php?t=515</url>
<versioncheckurl />
- <dependencies>
<dependency dependencytype="vbulletin" minversion="3.6.0" maxversion="" />
</dependencies>
<codes />
- <templates>
- <template name="forumhome_latestthreadslistbit" templatetype="template" date="1170090174" username="ckmarkhsu" version="2.1">
- <![CDATA[
<tr>
<td class="alt1">
<img src="$stylevar[imgdir_statusicon]/thread$thread[statusicon].gif" border="" />
</td>
<td class="alt1Active" id="t$thread[threadid]" title="$thread[preview]">
<div>
<a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]">$thread[title]</a>
</div>
<td class="alt2" align="center">$thread[postusername]</td>
<td class="alt2">
<div class="smallfont" style="text-align:$stylevar[right]; white-space:nowrap">
<phrase 1="member.php?find=lastposter&t=$thread[threadid]" 2="$thread[lastposter]">$vbphrase[by_x]</phrase> <a href="showthread.php?$session[sessionurl]p=$thread[lastpostid]#post$thread[lastpostid]"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[go_to_last_post]" border="0" /></a>
</div>
</td>
<td class="alt1" align="center"><a href="#" onclick="who($thread[threadid]); return false;">$thread[replycount]</a></td>
<td class="alt2" align="center">$thread[views]</td>
</tr>
]]>
</template>
</templates>
- <plugins>
- <plugin active="1" executionorder="5">
<title>首頁最新主題列表</title>
<hookname>forumhome_start</hookname>
- <phpcode>
- <![CDATA[
global $vbulletin;
if($vbulletin->options['shownewpost'])
{
$forumperms = array();
foreach($vbulletin->forumcache AS $forum)
{
$forumperms[$forum['forumid']] = fetch_permissions($forum['forumid']);
//check permission
if (!($forumperms[$forum["forumid"]] & $vbulletin->bf_ugp_forumpermissions['canview']) AND !$vbulletin->options['showprivateforums'])
{
$limitfids .= ','.$forum['forumid'];
}
}
unset($forum);
$banforumlist = explode(" ",trim($vbulletin->options['banforumlist']));
for($i = 0; $i < count($banforumlist); $i++)
{
if(intval($banforumlist[$i])!=0)
{
$limitfids .= ','.$banforumlist[$i];
}
}
$threads = $db->query_read("
SELECT title,threadid,replycount,views,postusername,lastposter,lastpostid
FROM ".TABLE_PREFIX."thread AS thread
LEFT JOIN ".TABLE_PREFIX."deletionlog AS deletionlog ON(thread.threadid = deletionlog.primaryid AND type = 'thread')
WHERE open <> 10
AND forumid NOT IN (0$limitfids)
AND thread.visible = '1'
AND deletionlog.primaryid IS NULL
ORDER BY lastpost
DESC LIMIT {$vbulletin->options['newpostlimit']}");
while($thread = $db->fetch_array($threads)){
$thread['lastposttime'] = vbdate($vboptions['timeformat'], $thread['lastpost']);
$thread[lastpostdate] = vbdate($vboptions['dateformat'], $thread['dateline']);
eval('$forumhome_latestthreadslist .= "' . fetch_template('forumhome_latestthreadslistbit') . '";');
}
$db->free_result($q);
unset($threads,$limitfids, $thread);
}
]]>
</phpcode>
</plugin>
</plugins>
- <phrases>
- <phrasetype name="全局" fieldname="global">
- <phrase name="newpostslist" date="0" username="" version="">
- <![CDATA[ 新回覆主題列表
]]>
</phrase>
</phrasetype>
- <phrasetype name="常規設定" fieldname="vbsettings">
- <phrase name="setting_banforumlist_desc" date="0" username="" version="">
- <![CDATA[ 請將不希望顯示於 最新文章列表 之討論版ID 填入此欄位(以空隔分隔)
]]>
</phrase>
- <phrase name="setting_banforumlist_title" date="0" username="" version="">
- <![CDATA[ 最新文章列表排除顯示論壇
]]>
</phrase>
- <phrase name="setting_newpostlimit_desc" date="0" username="" version="">
- <![CDATA[ 設定在首頁的最新文章列表顯示主題數量
]]>
</phrase>
- <phrase name="setting_newpostlimit_title" date="0" username="" version="">
- <![CDATA[ 最新文章列表顯示筆量
]]>
</phrase>
- <phrase name="setting_shownewpost_desc" date="0" username="" version="">
- <![CDATA[ 在首頁顯示最新文章列表
]]>
</phrase>
- <phrase name="setting_shownewpost_title" date="0" username="" version="">
- <![CDATA[ 首頁顯示最新文章列表
]]>
</phrase>
</phrasetype>
</phrases>
- <options>
- <settinggroup name="forumhome" displayorder="400">
- <setting varname="shownewpost" displayorder="120">
<datatype>free</datatype>
<optioncode>yesno</optioncode>
<defaultvalue>1</defaultvalue>
</setting>
- <setting varname="newpostlimit" displayorder="121">
<datatype>number</datatype>
<defaultvalue>10</defaultvalue>
</setting>
- <setting varname="banforumlist" displayorder="131">
<datatype>free</datatype>
<optioncode>textarea</optioncode>
</setting>
</settinggroup>
</options>
<helptopics />
<cronentries />
<faqentries />
</product>
|
|
|
|