南阳SEO网络营销博客

专注于网络营销研究,致力于南阳网站建设,加强用户体验,提升客户价值!

Archive for the ‘dede相关’ Category

[field:pubdate runphp='yes']
            $a=”<font color=“#66ccff”>”;
            $b=”</font>”;
            $c=strftime(”%m月%d日”,”@me”);
            $ntime = time();
            $oneday = 3600 * 24;
            if(($ntime - @me)&lt;$oneday) @me = $a.$c.$b;
else @me =$c;
[/field:pubdate]
Tags:

效果:给没有完全显示的标题加上…,给图片和图片链接加上title

改法:

打开文件:includeinc_arcpart_view.php

找到:

以下为引用的内容:
//$this->dtp2->SourceString = $oldSource;
//$this->dtp2->CTags = $oldCtags;
//处理一些特殊字段
$row["description"] = cn_substr($row["description"],$infolen);
$row["id"] = $row["ID"];
if($row["litpic"]==”") $row["litpic"] = $GLOBALS["cfg_plus_dir"].”/img/default.gif”;
$row["picname"] = $row["litpic"];
$row["arcurl"] = $this->GetArcUrl($row["id"],$row["typeid"],$row["senddate"],$row["title"],
$row["ismake"],$row["arcrank"],$row["namerule"],$row["typedir"],$row["money"]);
$row["typeurl"] = $this->GetListUrl($row["typeid"],$row["typedir"],$row["isdefault"],$row["defaultname"],$row["ispart"],$row["namerule2"]);
$row["info"] = $row["description"];
$row["filename"] = $row["arcurl"];
$row["stime"] = GetDateMK($row["pubdate"]);
$row["typelink"] = “<a href=’”.$row["typeurl"].”‘>”.$row["typename"].”</a>”;
$row["imglink"] = “<a href=’”.$row["filename"].”‘><img src=’”.$row["picname"].”‘ border=’0′ width=’$imgwidth’ height=’$imgheight’></a>”;
$row["image"] = “<img src=’”.$row["picname"].”‘ border=’0′ width=’$imgwidth’ height=’$imgheight’>”;
$row["title"] = cn_substr($row["title"],$titlelen);
$row["textlink"] = “<a href=’”.$row["filename"].”‘>”.$row["title"].”</a>”;
if($row["color"]!=”") $row["title"] = “<font color=’”.$row["color"].”‘>”.$row["title"].”</font>”;
if($row["iscommend"]==5||$row["iscommend"]==16) $row["title"] = “<b>”.$row["title"].”</b>”;
$row["phpurl"] = $GLOBALS["cfg_plus_dir"];
$row["templeturl"] = $GLOBALS["cfg_templets_dir"];
//—————————

改为

以下为引用的内容:
//$this->dtp2->SourceString = $oldSource;
//$this->dtp2->CTags = $oldCtags;
//处理一些特殊字段
$row["description"] = cn_substr($row["description"],$infolen);
$row["id"] = $row["ID"];
if($row["litpic"]==”") $row["litpic"] = $GLOBALS["cfg_plus_dir"].”/img/default.gif”;
$row["picname"] = $row["litpic"];
$row["arcurl"] = $this->GetArcUrl($row["id"],$row["typeid"],$row["senddate"],$row["title"],$row["ismake"],$row["arcrank"],$row["namerule"],$row["typedir"],$row["money"]);
$row["typeurl"] = $this->GetListUrl($row["typeid"],$row["typedir"],$row["isdefault"],$row["defaultname"],$row["ispart"],$row["namerule2"]);
$row["info"] = $row["description"];
$row["filename"] = $row["arcurl"];
$row["stime"] = GetDateMK($row["pubdate"]);
$row["typelink"] = “<a href=’”.$row["typeurl"].”‘>”.$row["typename"].”</a>”;
//zouql
$row["imglink"] = “<a href=’”.$row["filename"].”‘><img alt=’”.$row["title"].”‘ src=’”.$row["picname"].”‘></a>”;
$row["image"] = “<img title=’”.$row["title"].”‘ src=’”.$row["picname"].”‘>”;
//zouql标题没有显示完全后面显示的省略号…,为空则不开启本功能
$cfg_list_slh = “…”;
if ($cfg_list_slh != “”) $slh = strlen($cfg_list_slh);
$row["title_full"] = $row["title"];
$row["title"] = cn_substr($row["title"],$titlelen);
$row["title_2"] = cn_substr($row["title_full"],$titlelen-$slh);
if($row["title"] != $row["title_full"]) $row["title"] = $row["title_2"].$cfg_list_slh;
$row["textlink"] = “<a title=’”.$row["title_full"].”‘ href=’”.$row["filename"].”‘>”.$row["title"].”</a>”;
if($row["color"]!=”") $row["title"] = “<font color=’”.$row["color"].”‘>”.$row["title"].”</font>”;
if($row["iscommend"]==5||$row["iscommend"]==16) $row["title"] = “<b>”.$row["title"].”</b>”;
$row["phpurl"] = $GLOBALS["cfg_plus_dir"];
$row["templeturl"] = $GLOBALS["cfg_templets_dir"];
//—————————

再改动下面这个:

$row["imglink"] = “<a href=’”.$row["filename"].”‘><img alt=’”.$row["title"].”‘ src=’”.$row["picname"].”‘></a>”;

改成

…….

其实现在有了一种更好的改法,就是在inc_arclist_view.php中

找到:

$row["title"] = cn_substr($row["title"],$titlelen);

改为:

以下为引用的内容:
$row["title_full"] = $row["title"];
$row["title"] = cn_substr($row["title"],$titlelen);

这样就可以在ARTLIST中多了个完全标题[field:title_full/]

模板中这样写就可以了,更加自由

<a href=”[field:filename/]“><img alt=”[field:title_full/]” src=”[field:picname/]“></a>

Tags:

1:修改include/inc_arcpart_view.php第367行为:

$row = $this->dsql->GetOne(”Select ID,typedir,isdefault,defaultname,ispart,namerule2,typename,moresite,

sitrefer,siteurl,sitepath,description,litpic,keywords From #@__arctype where ID=’$typeid’”);

2:在模板上需要调用栏目缩略图,关键字,描述的地方写: Read the rest of this entry »

Tags: ,