Parcourir la source

自定义模型图片字段优化

tags/6.5.8
tianya il y a 1 semaine
Parent
révision
393a7faf91
1 fichiers modifiés avec 11 ajouts et 2 suppressions
  1. +11
    -2
      src/system/taglib/channel/img.lib.php

+ 11
- 2
src/system/taglib/channel/img.lib.php Voir le fichier

@@ -1,5 +1,5 @@
<?php
if (!defined('DEDEINC')) exit ('dedebiz');
if (!defined('DEDEINC')) exit('dedebiz');
/**
* 图片标签
*
@@ -18,6 +18,10 @@ function ch_img($fvalue, &$arcTag, &$refObj, $fname = '')
$dtp->Clear();
return $fvalue;
}
if (count($dtp->CTags) == 0) {
$dtp->Clear();
return $fvalue;
}
$pagestyle = $cfg_album_style;
$maxwidth = $cfg_album_width;
$ddmaxwidth = $cfg_album_ddwidth;
@@ -58,11 +62,16 @@ function ch_img($fvalue, &$arcTag, &$refObj, $fname = '')
$pagesize = 12;
}
$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'];
$revalue = '';
$GLOBAL['photoid'] = 0;
foreach ($dtp->CTags as $ctag) {
if ($ctag->GetName() == "img") {
$fields = $ctag->CAttribute->Items;
$fields['text'] = str_replace("'", "", $ctag->GetAtt('text'));


Chargement…
Annuler
Enregistrer