Home >CMS Tutorial >PHPCMS >How to retrieve column pictures in phpcms

How to retrieve column pictures in phpcms

王林
王林Original
2020-02-06 17:53:382798browse

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="{$CATEGORYS[$catid][image]}" width="994" height="229" style="border:0px;">{else}<img src="{$CATEGORYS[$top_parentid][image]}" width="994" height="229" style="border:0px;">{/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><a href="{$r[url]}">{$r[catname]}</a></h3><span><a href="{$r[url]}">更多>></a></span></div>
   <div class="cboxm"><img src="{thumb($r[image],96,96)}" width="96px" height="96px"/>
<!--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