本文目錄一覽:
誰可能給我介紹一下PHP CMS?它到底有什麼用啊?
cms是content management system ,內容管理系統 具體點說就是文章發布管理後台 類似寫博客的時候所用的頁面 用來管理一個網站的文章發布。
PHP是一種服務器端編程語言,可以用來編寫實現cms。
phpcms文章描述標籤什麼?
phpcms常用標籤
guml
php開發
頂級欄目名稱:{$CATEGORYS[$top_parentid][catname]}
頂級欄目url:{$CATEGORYS[$top_parentid][url]}
頂級欄目id:{$CATEGORYS[$top_parentid][catid]}
其他字段只需要改動xxx:{$CATEGORYS[$top_parentid][xxx]}
父欄目名稱:{$CATEGORYS[$CAT[parentid]][catname]}
父欄目url:{$CATEGORYS[$CAT[parentid]][url]}
父欄目id:{$CATEGORYS[$CAT[parentid]][catid]}
其他字段只需要改動xxx:{$CATEGORYS[$CAT[parentid]][xxx]}
**************************
內容頁:
{$CAT[catid]}//調用上一級 欄目id
{$CAT[catname]}//調用上一級 欄目名稱
{$CAT[url]}//調用上一級 欄目url
*****************************
{go($catid,$id)} 獲取當前頁面鏈接 {$url}在靜態時不正常
{$CATEGORYS[$catid][url]} 顯示當前欄目鏈接
{$CATEGORYS[$catid][catname]} 顯示當前欄目名稱
{$CATEGORYS[$r[catid]][catname]}循環內顯示欄目
{if $r[thumb]}img src=”{thumb($r[thumb],120,90)}”
alt=”{$r[title]}” width=”120″ height=”90″ /{/if}有圖顯示圖 沒圖不顯示
截取:{str_cut($r[title],46,”)}
{str_cut(strip_tags($r[content]),400)} 列表頁調取內容 過濾html標籤 需要加moreinfo=”1″
{date(‘Y-m-d H:i:s’, $r[‘inputtime’])} 列表頁調取發布時間
{date(‘Y-m-d’,strtotime($inputtime))} 或者 {date(‘Y-m-d’,time($inputtime))} 內容頁調取發布時間
**********************************************************************
phpcms 調用當前欄目下的子欄目
category.html 寫以下代碼:
{loop subcat($catid) $r}
ul
lia href=”{$r[url]}” title=”{$r[catname]}”{$r[catname]}/a/li
/ul
{/loop}
list.html 寫以下代碼:
{loop subcat($catid) $r}
ul
lia href=”{$CATEGORYS[$r[catid]][url]}”{$CATEGORYS[$r[catid]][catname]}/a/li
/ul
{/loop}
********************************************************************************
div class=”pindaoright” {if $r[thumb]==””} style=”width:100%;” {/if}
如果圖片不存在 則執行某某
********************************
{if $r[‘catid’]==$catid} class=”newclass” {/if} 導航欄當前欄目增加class
*********************************************************
phpcms分頁代碼
style type=”text/css”
.text-c {margin:10px 0;}
.text-c a {padding:5px;margin:0 8px;border:1px solid #ccc;background-color:#eee;}
/style
centerdiv id=”pages” class=”text-c”{$pages}/div/center
****************************************************************
phpcms v9列表頁默認分頁頁碼為10頁,下面為分頁頁碼條數的修改方法:
打開phpcms\libs\functions\global.func.php文件,
找到function pages函數(在672行左右)
修改下面代碼中紅色數字(10)為你想要顯示的頁碼條數即可。
function pages($num, $curr_page, $perpage = 20, $urlrule = ”, $array = array(),$setpages =?10)
———————
手機端圖片自適應大小和居中 文章縮進
style type=”text/css”
.part img {
width:100%!important;
height: auto!important;
display: table-cell!important;
}
.part p {
text-indent: 2em;
}
/style
————————————-
第一個是圖 剩下的是列表
{pc:content action=”lists” catid=”7″ order=”listorder DESC” thumb=”1″ num=”1″}
{php $imgarr=array();$count=0;}
{loop $data $r}
{php array_push($imgarr,$r[id]);}
h4
a href=”{$r[url]}” target=”_blank” title=”{$r[title]}”{str_cut($r[title],60,”)}/a
/h4
a href=”{$r[url]}” target=”_blank” title=”{$r[title]}”
img src=”{thumb($r[thumb],100,70)}” width=”100″ height=”70″ alt=”{$r[title]}”
/a
p{str_cut($r[description],90)}/p
{/loop}
{/pc}
/div
ul
{pc:content action=”lists” catid=”7″ order=”listorder DESC” num=”5″}
{loop $data $r}
{if $count4!in_array($r[id],$imgarr)}
{php $count++;}
lia href=”{$r[url]}” target=”_blank” title=”{$r[title]}”{str_cut($r[title],57,”)}/a/li
{/if}
{/loop}
{/pc}
*********************************************
phpcms調用sql實例
{pc:get sql=”select * from v9_news where catid=$catid and id!=$id order by updatetime desc” num=”10″}
{loop $data $r}
li
a target=”_blank” href=”{$r[url]}” style=”color:#333333;”{$r[title]}/a
span style=”margin-left: 30px;color: #666;font-size: 14px;”{date(‘Y-m-d’, $r[updatetime])}/span
/li
{/loop}
{/pc}
{pc:get sql=”SELECT * FROM `v9_news` WHERE thumb!=’$thumb’ Order by id DESC ” num=”50″} 調用有圖片的最新新聞
{loop $data $r}
織夢調用sql實例
{dede:sql sql=”select * from dede_archives where typeid=5 and id!=~id~”}
li
a href=”[field:id function=IDReturnURL(@me)/]” class=”step-link”[field:title/]/a
/li
{/dede:sql}
PHPCMS是什麼?
phpcms是一款具備文章、下載、圖片、分類信息、影視、商城、採集、財務等眾多功能的強大、易用、可擴展的優秀網站管理軟件。軟件採用模塊化開發,支持多種分類方式,使其可方便實現個性化網站的設計、開發與維護。它支持眾多的程序組合,可輕鬆實現網站平台遷移,並可廣泛滿足各種規模的網站需求,可靠性高。
原創文章,作者:小藍,如若轉載,請註明出處:https://www.506064.com/zh-hant/n/241296.html