discuz X3 Space Theme List Picture presentation mode, Discuz realization of personal space Theme list call picture mode, Discuz home Picture List
If you need to implement this rendering, we need to first understand the discuz cover picture storage principle:
Discuz does not have a topic list cover path in the data table, but only a cover identity is stored in the Pre_forum_thread table. Then use the Getthreadcover function to call, DIY calls the picture will also produce thumbnails, you can set the quality of the thumbnail image.
Cover picture Storage path format: data/attachment/forum/threadcover/43/ec/81.jpg
Getthreadcover function:
function Getthreadcover ($tid, $cover = 0, $getfilename = 0) {global $_g; if (empty ($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;} File path:/source/function/function_forum.php
Implementation method:
Modified:/source/language/home/lang_template.php
Add like or view
Modified:/template/default/home/space_thread.htm
To process a cover chart:
{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;} Picture List <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] "> </a> </div>
Download file (downloaded 119 times) Click here to download the file: Homepic.zipDiscuz Personal Space Theme list Picture mode implementation method