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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

█列表缩略图█【社区图库】不要金币 不要钱 分享精神 如果喜欢 请你顶顶 1021更新

  [复制链接]
站站鱼 发表于 2010-10-8 14:56:45 | 显示全部楼层 |阅读模式
插件发布
插件名称: 【发型库看图】
插件来源:
适用版本: Discuz! X1.5
语言编码: GBK简体 
最后更新时间:
插件作者: love322093 站站鱼
插件简介: 本插件对于图片社区来说应该算是非常不错的选择,一直觉得没有必要为了图片展示安装N个文件的插件,认为这个是最简单直观的表达方式!特别说明,本插件在love322093帮助下才得以完成,再次表示感谢!
[ 本帖最后由 站站鱼 于 2010-10-21 10:18 编辑 ]

遇到问题请仔细检查是不是改的错误,版本对不对?语言对不对?请仔细检查代码,实在弄不好,留下你设置的图片列表地址看看   我真的找不到问题出在哪?完全正常  .-----------兼容

评分

5

查看全部评分

 楼主| 站站鱼 发表于 2010-10-8 14:57:20 | 显示全部楼层

请仔细看说明

本帖最后由 站站鱼 于 2010-10-21 20:45 编辑

http://faxingku.com/browse-2-1.shtml
看看这些很简单单东西,我折腾了好长时间
【发型库帖子摘要+缩略图】不要金币 不要钱 分享精神 如果喜欢 请你顶顶
从28号开始整理列表美化,结果才发现模板代码和原来变化也非常大,折腾了将近10天,总算可以见人了,
肯定还有不少问题等待发现和处理,有兴趣的朋友可以先研究研究,


修改方法
第一步
----------------------------------------------------------------
在/source/module/forum/forum_forumdisplay.php
搜索

  1. while(($querysticky && $thread = DB::fetch($querysticky)) || ($query && $thread = DB::fetch($query))) {
复制代码

后面加

  1. //图片插件 作者:love322093 报以对原作者的感激之情,请保留本代码,它不会影响您的任何界面,谢绝任何形式的改版!
  2. $thread['aticon'] = DB::result_first("SELECT attachment FROM ".DB::table('forum_attachment')." WHERE isimage = 1 AND tid=".$thread['tid']."");
  3. $thread['thumb'] = DB::result_first("SELECT thumb FROM ".DB::table('forum_attachment')." WHERE isimage = 1 AND tid=".$thread['tid']."");
  4. if($thread['aticon'] && !$thread['thumb'] ){
  5. require_once libfile('class/image');
  6. $image = new image;
  7. $r = $image->Thumb($_G['setting']['attachurl'].'forum/'.$thread['aticon'], '', 200, 200, 2);//生成缩略图,400 宽 高是图片的大小.
  8. if ($r) {
  9. DB::update('forum_attachment', array('thumb' => 1), "isimage = 1 AND tid=".$thread['tid']."");
  10. } else {
  11. $error = $image->error();
  12. showmessage($error);
  13. }
  14. }
  15. if($thread['thumb'] && $thread['aticon']!=null){
  16. // $thread['aticon']=$_G['setting']['attachurl'].'forum/'.$thread['aticon'].".thumb.jpg";
  17. $thread['aticon']='<img src='.$_G['setting']['attachurl'].'forum/'.$thread['aticon'].".thumb.jpg".'>';
  18. }else{
  19. $thread['aticon']="<img class='pic_li_img' src='static/image/common/nopic.gif'>";
  20. }
  21. //echo $thread['aticon'];
  22. //图片插件 作者:love322093 报以对原作者的感激之情,请保留本代码,它不会影响您的任何界面,谢绝任何形式的改版!
复制代码

第二步
在/template/default/forum/forumdisplay.htm
搜索
  1. <!--{hook/forumdisplay_postbutton_top}-->

  2.                         </div>
复制代码


后面加


  1. <!--{if (!$simplestyle || !$_G['forum']['allowside']) && !empty($announcement)}-->
  2.                         <div  class="forumdisplay_announcement"style="margin-bottom: 10px;">
  3.                                 <tbody>
  4.                                         <tr>
  5.                                                 <td class="icn"><img src="{IMGDIR}/ann_icon.gif" alt="{lang announcement}" /></td>
  6.                                                 <!--{if $_G['forum']['ismoderator'] && !$_G['gp_archiveid']}--><td class="o"> </td><!--{/if}-->
  7.                                                 <th><strong class="xst"><font style="font-size: 18px;font-family:'黑体'">{lang announcement}: <!--{if empty($announcement['type'])}--><a href="forum.php?mod=announcement&id=$announcement[id]#$announcement[id]" target="_blank">$announcement[subject]</a><!--{else}--><a href="$announcement[message]" target="_blank">$announcement[subject]</a><!--{/if}--></font></strong></th>
  8.                                                 <td class="by">
  9.                                                         <cite><a href="home.php?mod=space&uid=$announcement[authorid]" c="1">$announcement[author]</a></cite>
  10.                                                         
  11.                                                 </td>
  12.                                                 <td class="num"><em>$announcement[starttime]</em></td>
  13.                                         </tr>
  14.                                 </tbody>
  15.                         </div>
  16.                         <!--{/if}-->
复制代码

第三部
在/template/default/forum/forumdisplay_list.htm
搜索   
  1. "forum.php?mod=topicadmin&action=moderate&fid=$_G[fid]&infloat=yes&nopost=yes">
  2.    <input type="hidden" name="formhash" value="{FORMHASH}" />
复制代码

后面加

  1. <!--图片显示的模板+来自站站鱼+开始-->
  2.    <!--{if in_array($_G['fid'], array(36,110))}-->
  3.    <table summary="forum_$_G[fid]" {if !$separatepos}id="forum_$_G[fid]"{/if} cellspacing="0" cellpadding="0">
  4.    
  5. <div class="show_topic_div" >
  6. <ul class="show_topic_ul" >
  7. <!--{if $_G['forum_threadcount']}-->
  8.     <!--{loop $_G['forum_threadlist'] $key $thread}-->

  9.     <!--{if $separatepos <= $key + 1}-->
  10.      <!--{ad/threadlist}-->
  11.     <!--{/if}-->
  12. <li id="show_topic_li"class="off" onMouseOver="this.className='on'"onmouseout="this.className='off'" title="$thread[subject]">
  13. <!--{if $thread['weeknew']}-->
  14. <div style="margin-bottom:-36px;"><img src="{STATICURL}image/filetype/new.gif" alt="查看新发型" /></div>
  15. <!--{/if}-->

  16. <!--{if $_G['uid']}-->
  17. <a href='forum.php?mod=viewthread&tid=$thread[tid]'alt='$thread[subject]' title='$thread[subject]'>$thread['aticon']</a>
  18. <!--{/if}-->

  19. <!--{if $gid || !$_G['uid']}-->
  20. <a>$thread['aticon']</a>
  21. <!--{/if}-->

  22. <em style="float:left; display:block;width:200px;white-space:nowrap;overflow:hidden;text-align: center;text-overflow:ellipsis;" >
  23. <!--{if $_G['uid']}-->
  24. <dd style="float:left;width:200px;font-size: 14px;height:18px;margin-top:3px;white-space:nowrap;overflow:hidden;text-align: center; text-overflow:ellipsis;">
  25. <a href="forum.php?mod=viewthread&tid=$thread[tid]&{if $_G['gp_archiveid']}archiveid={$_G['gp_archiveid']}&{/if}extra=$extra"$thread[highlight]{if $thread['isgroup'] == 1} target="_blank"{/if} onclick="atarget(this)" >$thread[subject]</a>
  26. </dd>
  27. <!--{/if}-->
  28. <!--{if $gid || !$_G['uid']}-->
  29. <dd style="float:left; display:block;width:200px;white-space:nowrap;overflow:hidden;text-align: center; text-overflow:ellipsis;">
  30. <font color=#46A815>无权浏览高清图 请立即</font><a href="member.php?mod=register" target="_blank"><b><font color=#FF6600>注册</font></b></a><font color=#46A815>或</font><a href="member.php?mod=logging&action=login" target="_blank"><b><font color=#FF6600>登录</font></b></a></dd><br>
  31. <!--{/if}-->
  32. </em>
  33. <dd style="float:left;width:188px;">
  34. 分享者:<a href="home.php?mod=space&uid=$thread[authorid]" c="1">$thread[author]</a><br>
  35. 发布时间:{eval $days=date('Y-n-j',time());}
  36. <!--{if $thread[dateline]==$days}-->
  37. <font color="#0099FF">$thread[dateline]</font>
  38. <!--{else}-->
  39. $thread[dateline]
  40. <!--{/if}--><br>
  41. 最后评论:<a href="{if $thread[digest] != -2}home.php?mod=space&username=$thread[lastposterenc]{else}forum.php?mod=viewthread&tid=$thread[tid]&page={echo max(1, $thread[pages]);}{/if}" c="1">$thread[lastposter]</a>
  42. <br>
  43. 关注:<font color=#009AFF>$thread[views]</font>  评论: <font color=#17A801>$thread[replies]</font></dd> <br>

  44. <!---------图标开始------------>
  45. <em>
  46. <!--{if !$_G['gp_archiveid'] && $_G['forum']['ismoderator']}-->
  47.       
  48.        <!--{if $thread['fid'] == $_G[fid]}-->
  49.         <!--{if $thread['displayorder'] <= 3 || $_G['adminid'] == 1}-->
  50.          <input onclick="tmodclick(this)" type="checkbox" name="moderate[]" value="$thread[tid]" />
  51.         <!--{else}-->
  52.          <input type="checkbox" disabled="disabled" />
  53.         <!--{/if}-->
  54.        <!--{else}-->
  55.         <input type="checkbox" disabled="disabled" />
  56.        <!--{/if}-->
  57.      
  58.       <!--{/if}-->

  59. <!--{if $thread['readperm']}--> - [{lang readperm} <span class="bold">$thread[readperm]</span>]<!--{/if}-->
  60.        <!--{if $thread['price'] > 0}-->
  61.         <!--{if $thread['special'] == '3'}-->
  62.         - <span style="color: #C60">[{lang thread_reward}{$_G[setting][extcredits][$_G['setting']['creditstransextra'][2]][title]} <span class="bold">$thread[price]</span> {$_G[setting][extcredits][$_G['setting']['creditstransextra'][2]][unit]}]</span>
  63.         <!--{else}-->
  64.         - [{lang price} {$_G[setting][extcredits][$_G['setting']['creditstransextra'][1]][title]} <span class="bold">$thread[price]</span> {$_G[setting][extcredits][$_G['setting']['creditstransextra'][1]][unit]}]
  65.         <!--{/if}-->
  66.        <!--{elseif $thread['special'] == '3' && $thread['price'] < 0}-->
  67.         - [{lang reward_solved}]

  68.        <!--{/if}-->
  69.        <!--{if $thread['attachment'] == 2}-->
  70.         <img src="{STATICURL}image/filetype/image_s.gif" alt="attach_img" title="{lang attach_img}" align="absmiddle" />
  71.        <!--{elseif $thread['attachment'] == 1}-->
  72.         <img src="{STATICURL}image/filetype/common.gif" alt="attachment" title="{lang attachment}" align="absmiddle" />
  73.        <!--{/if}-->
  74.        <!--{if $thread['displayorder'] == 0}-->
  75.         <!--{if $thread[recommendicon] && $filter != 'recommend'}-->
  76.          <img src="{IMGDIR}/recommend_$thread[recommendicon].gif" align="absmiddle" alt="recommend" title="{lang thread_recommend} $thread[recommends]" />
  77.         <!--{/if}-->
  78.         <!--{if $thread[heatlevel]}-->
  79.          <img src="{IMGDIR}/hot_$thread[heatlevel].gif" align="absmiddle" alt="heatlevel" title="$thread[heatlevel] {lang heats}" />
  80.         <!--{/if}-->
  81.         <!--{if $thread['digest'] > 0 && $filter != 'digest'}-->
  82.          <img src="{IMGDIR}/digest_$thread[digest].gif" align="absmiddle" alt="digest" title="{lang thread_digest} $thread[digest]" />
  83.         <!--{/if}-->
  84.         </em>
  85.         <!--{if $thread['rate'] > 0}-->
  86.          <div id="2" style="
  87. float:right;margin-top:-70px;margin-right:-7px;" ><img src="{IMGDIR}/wq.png" align="absmiddle" alt="agree" title="{lang rate_credit_add}" /></div>
  88.         <!--{elseif $thread['rate'] < 0}-->
  89.          <img src="{IMGDIR}/disagree.gif" align="absmiddle" alt="disagree" title="{lang posts_deducted}" />
  90.         <!--{/if}-->
  91.        <!--{/if}-->
  92.        <!--{if $thread[multipage]}-->
  93.         <span class="tps">$thread[multipage]</span>
  94. </li>
  95.                            <!--{/if}-->
  96. <!-----图标结束-------->
  97. <!--{/loop}-->
  98.     </ul>
  99. <!--{else}-->
  100. </div>
  101.    <!--{/if}-->
  102.    </table>
  103. <!--{/if}-->
  104. <!--图片显示的模板+来自站站鱼+结束-->
  105. <!--普通显示的模板+来自站站鱼+开始-->
  106. <!--{if in_array($_G['fid'], array(2,100))}-->
复制代码



搜索
  1. {else}5{/if}"><p class="emp">{lang forum_nothreads}</p></th></tr></tbody>
  2.                         <!--{/if}-->
  3.                         </table>
复制代码

后面加
  1.    <!--{/if}-->
  2. <!--普通显示的模板+来自站站鱼+结束-->
复制代码
在common.css
最后面加

10月21日更新
#show_topic_li a img{ height:200px; width:200px; vertical-align: middle; opacity: 0.40;/**Opera9.0+、Firefox1.5+、Safari、Chrom.兼容浏览器了**/ FILTER: alpha(opacity=40)" onMouseOver="nereidFade(this,100,0,10)}
#show_topic_li a:hover img{ height:200px; width:200px; vertical-align: middle; opacity: 0.9;/**Opera9.0+、Firefox1.5+、Safari、Chrom.兼容浏览器了**/FILTER:}


  1. /* -------------------------------图片列表 CSS 样式 */
  2. .show_topic_list{ color: {TEXT}; padding: 0 10px 0 10px; height:30px; background:{WRAPBG}; line-height: 26px; border-top: 1px dashed {COMMONBORDER};}

  3. .show_topic_div{ margin-left:auto;margin-right:auto; border-top: 1px dashed {COMMONBORDER}; padding-top:5px;padding-left:3px;}
  4. .show_topic_ul{ width:100%; overflow: hidden; padding:2px; 0 0 0 }
  5. #show_topic_li { margin:10px; padding:5px; width:200px; height: 312px; float: left; text-align:left; list-style-type: none; border: 1px solid #E8E8E8; }
  6. #show_topic_li a img{ height:200px; width:200px; vertical-align: middle; opacity: 0.40;/**Opera9.0+、Firefox1.5+、Safari、Chrom.兼容浏览器了**/ FILTER: alpha(opacity=40)" onMouseOut="nereidFade(this,40,10,10)" onMouseOver="nereidFade(this,100,0,10)}
  7. #show_topic_li a:hover img{ height:200px; width:200px; vertical-align: middle; opacity: 0.9;/**Opera9.0+、Firefox1.5+、Safari、Chrom.兼容浏览器了**/FILTER:}
  8. .show_topic_li img { height:200px; width:200px; border: 1px solid #FFFFFF;}

  9. .off{overflow: hidden; background:#F9F9F9;}
  10. .on{ overflow: hidden; background:#99C531;}
  11. .show_topic_Newico { margin-bottom:-36px;}
复制代码

关于这两段代码需要特别说明,
无论自己修改还是覆盖这两段代码都要注意修改
关于这两段代码需要特别说明,
Dreamweaver 8打开修改
--------------------------------------------------------------------------------------
第一段
<!--图片显示的模板+来自站站鱼+开始-->
   <!--{if in_array($_G['fid'], array(36,110))}-->大约在58行

如果你是在子板下显示请将父版块id也要加上
这里是希望那些版块显示图片形式,请将版块ID写到里面,以半角逗号,
隔开!
--------------------------------------------------------------------------------------
第二段
<!--普通显示的模板+来自站站鱼+开始-->大约在196行
<!--{if in_array($_G['fid'], array(2,100))}-->

如果你是在子板下显示请将父版块id也要加上
这里版块普通显示,请将版块ID写到里面,以半角逗号,隔开!
-------------------------------------------------------------------------------------

10月21日更新
谷歌浏览器标题不现实问题

覆盖版也需要小修改


回复

使用道具 举报

 楼主| 站站鱼 发表于 2010-10-8 14:57:39 | 显示全部楼层

常见的问题!!!!!

本帖最后由 站站鱼 于 2010-10-18 21:14 编辑

遇到问题请仔细检查是不是改的错误,版本对不对?语言对不对?目前仅支持1.5正式版GBK简体!其它没有做过测试,请仔细检查代码,实在弄不好,留下你设置的图片列表地址看看   
我真的找不到问题出在哪?完全正常  
首先页面空白是怎么回事?
答:十有八九可能问题出在
forumdisplay.php和forumdisplay_list.htm两个文件,请仔细检查哪怕是一个“[”">"都可能出错


页头和页脚都显示了,就是内容列表不显示怎么办?
答:<!--{if in_array($_G['fid'], array(11,12,13,14))}-->
如果你是在子板下显示请将父版块id也要加上
如果写错了肯定不会显示,因为无法找到forumdisplay_list.htm模板


这里只是展示代码原理
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<!--图片显示的模板+来自站站鱼+开始-->
<!--{if in_array($_G['fid'], array(36,37,38,39))}-->图片频道ID:我这里只是举例子
<table width="200" border="1">
  <tr>
    <td>这里是图片显示 </td>
  </tr>
</table>
<!--{/if}-->
<!--图片显示的模板+来自站站鱼+结束-->

<!--普通显示的模板+来自站站鱼+开始-->
<!--{if in_array($_G['fid'], array(100,101,102,103))}-->普通显示版块ID:
<table width="200" border="1">
  <tr>
    <td>这里是普通显示 </td>
  </tr>
</table>
<!--{/if}-->
<!--普通显示的模板+来自站站鱼+结束-->
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


我建议您下载一个专门的Beyond Compare 2对比工具慢慢修改




部分安装成功演示的地址:http://219.70.21.55/forum.php?mod=forumdisplay&fid=77

http://bbs.13386.cn/forum-64-1.html

回复

使用道具 举报

slofbbs 发表于 2010-10-8 14:59:53 | 显示全部楼层
本帖最后由 slofbbs 于 2010-10-8 15:00 编辑

留位广告
回复

使用道具 举报

haoshoe 发表于 2010-10-8 15:13:27 | 显示全部楼层
好插件啊
回复

使用道具 举报

haoshoe 发表于 2010-10-8 15:27:36 | 显示全部楼层
测试怎么不行呢?提示“-2”
回复

使用道具 举报

long13374955 发表于 2010-10-8 15:37:15 | 显示全部楼层
收藏了
回复

使用道具 举报

小木心 发表于 2010-10-8 15:41:58 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

 楼主| 站站鱼 发表于 2010-10-8 15:46:02 | 显示全部楼层
haoshoe 发表于 2010-10-8 15:27
测试怎么不行呢?提示“-2”

哪里提示“-2”??
回复

使用道具 举报

haoshoe 发表于 2010-10-8 15:55:59 | 显示全部楼层
浏览列表页的时候,是不是这个修改得要后台开启缩略图???

有没有像7.2的自动裁切图片的?
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-10-7 15:28 , Processed in 0.574618 second(s), 20 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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