网络营销电子商务研究中心  
How to buy the best prescription safety glasses in Canada? Let's study!
Go Back   网络营销电子商务研究中心 > 网站建设 > vBulletin技术交流
User Name
Password
 
FAQ Members List Calendar Cheap Glasses

vBulletin技术交流 主要讨论vBulletin的安装使用、模板风格、插件以及小技巧等。

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   IP: 117.95.50.143
Old 2009-05-05, 05:49 PM
topvip topvip is offline
超级版主
 
Join Date: 2006-01-04
Posts: 1206
topvip 正向着好的方向发展
Default 如何在主题的第一帖后面显示一个广告条

管理面板->风格与模版->风格管理->« » 按钮->帖子块模版->postbit 或 postbit_legacy (根据您选择的帖子布局选择)

在模版最下方的位置添加下面代码中的蓝色部分:
Code:
</if>
    <if condition="$post['userid'] AND $show['member']">
    <tr><td class="vbmenu_option"><a href="profile.php?$session[sessionurl]do=addlist&amp;userlist=buddy&amp;u=$post[userid]"><phrase 1="$post[username]">$vbphrase[add_x_to_buddy_list]</phrase></a></td></tr>
    </if>
    </table>
</div>
<!-- / post $post[postid] popup menu -->

<if condition="$post[postcount] == 1">

<div style="padding: $stylevar[cellpadding]px 0px 0px 0px">

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
    <td class="thead" align="left">赞助商链接</td>
</tr>
<tr>
    <td class="alt1" align="center">
        广告条代码放置于此
    </td>
</tr>
</table>

</div>

</if>
将上面代码中红色的部分替换为您的广告条代码。

还有几个变体供您将广告条显示在不同位置。您只需将上面的代码中的“if”部分替换为下述的代码。

...在每一页的第一篇帖子后 (而不只是第一页的第一篇帖子):
Code:
<if condition="$post[postcount] % $vboptions[maxposts] == 1">
在第一篇帖子后,但是仅对游客可见:
Code:
<if condition="$post[postcount] == 1 AND !$bbuserinfo[userid]">
在第一篇帖子后,但是仅当该主题有两篇帖子时才显示:
Code:
<if condition="$post[postcount] == 1 AND $GLOBALS[threadinfo][replycount] >= 2">
在第一篇帖子后,但是仅在指定版面显示 (X,Y,Z 是逗号分隔的版面 ID 列表):
Code:
<if condition="$post[postcount] == 1 AND in_array($GLOBALS[forumid], array(X,Y,Z))">
在每 X 篇帖子后 (将 X 替换为一个数字):
Code:
<if condition="$post[postcount] % X == 0">
在每页的最后一帖之后:
Code:
<if condition="$post['islastshown']">
...在最后一帖和倒数第二帖之间 (需要将上面的代码从模版的最下方移动到最上方,然后使用与上一条相同的条件):
Code:
<if condition="$post['islastshown']">
您可以使用上面列出的条件的不同组合。例如。如果您想让广告条现实中每页的第一帖之后 (而不只是第一页的第一帖后),但是只有游客可以看到广告条,并且广告条仅出现在某些版面中 (X,Y,Z 是逗号分隔的版面 ID 列表):
Code:
<if condition="$post[postcount] % $vboptions[maxposts] == 1 AND !$bbuserinfo[userid] AND in_array($GLOBALS[forumid], array(X,Y,Z))">
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off

Forum Jump

Prescription-glasses.com offers prescription glasses online at discount prices.
All times are GMT +8. The time now is 12:21 AM.


Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.