您现在的位置是:首页 > 教程 > dedecms教程dedecms教程
dedecms5.7织梦后台广告插件增加图片上传功能教程
林包显2023-09-06 20:03:47dedecms教程已有人查阅
导读修改方法:1、打开dede/ad_add.php文件2、打开dede/ad_edit.php文件:3、打开dede/templets/ad_add.htm文件
修改方法:
1、打开dede/ad_add.php文件
查找:
查找:
查找:
查找:
1、打开dede/ad_add.php文件
查找:
$normbody = "<a href=\"{$link}\"><img src=\"{$normbody['url']}\"$width $height border=\"0\" /></a>";
改成
$normbody = "}\" id=\"qyuef\"><img src=\"{$pic}\"$width $height border=\"0\" />>";
2、打开dede/ad_edit.php文件:查找:
$endtime = GetMkTime($endtime);
下方添加:
if($img=="qyuefimg"){
$normbody = "<a href=\"{$piclink}\" id=\"qyuef\"><img src=\"{$pic}\" border=\"0\" /></a>";
}
3、打开dede/templets/ad_add.htm文件 查找:
<script type="text/javascript" src="js/calendar/calendar.js"></script>
下方添加:
<script language="javascript" src="../include/js/dedeajax2.js"></script>
<script language='javascript' src="js/main.js"></script>
查找:
$endtime = GetMkTime($endtime);
替换成
<td class="b">
<input type="text" size="40" name="pic" id="pic" value="" class='iptxt'/>
<input type="button" name="Submit" value="浏览..." style="width:70px" onClick="SelectImage('form1.pic','');"></span>
</td>
4、打开dede/templets/ad_edit.htm文件 查找:
<script type="text/javascript" src="js/calendar/calendar.js"></script>
下方添加:
<script language="javascript" src="../include/js/dedeajax2.js"></script>
<script language='javascript' src="js/main.js"></script>
查找:
<td width="76%"><textarea name="normbody" rows="10" id="normbody" style="width:80%;height:100"><?php echo htmlspecialchars(stripslashes($row['normbody']))?></textarea></td>
<td width="9%"> </td>
</tr>
<tr>
<td height="80" align="center">过期显示内容:</td>
<td><textarea name="expbody" rows="10" id="expbody" style="width:80%;height:100"><?php echo htmlspecialchars($row['expbody'])?></textarea></td>
替换为:
<td width="76%">
<?php
if(strstr($row['normbody'],'id="qyuef"'))
{
$pat = '/<a[^>]*?\s*href=\"(.*?)\"(.*?)>(.*?)<\/a>/i';
preg_match_all($pat,$row['normbody'], $m);
$piclink=$m[1][0];
$pic=$m[3][0];
$pattern="/<[img|IMG].*?src=[\'|\"](.*?(?:[\.gif|\.jpg]))[\'|\"].*?[\/]?>/";
preg_match_all($pattern,$pic,$match);
$qyuefpic=$match[1][0]
?>
<input type="hidden" size="40" name="img" id="img" value="qyuefimg" class='iptxt'/>
<input type="text" size="40" name="pic" id="pic" value="<?php echo $qyuefpic?>" class='iptxt'/>
<input type="button" name="Submit" value="浏览..." style="width:70px" onClick="SelectImage('form1.pic','');"></span>
<tr>
<td height="80" align="center">图片链接:</td>
<td><input type="text" size="40" name="piclink" id="piclink" value="<?php echo $piclink?>" class='iptxt'/></td>
<td> </td>
</tr>
<?php
}else{ ?>
<textarea name="normbody" rows="10" id="normbody" style="width:80%;height:100"><?php echo $row['normbody']?></textarea>
<?php
}
?>
<tr> <td height="80" align="center">过期显示内容:</td>
<td><textarea name="expbody" rows="10" id="expbody" style="width:80%;height:100"><?php echo $row['expbody']?></textarea></td>
本文标签:
很赞哦! ()
相关文章
随机图文
-
织梦cms关键词关连文章出错的原因和解决方法
使用DEDE的时候,当你用到:“关键词关连文章(文章内容关键词替换,DEDE的开发人员肯定是打拼音的,关联都会打错)”这个功能的时候,是不是发现达不到预期的效果? -
织梦dedecms搜索框提示信息的修改方法
在搜索框里面留下提示信息,会更加人性化,鼠标点击后又会自动消失,不需按退格键将里面的内容删除,就想我这个博客一样,搜索框就实现了这个功能。在织梦DedeC -
dedecms自定义表单列表编辑内容联动地区显示为数字的方法
解决方法;打开 \dede\templets\diy_edit_content.htm 找到这一块PHP代码改成 -
dede织梦修改文章标题长度的步骤
有些新手朋友发布的文章标题太长,显示不全,可以使用下面的方法修改文章标题的长度。 1、进入后台--系统--系统设置--系统基本参数--其他选项--文档标题
留言与评论 (共有 条评论) |