一、修改数据库结构,在 ecs_brand 表里增加一个新字段 page_title
依次进入 后台 》数据库管理 》SQL查询,输入下面的SQL语句,并执行。
ALTER TABLE `ecs_brand` ADD `page_title` VARCHAR( 255 ) NOT NULL
二、修改模板文件 /admin/templates/brand_info.htm 查找
<tr>
<td class="label">{$lang.sort_order}</td>
<td><input type="text" name="sort_order" maxlength="40" size="15" value="{$brand.sort_order}" /></td>
</tr>
在下面添加代码
<tr>
<td class="label">自定义TITLE:</td>
<td><input type="text" name="page_title" size="60" value="{$brand.page_title}" /></td>
</tr>
三、修改 /admin/brand.php 查找
$sql = "INSERT INTO ".$ecs->table('brand')."(brand_name, site_url, brand_desc, brand_logo, is_show, sort_order) ".
"VALUES ('$_POST[brand_name]', '$site_url', '$_POST[brand_desc]', '$img_name', '$is_show', '$_POST[sort_order]')";
$db->query($sql);
修改为
$sql = "INSERT INTO ".$ecs->table('brand')."(brand_name, site_url, brand_desc, brand_logo, is_show, sort_order,page_title) ".
"VALUES ('$_POST[brand_name]', '$site_url', '$_POST[brand_desc]', '$img_name', '$is_show', '$_POST[sort_order]'),'$_post[page_title]'";
$db->query($sql);
续续查找
$sql = "SELECT brand_id, brand_name, site_url, brand_logo, brand_desc, brand_logo, is_show, sort_order ".
"FROM " .$ecs->table('brand'). " WHERE brand_id='$_REQUEST[id]'";
$brand = $db->GetRow($sql);
修改为
$sql = "SELECT brand_id, brand_name, site_url, brand_logo, brand_desc, brand_logo, is_show, sort_order,page_title ".
"FROM " .$ecs->table('brand'). " WHERE brand_id='$_REQUEST[id]'";
$brand = $db->GetRow($sql);
再继续查找
/* 处理图片 */
$img_name = basename($image->upload_image($_FILES['brand_logo'],'brandlogo'));
$param = "brand_name = '$_POST[brand_name]', site_url='$site_url', brand_desc='$_POST[brand_desc]', is_show='$is_show', sort_order='$_POST[sort_order]' ";
修改为
/* 处理图片 */
$img_name = basename($image->upload_image($_FILES['brand_logo'],'brandlogo'));
$param = "brand_name = '$_POST[brand_name]', site_url='$site_url', brand_desc='$_POST[brand_desc]', is_show='$is_show', sort_order='$_POST[sort_order]',page_title='$_POST[page_title]' ";
四、修改前台程序文件 /brand.php 查找
$smarty->assign('page_title', $position['title']); // 页面标题
修改为
$smarty->assign('page_title', htmlspecialchars($brand_info['page_title'])); // 页面标题
新闻热点
疑难解答