### Global Template Tags
Source: https://github.com/pbootcmspro/pbootcms/blob/master/README.md
Examples of global template tags used in PbootCMS for site-wide information.
```html
{pboot:sitetitle} 站点标题
{pboot:sitelogo} 站点logo
```
--------------------------------
### Install PbootCMS with MySQL
Source: https://github.com/pbootcmspro/pbootcms/blob/master/README.md
Instructions for setting up PbootCMS with a MySQL database, including importing the SQL file and configuring database connection details.
```sql
import "/static/backup/sql/xxx.sql"
```
--------------------------------
### Content Page Template Tags
Source: https://github.com/pbootcmspro/pbootcms/blob/master/README.md
Examples of PbootCMS template tags for displaying article details on a content page.
```html
{content:title}
{content:subtitle}
{content:author}
{content:source}
```
--------------------------------
### Initialize and Render Image List Table
Source: https://github.com/pbootcmspro/pbootcms/blob/master/apps/admin/view/default/system/extimage.html
This JavaScript function uses the Layui library to render a table displaying redundant image files. It fetches data from a specified URL and configures columns for file preview, path, and modification time. Use this to display the list of images to be checked.
```javascript
function checkDataFile(){
layui.use('table', function(){
var table = layui.table;
//第一个实例
table.render({
elem: '#list',
height: 500,
unresize:false,
url: $("#check_data").data('url'),//数据接口,
page: {
limit:30,
}, //开启分页
cols: [[
//表头
{width:80, type: 'checkbox'},
{field: 'static_path', title: '文件预览', templet: function (d){
return '
';
}},
{field: 'real_path', title: '文件路径'},
{field: 'update_time', title: '文件修改时间'}
]],
done:function (res,curr,count){
$('.layui-table-cell').css({'height':'auto'})
}
});
});
$(".layui-table").removeClass('layui-hide');
$(".buttons").removeClass('layui-hide');
}
```
--------------------------------
### Initialize File Upload Plugin
Source: https://github.com/pbootcmspro/pbootcms/blob/master/template/default/html/comm/upload.html
Initializes the file input plugin for single file uploads with preview and auto-replace enabled. Use this for standard single file uploads.
```javascript
$(document).on('ready', function() {
var target;
$(".upload").on("click",function(){
target=$(this).data("target");
upload('uploadInput',false,false,true,1);
$("#uploadBox").modal("show");
});
$(".uploads").on("click",function(){
target=$(this).data("target");
upload('uploadInputs',true,true,true,0);
$("#uploadBoxs").modal("show");
});
$(".file").on("click",function(){
target=$(this).data("target");
upload('fileInput',false,false,true,1);
$("#fileBox").modal("show");
});
function upload(inputName,showPreview,dropZoneEnabled,autoReplace,maxFileCount){
$("#"+inputName).fileinput({
language:'zh',
showUpload: false,
showPreview: showPreview,
dropZoneEnabled: dropZoneEnabled,
autoReplace: autoReplace,
elErrorContainer: '#kartik-file-errors',
uploadAsync: false,
maxFileCount: maxFileCount,
uploadUrl: '{pboot:upload}'//文件上传接口
}).on("filebatchuploadsuccess", function (event, data, previewId, index) {
if(data.response.code){
$(target).val(data.response.data);
$("img"+target).attr("src","{pboot:sitepath}"+data.response.data);
$("#"+inputName).fileinput('reset');
$("#uploadBox").modal("hide");
$("#fileBox").modal("hide");
$("#uploadBoxs").modal("hide");
}else{
alert(data.response.data);
}
});
$(".uploadSubmit").on("click",function(){
$("#"+inputName).fileinput("upload");
});
}
});
```
--------------------------------
### PbootCMS Footer Include
Source: https://github.com/pbootcmspro/pbootcms/blob/master/template/default/html/member/login.html
Includes the common footer file for the PbootCMS template.
```html
{include file=comm/foot.html}
```
--------------------------------
### List Page Template Tags
Source: https://github.com/pbootcmspro/pbootcms/blob/master/README.md
Demonstrates how to use PbootCMS template tags to display a list of articles on a list page.
```html
{pboot:list num=10 order=date}
[list:title]
{/pboot:list}
```
--------------------------------
### QQ Online Consultation Buttons
Source: https://github.com/pbootcmspro/pbootcms/blob/master/template/default/html/comm/foot.html
Creates buttons for initiating QQ chats with pre-sales and after-sales service representatives.
```html
[ 售前咨询专员](http://wpa.qq.com/msgrd?v=3&uin={pboot:companyqq}&site=qq&menu=yes)
[ 售后服务专员](http://wpa.qq.com/msgrd?v=3&uin={pboot:companyqq}&site=qq&menu=yes)
```
--------------------------------
### DOM Ready Initialization
Source: https://github.com/pbootcmspro/pbootcms/blob/master/core/extend/ueditor/dialogs/wordimage/wordimage.html
Initializes the word image dialog functionality once the DOM is fully loaded. This ensures that all necessary HTML elements are available before the script attempts to interact with them.
```javascript
utils.domReady(function () {
var options = {};
var callbacks = {};
wordImage.init(options, callbacks);
});
```
--------------------------------
### Contact Information Tags
Source: https://github.com/pbootcmspro/pbootcms/blob/master/template/default/html/comm/foot.html
Displays company phone, email, and QQ number using PbootCMS template tags.
```html
* 电话:{pboot:companyphone}
* 邮箱:{pboot:companyemail}
* Q Q:{pboot:companyqq}
```
--------------------------------
### Call and Online Consultation Links
Source: https://github.com/pbootcmspro/pbootcms/blob/master/template/default/html/comm/foot.html
Provides direct links for phone consultation and online QQ chat.
```html
[电话咨询](tel:{pboot:companymobile})
[在线咨询](http://wpa.qq.com/msgrd?v=3&uin={pboot:companyqq}&site=qq&menu=yes)
```
--------------------------------
### Content Listing and Filtering
Source: https://github.com/pbootcmspro/pbootcms/blob/master/apps/admin/view/default/content/content.html
Displays a list of content items with options for filtering, sorting, and batch operations. Includes logic for status, top, recommendation, and link management.
```html
{include file='common/head.html'}
{if(\[$list\])}
* {$model_name}内容
* {$model_name}新增
{$pathinfo} 全部栏目 {$search_select}
搜索 [清除搜索]({url./admin/Content/index/mcode/'.get\('mcode'\).'})
{foreach $contents(key,value)} {/foreach}
ID
栏目
标题
发布时间
排序
状态
置顶
推荐
访问量
操作
outlink)}disabled{/if} value="\[value->id\]">
\[value->id\]
\[value->sortname\]
{fun=substr_both($value->title,0,15)} {if($value->isheadline)} 头 {/if} {if($value->ico)} 缩 {/if} {if($value->pics)} 图 {/if} {if($value->outlink)} 链 {/if}
\[value->date\]
{if($value->status)} []({url./admin/'.C.'/mod/id/'.$value->id.'/field/status/value/0}){else} []({url./admin/'.C.'/mod/id/'.$value->id.'/field/status/value/1}){/if}
{if($value->istop)} []({url./admin/'.C.'/mod/id/'.$value->id.'/field/istop/value/0}){else} []({url./admin/'.C.'/mod/id/'.$value->id.'/field/istop/value/1}){/if}
{if($value->isrecommend)} []({url./admin/'.C.'/mod/id/'.$value->id.'/field/isrecommend/value/0}){else} []({url./admin/'.C.'/mod/id/'.$value->id.'/field/isrecommend/value/1}){/if}
\[value->visits\]
{if(!$value->outlink)} {php} $Parser=new app\home\controller\ParserController(); $link=$Parser->parserLink(2,$value->urlname,'content',$value->scode,$value->sortfilename,$value->id,$value->filename); {/php} [查看]({php}echo $link{/php}) {/if} {fun=get_btn_del($value->id)} {if(check_level('mod'))} [修改]({url./admin/Content/mod/mcode/'.get\('mcode'\).'/id/'.$value->id.'}{$btnqs}) {/if}
每页显示数量 20条/页 30条/页 50条/页 60条/页 100条/页 150条/页 200条/页
请选择移动/复制到栏目 {$search_select}
{if(check_level('mod'))} 复制 移动 {/if} {if(check_level('del'))} 批量删除 {/if} {if(check_level('mod'))} 保存排序 {if(\[baidu_zz_token\])} 百度普通推送 {/if} {if(\[baidu_ks_token\])} 百度快速推送 {/if} {/if}
function setDelAction(){
document.contentForm.action = "{url./admin/Content/del}";
return confirm("您确定要删除选中的内容么?");
}
{$pagebar}
```
--------------------------------
### Include Common Head and Foot
Source: https://github.com/pbootcmspro/pbootcms/blob/master/apps/admin/view/default/content/single.html
Includes common head and foot partial files for the HTML page.
```html
{include file='common/head.html'}
{include file='common/foot.html'}
```
--------------------------------
### Default Admin Login
Source: https://github.com/pbootcmspro/pbootcms/blob/master/README.md
Default credentials for accessing the PbootCMS administration panel.
```text
http://ip/admin.php
账号:admin
密码:123456
```
--------------------------------
### Company Information Tags
Source: https://github.com/pbootcmspro/pbootcms/blob/master/template/default/html/comm/foot.html
Displays company name, business license, ICP filing number, and address using PbootCMS template tags.
```html
{pboot:companyname}
* 营业执照:{pboot:companyblicense}
* 备案号码:[{pboot:siteicp}](http://beian.miit.gov.cn/)
* 地址:{pboot:companyaddress}
```
--------------------------------
### Image Sorting with Dragsort
Source: https://github.com/pbootcmspro/pbootcms/blob/master/apps/admin/view/default/content/single.html
Initializes the Dragsort plugin for sorting images within the 'pics_box' element. Includes a function to save the order of sorted images.
```javascript
.placeHolder {border:dashed 2px gray; }
$("#pics_box").dragsort({ dragSelector: "dl", dragSelectorExclude: "input,textarea,dd", dragBetween: false, dragEnd: saveOrder, placeHolderTemplate: "
" });
function saveOrder() {
var data = $("#pics_box dl dt img").map(function() {
return $(this).data("url");
}).get();
$("input[name=pics]").val(data.join(","))
};
```
--------------------------------
### Displaying Content List
Source: https://github.com/pbootcmspro/pbootcms/blob/master/apps/admin/view/default/content/single.html
Iterates through a list of content items to display details like ID, category, title, date, status, and visits. Includes links for viewing, modifying, and pushing content to Baidu.
```html
{if(\[$list\])}
* {$model_name}内容
{$pathinfo} 栏目名称 文章标题 文章内容
搜索 [清除搜索]({url./admin/Single/index/mcode/'.get\('mcode'\).'})
{foreach $contents(key,value)} {/foreach}
ID
栏目
标题
时间
状态
访问量
操作
\[value->id\]
\[value->sortname\]
{fun=substr_both($value->title,0,15)} {if($value->ico)} 缩 {/if} {if($value->pics)} 图 {/if} {if($value->outlink)} 链 {/if}
\[value->date\]
{if($value->status)} []({url./admin/'.C.'/mod/id/'.$value->id.'/field/status/value/0}){else} []({url./admin/'.C.'/mod/id/'.$value->id.'/field/status/value/1}){/if}
\[value->visits\]
{if(!$value->outlink)} {php} $Parser=new app\home\controller\ParserController(); $link=$Parser->parserLink(1,$value->urlname,'about',$value->scode,$value->filename,'',''); {/php} [查看]({php}echo $link{/php}) {/if} {if(check_level('mod'))} [修改]({url./admin/Single/mod/mcode/'.$value->mcode.'/id/'.$value->id.'}{$btnqs}) {if(\[baidu_zz_token\] && !$value->outlink)} [百度普通推送]({url./admin/'.C.'/mod/baiduzz/'.$value->id.'}) {/if} {if(\[baidu_ks_token\] && !$value->outlink)} [百度快速推送]({url./admin/'.C.'/mod/baiduks/'.$value->id.'}) {/if} {/if}
{/if}
```
--------------------------------
### Displaying Comment Status and Content
Source: https://github.com/pbootcmspro/pbootcms/blob/master/template/default/html/comm/comment.html
Use PbootCMS tags to conditionally display comment sections and iterate through comments and their replies.
```html
{pboot:if({pboot:commentstatus})}
#### 发表评论:
{pboot:2if({pboot:commentcodestatus})}

{/pboot:2if}
提交评论
#### 评论记录:
{pboot:comment contentid={content:id} num=20}

###### **[comment:nickname]** [comment:date]
[comment:comment] 回复
{pboot:commentsub}

###### **[commentsub:nickname]** [commentsub:date]
@[commentsub:pnickname] [commentsub:comment] 回复
{/pboot:commentsub}
{/pboot:comment} {pboot:2if({page:rows}>0)}
[首页]({page:index}#comment) [上一页]({page:pre}#comment) [下一页]({page:next}#comment) [尾页]({page:last}#comment)
{2else}
未查询到任何数据!
{/pboot:2if}
##### 回复评论:
×
{pboot:2if({pboot:commentcodestatus})}

{/pboot:2if}
关闭 提交评论
{/pboot:if}
```
--------------------------------
### UEditor Image Upload Initialization
Source: https://github.com/pbootcmspro/pbootcms/blob/master/core/extend/ueditor/dialogs/wordimage/wordimage.html
Initializes the UEditor image upload functionality, setting up parameters, action URLs, and WebUploader configuration. This code prepares the uploader for handling image uploads.
```javascript
var imageUrls = [], //用于保存从服务器返回的图片信息数组
selectedImageCount = 0, //当前已选择的但未上传的图片数量
optImageUrl = editor.getActionUrl(editor.getOpt('imageActionName')),
optImageFieldName = editor.getOpt('imageFieldName'),
optImageCompressBorder = editor.getOpt('imageCompressEnable') ? editor.getOpt('imageCompressBorder') : null,
maxSize = editor.getOpt('imageMaxSize') / 1024 / 1024,
extension = editor.getOpt('imageAllowFiles').join(';').replace(/\./g, '\ '); /* 添加额外的GET参数 */
var params = utils.serializeParam(editor.queryCommandValue('serverparam')) || '',
urlWidthParams = optImageUrl + (optImageUrl.indexOf('?') == -1 ? '?' : '&') + params;
var uploader,
actionUrl = editor.getActionUrl(editor.getOpt('imageActionName')),
acceptExtensions = (editor.getOpt('imageAllowFiles') || []).join('').replace(/\./g, ',').replace(/^[,]/, ''),
imageMaxSize = editor.getOpt('imageMaxSize'),
imageCompressBorder = editor.getOpt('imageCompressBorder');
uploader = WebUploader.create({
accept: {
title: 'Images',
extensions: acceptExtensions,
mimeTypes: 'image/*'
},
swf: '../../third-party/webuploader/Uploader.swf',
server: actionUrl,
fileVal: editor.getOpt('imageFieldName'),
duplicate: true,
fileSingleSizeLimit: imageMaxSize, // 默认 2 M
threads: 1,
compress: editor.getOpt('imageCompressEnable') ? {
width: imageCompressBorder,
height: imageCompressBorder,
// 图片质量,只有type为`image/jpeg`的时候才有效。
quality: 90,
// 是否允许放大,如果想要生成小图的时候不失真,此选项应该设置为false.
allowMagnify: false,
// 是否允许裁剪。
crop: false,
// 是否保留头部meta信息。
preserveHeaders: true
} : false
});
```
--------------------------------
### Include Ueditor
Source: https://github.com/pbootcmspro/pbootcms/blob/master/apps/admin/view/default/content/single.html
Includes the Ueditor rich text editor partial file.
```html
{include file='common/ueditor.html'}
```
--------------------------------
### List Forms and Actions
Source: https://github.com/pbootcmspro/pbootcms/blob/master/apps/admin/view/default/content/form.html
Iterates through a list of forms, displaying their details and providing actions like viewing data, editing fields, adding to menu, and deleting. Conditional logic is used for different form types and user permissions.
```html
{if(\[$list\])}
* 表单列表
* 表单新增
{foreach $forms(key,value)} {else} [查看数据]({url./admin/Form/index/fcode/'.$value->fcode.'/action/showdata}) {/if} {/foreach}
编码
表单名称
表名称
数据
字段
操作
\[value->fcode\]
\[value->form_name\]
\[value->table_name\]
{if($value->id==1)} [查看数据]({url./admin/Message/index})
[编辑字段]({url./admin/Form/index/fcode/'.$value->fcode.'/action/showfield})
{if($value->id!=1)} [添加到菜单]({url./admin/Form/mod/id/'.$value->id.'/action/addmenu}{$btnqs}) [删除]({url./admin/Form/del/id/'.$value->id.'/action/delform} "删除") {/if} [修改]({url./admin/Form/mod/id/'.$value->id.'/action/modform}{$btnqs})
{/if}
```
--------------------------------
### QR Code and Mobile Access Tag
Source: https://github.com/pbootcmspro/pbootcms/blob/master/template/default/html/comm/foot.html
Generates a QR code for mobile access to the current URL.
```html
{pboot:qrcode string={pboot:httpurl}{URL}}
扫一扫 手机访问
```
--------------------------------
### Member List Table
Source: https://github.com/pbootcmspro/pbootcms/blob/master/apps/admin/view/default/member/member.html
Displays a table of members with their details and actions. Includes conditional rendering for status and action buttons.
```html
{include file='common/head.html'}
{if(\[$list\])}
* 会员列表
* 会员新增
{$pathinfo} 会员用户名 会员邮箱 会员昵称
搜索 [清除搜索]({url./admin/Member/index})
{foreach $members(key,value)} {/foreach}
编号
用户名
昵称
状态
等级
积分
注册时间
最后登录时间
操作
\[value->ucode\]
\[value->username\]
\[value->nickname\]
{if($value->status)} []({url./admin/'.C.'/mod/id/'.$value->id.'/field/status/value/0}){else} []({url./admin/'.C.'/mod/id/'.$value->id.'/field/status/value/1}){/if}
\[value->gname\]
\[value->score\]
\[value->register_time\]
\[value->last_login_time\]
{fun=get_btn_more($value->id)} {fun=get_btn_del($value->id)} {fun=get_btn_mod($value->id)}
{if(\[$members\])}
{if(check_level('del'))} 删除 {/if} {if(check_level('mod'))} 启用 禁用 {/if}
{/if}
{$pagebar}
{/if}
```
--------------------------------
### Copyright Tag
Source: https://github.com/pbootcmspro/pbootcms/blob/master/template/default/html/comm/foot.html
Displays the website's copyright information.
```html
{pboot:sitecopyright}
```
--------------------------------
### UEditor Global Configuration
Source: https://github.com/pbootcmspro/pbootcms/blob/master/core/extend/ueditor/dialogs/wordimage/wordimage.html
Sets global options for UEditor, including image field name, compression settings, and maximum image dimensions. This is typically called once at initialization.
```javascript
editor.setOpt({
wordImageFieldName: "upfile",
compressSide: 0,
maxImageSideLength: 900
});
```
--------------------------------
### PbootCMS Login Form HTML
Source: https://github.com/pbootcmspro/pbootcms/blob/master/template/default/html/member/login.html
The HTML structure for the login form, including input fields for username, password, and CAPTCHA, as well as links for registration and password recovery. It utilizes PbootCMS template tags for dynamic content.
```html
{include file=comm/head.html} {include file=comm/top.html}
{include file=comm/position.html}
账 号
密 码
{pboot:if({pboot:logincodestatus})}
验证码

{/pboot:if}
立即登录 [注册账号]({pboot:register}) [找回密码]({pboot:retrieve})
```
--------------------------------
### Process Redundant Image Files
Source: https://github.com/pbootcmspro/pbootcms/blob/master/apps/admin/view/default/system/extimage.html
This JavaScript function handles the action of cleaning redundant image files based on user selection or a 'clean all' command. It sends a POST request with the type of cleaning operation and a list of selected files. Use this after checking the files to initiate the cleanup process.
```javascript
function do_ext(type){
let jsonList = {};
switch (type){
case 0:
jsonList = layui.table.checkStatus('list').data;
break;
case 1:
break;
}
$.ajax({
type: 'POST',
url: $("#do_ext").data('url'),
data:{type:type,list:jsonList},
dataType: 'json',
success: function (response) {
if(response.code === 1){
layer.msg('清理成功',{time: 1000},function (){
location.reload();
});
}
}
});
}
```
--------------------------------
### Member Detail View
Source: https://github.com/pbootcmspro/pbootcms/blob/master/apps/admin/view/default/member/member.html
Displays detailed information about a specific member, including personal details, status, group, points, and login history.
```html
{if(\[$more\])}
* 会员详情
{foreach $fields(key2,value2,num2)} {php}$field=$value2->name{/php} {/foreach}
编号
{$member->ucode}
用户名
{$member->username}
邮箱
{$member->useremail}
手机
{$member->usermobile}
昵称
{$member->nickname}
头像

等级
{$member->gname}
积分
{$member->score}
状态
{if(\[$member->status\]==1)}启用{/if} {if(\[$member->status\]==0)}禁用{/if}
\[value2->description\]
{$member->$field}
注册时间
{$member->register_time}
登录次数
{$member->login_count}
最后登录IP
{fun=long2ip(\[$member->last_login_ip\])}
最后登录时间
{$member->last_login_time}
{fun=get_btn_back()}
{/if}
```
--------------------------------
### Display Slide List
Source: https://github.com/pbootcmspro/pbootcms/blob/master/apps/admin/view/default/content/slide.html
Iterates through a list of slides to display their details in a table format. Includes operations for deletion and modification.
```html
{if(\[$list\])}
* 幻灯片列表
* 幻灯片新增
{foreach $slides(key,value)} {/foreach}
分组(gid)
图片
链接
标题
副标题
排序
操作
\[value->gid\]

\[value->link\]
\[value->title\]
\[value->subtitle\]
{fun=get_btn_del($value->id)} {fun=get_btn_mod($value->id)}
保存排序
{$pagebar}
{/if}
```
--------------------------------
### AJAX Check Registration Availability Function
Source: https://github.com/pbootcmspro/pbootcms/blob/master/template/default/html/member/register.html
Checks if a username is already registered via an AJAX request. It updates the UI to indicate whether the username is available or already taken.
```javascript
function isRegister(){
var url='{pboot:isregister}';
var username=$("#username").val();
if(!username){
$("#username").addClass("is-invalid");
$("#usernote").addClass("invalid-feedback");
$("#username").removeClass("is-valid");
$("#usernote").removeClass("valid-feedback");
$("#usernote").text("请输入需要注册的账号!");
return false;
}
$.ajax({
type: 'POST',
url: url,
dataType: 'json',
data: {
username: username
},
success: function (response, status) {
if(response.code){//已经被注册
$("#username").addClass("is-invalid");
$("#usernote").addClass("invalid-feedback");
$("#username").removeClass("is-valid");
$("#usernote").removeClass("valid-feedback");
}else{//未被注册
$("#username").addClass("is-valid");
$("#usernote").addClass("valid-feedback");
$("#username").removeClass("is-invalid");
$("#usernote").removeClass("invalid-feedback");
}
$("#usernote").text(response.data);
},
error:function(xhr,status,error){
alert('返回数据异常!');
}
});
return false;
}
```
--------------------------------
### Manage Form Fields
Source: https://github.com/pbootcmspro/pbootcms/blob/master/apps/admin/view/default/content/form.html
Lists fields associated with a form, showing details like description, name, length, and required status. Provides options to edit, delete, and sort fields, as well as add new fields.
```html
{if(\[$showfield\])}
* {$form->form_name}-表单字段
* 新增字段
{foreach $fields(key,value)} {/foreach}
序号
描述
字段
长度
是否必填
排序
操作
\[num\]
\[value->description\]
\[value->name\]
\[value->length\]
{if($value->required)} []({url./admin/'.C.'/mod/id/'.$value->id.'/field/required/value/0}){else} []({url./admin/'.C.'/mod/id/'.$value->id.'/field/required/value/1}){/if}
\[value->sorting\]
[删除]({url./admin/Form/del/id/'.$value->id.'/fcode/'.\[$get.fcode\]} "删除") {fun=get_btn_mod($value->id)}
{$pagebar}
[返回表单]({url./admin/Form/index})
字段描述
字段名称
字段长度
是否必填
字段排序
立即提交 重置
{/if}
```
--------------------------------
### Handling Comment Reply Interaction
Source: https://github.com/pbootcmspro/pbootcms/blob/master/template/default/html/comm/comment.html
JavaScript code to show a reply modal and store the reply action URL.
```javascript
$('.replybtn').on("click",function(){
var url=$(this).data("action");
$("#reply").modal("show");
$("#replyform").data("action",url);
});
```
--------------------------------
### Displaying and Linking Content Categories
Source: https://github.com/pbootcmspro/pbootcms/blob/master/apps/admin/view/default/content/contentsort.html
Iterates through a list of content categories to display their names, codes, URLs, and associated models. It generates links for external links, single pages, or content lists based on category type and status. Includes operations for status toggling and deletion.
```html
{if(\[$list\])}
* 栏目列表
* 栏目新增
* 批量新增
{foreach $sorts(key,value)} {/foreach}
栏目名称
编码
URL名称
模型
列表页模板
详情页模板
排序
状态
操作
{if($value->son)} {else} {/if} \[value->name\] {if($value->outlink)} []([value->outlink]){else} {if($value->type==1)} []({url./admin/Single/index/mcode}/[value->mcode]&scode=[value->scode]){else} []({url./admin/Content/index/mcode}/[value->mcode]&scode=[value->scode]){/if} {/if}
\[value->scode\]
\[value->filename\]
{foreach $allmodels(key2,value2)} {if($value2->mcode==$value->mcode)} \[[value2->name\] {/if} {/foreach}
\[value->listtpl\]
\[value->contenttpl\]
{if($value->status)} []({url./admin/'.C.'/mod/scode/'.$value->scode.'/field/status/value/0}){else} []({url./admin/'.C.'/mod/scode/'.$value->scode.'/field/status/value/1}){/if}
{if(!$value->outlink)} {php} $Parser=new app\\home\\controller\\ParserController(); $link=$Parser->parserLink($value->type,$value->urlname,'list',$value->scode,$value->filename,'',''); {/php} [查看]({php}echo $link{/php}) {/if} {fun=get_btn_del($value->scode,'scode')} {fun=get_btn_mod($value->scode,'scode')}
保存排序 批量删除 function setDelAction(){
document.sortForm.action = "{url./admin/ContentSort/del}";
return confirm("您确定要删除选中的栏目么?");
}
$("#sortTable").treetable({
expandable: true,
column: 1,
indent:20,
stringCollapse:'收缩',
stringExpand:'展开'
});
* 基本选项
* 高级选项
父栏目
顶级栏目 {$sort_select}
栏目名称 *
URL名称
内容模型 *
请选择内容模型 {foreach $models(key,value)} \[[value->name\] {/foreach}
列表页模板
无 {foreach $tpls(key,value)} \[[value\] {/foreach}
详情页模板
无 {foreach $tpls(key,value)} \[[value\] {/foreach}
状态
浏览权限
不限制 {foreach $groups(key,value)} \[[value->gname\] {/foreach}
权限类型
小于 小于等于 等于 大于等于 大于
栏目副名称
栏目描述1
栏目描述2
栏目描述3
跳转链接
权限不足提示
栏目缩略图
__上传图片
栏目大图
__上传图片
SEO标题
SEO关键字
SEO描述
立即提交 重置
父栏目
顶级栏目 {$sort_select}
栏目名称
内容模型
请选择内容模型 {foreach $models(key,value)} \[[value->name\] {/foreach}
列表页模板
无 {foreach $tpls(key,value)} \[[value\] {/foreach}
详情页模板
无 {foreach $tpls(key,value)} \[[value\] {/foreach}
状态
立即提交 重置
{/if} {if(\[$mod\])}
* 栏目修改
* 基本选项
* 高级选项
父栏目
顶级栏目 {$sort_select}
栏目名称 *
URL名称
内容模型 *
请选择内容模型 {foreach $models(key,value)} mcode==\[$sort->mcode\])}selected{/if} data-type="\[value->type\]" data-listtpl="\[value->listtpl\]" data-contenttpl="\[value->contenttpl\]" >\[[value->name\] {/foreach}
列表页模板
{$sort->listtpl} 无 {foreach $tpls(key,value)} {if($value!=\[$sort->listtpl\])} \[[value\] {/if} {/foreach}
详情页模板
{$sort->contenttpl} 无 {foreach $tpls(key,value)} {if($value!=\[$sort->contenttpl\])} \[[value\] {/if} {/foreach}
同步子栏目模板
状态
status\]==1)}checked="checked"{/if}> status\]==0)}checked="checked"{/if}>
浏览权限
不限制 {foreach $groups(key,value)} gid\]==$value->id)}selected="selected"{/if}>\[[value->gname\] {/foreach}
权限类型
gtype\]==1)}selected="selected"{/if}>小于 gtype\]==2)}selected="selected"{/if}>小于等于 gtype\]==3)}selected="selected"{/if}>等于 gtype\]==4||(!\[$sort->gtype\]))}selected="selected"{/if}>大于等于 gtype\]==5)}selected="selected"{/if}>大于
栏目副名称
栏目描述1
栏目描述2
栏目描述3
跳转链接
权限不足提示
栏目缩略图
__上传图片
{if(\[$sort->ico\])}
删除
{/if}
栏目大图
__上传图片
{if(\[$sort->pic\])}
删除
{/if}
SEO标题
SEO关键字
SEO描述
{$sort->description}
立即提交 重置 {fun=get_btn_back()}
{/if} {include file='common/foot.html'}
```
--------------------------------
### Sortable Category Links
Source: https://github.com/pbootcmspro/pbootcms/blob/master/template/default/html/comm/foot.html
Generates links for sortable categories, displaying the category name and its link.
```html
{pboot:sort scode=1} [sort:name](sort:link) {/pboot:sort}
```
--------------------------------
### Content Modification Form
Source: https://github.com/pbootcmspro/pbootcms/blob/master/apps/admin/view/default/content/content.html
Form for modifying existing content, pre-populating fields with current data and supporting all field types from the addition form.
```html
* {$model_name}内容修改
* 基本内容
* 高级内容
内容栏目 *
请选择内容栏目 {$sort_select}
内容标题 *
{foreach $extfield(key,value)} {if($value->type==1)}
\[value->description\]
{/if} {if($value->type==2)}
\[value->description\]
{php}$name=$value->name;echo str_replace('
', "\r\n",$this->vars['content']->$name);{/php}
{/if} {if($value->type==3)}
\[value->description\]
{php} $radios=explode(',',$value->value); $name=$value->name; foreach ($radios as $value2) { if($this->vars['content']->$name==$value2){ echo ''; }else{ echo ''; } } {/php}
{/if} {if($value->type==4)}
\[value->description\]
{php} $checkboxs=explode(',',$value->value); $name=$value->name; echo '';//占位清空 $values=explode(',',$this->vars['content']->$name); foreach ($checkboxs as $value2) { if(in_array($value2,$values)){ echo ''; }else{ echo ''; } } {/php}
{/if} {if($value->type==5)}
\[value->description\]
__上传图片 {php}$name=$value->name; {/php}
{if(\[$content]->$name)}
删除
{/if}
{/if} {if($value->type==10)}
\[value->description\]
__上传多图
{php} $name=$value->name; if(\[$content->$name]){ $pics=explode(',',[$content->$name]); }else{ $pics = array(); } foreach ($pics as $key=>$value) { //需要留一个空,不然被解析为标签了 echo "

删除
"; }
{/php}
{/if} {if($value->type==6)}
\[value->description\]
__上传文件
{/if} {if($value->type==7)}
\[value->description\]
{/if} {if($value->type==8)}
\[value->description\]
{php} $name=@$value->name; {/php} {fun=decode_string(\[$content->$name])} //初始化编辑器 $(document).ready(function (e) { var ue = UE.getEditor('editor_\[value->name\]',{ maximumWords:10000 }); })
{/if} {if($value->type==9)}
\[value->description\]
```
--------------------------------
### Website Statistical Code
Source: https://github.com/pbootcmspro/pbootcms/blob/master/template/default/html/comm/foot.html
Placeholder for website statistical tracking code.
```html
{pboot:sitestatistical}
```
--------------------------------
### AJAX Login Function
Source: https://github.com/pbootcmspro/pbootcms/blob/master/template/default/html/member/login.html
A JavaScript function that handles user login using AJAX. It sends the username, password, and CAPTCHA to the server and processes the response to either log the user in or display an error message. It also handles CAPTCHA refreshing on error.
```javascript
function login(obj){
var url='{pboot:login}';
var username=$(obj).find("#username").val();
var password=$(obj).find("#password").val();
var checkcode=$(obj).find("#checkcode").val();
$.ajax({
type: 'POST',
url: url,
dataType: 'json',
data: { username: username, password: password, checkcode: checkcode },
success: function (response, status) {
if(response.code){
alert("登录成功!");
location.href=response.tourl;
}else{
$('#codeimg').click();
alert(response.data);
}
},
error:function(xhr,status,error){
alert('返回数据异常!');
}
});
return false;
}
```
--------------------------------
### Displaying Message Records
Source: https://github.com/pbootcmspro/pbootcms/blob/master/template/default/html/message.html
Iterates through message records to display nickname, content, OS, browser, and timestamps. Includes conditional display for administrator replies.
```html
{pboot:message num=2}

##### [message:nickname]:
[message:content]
[message:os] [message:bs] [message:askdate]
{pboot:if('[message:recontent]'!='')}

##### 管理员回复:
[message:recontent]
[message:replydate]
{/pboot:if}
{/pboot:message}
```
--------------------------------
### AJAX Registration Function
Source: https://github.com/pbootcmspro/pbootcms/blob/master/template/default/html/member/register.html
Handles the submission of registration form data via AJAX. It sends user credentials and verification codes to the server and processes the response to indicate success or failure.
```javascript
function register(obj){
var url='{pboot:register}';
var username=$(obj).find("#username").val();
var nickname=$(obj).find("#nickname").val();
var password=$(obj).find("#password").val();
var rpassword=$(obj).find("#rpassword").val();
var sex=$(':radio\[name="sex" \]:checked').val();
var checkcode=$(obj).find("#checkcode").val();
$.ajax({
type: 'POST',
url: url,
dataType: 'json',
data: {
username: username,
nickname: nickname,
password: password,
rpassword: rpassword,
sex: sex,
checkcode: checkcode
},
success: function (response, status) {
if(response.code){
alert("注册成功!");
location.href= response.tourl;
}else{
$('#codeimg').click();
alert(response.data);
}
},
error:function(xhr,status,error){
alert('返回数据异常!');
}
});
return false;
}
```
--------------------------------
### Content Addition Form
Source: https://github.com/pbootcmspro/pbootcms/blob/master/apps/admin/view/default/content/content.html
Form for adding new content, supporting various field types including text, textareas, radios, checkboxes, images, multi-images, files, rich text editors, and select dropdowns.
```html
* 基本内容
* 高级内容
内容栏目 *
请选择内容栏目 {$sort_select}
内容标题 *
{foreach $extfield(key,value)} {if($value->type==1)}
\[value->description\]
{/if} {if($value->type==2)}
\[value->description\]
{/if} {if($value->type==3)}
\[value->description\]
{php} $radios=explode(',',$value->value); foreach ($radios as $value2) { echo ''; } {/php}
{/if} {if($value->type==4)}
\[value->description\]
{php} $checkboxs=explode(',',$value->value); foreach ($checkboxs as $value2) { echo ''; } {/php}
{/if} {if($value->type==5)}
\[value->description\]
__上传图片
{/if} {if($value->type==10)}
\[value->description\]
__上传多图
{/if} {if($value->type==6)}
\[value->description\]
__上传文件
{/if} {if($value->type==7)}
\[value->description\]
{/if} {if($value->type==8)}
\[value->description\]
//初始化编辑器 $(document).ready(function (e) { var ue = UE.getEditor('editor_\[value->name\]',{ maximumWords:10000 }); })
{/if} {if($value->type==9)}
\[value->description\]
{php} $selects=explode(',',$value->value); foreach ($selects as $value2) { echo ''.$value2.''; } {/php}
{/if} {/foreach}
内容
tags
作者
来源
缩略图
__上传图片
轮播多图
__上传多图
参数
浏览权限
不限制 {foreach $groups(key,value)} \[value->gname\] {/foreach}
权限类型
小于 小于等于 等于 大于等于 大于
内容副栏目
请选择内容副栏目 {$subsort_select}
标题颜色
副标题
URL名称
跳转外链接
权限不足提示
发布时间
温馨提示:设置未来时间可定时发布!
附件
__上传附件
SEO关键字
SEO描述
状态
立即提交 重置
```
--------------------------------
### View Form Data
Source: https://github.com/pbootcmspro/pbootcms/blob/master/apps/admin/view/default/content/form.html
Displays data records for a specific form. It iterates through form data and associated fields, showing details for each record and providing options to delete or clear records, and export data.
```html
{if(\[$showdata\])}
* {$form->form_name} — 数据
{foreach $formdata(key,value,num)} {foreach $fields(key2,value2,num2)} {php} $field=$value2->name {/php} {/foreach}
{$form->form_name}-\[num\] [删除]({url./admin/Form/del/id/'.$value->id.'/fcode/'.\[$form->fcode\]/action/deldata} "删除")
\[value2->description\]
\[value->$field\]
时间
\[value->create_time\]
{/foreach} {if(session('ucode')==10001 && \[$formdata\])} [清空记录]({url./admin/Form/clear/fcode/'.\[$form->fcode\]}) {/if} {if(\[$formdata\])} [导出记录]({url./admin/Form/index/fcode/'.\[$form->fcode\]/action/showdata/export/1}) {/if}
{$pagebar}
{/if}
```
--------------------------------
### Member Add/Edit Form
Source: https://github.com/pbootcmspro/pbootcms/blob/master/apps/admin/view/default/member/member.html
Form for adding or editing member details, including fields for username, email, password, avatar, status, group, and points.
```html
{if(\[$list\])}
用户名 *
邮箱
手机
昵称
登录密码 *
头像
__上传图片
状态
等级
{foreach $groups(key,value)} \[value->gname\] {/foreach}
积分
立即提交 重置
{/if}
```
--------------------------------
### Add New Slide Form
Source: https://github.com/pbootcmspro/pbootcms/blob/master/apps/admin/view/default/content/slide.html
Form for adding a new slide, including fields for group, image upload, link, title, subtitle, and sort order.
```html
分组
{foreach $gids(key,value)} 分组\[value\] {/foreach} 自动新增分组
图片
__上传图片
链接
标题
副标题
排序
立即提交 重置
```
--------------------------------
### WebUploader Upload Success Handler
Source: https://github.com/pbootcmspro/pbootcms/blob/master/core/extend/ueditor/dialogs/wordimage/wordimage.html
Handles the response after a successful file upload via WebUploader. It checks the server response state, updates the UI, and stores the image URL if the upload was successful.
```javascript
uploader.on('uploadSuccess', function (file, res) {
if ('state' in res) {
if (res.state === 'SUCCESS') {
if (res.url) {
imageUrls.push({
name: file.name,
url: res.url,
title: ''
});
if ($('#fileUrl').val().indexOf(file.name) >= 0) {
$('#fileUrl').val(res.url);
$('.image-tip').html('转存成功,请提交确认');
}
} else {
$('.image-tip').html('上传失败:' + JSON.stringify(res))
}
} else {
$('.image-tip').html('上传失败:' + JSON.stringify(res))
}
} else {
$('.image-tip').html('上传失败:' + JSON.stringify(res))
}
});
```