DedeCMS 기사 페이지의 이전 링크와 다음 링크에 기사 요약을 추가하는 방법

藏色散人
풀어 주다: 2019-12-26 09:43:24
원래의
2117명이 탐색했습니다.

DedeCMS 기사 페이지의 이전 링크와 다음 링크에 기사 요약을 추가하는 방법

DedeCMS 기사 페이지의 이전 및 다음 링크에 기사 요약을 추가하는 방법은 무엇입니까?

DedeCMS 시스템은 기본적으로 기사의 이전 및 다음 링크에 제목만 표시하도록 설정되어 있지만 때로는 기사의 요약과 같은 다른 정보를 표시하고 싶을 때도 있습니다. 방법을 소개하겠습니다

권장 학습: Dreamweavercms

기본적으로 DedeCMS 시스템은 이전 및 다음 기사 링크를 기본값으로 설정합니다. 기사에는 제목만 표시되지만 때로는 기사 요약과 같은 다른 정보를 표시하고 싶을 때도 있습니다.

포함 디렉터리에서 arc.archives.class.php 파일을 찾은 다음 "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=&#39;$mlink&#39;>{$preRow[&#39;title&#39;]}</a> 
";
$this->PreNext[&#39;preimg&#39;] = "<a href=&#39;$mlink&#39;><img 
src="{$preRow[&#39;litpic&#39;]}" alt="{$preRow[&#39;title&#39;]}"/></a> 
";
}
else
{
$this->PreNext[&#39;pre&#39;] = "上一篇:没有了 "; 
$this->PreNext[&#39;preimg&#39;] 
="<img src="/templets/default/images/nophoto.jpg" 
alt="对不起,没有上一图集了!"/>";
}
if(is_array($nextRow))
{
$mlink = 
GetFileUrl($nextRow[&#39;id&#39;],$nextRow[&#39;typeid&#39;],$nextRow[&#39;senddate&#39;],$nextRow[&#39;title&#39;],$nextRow[&#39;ismake&#39;],$nextRow[&#39;arcrank&#39;],
$nextRow[&#39;namerule&#39;],$nextRow[&#39;typedir&#39;],$nextRow[&#39;money&#39;],$nextRow[&#39;filename&#39;],$nextRow[&#39;moresite&#39;],$nextRow[&#39;siteurl&#39;],$nextRow[&#39;sitepath&#39;]);
$this->PreNext[&#39;next&#39;] 
= "下一篇:<a href=&#39;$mlink&#39;>{$nextRow[&#39;title&#39;]}</a> 
";
$this->PreNext[&#39;nextimg&#39;] = "<a href=&#39;$mlink&#39;><img 
src="{$nextRow[&#39;litpic&#39;]}" alt="{$nextRow[&#39;title&#39;]}"/></a> 
";
}
else
{
$this->PreNext[&#39;next&#39;] = "下一篇:没有了 "; 
$this->PreNext[&#39;nextimg&#39;] ="<a href=&#39;javascript:void(0)&#39; 
alt=""><img src="/templets/default/images/nophoto.jpg" 
alt="对不起,没有下一图集了!"/></a>";
}
}
로그인 후 복사

기사 설명을 표시하려면 각 태그 뒤에 div를 추가하세요. div에는 기사 설명이 포함되어 있습니다.

if(is_array($preRow))
{
$mlink = 
GetFileUrl($preRow[&#39;id&#39;],$preRow[&#39;typeid&#39;],$preRow[&#39;senddate&#39;],$preRow[&#39;title&#39;],$preRow[&#39;ismake&#39;],$preRow[&#39;arcrank&#39;],
$preRow[&#39;namerule&#39;],$preRow[&#39;typedir&#39;],$preRow[&#39;money&#39;],$preRow[&#39;filename&#39;],$preRow[&#39;moresite&#39;],$preRow[&#39;siteurl&#39;],$preRow[&#39;sitepath&#39;]);
$this->PreNext[&#39;pre&#39;] 
= "上一篇:<a href=&#39;$mlink&#39;>{$preRow[&#39;title&#39;]}</a> <div>{$preRow[&#39;description&#39;]}</div> 
";
$this->PreNext[&#39;preimg&#39;] = "<a href=&#39;$mlink&#39;><img 
src="{$preRow[&#39;litpic&#39;]}" alt="{$preRow[&#39;title&#39;]}"/></a> <div>{$preRow[&#39;description&#39;]}</div> "; 
}
else
{
$this->PreNext[&#39;pre&#39;] 
= "上一篇:没有了 ";
$this->PreNext[&#39;preimg&#39;] ="<img 
src="/templets/default/images/nophoto.jpg" 
alt="对不起,没有上一图集了!"/>";
}
if(is_array($nextRow))
{
$mlink = 
GetFileUrl($nextRow[&#39;id&#39;],$nextRow[&#39;typeid&#39;],$nextRow[&#39;senddate&#39;],$nextRow[&#39;title&#39;],$nextRow[&#39;ismake&#39;],$nextRow[&#39;arcrank&#39;],
$nextRow[&#39;namerule&#39;],$nextRow[&#39;typedir&#39;],$nextRow[&#39;money&#39;],$nextRow[&#39;filename&#39;],$nextRow[&#39;moresite&#39;],$nextRow[&#39;siteurl&#39;],$nextRow[&#39;sitepath&#39;]);
$this->PreNext[&#39;next&#39;] 
= "下一篇:<a href=&#39;$mlink&#39;>{$nextRow[&#39;title&#39;]}</a> <div>{$preRow[&#39;description&#39;]}</div> 
";
$this->PreNext[&#39;nextimg&#39;] = "<a href=&#39;$mlink&#39;><img 
src="{$nextRow[&#39;litpic&#39;]}" alt="{$nextRow[&#39;title&#39;]}"/></a> <div>{$preRow[&#39;description&#39;]}</div> "; 
}
else
{
$this->PreNext[&#39;next&#39;] 
= "下一篇:没有了 ";
$this->PreNext[&#39;nextimg&#39;] ="<a href=&#39;javascript:void(0)&#39; 
alt=""><img src="/templets/default/images/nophoto.jpg" 
alt="对不起,没有下一图集了!"/></a>";
}
}
로그인 후 복사
이렇게 하면 기사 요약이 표시될 수 있지만 형식이 지저분해질 수 있습니다. 필요에 따라 스타일을 추가할 수 있습니다.

위 내용은 DedeCMS 기사 페이지의 이전 링크와 다음 링크에 기사 요약을 추가하는 방법의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
최신 이슈
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!