How does phpcms_v9 display or exclude certain topics on the home page subcat (, 0, $ siteid) _ PHP Tutorial

Source: Internet
Author: User
How does phpcms_v9 display or exclude certain topics subcat (, 0, $ siteid) on the home page ). How does phpcms_v9 display or exclude certain topics subcat (, 0, $ siteid) on the home page? How does v9 display or exclude certain topics subcat (, 0, $ siteid) on the home page) use the column id in the red section below to control how phpcms_v9 displays or excludes some subcat (, 0, $ siteid) on the homepage)
V9 how to display or exclude certain topics in the home page subcat (, 0, $ siteid)

You can use the column id in the red section below to control which columns are displayed. The id is queried in the background based on the actual situation. the subcat function is used to view the last Appendix explanation. the following code is modified:

What columns are displayed in V9?

{Loop subcat (0, 0, 0, $ siteid) $ r}
{If $ r ['catid'] = 1 | $ r ['catid'] = 2} // which columns are displayed?
{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}



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 topic


{Loop subcat (0, 0, 0, $ siteid) $ r}
{If $ r ['catid'] = 3} {/If} // exclude a topic
{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}



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} function explanation:


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

/**

* Obtain subtopics
* @ Param $ parentid parent id
* @ Param $ type column type 1 is a single webpage type, and 0 is a topic type. (you can view the mysql database of phpcms)
* @ Param $ whether 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;
}

When (, 0, $ siteid) v9 on the home page, how to display or exclude certain topics subcat (, 0, $ siteid) using the column id in the red section below to control...

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.