国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > CMS > Discuz > 正文

discuz 個人空間主題列表圖片顯示

2024-09-11 09:05:22
字體:
來源:轉載
供稿:網友
如果需要實現該呈現方式,我們需要首先了解discuz封面圖片存儲原理:
discuz沒有將主題列表封面路徑存在數據表中,只是在pre_forum_thread表中存了一個cover標識。然后用getthreadcover 函數調取,diy調用的圖片也會產生縮略圖,可以設置縮略圖的質量。
封面圖片存儲路徑格式:data/attachment/forum/threadcover/43/ec/81.jpg
getthreadcover 函數:    function getthreadcover($tid, $cover = 0, $getfilename = 0) {        global $_G;        if(emptyempty($tid)) {          return '';        }        $coverpath = '';        $covername = 'threadcover/'.substr(md5($tid), 0, 2).'/'.substr(md5($tid), 2, 2).'/'.$tid.'.jpg';        if($getfilename) {          return $covername;        }        if($cover) {          $coverpath = ($cover < 0 ? $_G['setting']['ftp']['attachurl'] : $_G['setting']['attachurl']).'forum/'.$covername;        }        return $coverpath;      }  

   
復制代碼
文件路徑:/source/function/function_forum.php  
實現方法:
修改:/source/language/home/lang_template.php
添加like 喜歡或查看
修改:/template/default/home/space_thread.htm
處理封面圖:
    
{eval         $covername = 'threadcover/'.substr(md5($thread[tid]), 0, 2).'/'.substr(md5($thread[tid]), 2, 2).'/'.$thread[tid].'.jpg';                $coverpath = ($cover < 0 ? $_G['setting']['ftp']['attachurl'] : $_G['setting']['attachurl']).'forum/'.$covername;      }      <li style="width: 227px;  left: 0px; top: 0px;float:left;">        <div class="c cl">        <a class="z" title="$thread[subject]" onclick="atarget(this)" href="forum.php?mod=viewthread&tid=$thread[tid]">        <img width="203" alt="$thread[subject]" src="{eval echo $coverpath;}">        </a>        </div>        <h3 class="xw0">        <a href="forum.php?mod=viewthread&tid=$thread[tid]" onclick="atarget(this)" target="_blank" {if $thread['displayorder'] == -1}class="recy"{/if}>$thread[subject]</a>        </h3>        <div class="auth cl">        <cite class="xg1 y">        {lang like}: <em>$thread[views]</em>   {lang reply}: <a title="0回復" href="forum.php?mod=viewthread&tid=$thread[tid]">$thread[replies]</a>        </cite>        <a href="home.php?mod=space&uid=$thread[authorid]" target="_blank">$thread[author]</a>$thread[dateline]</div>      </li>  

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 彭阳县| 威海市| 察雅县| 远安县| 莱芜市| 太保市| 明星| 朝阳县| 泾阳县| 十堰市| 普洱| 武汉市| 武安市| 肇庆市| 嘉峪关市| 重庆市| 山丹县| 石阡县| 岳普湖县| 佛坪县| 焦作市| 手机| 台江县| 连城县| 微博| 平顶山市| 兴仁县| 宜君县| 汪清县| 衡山县| 湟源县| 玉屏| 凤凰县| 凤庆县| 康马县| 方城县| 镇原县| 卓资县| 沈丘县| 泾川县| 喀喇沁旗|