Home Backend Development PHP Tutorial phpcms v9 模板标签说明拾掇

phpcms v9 模板标签说明拾掇

Jun 13, 2016 pm 01:14 PM
content gt loop lt

phpcms v9 模板标签说明整理

<span ><span style="color: #ff0000; font-size: small;">{template "content","header"}?
</span></span><span ><span style="font-size: small;">调用根目录下phpcms\template\content\header文件
</span></span>
Copy after login
<span ><span style="font-size: small;"><span style="color: #ff0000;">{CHARSET}?
</span></span></span><span ><span style="font-size: small;">字符集 (gbk或者utf-8)
</span></span>
Copy after login
<span ><span style="font-size: small;"><span style="color: #ff0000;">{if isset($SEO['title']) && !empty($SEO['title'])}
</span></span></span><span ><span style="color: #ff0000; font-size: small;">{$SEO['title']}{/if}
</span></span><span ><span style="color: #ff0000; font-size: small;">{$SEO['site_title']}
</span></span><span ><span style="color: #ff0000; font-size: small;">{$SEO['keyword']}
</span></span><span ><span style="color: #ff0000; font-size: small;">{$SEO['description']}
</span></span><span ><span style="font-size: small;">标题和标题seo优化
</span></span>
Copy after login
<span ><span style="font-size: small;"><span style="color: #ff0000;">{CSS_PATH}?
</span></span></span><span ><span style="font-size: small;">地址替换为根目录下\statics\css
</span></span>
Copy after login
<span ><span style="font-size: small;"><span style="color: #ff0000;">{JS_PATH}
</span></span></span><span ><span style="font-size: small;">地址替换为根目录下\statics\js
</span></span>
Copy after login
<span ><span style="font-size: small;"><span style="color: #ff0000;">{pc:content ?action="position" posid="9" order="id" num="10" cache="3600"}
</span></span></span><span ><span style="font-size: small;">pc标签{pc:content 参数名="参数值"参数名="参数值"参数名="参数值"}
</span></span>
Copy after login
<span ><span style="font-size: small;"><span style="color: #ff0000;">{loop $data $k $v}
</span></span></span><span ><span style="color: #ff0000; font-size: small;">? ? ? <li><a href="%7B%24v%5Burl%5D%7D">{$v[title]}</a></li>
</span></span><span ><span style="color: #ff0000; font-size: small;">{/loop}
</span></span>
Copy after login
<span ><span style="font-size: small;"><strong>pc标签值</strong>
</span></span><span ><span style="color: #ff0000; font-size: small;">action="position"--------------对话框的类型=“内容推荐位列表”
</span></span><span ><span style="color: #ff0000; font-size: small;">posid="9"----------------------推荐位ID="9"
</span></span><span ><span style="color: #ff0000; font-size: small;">order="id"---------------------排序类型="id"
</span></span><span ><span style="color: #ff0000; font-size: small;">num="10" ----------------------数据调用数量="10"
</span></span><span ><span style="color: #ff0000; font-size: small;">cache="3600"-------------------缓存="3600"毫秒
</span></span><span ><span style="color: #ff0000; font-size: small;">{get_siteid()}
</span></span><span ><span style="color: #ff0000; font-size: small;">{IMG_PATH}
</span></span><span ><span style="color: #ff0000; font-size: small;">action="hits" 排行,热点等
</span></span><span ><span style="color: #ff0000; font-size: small;">action="lists" 主要用于列表等。
</span></span><span ><span style="color: #ff0000; font-size: small;">catid="$catid" 当前栏目ID ? 指定数字,即为指定的栏目
</span></span><span ><span style="color: #ff0000; font-size: small;">num="" ?调用文章的数量
</span></span><span ><span style="color: #ff0000; font-size: small;">order="id DESC" 按ID降序排列
</span></span><span ><span style="color: #ff0000; font-size: small;">order="id ASC" ?按ID升序排列
</span></span><span ><span style="color: #ff0000; font-size: small;">"views DESC"?
</span></span><span ><span style="color: #ff0000; font-size: small;">sort=""
</span></span><span ><span style="color: #ff0000; font-size: small;">"1" 缩略图
</span></span><span ><span style="color: #ff0000; font-size: small;">return=""
</span></span><span ><span style="color: #ff0000; font-size: small;">page="$page" 需要分页
</span></span>
Copy after login
<span ><span style="font-size: small;">每当列表几行的时候出现一次这个
</span></span><span ><span style="color: #ff0000; font-size: small;">{if $num%2==0} ? {/if}
</span></span>
Copy after login
<span ><span style="font-size: small;">循环标签<span style="color: #ff0000;">
</span></span></span><span ><span style="color: #ff0000; font-size: small;">{loop $data $r} ?{/loop}
</span></span><span ><span style="font-size: small;"><span style="color: #ff0000;">{loop $info $r} ?{/loop}</span>
</span></span>
Copy after login
<span ><span style="font-size: small;">日期-------------{date('Y-m-d H:i:s',$r[inputtime])}
</span></span><span ><span style="font-size: small;">文章链接------{$r[url]}
</span></span><span ><span style="font-size: small;">文章标题------{$r[title]}
</span></span><span ><span style="font-size: small;">标题截取------{str_cut($r[title],40,'...')}
</span></span><span ><span style="font-size: small;">缩略图---------loop是info的时候用 ?{thumb($r[thumb],110,0)} ? ? loop是data的时候用{thumb($v[thumb],90,0)}
</span></span><span ><span style="font-size: small;">分页标签------{$pages}
</span></span><span ><span style="font-size: small;">文章页标签
</span></span><span ><span style="font-size: small;">标题-------{$title}
</span></span><span ><span style="font-size: small;">内容-------{$content}
</span></span><span ><span style="font-size: small;">日期-------{$inputtime}
</span></span><span ><span style="font-size: small;">来源-------{$copyfrom}
</span></span><span ><span style="font-size: small;">点击数------<span id="hits"></span> ?
</span></span><span ><span style="font-size: small;"><script language="JavaScript" src="%7BAPP_PATH%7Dapi.php?op=count&id=%7B%24id%7D&modelid=%7B%24modelid%7D"></script>
</span></span><span ><span style="font-size: small;">网站首页----------------{siteurl($siteid)}
</span></span><span ><span style="font-size: small;">当前位置----------------{catpos($catid)}
</span></span><span ><span style="font-size: small;">栏目名称----------------{$CAT[catname]}?
</span></span><span ><span style="font-size: small;">栏目拼音----------------{$CAT[letter]}
</span></span><span ><span style="font-size: small;">栏目链接----------------{$CAT[url]}
</span></span><span ><span style="font-size: small;">父栏目名称--------------{$CATEGORYS[$CAT[parentid]][catname]}?
</span></span><span ><span style="font-size: small;">父栏目链接--------------{$CATEGORYS[$CAT[parentid]][url]}
</span></span><span ><span style="font-size: small;">上上级栏目名称--------{$CATEGORYS[$CATEGORYS[$CAT[parentid]][parentid]][catname]}
</span></span><span ><span style="font-size: small;">上上级栏目链接--------{$CATEGORYS[$CATEGORYS[$CAT[parentid]][parentid]][url]}
</span></span>
Copy after login
<span ><span style="font-size: small;">?一级父栏目列表
</span></span><span style="color: #ff0000;"><span ><span style="font-size: small;">{pc:content action="category" catid="0" num="34" siteid="$siteid" order="listorder ASC"}
</span></span><span ><span style="font-size: small;">? ? ? {loop $data $r}
</span></span><span ><span style="font-size: small;">? ? ? ? ? ? <li><a href="%7B%24r%5Burl%5D%7D">{$r[catname]}</a></li>
</span></span><span ><span style="font-size: small;">? ? ? {/loop}
</span></span></span><span ><span style="font-size: small;"><span style="color: #ff0000;">{/pc}</span>
</span></span>
Copy after login
<span ><span style="font-size: small;">同级栏目列表
</span></span><span style="color: #ff0000;"><span ><span style="font-size: small;">{pc:content action="category" catid="$parentid" num="12" siteid="$siteid" order="listorder ASC"}
</span></span><span ><span style="font-size: small;">? ? ? {loop $data $r}
</span></span><span ><span style="font-size: small;">? ? ? ? ? ? <li><a href="%7B%24r%5Burl%5D%7D">{$r[catname]}</a></li>
</span></span><span ><span style="font-size: small;">? ? ? ?{/loop}
</span></span></span><span ><span style="font-size: small;"><span style="color: #ff0000;">{/pc}</span>
</span></span>
Copy after login
<span ><span style="font-size: small;">组图列表
</span></span><span style="color: #ff0000;"><span ><span style="font-size: small;">{loop $photos $r}?
</span></span><span ><span style="font-size: small;"><li><a href="%7B%24r%5Burl%5D%7D"><img src="%7Bthumb(%24r%5Burl%5D,%2075,%2045,%200)%7D" alt="{$r[alt]}"></a></li>
</span></span></span><span ><span style="font-size: small;"><span style="color: #ff0000;">{/loop}</span>
</span></span><span ><span style="font-size: small;">注释:其中$photos为自定义组图字段,{$r[url]}为图片地址,{thumb($r[url], 75, 45, 0)}为图片缩略图,{$r[alt]}为图片描述</span></span>
Copy after login
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What are the differences between Huawei GT3 Pro and GT4? What are the differences between Huawei GT3 Pro and GT4? Dec 29, 2023 pm 02:27 PM

Many users will choose the Huawei brand when choosing smart watches. Among them, Huawei GT3pro and GT4 are very popular choices. Many users are curious about the difference between Huawei GT3pro and GT4. Let’s introduce the two to you. . What are the differences between Huawei GT3pro and GT4? 1. Appearance GT4: 46mm and 41mm, the material is glass mirror + stainless steel body + high-resolution fiber back shell. GT3pro: 46.6mm and 42.9mm, the material is sapphire glass + titanium body/ceramic body + ceramic back shell 2. Healthy GT4: Using the latest Huawei Truseen5.5+ algorithm, the results will be more accurate. GT3pro: Added ECG electrocardiogram and blood vessel and safety

Fix: Snipping tool not working in Windows 11 Fix: Snipping tool not working in Windows 11 Aug 24, 2023 am 09:48 AM

Why Snipping Tool Not Working on Windows 11 Understanding the root cause of the problem can help find the right solution. Here are the top reasons why the Snipping Tool might not be working properly: Focus Assistant is On: This prevents the Snipping Tool from opening. Corrupted application: If the snipping tool crashes on launch, it might be corrupted. Outdated graphics drivers: Incompatible drivers may interfere with the snipping tool. Interference from other applications: Other running applications may conflict with the Snipping Tool. Certificate has expired: An error during the upgrade process may cause this issu simple solution. These are suitable for most users and do not require any special technical knowledge. 1. Update Windows and Microsoft Store apps

How to Fix Can't Connect to App Store Error on iPhone How to Fix Can't Connect to App Store Error on iPhone Jul 29, 2023 am 08:22 AM

Part 1: Initial Troubleshooting Steps Checking Apple’s System Status: Before delving into complex solutions, let’s start with the basics. The problem may not lie with your device; Apple's servers may be down. Visit Apple's System Status page to see if the AppStore is working properly. If there's a problem, all you can do is wait for Apple to fix it. Check your internet connection: Make sure you have a stable internet connection as the "Unable to connect to AppStore" issue can sometimes be attributed to a poor connection. Try switching between Wi-Fi and mobile data or resetting network settings (General > Reset > Reset Network Settings > Settings). Update your iOS version:

php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决 php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决 Jun 13, 2016 am 10:23 AM

php提交表单通过后,弹出的对话框怎样在当前页弹出php提交表单通过后,弹出的对话框怎样在当前页弹出而不是在空白页弹出?想实现这样的效果:而不是空白页弹出:------解决方案--------------------如果你的验证用PHP在后端,那么就用Ajax;仅供参考:HTML code

How to leverage AI Copilot for collaboration in the Microsoft Loop collaboration platform? How to leverage AI Copilot for collaboration in the Microsoft Loop collaboration platform? Nov 18, 2023 pm 01:33 PM

Microsoft Loop, enhanced with its new feature Copilot, is a modern tool designed to improve the way teams collaborate. It consists of three main parts: components, pages, and workspaces. Components are things like lists or notes that stay updated no matter where you use them, whether in email, documents, or chat. This means you are always working with the latest information. Cycle pages are like digital whiteboards where you put all your components, tasks, and data together. These pages can grow as your project grows, making it easy to keep everything in one place. Workspaces in Loop are shared areas where your team can view and organize everything important to the project, helping everyone

How to download and use Microsoft Loop How to download and use Microsoft Loop May 08, 2023 pm 01:16 PM

Microsoft is ready to give users access to the first preview version of the Loop project. Now, let's learn where to get it, how to install it and how to get the most out of it. Want to learn how to use this software across Office apps and manage tasks? You've come to the right place. What is the Microsoft Cycle? What should we say? You can compare loops to project boards. Here you can see a list of all Loop components and Loop pages, and who is currently working on them. Think of it as a modern file explorer where everything is live and collaborative. The loop page is a separate canvas where people can share and collaborate on loop components. In addition, Loop components are constantly updated and edited, without

Is watch4pro better or gt? Is watch4pro better or gt? Sep 26, 2023 pm 02:45 PM

Watch4pro and gt each have different features and applicable scenarios. If you focus on comprehensive functions, high performance and stylish appearance, and are willing to bear a higher price, then Watch 4 Pro may be more suitable. If you don’t have high functional requirements and pay more attention to battery life and reasonable price, then the GT series may be more suitable. The final choice should be decided based on personal needs, budget and preferences. It is recommended to carefully consider your own needs before purchasing and refer to the reviews and comparisons of various products to make a more informed choice.

How to optimize iPad battery life with iPadOS 17.4 How to optimize iPad battery life with iPadOS 17.4 Mar 21, 2024 pm 10:31 PM

How to Optimize iPad Battery Life with iPadOS 17.4 Extending battery life is key to the mobile device experience, and the iPad is a good example. If you feel like your iPad's battery is draining too quickly, don't worry, there are a number of tricks and tweaks in iPadOS 17.4 that can significantly extend the run time of your device. The goal of this in-depth guide is not just to provide information, but to change the way you use your iPad, enhance your overall battery management, and ensure you can rely on your device for longer without having to charge it. By adopting the practices outlined here, you take a step toward more efficient and mindful use of technology that is tailored to your individual needs and usage patterns. Identify major energy consumers

See all articles