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