Home > Backend Development > PHP Tutorial > phpcms_v9 How to display or exclude certain columns subcat(0,0,0,$siteid) on the homepage_PHP tutorial

phpcms_v9 How to display or exclude certain columns subcat(0,0,0,$siteid) on the homepage_PHP tutorial

WBOY
Release: 2016-07-13 10:19:06
Original
874 people have browsed it

How phpcms_v9 displays or excludes certain columns on the homepage subcat(0,0,0,$siteid)

How v9 displays or excludes certain columns on the homepage subcat(0,0,0,$siteid)


Use the column id in the red part below to control which columns are displayed. The id is queried in the background according to the actual situation. For the subcat function, see the explanation in the last attachment. Modify the code as follows:

How to display which columns in V9

{loop subcat(0,0,0,$siteid) $r}
{if $r['catid']==1||$r['catid']==2 } //Which columns to display
{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}


phpcms_v9 How to display or exclude certain columns subcat(0,0,0,$siteid) on the homepage_PHP tutorial
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}


How to exclude a certain column in V9


{loop subcat(0,0,0,$siteid) $r}
{if $r['catid']==3 }{/if} //Exclude a certain 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}


phpcms_v9 How to display or exclude certain columns subcat(0,0,0,$siteid) on the homepage_PHP tutorial
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}{/loop}函数解释:


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

/**

* Get sub-column
* @param $parentid parent id
* @param $type column type 1 is a single web page type, 0 is a column type; (you can see it by looking at the mysql database of phpcms)
* @param $self Whether it contains itself 0 means it does not contain
* @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;
}

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/879179.htmlTechArticlephpcms_v9如何在首页显示或排除某些栏目subcat(0,0,0,$siteid) v9如何在首页显示或排除某些栏目subcat(0,0,0,$siteid) 通过以下红色部分的栏目id来控制...
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template