一、后台执行sql语句
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;
}
下方增加修改函数
function EditOne(tid){
location = 'tags_edit.php?gourl='+ encodeURIComponent(document.URL) +'&dopost=edit&id=' + tid;
}
同时
更新后面增加修改如下
<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标签
if($dopost == 'edit')
{
$id = intval($id);
if(empty($id))
{
ShowMsg('指定参数不合法', -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('指定标签不存在或已删除', -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标签:</strong></td>
<td width="70%" align="right">西安剑锋网络</td>
</tr>
</table></td>
</tr>
<tr>
<td width="108" height="20" valign="top" bgcolor="#FFFFFF">标签名称:</td>
<td height="20" valign="top" bgcolor="#FFFFFF"><?php echo $row['tag']; ?></td>
</tr>
<tr>
<td height="20" valign="top" bgcolor="#FFFFFF">SEO标题:</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">关键词:</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 = "系统无此标签,可能已经移除!<br /><br />你还可以尝试通过搜索程序去搜索这个关键字:<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);
六、调用
在模板中用 {dede:field.seotitle/} {dede:field.keywords/} {dede:field.description/} 即可调用