Today, no matter how we set up personal blogs, corporate websites, or even big data content websites, we basically don't need to re-write our own programs. After all, there are many free and open-source CMS programs available on the Internet. CMS commonly used by Lao Jiang includes WordPress, which is suitable for content and custom websites that are slightly more automated. For example, the Lao Jiang tribe adopts this CMS and uses more zblog php programs, after the PHP version is automatically available, the usage is high, because currently there are many Linux virtual hosts and VPS hosts, which are used for enterprise websites and lightweight blogs.
For general users, it is sufficient for us to be familiar with 1-3 open-source free applications. Basically, the kernel does not need to be defined and changed by ourselves. We only need to sort out the commonly used call code, you can call the template directly later. In this article, Lao Jiang will sort out the list of the latest articles called during zblog php template creation, filtered by clicks and comments.
First, the latest article
The code is as follows: |
Copy code |
{Foreach GetList (8) as $ newlist}
<Li> <a href = "{$ newlist. url} "title =" {$ newlist. title} "> {$ newlist. title} </a> <span >{$ newlist. time ('M-D')} </span> </li>
{/Foreach}
|
Call the latest 8 articles.
2. Call clicks
The code is as follows: |
Copy code |
{Php}
$ Order = array ('log _ viewnums' => 'desc ');
$ Where = array ('=', 'log _ status', '0 '));
$ Array = $ zbp-> GetArticleList (array ('*'), $ where, $ order, array (8 ),'');
{/Php}
{Foreach $ array as $ hotlist}
<Li> <span> {$ hotlist. viewNums} Times </span> <a href = "{$ hotlist. url} "title =" {$ hotlist. title} "> {$ hotlist. title} </a> </li>
{/Foreach}
|
Sort the number of clicks/readings in an article. You can call up to eight articles.
Third, comment on articles at most
The code is as follows: |
Copy code |
{Php}
$ Order = array ('log _ commnums' => 'desc ');
$ Where = array ('=', 'log _ status', '0 '));
$ Array = $ zbp-> GetArticleList (array ('*'), $ where, $ order, array (8 ),'');
{/Php}
{Foreach $ array as $ hotlist}
<Li> <span> {$ hotlist. commNums} comment </span> <a href = "{$ hotlist. url} "title =" {$ hotlist. title} "> {$ hotlist. title} </a> </li>
{/Foreach}
|
Call 8 articles based on comment data.
In summary, I usually use more of the above three calls, which can be used when creating themes.