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 Article

Hot Tools

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft