ALTER TABLE `ecs_article` ADD `title_style` VARCHAR( 60 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '+'
2、languageszh_cnadminarticle.php 加入語言
//文章標題加樣式 by neo
$_LANG['select_font'] = '字體樣式';
$_LANG['font_styles'] = array('strong' => '加粗', 'em' => '斜體', 'u' => '下劃線', 'strike' => '刪除線');
$_LANG['js_languages']['cancel_color'] = '無樣式';
3、adminjscolorselector.js 一個,改名 colorselector2.js
{$lang.title}
{$lang.require_field}
修改成
{$lang.title}
{$lang.require_field}
5、adminarticle.php
/* 文章標題加樣式 by neo */
$title_style = explode('+', empty($article['title_style']) ? '+' : $article['title_style']);
$smarty->assign('title_color', $title_style[0]);
$smarty->assign('title_style', $title_style[1]);
3).找到
$sql = "INSERT INTO ".$ecs->table('article')."(title, cat_id, article_type, is_open, author, ".
"author_email, keywords, content, add_time, file_url, open_type, link, description) ".
"VALUES ('$_POST[title]', '$_POST[article_cat]', '$_POST[article_type]', '$_POST[is_open]', ".
"'$_POST[author]', '$_POST[author_email]', '$_POST[keywords]', '$_POST[FCKeditor1]', ".
"'$add_time', '$file_url', '$open_type', '$_POST[link_url]', '$_POST[description]')";
修改成
$title_style = $_POST['title_color'] . '+' . $_POST['title_style'];//文章標題加樣式 by neo
$sql = "INSERT INTO ".$ecs->table('article')."(title, cat_id, article_type, is_open, author, ".
"author_email, keywords, content, add_time, file_url, open_type, link, description, title_style) ".
"VALUES ('$_POST[title]', '$_POST[article_cat]', '$_POST[article_type]', '$_POST[is_open]', ".
"'$_POST[author]', '$_POST[author_email]', '$_POST[keywords]', '$_POST[FCKeditor1]', ".
"'$add_time', '$file_url', '$open_type', '$_POST[link_url]', '$_POST[description]', '$title_style')";
4).找到
if ($exc->edit("title='$_POST[title]', cat_id='$_POST[article_cat]', article_type='$_POST[article_type]', is_open='$_POST[is_open]', author='$_POST[author]', author_email='$_POST[author_email]', keywords ='$_POST[keywords]', file_url ='$file_url', open_type='$open_type', content='$_POST[FCKeditor1]', link='$_POST[link_url]', description = '$_POST[description]'", $_POST['id']))
修改成
$title_style = $_POST['title_color'] . '+' . $_POST['title_style'];//文章標題加樣式 by neo
if ($exc->edit("title='$_POST[title]', cat_id='$_POST[article_cat]', article_type='$_POST[article_type]', is_open='$_POST[is_open]', author='$_POST[author]', author_email='$_POST[author_email]', keywords ='$_POST[keywords]', file_url ='$file_url', open_type='$open_type', content='$_POST[FCKeditor1]', link='$_POST[link_url]', description = '$_POST[description]', title_style = '$title_style'", $_POST['id']))
======================以上步驟能實現(xiàn)了后臺的文章標題樣式添加和修改============================
$arr[$article_id]['title_style'] ? = add_style($row['title'],$row['title_style']);//文章標題加樣式 by neo
$arr[$article_id]['short_title_style'] ? = add_style($arr[$article_id]['short_title'],$row['title_style']);//文章標題加樣式 by neo
前臺dwt,lbi模板部分
$sql = 'SELECT a.article_id, a.title, a.title_style, ac.cat_name, a.add_time, a.file_url, a.open_type, ac.cat_id, ac.cat_name ' .
' FROM ' . $GLOBALS['ecs']->table('article') . ' AS a, ' .
$GLOBALS['ecs']->table('article_cat') . ' AS ac' .
' WHERE a.is_open = 1 AND a.cat_id = ac.cat_id AND ac.cat_type = 1' .
' ORDER BY a.article_type DESC, a.add_time DESC LIMIT ' . $GLOBALS['_CFG']['article_number'];
在里面foreach里添加
$arr[$idx]['title_style'] ? = add_style($row['title'],$row['title_style']);//文章標題加樣式 by neo
$arr[$idx]['short_title_style'] ? = add_style($arr[$idx]['short_title'],$row['title_style']);//文章標題加樣式 by neo
版權(quán)聲明: 本站資源均來自互聯(lián)網(wǎng)或會員發(fā)布,如果侵犯了您的權(quán)益請與我們聯(lián)系,我們將在24小時內(nèi)刪除!謝謝!
轉(zhuǎn)載請注明: ecshop文章標題文字增加顏色樣式修改方法