Phpcms_v9 How to display or exclude certain columns subcat (0,0,0, $siteid) _php tutorials on the homepage

Source: Internet
Author: User

Phpcms_v9 How to display or exclude certain columns on the homepage subcat (0,0,0, $siteid)


V9 How to display or exclude certain columns on the homepage subcat (0,0,0, $siteid)


Through the following red section of the column ID to control which columns to display, ID according to the actual situation background query, subcat function see the last attachment explanation, the following modified code:

V9 show which columns are used

{Loop subcat (0,0,0, $siteid) $r}
{if $r [' catid ' ]==1| | $r [' CatID ']==2}//Show which columns
{ php $num + +}

http://blog.csdn.net/a1079540945/article/details/{$r} more >>



{pc:content action= "lists" catid= "$r" order= "UpdateTime DESC" thumb= "1" num= "1" return= "info"}
{Loop $info $v}



< c40> target= " _blank" title= "{$v [" title ']} "{ Title_style ($v )}>{str_cut ($v [' title '],28)}
{str_cut ($v [' Description '],100)}


{/loop}
{/PC}

{pc:content action= "lists" catid= "$r" num= "5" order= "id DESC" return= "info"}

      {Loop $info $v}
    • · {str_cut ($v [' title '],40)}

    • {/loop}

{/PC}


{if $num%2==0} {/if}
{/if}
{/loop}


V9 how to exclude a column


{Loop subcat (0,0,0, $siteid) $r}
{if $r [' CatID ']==3} {/if}//Exclude a column
{ php $num + +}

http://blog.csdn.net/a1079540945/article/details/{$r} more >>



{pc:content action= "lists" catid= "$r" order= "UpdateTime DESC" thumb= "1" num= "1" return= "info"}
{Loop $info $v}



< c20> target= " _blank" title= "{$v [" title ']} "{ Title_style ($v )}>{str_cut ($v [' title '],28)}
{str_cut ($v [' Description '],100)}


{/loop}
{/PC}

{pc:content action= "lists" catid= "$r" num= "5" order= "id DESC" return= "info"}

      {Loop $info $v}
    • · {str_cut ($v [' title '],40)}

    • {/loop}

{/PC}


{if $num%2==0} {/if}
{/loop}

=====================================================

{Loop subcat (0,0,0, $siteid) $r} The {/loop} function explains:


{Loop subcat (0,0,0, $siteid) $r} {/loop}

/**

* Get sub-columns
* @param $parentid Parent ID
* @param $type Column Type 1 is a single page type, 0 is the column type; (see phpcms MySQL database)
* @param whether the $self contains itself 0 is not included
* @param $siteid Site ID
*/
function subcat ($parentid = null, $type = null, $self = ' 0 ', $siteid = ') {
if (empty ($siteid)) $siteid = Get_siteid ();
$category = GetCache (' Category_content_ '. $siteid, ' Commons ');
foreach ($category as $id = = $cat) {
if ($cat [' siteid '] = = $siteid && ($parentid = = = NULL | | $cat [' parentid '] = = $parentid) && ($type = = = NULL | | $cat [' type '] = = $type)) $subcat [$id] = $cat;
if ($self = = 1 && $cat [' catid '] = = $parentid &&! $cat [' child ']) $subcat [$id] = $cat;
}
return $subcat;
}

http://www.bkjia.com/PHPjc/879179.html www.bkjia.com true http://www.bkjia.com/PHPjc/879179.html techarticle phpcms_v9 How to show or exclude some columns subcat (0,0,0, $siteid) v9 How to display or exclude certain columns from the homepage subcat (0,0,0, $siteid) by the following red section of the column ID to control ...

  • Related Article

    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.