天天看點

織夢自定義表單關聯地區顯示為數字的解決方法

自定義表單清單編輯内容關聯地區顯示為數字

織夢自定義表單關聯地區顯示為數字的解決方法

解決方法

打開 \dede\templets\diy_edit_content.htm 找到

<?php
$formfields = '';
foreach($fieldlist as $field=>$fielddata)
{
    $allowhtml = array('htmltext');
    if($row[$field]=='') continue;
    if($fielddata[]=='img')
    {
        $row[$field] = "<input name='photo' type='file' />  <a href='{$row[$field]}' target='_blank'><img src='images/channeladd.gif'  /> 浏覽原圖</a> <a href='diy_list.php?action=delete&diyid=$diy->diyid&id=$row[id]&do=1&name=$field'>删除原圖</a>\r\n";
    }
    else if($fielddata[]=='addon')
    {
        $row[$field] = "<input name='file' type='file' />  <a href='{$row[$field]}' target='_blank'><img src='images/channeladd.gif'  /> 浏覽原附件</a> <a href='diy_list.php?action=delete&diyid=$diy->diyid&id=$row[id]&do=1&name=$field'>删除原附件</a>";
    }
    else
    {
        if(!in_array($fielddata[],$allowhtml)){
            $row[$field] = dede_htmlspecialchars($row[$field]);
            $row[$field] = "<input type='text' name='".$field."' value='".$row[$field]."'/>";
        }
    }
    echo '<tr bgcolor="#ffffff"><td width="20%" height="24">'.$fielddata[].':'.'</td><td width="80%">'.$row[$field].'</td></tr>';
    $formfields .= 	$formfields == ''? $field.','.$fielddata[] : ';'.$field.','.$fielddata[];    
}
echo "<input type='hidden' name='dede_fields' value='".$formfields."'>";
?>
           

這一塊PHP代碼改成

<?php
    echo $postform;
?>
           

完成後效果

織夢自定義表單關聯地區顯示為數字的解決方法