Discuz Personal Space Theme list Picture mode implementation method

Source: Internet
Author: User

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.zip

Discuz Personal Space Theme list Picture mode implementation method

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.