PHPCMS usage tutorialThe column introduces frequently used syntax
Recommended (free) :PHPCMS usage tutorial
Comment call:
{php?$comment_tag?=?pc_base::load_app_class("comment_tag",?"comment");?$comment_total?=?$comment_tag->count(array('commentid'=>'content_'.$v[catid].'-'.$v[id].'-'.$modelid));} comment:?{if?$comment_total}{$comment_total}{else}0{/if}
Recommended position call:
{pc:content?action="position"?posid="2"??moreinfo="1"?catid="$catid"?order="listorder?DESC"?num="1"} {loop?$data?$r} {/loop} {/pc}
Click call:
<script language="JavaScript" src="{APP_PATH}api.php?op=count&id={$id}&modelid={$modelid}"></script>
List page call:
{php?$db?=?pc_base::load_model('hits_model');?$_r?=?$db->get_one(array('hitsid'=>'c-'.$modelid.'-'.$r[id]));?$views?=?$_r[views];?} {$views}
Content page call:
hit:<script language="JavaScript" src="{APP_PATH}api.php?op=count&id={$id}&modelid={$modelid}"></script>
Total number of judgments:
{if?$n==count($dat)}class="friendly-border"?{/if}
News previous article next article display
<span class="fl">上一篇:<a href="{$previous_page[url]}">{$previous_page[title]}</a></span> <span class="fr">下一篇:<a href="{$next_page[url]}">{$next_page[title]}</a></span>
Phpcms grouping
array_chunk($data(數(shù)組),10(每組有幾個數(shù))) <p class="bd"> ????{pc:content?action="lists"?moreinfo="1"?catid="17"?num="20"?order="id?ASC"} ????{php?$da=array_chunk($data,4(每組顯示幾個));} ????????{loop?$da?$d} ????????<p class="wrap1"> ??????????{php?$i=1;} ????????????{loop?$d?$r} ????????????<p class="box1 {if $i==4} br1 {/if}"> ????????????????<a class="hot" href="{$r[url]}" > ???????????????? ????????????????<p>{$r[title]}</p> ????????????????</a> ????????????</p> ????????????{php?$i++;} ????????????{/loop} ????????</p> ????????{/loop} ????????{/pc} ???????? ????</p>
//Intercept the number of words
{str_cut($r[description],102,'...')}? {str_cut(strip_tags($r[content]),300,"...")}??//截取文字??strip_tags()?函數(shù)剝?nèi)プ址械?HTML、XML?以及?PHP?的標簽。
Add to favorites and set the homepage
<a target=_top href="javascript:window.external.addFavorite('http://www.webjx.com','網(wǎng)頁教學(xué)網(wǎng)');">加入收藏</a> <a href='#' onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.webjx.com');">設(shè)為首頁</a>
Add anchor
{$r[url]}#n{$r[id]}??{$rs[url]}&#area{$n}
Time difference
{php?$now?=?strtotime("now")} {date('d',$now-$r[inputtime])}天前
Get the current column
{php?$arrid=$r[catid]}???{$CATEGORYS[$arrid][catname]}
Get the parent column of the current column
{$CATEGORYS[$CATEGORYS[$arrid][parentid]][catname]}
Current position call:
{catpos($catid)}
phpcms starts calling from the specified number
{pc:content?action="lists"?catid="10"?order="id?DESC?LIMIT?1,4--"?num="4"} //這樣就可以從第二條開始調(diào)用數(shù)據(jù)。 其中的order="id?DESC?LIMIT?1,4--"里的兩個數(shù)字,第1個數(shù)字1表示從第2條開始調(diào)用,第2個數(shù)字4表示共調(diào)用4條。 如果改成order="id?DESC?LIMIT?0,4--"那么就表示從第1條開始調(diào)用,共調(diào)用4條。 如果改成order="id?DESC?LIMIT?2,4--"那么就表示從第3條開始調(diào)用,共調(diào)用4條。 欄目指定第幾個顯示(phpcms從指定第幾條開始調(diào)用?) 1--->??????從第二個開始顯示 {php?$data?=?array_slice($data,1);} ?????{pc:content?action="category"?catid="$catid"?num="5"?siteid="$siteid"?order="listorder?ASC,id?ASC"} ????{php?$data?=?array_slice($data,1);} ????????{loop?$data?$r} ?????????????{if?$cat==$catid} ????????????<span {if $n=="1"} class="cur" {/if} >{$r[catname]}</span> ?????????????{else} ????????????<span {if $r[catid]==$catid} class="cur" {/if}>{$r[catname]}</span>????????????????????????{/if} ?????????????{/loop} ????????{/pc}
Return to the previous level
{$CATEGORYS[$catid][url]} <a href="javascript:history.back(-1);" class="back">返回上一級</a>
Related articles
{pc:content?action="relation"?relation="$relation"?catid="$catid"?num="5"?keywords="$rs[keywords]"} {loop?$data?$r} <li>·<a href="{$r[url]}" target="_blank">{$r[title]}</a><span>({date('Y-m-d',$r[inputtime])})</span></li> {/loop} {/pc}
Calling multiple pictures
{loop?string2array($r['pics'])??$v}
Calling ads
{php?$banner=getads(11);$i=1;} ????<ul> ????????{loop?$banner[d]?$v} ????????{if?$i<=5} <li _src="url({$v[imageurl]})" style="background:none no-repeat center center;"><a href="{$v[linkurl]}"></a></li> ???????{/if} ???????{php?$i++;} ???????{/loop}?? ???????</ul>
Calling friendly links
圖片鏈接: {pc:link?action="lists"?typeid="0"?siteid="$siteid"?linktype="1"?order="desc"?num="6"?return="dat"} ????{loop?$dat?$v} ?????<a href="{$v[url]}" title="{$v[name]}" target="_blank"></a> ?????{/loop} {/pc} 文字鏈接: {pc:link?action="lists"?typeid="0"?siteid="$siteid"?linktype="0"?order="desc"?num="10"?return="dat"} ????{loop?$dat?$v} ?????????????<a href="{$v[url]}" title="{$v[name]}" target="_blank">{$v[name]}?</a> ????????{/loop} {/pc}
Judge whether the array contains a certain number
if(in_array("29",$xmlx)){ ????//array_push($xmlx,$qt); ????$qt=$_POST['qita']; }
Column page calling source:
{php?list($copyfrom)?=?explode('|',?$r['copyfrom'])}??{$copyfrom}
Call verification code:
前臺 {php?pc_base::load_sys_class('form',?'',?0);$setting?=?getcache('formguide',?'commons');}? {form::checkcode('code_img',?'4',?90,?30)} ?{form::checkcode('code_img','4','14',110,30)} 后臺開始session配置 //啟動session $session_storage?=?'session_'.pc_base::load_config('system','session_storage'); pc_base::load_sys_class($session_storage);
Mysql search how to determine whether a field contains a certain string
利用mysql?字符串函數(shù)?find_in_set(); SELECT?*?FROM?users?WHERE?find_in_set('aa@email.com',?emails);
Calling the model drop-down box
{php?$ks=filtersele('dertment',12);}
Path jump (without a tag):
<script> ????function?urls(obj){ ????var?url?=?$(obj).attr('data-url'); ????window.location.href?=?url; } </script> <span data-url="javascript:history.back();" onclick="urls(this)" >返回</span>
Jump to the home page
{siteurl($siteid)}
Column picture call
{$CATEGORYS[$catid][image]}
Mobile site previous articleNext article
PHP源碼修改: 打開?phpcms\modules\wap\index.php?文件 找到 if(!$r?||?$r['status']?!=?99)?showmessage(L('info_does_not_exists'),'blank'); 在其下面添加 //上一篇 $previous_page?=?$this->db->get_one("`catid`?=?'$catid'?AND?`id`<'$id' AND `status`=99",'*','id DESC'); //下一篇 $next_page = $this->db->get_one("`catid`=?'$catid'?AND?`id`>'$id'?AND?`status`=99"); //當前頁為第一篇時:再點擊上一篇仍然顯示第一篇 if(empty($previous_page))?{ $previous_page?=?$this->db->get_one("`catid`?=?'$catid'?AND?`id`='$id'?AND?`status`=99",'*','id?DESC'); } //當前頁為最后一篇時:再點擊下一篇仍然顯示最后一篇 if(empty($next_page))?{ $next_page?=?$this->db->get_one("`catid`=?'$catid'?AND?`id`='$id'?AND?`status`=99"); } 調(diào)用: ?<a href="{WAP_SITEURL}?m=wap&c=index&a=show&catid={$catid}&typeid={$typeid}&id={$previous_page[id]}" class="page">上一條:{$previous_page[title]}</a>???????????? <a href="{WAP_SITEURL}?m=wap&c=index&a=show&catid={$catid}&typeid={$typeid}&id={$next_page[id]}" class="page">下一條:?{$next_page[title]}</a>
Mobile site call Column picture
{$TYPE[$typeid][image]}
Column secondary display
{pc:content?action="category"?catid="0"?order="listorder?DESC"?siteid="$siteid"?num="7"} ????????{loop?$data?$r} ????????????<li class="navList {if $r[catid]==$catid||$r[catid]==$cat}on{/if}" > ????????????????<a href="{$r[url]}" class="href">{$r[catname]}</a> ????????????????????<p class="listList"> ????????????????????{pc:content?action="category"?catid="$r[catid]"?num="8"?siteid="$siteid"?order="listorder?DESC"?return="dat"} ????????????????????{loop?$dat?$v} ????????????????????????<a href="{$v[url]}">{$v[catname]}</a> ????????????????????{/loop} ????????????????????{/pc} ????????????????????</p> ????????????</li> ????????{/loop} ????????{/pc}
Download model
????????{pc:content?action="lists"?catid="$catid"?num="15"?order="id?DESC"?page="$page"?moreinfo="1"} ????????{loop?$data?$r} ????????????{php?$xiazai?=?string2array($r['downfiles']);} ????????????{loop?$xiazai?$b} ????????????????<dl class="news_dl"> ????????????????????<dt> ????????????????????????<a href="{$b[fileurl]}" title="{$r[title]}" class="dt_1"> ????????????????????????????{$r[title]} ????????????????????????</a> ????????????????????????<span class="dt_2">[{date('Y-m?H:i',$r[inputtime])}]</span> ????????????????????</dt> ????????????????????<dd> ????????????????????????{str_cut(strip_tags($r[content]),340)} ????????????????????</dd> ????????????????</dl> ????????????????<!-- 文件地址調(diào)用標簽:{$b[fileurl]} 文件名調(diào)用標簽:{$b[filename]} --> ????????????{/loop} ????????{/loop} ????????{/pc}
Judge odd and even numbers
{$n}.{if?$n%2==0}偶數(shù){else}奇數(shù){/if}???<br>
The above is the detailed content of Recommended PHPCMS guide. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

How to jump to the details page in phpcms: 1. Use the header function to generate a jump link; 2. Loop through the content list; 3. Get the title and details page link of the content; 4. Generate a jump link.

PHP CMS is a PHP-based open source content management system for managing website content. Its features include ease of use, powerful functionality, scalability, high security, and free open source. It can save time, improve website quality, enhance collaboration and reduce development costs, and is widely used in various websites such as news websites, blogs, corporate websites, e-commerce websites and community forums.

phpcms is not completely free. phpcms is an open source cms system, but open source does not mean free. It has two versions: free version and commercial version. The free version is limited to personal non-commercial use, while the commercial version requires purchasing a license; individuals can use it for research, and if it is commercial application , you need to pay a certain fee.

Title: WeChat Login Integration Guide: PHPCMS in Action In today’s Internet era, social login has become one of the essential functions of a website. As one of the most popular social platforms in China, WeChat’s login function is also used by more and more websites. This article will introduce how to integrate the WeChat login function in the PHPCMS website and provide specific code examples. Step 1: Register a WeChat Open Platform Account First, we need to register a developer account on the WeChat Open Platform and apply for the corresponding development permissions. Log in [WeChat open platform]

PHPCMS user name security setting strategy revealed In website development, user account security has always been an aspect that developers attach great importance to. The security settings of the username are also crucial, because the username is not only the user's login credentials, but may also expose the user's personal information and even cause security risks. This article will reveal the username security setting strategy in PHPCMS and give specific code examples for developers to refer to. 1. Prevent common usernames. In order to improve the security of usernames, developers should prevent users from using excessive

PHPCMS is a free and open source content management system (CMS) that features: open source, modularity, flexibility, user-friendliness and community support. It can be used to create various types of websites, including corporate websites, e-commerce websites, blogs, and community forums. Technical requirements include: PHP 5.6 or higher, MySQL, MariaDB or PostgreSQL database, and Apache or Nginx web server.

There are two well-known versions of phpcms, namely: 1. phpCMS4, which supports custom URL rules. The website management background is beautiful and easy to use, and has many front-end plug-ins, which can freely expand functions; 2. phpCMS2008R1, which supports multi-language, multi-site management, and page The manager is convenient, flexible, very lightweight, and runs fast.

phpcms uses mysql database. phpcms is a PHP open source website management system, developed using PHP+MYSQL as the technical basis. PHPCMS V9 adopts OOP method to build the basic operating framework. The supported PHP version is PHP5 and above, and the supported MYSQL version is MySql 4.1 and above.
