模板调用代码
{eyou:artlist typeid='2' loop='5' titlelen='30' }
<li><a href="{$field.arcurl}" title="{$field.title}">{$field.title}</a></li>
{/eyou:artlist}
分享服务器维护、抵抗入侵、防篡改、防御攻击、排查后门木马、清理挖矿病毒、网络安全、信息安全、内网安全、数据灾备、网站搬迁、程序升级、威胁情报、网站安全运维的日常知识
模板调用代码
{eyou:artlist typeid='2' loop='5' titlelen='30' }
<li><a href="{$field.arcurl}" title="{$field.title}">{$field.title}</a></li>
{/eyou:artlist}
dedecms文章详情页面的上一篇下一篇默认标签是调取的标题和链接。
现在需要修改为只调取链接,因为上一篇下一篇是用左右箭头实现的,这样只需要获取上一篇下一篇的链接即可。
修改文件/include/arc.archives.class.php
找到代码
$this->PreNext['pre'] = "上一篇:<a href='$mlink'>{$preRow['title']}</a> ";
在下方添加
$this->PreNext['prelink'] = $mlink;
找到代码
$this->PreNext['pre'] = "上一篇:没有了 ";
在下方添加
$this->PreNext['prelink'] = "javascript:;";
找到代码
$this->PreNext['next'] = "下一篇:<a href='$mlink'>{$nextRow['title']}</a> ";
在下方添加
$this->PreNext['nextlink'] = $mlink;
找到代码
$this->PreNext['next'] = "下一篇:没有了 ";
在下方添加
$this->PreNext['nextlink'] = "javascript:;";
找到代码
else if($gtype=='preimg'){
在上方添加
else if($gtype=='prelink'){
$rs = $this->PreNext['prelink'];
}
else if($gtype=='nextlink'){
$rs = $this->PreNext['nextlink'];
}
修改后覆盖即可。
然后模板中使用
{dede:prenext get='prelink'/}
{dede:prenext get='nextlink'/}
如果开启了“关闭前台所有动态页面”选项,二次开发的文件如何能访问?
答:可以在开发的程序代码顶部一行加:define(‘EmpireCMSAdmin’,’1′);
就可以不受此设置影响。
安装成功后点击登录网站后台报404错误怎么办?
答: DedeCMS 默认的管理后台路径为 /dede
。遇到这个问题,需先检查 /dede
目录是否被重命名了。如果被重命名了,改回 /dede
即可。或直接在浏览器地址栏手动输入相应的管理后台路径,就可以打开后台登录页面了。
如何记录发布者IP:
增加“infoip”字段,infoip为记录IP的字段,只需将字段设置为录入项或投稿项,增加信息时自动存储发布者IP,字段类型用VARCHAR、长度15。
1.启动:ssh下面操作
(1)使用 service 启动:service mysqld start
(2)使用 mysqld 脚本启动:/etc/inint.d/mysqld start
2.停止:
(1)使用 service 停止:service mysqld stop
(2)使用 mysqld 脚本停止:/etc/inint.d/mysqld stop
3.重启:
(1)使用 service 重启:service mysqld restart
(2)使用 mysqld 脚本重启:/etc/inint.d/mysqld restart
生成内容页提示“Table ‘*.phome_ecms_’ doesn’t exist……update ***_ecms_ set havehtml=1 where id=” limit 1”
原因是你修改了栏目所属系统模型导致,因为栏目原来所属系统模型本身就有信息,而你改动了所属系统模型,使得这些信息无法找出所属栏目导致出错。
解决办法:修改栏目改回原来所属系统模型,然后进管理信息删除栏目所有的信息,最后再修改栏目改回所属新系统模型就可以解决。
具体步骤可以看:http://bbs.phome.net/showthread-35-46681-0.html
(此方法的好处是不用考虑重新设置目录权限问题)
1、恢复数据库数据到新服务器;
2、上传网站目录到新服务器,并设置好相应的目录权限;
3、修改e/class/config.php数据库配置参数(设置数据库帐号、密码及数据库名;utf-8版修改文件要用Dreamweaver等工具修改,不能用记事本);
4、完成。
模板文件放在/template/PC或Mobile/system/里面
<!-- 电脑端使用此标签需要加载 /template/pc/system/article_pay.htm 模板文件,手机端不需要此文件 -->
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<title>订单支付-{eyou:global name='web_name' /}</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
<link href="{eyou:global name='web_cmspath'/}/favicon.ico" rel="shortcut icon" type="image/x-icon" />
{eyou:static file="users/skin/css/basic.css" /}
{eyou:static file="users/skin/css/eyoucms.css" /}
<!-- 新样式 2020-11-25 -->
{eyou:static file="users/skin/css/element/index.css" /}
{eyou:static file="users/skin/css/e-user.css" /}
{eyou:include file="users/skin/css/diy_css.htm" /}
{eyou:static file="/public/static/common/js/jquery.min.js"/}
{eyou:static file="/public/plugins/layer-v3.1.0/layer.js"/}
{eyou:static file="users/skin/js/global.js" /}
<style>
.pay-item{border:1px solid #eee;height: 50px;position: relative;}
.pay-item-select{border:1px solid #1E9FFF;}
.pay-item-select::after{position: absolute;right: 4px;bottom: 0;content: ";width:6px;height: 12px;border-bottom: 2px solid #fff;border-right: 2px solid #fff;-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);transform: rotate(45deg);}
.pay-item.pay-item-select span {position: absolute;right: 0;bottom: 0;width: 0;height: 0;border-bottom: 20px solid #1E9FFF;border-left: 20px solid transparent;}
.button-wrapper{padding-left: 140px;text-align: left;margin-top: 20px;}
.layui-btn{height: 32px;line-height: 32px;border: 1px solid transparent;padding: 0 15px;background-color:#1E9FFF;color: #fff;white-space: nowrap;text-align: center;font-size: 14px;border-radius: 2px;cursor: pointer;}
.main-bg{margin-bottom: 0 !important;padding-bottom: 0 !important; }
</style>
</head>
<body>
<div class="ey-container w1200">
<div class="el-main main-bg">
<div class="el-form-item" style="text-align: center;">
<div class="el-form-item__content pay-type-select">
<!-- 支付API列表,套板请务必将整块代码一起复制,包含隐藏域 -->
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
{eyou:sppayapilist id='vo'}
{eyou:notempty name="$vo.pay_id"}
{neq name="$vo.pay_mark" value="Hupijiaopay"}
{eyou:php}$pay_mark_vars = "users/skin/images/".$vo['pay_mark'].".png";{/eyou:php}
<div class="pay-item" onclick="LayerPaySelect(this);" data-mark="{$vo.pay_mark}" data-parameter="'{$vo.pay_id}','{$vo.pay_mark}'">
<a href="JavaScript:void(0);" >
<img src="{eyou:empty name='$vo.pay_img'}{eyou:static file='$pay_mark_vars' /}{eyou:else/}{$vo.pay_img}{/eyou:empty}">
<span></span>
</a>
</div>
{/neq}
{/eyou:notempty}
{$vo.hidden}
{/eyou:sppayapilist}
<input type="hidden" id="PayID">
<input type="hidden" id="PayMark">
<!-- END -->
{eyou:if condition="1 != $data.transaction_type && 1 == $data.pay_balance_open"}
<div class="pay-item" data-toggle="modal" data-target="#pay-order-modal" onclick="LayerPaySelect(this);" data-mark="balance" data-parameter="'{$data.unified_id}','{$data.unified_number}','{$data.transaction_type}'">
<a href="JavaScript:void(0);" id="PayBalancePayment" >
<img src="{eyou:static file='users/skin/images/pay_yiyou.png' /}" >
<span></span>
</a>
</div>
<script type="text/javascript">
// 余额支付,购买商品+视频支付使用
function PayBalancePayment(unified_id,unified_number,transaction_type) {
if (!unified_number || !unified_id) layer.msg('订单号异常,请刷新重试', {time: 1500});
// 禁止再次点击余额支付
$('#PayBalancePayment').prop("disabled", true).css("pointer-events", "none");
var parentObj = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
// 发送请求
layer_loading('订单处理中');
$.ajax({
url: '{$RootDir}/index.php?m=user&c=PayApi&a=balance_payment&_ajax=1',
data: {unified_id: unified_id, unified_number: unified_number, transaction_type: transaction_type},
type:'post',
dataType: 'json',
success:function(res){
layer.closeAll();
var parentObj = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
var _parent = parent;
_parent.layer.close(parentObj);
if (1 == res.code) {
if (!res.data.mobile && !res.data.email) {
_parent.layer.msg(res.msg, {shade: 0.3, time: 1000}, function(){
_parent.window.location.reload();
});
} else {
if (res.data.mobile) SendMobile(res.data.mobile);
if (res.data.email) SendEmail(res.data.email);
_parent.layer.msg(res.msg, {shade: 0.3, time: 1000}, function(){
_parent.window.location.reload();
});
}
} else {
_parent.PayIsRecharge(res.msg, res.url,unified_id,unified_number,transaction_type);
}
}
});
}
</script>
{/eyou:if}
</div>
<div class="button-wrapper"><button type="button" class="layui-btn layui-btn-sm" id="confirm">确认支付{$data.order_amount}元</button></div>
</div>
</div>
</div>
<script type="text/javascript">
$(function(){
// 默认支付方式
$($('.el-form-item__content .pay-item')[0]).trigger("click");
});
function LayerPaySelect(obj) {
$(".pay-item").each(function(){
$(this).removeClass('pay-item-select');
});
$(obj).addClass('pay-item-select');
var mark = $(obj).attr('data-mark')
if (mark){
var parameter = $(obj).attr('data-parameter')
if ('balance' == mark){
$('#confirm').attr("onclick","PayBalancePayment("+parameter+");");
}else{
$('#confirm').attr("onclick","SelectPayMethodLayer("+parameter+");");
}
}
}
</script>
</body>
标签:adv
描述:获取广告列表内容。
用法:
{eyou:adv pid='1' loop='3'}
<a href='{$field.links}'><img alt='{$field.title}' src='{$field.litpic}' /></a>
{/eyou:adv}
属性:
pid='' 广告位置ID
loop='10' 返回广告列表总数
currentclass='' 应用样式class类名
orderby='now' 文档排序方式
----orderby='hot' 或 orderby='click' 表示按点击数从高到低排序
----orderby='now' 按发布时间最新排序
----orderby='sort_order' 按排序号从小到大排序
----orderby='rand' 随机排序
----orderby='sort_order asc, id desc' 自定义多字段组合排序
empty='' 没有数据时显示的文案
mod='' 每隔N行输出的内容
id='' 可以任意指定循环里的变量名替代field,假设id='field1',模板调用如:{$field.title} 变成 {$field1.title}
涉及表字段: