소스 검색

自定义模型图片字段优化

tags/6.5.8
tianya 1 주 전
부모
커밋
393a7faf91
1개의 변경된 파일11개의 추가작업 그리고 2개의 파일을 삭제
  1. +11
    -2
      src/system/taglib/channel/img.lib.php

+ 11
- 2
src/system/taglib/channel/img.lib.php 파일 보기

@@ -1,5 +1,5 @@
<?php <?php
if (!defined('DEDEINC')) exit ('dedebiz');
if (!defined('DEDEINC')) exit('dedebiz');
/** /**
* 图片标签 * 图片标签
* *
@@ -18,6 +18,10 @@ function ch_img($fvalue, &$arcTag, &$refObj, $fname = '')
$dtp->Clear(); $dtp->Clear();
return $fvalue; return $fvalue;
} }
if (count($dtp->CTags) == 0) {
$dtp->Clear();
return $fvalue;
}
$pagestyle = $cfg_album_style; $pagestyle = $cfg_album_style;
$maxwidth = $cfg_album_width; $maxwidth = $cfg_album_width;
$ddmaxwidth = $cfg_album_ddwidth; $ddmaxwidth = $cfg_album_ddwidth;
@@ -58,11 +62,16 @@ function ch_img($fvalue, &$arcTag, &$refObj, $fname = '')
$pagesize = 12; $pagesize = 12;
} }
$aid = $refObj->ArcID; $aid = $refObj->ArcID;
$row = $refObj->dsql->GetOne("SELECT title FROM `#@__archives` WHERE `id` = '$aid';");
if ($refObj->ChannelInfos['issystem'] == '-1') {
$row = $refObj->dsql->GetOne("SELECT title FROM `{$refObj->ChannelInfos['addtable']}` WHERE `aid` = '$aid';");
} else {
$row = $refObj->dsql->GetOne("SELECT title FROM `#@__archives` WHERE `id` = '$aid';");
}
$title = $row['title']; $title = $row['title'];
$revalue = ''; $revalue = '';
$GLOBAL['photoid'] = 0; $GLOBAL['photoid'] = 0;
foreach ($dtp->CTags as $ctag) { foreach ($dtp->CTags as $ctag) {
if ($ctag->GetName() == "img") { if ($ctag->GetName() == "img") {
$fields = $ctag->CAttribute->Items; $fields = $ctag->CAttribute->Items;
$fields['text'] = str_replace("'", "", $ctag->GetAtt('text')); $fields['text'] = str_replace("'", "", $ctag->GetAtt('text'));


불러오는 중...
취소
저장