如果您想了解给dede新闻页面的上一篇下一篇增加新闻摘要的功能的相关知识,那么本文是一篇不可错过的文章,我们将对添加新闻进行全面详尽的解释,并且为您提供关于DEDECMS上一篇下一篇调用图片的方法、D
如果您想了解给dede新闻页面的上一篇下一篇增加新闻摘要的功能的相关知识,那么本文是一篇不可错过的文章,我们将对添加新闻进行全面详尽的解释,并且为您提供关于DEDECMS 上一篇下一篇调用图片的方法、DEDECMS上一篇下一篇调用代码、DEDECMS上一篇下一篇调用图片的办法、DEDECMS上一篇下一篇调用图片的方法的有价值的信息。
本文目录一览:- 给dede新闻页面的上一篇下一篇增加新闻摘要的功能(添加新闻)
- DEDECMS 上一篇下一篇调用图片的方法
- DEDECMS上一篇下一篇调用代码
- DEDECMS上一篇下一篇调用图片的办法
- DEDECMS上一篇下一篇调用图片的方法
给dede新闻页面的上一篇下一篇增加新闻摘要的功能(添加新闻)
找到arc.archives.class.php文件,在include目录下面,然后查找“GetPreNext”这个函数,将
$query = "Select arc.id,arc.title,arc.shorttitle,arc.typeid,arc.ismake,arc.senddate,arc.arcrank,arc.money,arc.filename,arc.litpic, t.typedir,t.typename,t.namerule,t.namerule2,t.ispart,t.moresite,t.siteurl,t.sitepath from `jcode_archives` arc left join jcode_arctype t on arc.typeid=t.id ";
改成
$query = "Select arc.id,arc.title,arc.shorttitle,arc.typeid,arc.ismake,arc.senddate,arc.arcrank,arc.money,arc.filename,arc.litpic, arc.description,t.typedir,t.typename,t.namerule,t.namerule2,t.ispart,t.moresite,t.siteurl,t.sitepath from `jcode_archives` arc left join jcode_arctype t on arc.typeid=t.id ";
比较一下其实现在只是多了arc.description,这就是新闻的摘要,也称为新闻描述。
需要注意的是这里的jcode_archives和jcode_arctype中的jcode_是我表结构的前缀,你需要将这个前缀改成你自己的。
现在我们已经将新闻描述从数据库里面取出来了。下一步将描述显示在页面上,显示连接文字的代码本来是这样的,你可以通过查找找到,其实就在上面那段代码的附近:
if(is_array($preRow))
{
$mlink = GetFileUrl($preRow['id'],$preRow['typeid'],$preRow['senddate'],$preRow['title'],$preRow['ismake'],$preRow['arcrank'],
$preRow['namerule'],$preRow['typedir'],$preRow['money'],$preRow['filename'],$preRow['moresite'],$preRow['siteurl'],$preRow['sitepath']);
$this->PreNext['pre'] = "上一篇:<a href='$mlink'>{$preRow['title']}</a> ";
$this->PreNext['preimg'] = "<a href='$mlink'><img src=\"{$preRow['litpic']}\" alt=\"{$preRow['title']}\"/></a> ";
}
else
{
$this->PreNext['pre'] = "上一篇:没有了 ";
$this->PreNext['preimg'] ="<img src=http://www.dede58.com/a/dedejq/\"/templets/default/images/nophoto.jpg\" alt=\"对不起,没有上一图集了!\"/>";
}
if(is_array($nextRow))
{
$mlink = GetFileUrl($nextRow['id'],$nextRow['typeid'],$nextRow['senddate'],$nextRow['title'],$nextRow['ismake'],$nextRow['arcrank'],
$nextRow['namerule'],$nextRow['typedir'],$nextRow['money'],$nextRow['filename'],$nextRow['moresite'],$nextRow['siteurl'],$nextRow['sitepath']);
$this->PreNext['next'] = "下一篇:<a href='$mlink'>{$nextRow['title']}</a> ";
$this->PreNext['nextimg'] = "<a href='$mlink'><img src=\"{$nextRow['litpic']}\" alt=\"{$nextRow['title']}\"/></a> ";
}
else
{
$this->PreNext['next'] = "下一篇:没有了 ";
$this->PreNext['nextimg'] ="<a href='javascript:void(0)' alt=\"\"><img src=http://www.dede58.com/a/dedejq/\"/templets/default/images/nophoto.jpg\" alt=\"对不起,没有下一图集了!\"/></a>";
}
}
现在为了显示出新闻描述,在每一个a标签之后添加一个div div中包含新闻描述(红色部分):
if(is_array($preRow))
{
$mlink = GetFileUrl($preRow['id'],$preRow['typeid'],$preRow['senddate'],$preRow['title'],$preRow['ismake'],$preRow['arcrank'],
$preRow['namerule'],$preRow['typedir'],$preRow['money'],$preRow['filename'],$preRow['moresite'],$preRow['siteurl'],$preRow['sitepath']);
$this->PreNext['pre'] = "上一篇:<a href='$mlink'>{$preRow['title']}</a> <div>{$preRow['description']}</div> ";
$this->PreNext['preimg'] = "<a href='$mlink'><img src=\"{$preRow['litpic']}\" alt=\"{$preRow['title']}\"/></a> <div>{$preRow['description']}</div> ";
}
else
{
$this->PreNext['pre'] = "上一篇:没有了 ";
$this->PreNext['preimg'] ="<img src=http://www.dede58.com/a/dedejq/\"/templets/default/images/nophoto.jpg\" alt=\"对不起,没有上一图集了!\"/>";
}
if(is_array($nextRow))
{
$mlink = GetFileUrl($nextRow['id'],$nextRow['typeid'],$nextRow['senddate'],$nextRow['title'],$nextRow['ismake'],$nextRow['arcrank'],
$nextRow['namerule'],$nextRow['typedir'],$nextRow['money'],$nextRow['filename'],$nextRow['moresite'],$nextRow['siteurl'],$nextRow['sitepath']);
$this->PreNext['next'] = "下一篇:<a href='$mlink'>{$nextRow['title']}</a> <div>{$preRow['description']}</div> ";
$this->PreNext['nextimg'] = "<a href='$mlink'><img src=\"{$nextRow['litpic']}\" alt=\"{$nextRow['title']}\"/></a> <div>{$preRow['description']}</div> ";
}
else
{
$this->PreNext['next'] = "下一篇:没有了 ";
$this->PreNext['nextimg'] ="<a href='javascript:void(0)' alt=\"\"><img src=http://www.dede58.com/a/dedejq/\"/templets/default/images/nophoto.jpg\" alt=\"对不起,没有下一图集了!\"/></a>";
}
}
这样做的话能显示新闻摘要,但是格式可能会很乱,你可以根据需要增加样式。
本文章网址:http://www.ppssdd.com/code/13359.html。转载请保留出处,谢谢合作!DEDECMS 上一篇下一篇调用图片的方法
只限 5.5 的版本 5.3 的没看过,目录地址 /include/arc.archives.class.php 查找:arc.money,arc.filename, 在后面添加 arc.litpic, 查找:$this-PreNext [只限 5.5 的版本 5.3 的没看过
目录地址:/include/arc.archives.class.php
查找:arc.money,arc.filename, 在后面添加 arc.litpic,
查找:$this->PreNext [''pre''] = "上一篇:<a href=''$mlink''>{$preRow [''title'']}</a>";
替换:〔上一篇〕
if(empty($preRow[''litpic'']))
{
$this->PreNext [''pre''] = "上一篇:<a href=''$mlink''>{$preRow [''title'']}</a>";
}else{
$preimage = str_replace(''/photo-img'', ''http://images.jiaju123.com'',trim($preRow[''litpic'']));
$this->PreNext[''pre''] = "<div class=\"photo_article_pre\">
<div class=\"pre_photo\"><a href=\"$mlink\"><img src=\"$preimage\" alt=\"上一篇:{$preRow [''title'']}\"></a></div>
<div class=\"pre_right\">
<p> 上一篇:{$preRow [''title'']}</p>
<div class=\"photo_textlink\">◀<a href=\"$mlink\"> 浏览上一张图片 </a></div>
织梦内容管理系统
</div></div>";
}
查找:$this->PreNext [''next''] = "下一篇:<a href=''$mlink''>{$nextRow [''title'']}</a>";
替换:if (empty ($nextRow [''litpic'']))
{
$this->PreNext [''next''] = "下一欧洲杯推荐 篇:<a href=''$mlink''>{$nextRow [''title'']}</a>";
}else{
$nextimage = str_replace(''/photo-img'', ''http://images.jiaju123.com'',trim($nextRow[''litpic'']));
$this->PreNext[''next''] = "<div class=\"photo_article_next\">
<div class=\"pre_photo\"><a href=\"$mlink\"><img src=\"$nextimage\" alt=\"下一篇:{$nextRow [''title'']}\"></a></div>
<div class=\"pre_right\">
<p> 下一篇:{$nextRow [''title'']}</p>
<div class=\"photo_textlink\">▶<a href=\"$mlink\"> 浏览下一张图片 </a></div>
</div></div>"; dedecms.com
}
提示:以上教程来自 DEDE 论坛,没有经过测试。
DEDECMS上一篇下一篇调用代码
DEDECMS上一篇下一篇调用图片的办法
只限5.5的版本5.3的没看过,目录地址 /include/arc.archives.class.php 查找:arc.money,arc.filename, 在后面添加arc.litpic, 查找:$this-PreNext[
只限5.5的版本5.3的没看过
目录地址:/include/arc.archives.class.php
查找:arc.money,arc.filename, 在后面添加arc.litpic,
查找:$this->PreNext['pre'] = "上一篇:<a href='$mlink'>{$preRow['title']}</a> ";
替换:〔上一篇〕
if(empty($preRow['litpic']))
{
$this->PreNext['pre'] = "上一篇:<a href='$mlink'>{$preRow['title']}</a> ";
}else{
$preimage = str_replace('/photo-img', '',trim($preRow['litpic']));
$this->PreNext['pre'] = "<div class=\"photo_article_pre\">
<div class=\"pre_photo\"><a href=http://www.dede58.com/a/dedejq/\"$mlink\"><img src=\"$preimage\" alt=\"上一篇:{$preRow['title']}\"></a></div>
<div class=\"pre_right\">
<p>上一篇:{$preRow['title']}</p>
<div class=\"photo_textlink\">◀<a href=http://www.dede58.com/a/dedejq/\"$mlink\">浏览上一张图片</a></div>
织梦内容管理系统
</div></div>";
}
查找:$this->PreNext['next'] = "下一篇:<a href='$mlink'>{$nextRow['title']}</a> ";
替换:if(empty($nextRow['litpic']))
{
$this->PreNext['next'] = "下一篇:<a href='$mlink'>{$nextRow['title']}</a> ";
}else{
$nextimage = str_replace('/photo-img', '',trim($nextRow['litpic']));
$this->PreNext['next'] = "<div class=\"photo_article_next\">
<div class=\"pre_photo\"><a href=http://www.dede58.com/a/dedejq/\"$mlink\"><img src=\"$nextimage\" alt=\"下一篇:{$nextRow['title']}\"></a></div>
<div class=\"pre_right\">
<p>下一篇:{$nextRow['title']}</p>
<div class=\"photo_textlink\">▶<a href=http://www.dede58.com/a/dedejq/\"$mlink\">浏览下一张图片</a></div>
</div></div>"; dedecms.com
本文章网址:http://www.ppssdd.com/code/3864.html。转载请保留出处,谢谢合作!DEDECMS上一篇下一篇调用图片的方法
上一篇:{$preRow['title']}
下一篇:{$nextRow['title']}
总结
以上是小编为你收集整理的DEDECMS上一篇下一篇调用图片的方法全部内容。
如果觉得小编网站内容还不错,欢迎将小编网站推荐给好友。
Dedecms相关文章
- • 织梦系统 dedecms pagelist标签使用修改
- • 织梦网站怎么搬家?dede系统网站迁移数
- • 织梦网站安全设置方法 dede系统网站如何
- • 织梦自动生成网站地图sitemap代码 dede
- • dede织梦纯代码制作网站地图 dede网站地
- • 织梦dede自定义表单添加全选功能 dede自
- • dede cms如何定时主动推送文章 dede实现
- • 织梦dede发布文章实时api主动推送
- • 织梦dedecms当前位置标签代码的5种写法
- • 织梦DEDECMS文章、栏目页获取当前页面顶