search
HomeCMS TutorialPHPCMSHow to retrieve column pictures in phpcms

How to retrieve column pictures in phpcms

1. The best solution for calling the column image on the phpcms column page:

phpcms calls the highest parent column image:

{$CATEGORYS[$top_parentid][image]}

phpcms calls directly Parent column picture:

{$CATEGORYS[$parentid][image]}

phpcms calls the current column picture:

{$CATEGORYS[$catid][image]}

phpcms calls the column picture with the specified id:

{$CATEGORYS[78][image]}

If the secondary column does not set a picture, then the default Call the picture of the parent column

{if $image}<img  src="/static/imghwm/default1.png"  data-src="{$CATEGORYS[$catid][image]}"  class="lazy"      style="max-width:90%"  style="max-width:90%" style="border:0px;" alt="How to retrieve column pictures in phpcms" >{else}<img  src="/static/imghwm/default1.png"  data-src="{$CATEGORYS[$top_parentid][image]}"  class="lazy"      style="max-width:90%"  style="max-width:90%" style="border:0px;" alt="How to retrieve column pictures in phpcms" >{/if}

2. As follows:

 <div class="czb">
   {pc:content action="category" catid="$top_parentid" num="20" siteid="$siteid" order="listorder ASC"}
  {loop $data $r}
  <div class="cbox">
   <div class="cboxt"><h3 id="a-nbsp-href-r-url-r-catname-a"><a href="{$r[url]}">{$r[catname]}</a></h3><span><a href="{$r[url]}">更多>></a></span></div>
   <div class="cboxm"><img  src="/static/imghwm/default1.png"  data-src="{thumb($r[image],96,96)}"  class="lazy"      style="max-width:90%" height="96px"/ alt="How to retrieve column pictures in phpcms" >
<!--wei-->
{pc:content action="position" catid="$r[catid]" num="1" order="id DESC" posid="32"}
{loop $data $r}
   <p><a href="{$r[url]}">{str_cut($r[title],36,&#39;..&#39;)}</a></p>
   <p>{str_cut($r[description],116,&#39;..&#39;)}<a href="{$r[url]}">[详情]</a></p></div>
{/loop}
{/pc}
    
   {pc:content action="lists" catid="$r[catid]" num="5" siteid="$siteid" order="id desc" }
   <ul>  
   {loop $data $val}
   <li><span>[{date(&#39;m-d&#39;,$val[inputtime])}]</span><p><a href="{$val[&#39;url&#39;]}">{$val[&#39;title&#39;]}</a></p></li> 
    {/loop}
    {/pc}
   </ul>
  </div><!--cbox-->
  {/loop}
  {/pc}
  </div>

Recommended related tutorials: phpcms tutorial

The above is the detailed content of How to retrieve column pictures in phpcms. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor