Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

搜索页仿百度“推广连接”效果

[复制链接]
不被谁所认识 发表于 2010-10-22 12:41:36 | 显示全部楼层 |阅读模式
本帖最后由 不被谁所认识 于 2010-10-29 19:02 编辑

首先为了方便广告的替换,建议使用后台广告的自建功能,然后采用内部调用模式“<!--{ad/custom_8}-->”该代码里的8就是你后台建立自己广告位的数字编号。然后接下来,修改thread_list.htm文件

PS:似乎内部调用在搜索页面里不显示,不知道是不是被官方列入外部调用行列,我测试了下,没显示,所以建议大家采用外部调用,可惜的是搜索页里没DIY功能,要不就更棒了前台随意添加广告,也不用建议那么多的广告位了

在该文件里的


  1. <!--{if empty($threadlist)}-->
  2. <p class="emp xs2 xg2">{lang search_nomatch}</p>
  3. <!--{else}-->
  4. <div class="slst mtw">
  5. <ul>
  6. <!--{loop $threadlist $thread}-->
  7. <li class="pbw">
  8. <h3 class="xs3"><a href="forum.php?mod=viewthread&tid=$thread[tid]&highlight=$index[keywords]" target="_blank" $thread

  9. [highlight]>$thread[subject]</a></h3>
  10. <p class="xg1">$thread[replies] {lang a_comment} - $thread[views] {lang a_visit}</p>
  11. <p><!--{if !$thread['price'] && !$thread['readperm']}-->$thread[message]<!--{else}-->{lang thread_list_message1}<!--{/if}--

  12. ></p>
  13. <p>
  14. <span>$thread[dateline]</span>
  15. -
  16. <span>
  17. <!--{if $thread['authorid'] && $thread['author']}-->
  18. <a href="home.php?mod=space&uid=$thread[authorid]" target="_blank">$thread[author]</a>
  19. <!--{else}-->
  20. <!--{if $_G['forum']['ismoderator']}--><a href="home.php?mod=space&uid=$thread[authorid]"

  21. target="_blank">{lang anonymous}</a><!--{else}-->{lang anonymous}<!--{/if}-->
  22. <!--{/if}-->
  23. </span>
  24. -
  25. <span><a href="forum.php?mod=forumdisplay&fid=$thread[fid]" target="_blank" class="xi1">$thread[forumname]</a></span>
  26. </p>
  27. </li>
  28. <!--{/loop}-->
  29. </ul>
  30. </div>
  31. <!--{/if}-->
复制代码

在其前面加入
  1. <div id="xmc_search_ads">
  2. <div class="xmc_search_adsl">
复制代码
在其后面加入


  1. </div>
  2. <div class="xmc_search_adsr"><div class="tglj"><a href="http://www.xmcong.com/plugin.php?id=cc_sx:cctxt&to=union_members">推广链接</a></div>
  3. <div class="adcontent"><script type='text/javascript' src='http://www.xmcong.com/api.php?mod=ad&adid=custom_8'></script></div></div>
  4. </div>
  5. <div style="clear:both"></div>
复制代码
然后加入CSS代码


  1. /* 论坛帖子搜索页面右侧广告 */
  2. #xmc_search_ads{margin:0;padding:0;}
  3. .xmc_search_adsl{float:left;width:70%;}
  4. .xmc_search_adsr{float:right;width:25%;margin-left:10px;margin-top:20px;padding:10px 10px;border-left: 1px solid rgb(225, 225, 225);}
  5. .tglj{width:100%;}
  6. .tglj a{color:#666666}
  7. .adcontent{width:100%;margin-bottom:20px;margin-top:15px;}
复制代码
演示地址:http://www.xmcong.com/search-forum-srchfrom-167000-searchsubmit-yes.html
至此就已经基本结束完成右侧加入后台广告位代码了,终于该广告位的文字广告还是图片广告或是flash广告的具体最佳显示效果可根据自己喜欢好进行CSS的添加和修改!

本只 是对列表做了浮动效果以达添加广告位,希望可以帮助到大家,具体演示效果可见如下演示:




评分

3

查看全部评分

 楼主| 不被谁所认识 发表于 2010-10-22 12:45:01 | 显示全部楼层
本帖最后由 不被谁所认识 于 2010-10-22 12:46 编辑

在该页面有更好想法的可以跟帖提出,大家共同探讨下
回复

使用道具 举报

bobofashion 发表于 2010-10-22 12:46:55 | 显示全部楼层
这个真不错 收藏了
回复

使用道具 举报

a清风入林 发表于 2010-10-22 12:47:45 | 显示全部楼层
这个不错,占位支持!
回复

使用道具 举报

爱情博物馆 发表于 2010-10-22 12:52:08 | 显示全部楼层
确实不错!
回复

使用道具 举报

 楼主| 不被谁所认识 发表于 2010-10-22 12:56:32 | 显示全部楼层
有希望大家拿去折腾下,这个页面虽然广告效果不大好,但是可以避免正常页面加入广告导致整体效果,由于适合地方站的模式
回复

使用道具 举报

大家乡网 发表于 2010-10-22 13:24:55 | 显示全部楼层
回复

使用道具 举报

zyk157 发表于 2010-10-22 14:06:37 | 显示全部楼层
不错
回复

使用道具 举报

滋质子熠紫 发表于 2010-10-22 17:34:57 | 显示全部楼层
回复

使用道具 举报

Smirk 发表于 2010-10-22 19:26:47 | 显示全部楼层
赞一个。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-9-17 03:53 , Processed in 0.131844 second(s), 20 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表