一、后臺(tái)執(zhí)行sql語(yǔ)句
ALTER TABLE `dede_tagindex`
ADD `seotitle` VARCHAR( 255 ) NOT NULL ,
ADD `keywords` CHAR( 128 ) NOT NULL ,
ADD `description` VARCHAR( 255 ) NOT NULL ;
二、修改dede/templets/tags_main.htm
function DeleteOne(tid)
{
location = "tags_main.php?action=delete&ids="+tid;
}
下方增加修改函數(shù)
function EditOne(tid){
location = 'tags_edit.php?gourl='+ encodeURIComponent(document.URL) +'&dopost=edit&id=' + tid;
}
同時(shí)
更新后面增加修改如下
<a href='javascript:UpdateOne(<?php echo $fields['id']; ?>);'>[更新]</a>
<a href="javascript:EditOne(<?php echo $fields['id']; ?>);">[修改]</a>
三、dede目錄下增加修改文件tags_edit.php
<?php
require_once(dirname(__FILE__)."/config.php");
CheckPurview('sys_Keyword');
$tab = 'dede_tagindex';
// 修改tag標(biāo)簽
if($dopost == 'edit')
{
$id = intval($id);
if(empty($id))
{
ShowMsg('指定參數(shù)不合法', -1);
exit();
}
$gourl = empty($gourl) ? 'tags_main.php' : $gourl;
// 提交保存
if ($actions == 'save')
{
$query = "UPDATE `$tab` SET `keywords`='$keywords', `description`='$description', `seotitle`='$seotitle' WHERE `id`='$id'";
$msg = $dsql->ExecNoneQuery($query) ? '修改成功' : '修改失敗';
ShowMsg($msg, $gourl);
exit();
}
// 顯示編輯界面
else {
$row = $dsql->GetOne("SELECT `tag`, `keywords`, `description` , `seotitle` From `dede_tagindex` WHERE `id`='$id'");
if (!is_array($row)) {
ShowMsg('指定標(biāo)簽不存在或已刪除', -1);
exit();
}
include('templets/tags_edit.htm');
}
}
?>
四、增加修改模板dede/templets/tags_edit.htm
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>生成HTML</title>
<link href="css/base.css" rel="stylesheet" type="text/css">
</head>
<body background='images/allbg.gif' leftmargin='8' topmargin='8'>
<table width="98%" border="0" cellpadding="3" cellspacing="1" bgcolor="#D6D6D6" align="center">
<form name='tag_edit' action='makehtml_tag.php' method="post">
<input type="hidden" name="id" value="<?php echo $id; ?>">
<input type='hidden' name='dopost' value='<?php echo $dopost; ?>'>
<input type="hidden" name="actions" value="save">
<input type="hidden" name="gourl" value="<?php echo $gourl; ?>">
<tr>
<td height="28" colspan="2" background='images/tbg.gif'>
<table width="98%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="30%" height="18"><strong>修改TAG標(biāo)簽:</strong></td>
<td width="70%" align="right">西安劍鋒網(wǎng)絡(luò)</td>
</tr>
</table></td>
</tr>
<tr>
<td width="108" height="20" valign="top" bgcolor="#FFFFFF">標(biāo)簽名稱(chēng):</td>
<td height="20" valign="top" bgcolor="#FFFFFF"><?php echo $row['tag']; ?></td>
</tr>
<tr>
<td height="20" valign="top" bgcolor="#FFFFFF">SEO標(biāo)題:</td>
<td height="20" valign="top" bgcolor="#FFFFFF"><input type="text" name="seotitle" size="70" value="<?php echo $row['seotitle']; ?>"></td>
</tr>
<tr>
<td height="20" valign="top" bgcolor="#FFFFFF">關(guān)鍵詞:</td>
<td height="20" valign="top" bgcolor="#FFFFFF"><input type="text" name="keywords" size="70" value="<?php echo $row['keywords']; ?>"></td>
</tr>
<tr>
<td height="20" bgcolor="#FFFFFF">描述:</td>
<td height="20" bgcolor="#FFFFFF"><textarea cols="70" rows="7" name="description"><?php echo $row['description']; ?></textarea></td>
</tr>
<tr>
<td height="20" colspan="2" bgcolor="#FAFAF1" align="center">
<input type="submit" value="保存" class='coolbg np' />
<input type="button" value="返回" class='coolbg np' onClick="history.back()"></td>
</tr>
</form>
</table>
</body>
</html>
五、修改include/arc.taglist.class.php
在
if(!is_array($this->TagInfos))
{
//$fullsearch = $GLOBALS['cfg_phpurl']."/search.php?keyword=".$this->Tag."&searchtype=titlekeyword";
//$msg = "系統(tǒng)無(wú)此標(biāo)簽,可能已經(jīng)移除!<br /><br />你還可以嘗試通過(guò)搜索程序去搜索這個(gè)關(guān)鍵字:<a href='$fullsearch'>前往搜索>></a>";
//ShowMsg($msg,"-1");
ShowMsg('',"-1",0,1);
exit();
}
下方增加
$this->Fields['seotitle'] ='_'.$this->TagInfos['seotitle'];
$this->Fields['keywords'] =$this->TagInfos['keywords'];
$this->Fields['description'] =cn_substr($this->TagInfos['description'],200);
六、調(diào)用
在模板中用 {dede:field.seotitle/} {dede:field.keywords/} {dede:field.description/} 即可調(diào)用