閑著無(wú)聊業(yè)余搞了下織夢(mèng)dedecms后臺(tái)上傳LOGO功能,織夢(mèng)cms系統(tǒng)本身后臺(tái)系統(tǒng)設(shè)置沒有這一項(xiàng)。那么為了在后臺(tái)方便修改網(wǎng)站LOGO。我們就在后臺(tái)加一項(xiàng)后臺(tái)上傳LOGO功能。比較簡(jiǎn)單,在后臺(tái)系統(tǒng)設(shè)置里自定義圖片變量,即可實(shí)現(xiàn)可直接在織夢(mèng)網(wǎng)站后臺(tái)上傳網(wǎng)站logo。分享出來(lái)給供大家參考。
實(shí)現(xiàn)后效果:
修改教程:
織夢(mèng)DedeCMS后臺(tái)系統(tǒng)基本參數(shù)默認(rèn)無(wú)法添加自定義圖片變量,上傳網(wǎng)站LOGO等圖片時(shí),非常不方便,本文為大家分享增加圖片新變量功能的方法。本功能實(shí)現(xiàn)了可直接在網(wǎng)站后臺(tái)上傳網(wǎng)站logo,解決新手不知道織夢(mèng)logo在哪里修改的問題,具體流程如下:
1:打開/dede/templets/sys_info.htm
找到
<script language="javascript" src="../include/js/dedeajax2.js"></script>
<script language="javascript" src="../include/js/jquery/jquery.js"></script>
在下方添加:
<script language="javascript" src="js/main.js"></script>
繼續(xù)找到:
<input type="radio" name="vartype" value="bstring" class='np' />多行文本</td>
<input type="radio" name="vartype" value="bstring" class='np' />多行文本
<input type="radio" name="vartype" value="pic" class='np' />圖片
</td>
找到:
echo "<input type='text' name='edit___{$row['varname']}' id='edit___{$row['varname']}' value='{$row['value']}' style='width:30%'>";
在下方添加:
}else if($row['type']=='pic') { echo "<table><tbody><tr><td><input type='text' name='edit___{$row['varname']}' id='edit___{$row['varname']}' value='{$row['value']}' style='width:250px;'></td> <td><input type='button' name='set9' value='瀏覽... 'class='coolbg np' style='width:60px' onClick="."SelectImageN('form1.edit___{$row['varname']}','','idd_{$row['varname']}');"." /></td> "; if($row['value']){ echo "<td><img src=".$row['value']." style='max-width:150px;max-height: 100px;' id='idd_{$row['varname']}' ></td></tr></tbody></table>"; }else{ echo "<td><img src='images/pview.gif' style='max-width:150px;max-height: 100px;' id='idd_{$row['varname']}'></td></tr></tbody></table>"; } |
到此完成。有疑問的可留言。