博客系统emlog-V5.1.2修改记录(非模板修改)


1.后台在线编辑器调出“段落(formatblock)”、“插入横向(br)”模块;

修改文件: /admin/editor/kindeditor.js

function loadEditor(id) {
	editorMap[id] = editorMap[id] || KindEditor.create('#'+id, {
		resizeMode:1,
		allowUpload:false,
		allowImageUpload:false,
		allowFlashUpload:false,
		allowPreviewEmoticons:false,
		urlType:'domain',
		items:
		newlineTag:'p', // 设置回车换行标签,可设置”p”、”br”。
		['formatblock','bold','italic','underline','strikethrough','forecolor','hilitecolor','fontname','fontsize','lineheight','removeformat','plainpaste','quickformat','insertorderedlist','insertunorderedlist','indent','outdent','justifyleft','justifycenter','justifyright','link','unlink','image','flash','table','emoticons','hr','code','fullscreen','source','|','about']
	});
}

2.修改了编辑器的“代码高亮插件”的按钮图标

/content/plugins/syntaxHighlighter/syntaxHighlighter.php 

把 第15行 的 

echo ‘<script type=”text/javascript” src=”‘.BLOG_URL.’content/plugins/syntaxHighlighter/brush/code.js”></script>’.'<style type=”text/css”>.ke-icon-code{background-image: url(“../content/plugins/syntaxHighlighter/code.gif”);background-position: 0 0;height: 16px;width: 16px;}</style>';

改成了

echo ‘<script type=”text/javascript” src=”‘.BLOG_URL.’content/plugins/syntaxHighlighter/brush/code.js”></script>';

即,去掉了样式输出

3.修改了编辑器的“代码高亮插件”弹出框默认语言选择为 “PHP”。

  /content/plugins/syntaxHighlighter/brush/code.js

4.代码高亮插件,前台显示样式调整,修改了文件:

  /content/plugins/syntaxHighlighter/brush/shCore.css

  /content/plugins/syntaxHighlighter/brush/shThemeDefault.css

5.从官网的demo地址: http://www.kindsoft.net/ke4/examples/simple.html

  拔下了编辑器的默认样式文件 “http://www.kindsoft.net/ke4/themes/default/default.css” ,

  替换了文件 /admin/editor/themes/default/default.css

6./admin/views/sortedit.php 在 “别名”文字前加了个 “空格”

  预览地址: /admin/sort.php?action=mod_sort&sid=1

7.“阅读全文”新窗口打开

  /include/model/log_model.php

第 189 行

8.更改“rss.php” 中 “generator” 节点值为 “blog.snsgou.com”

9.修改 /m/view/footer.php 的

 

<div id=”footer”>Powered By <a href=”http://www.emlog.net/”>emlog</a></div>

<div id=”footer”>Powered By <a href=”http://blog.snsgou.com/”>snsgou.com</a></div>

10.添加SEO插件

  修改 emlog_log表,增加字段 seo_keywords varchar(255) // seo关键字, seo_description varchar(500) // seo描述

  •   /admin/views/edit_log.php
  •   /admin/views/add_log.php
  •   /admin/views/css/css-main.css
  •   /admin/views/js/common.js
  •   /admin/save_log.php
  •   /include/model/log_model.php
  •   /include/controller/log_controller.php // 首页、内容详细页 控制器
  •   /include/controller/tab_controller.php // 标签页 控制器
  •   /include/controller/sort_controller.php // 分类页 控制器
  • $site_title
  • $site_key
  • $site_description

11.优化在线编辑产生的HTML标签

找到文件 /admin/save_log.php ,在 //check alias 前面追加如下代码:

// add by snsgou.com
/*
 1.将 “<p><br/></p>”替换成“<p>&nbsp;</p>”
 2.删除掉“<br/>”
 3.删除掉“style=""”
 4.删除掉“”
*/
$content = preg_replace('/<(p|h3|h4)>[/s]*(<strong>)?[/s]*(<br[/s]*//>)?[/s]*(<//strong>)?[/s]*<//(p|h3|h4)>/is', '<p>&nbsp;</p>', $content);
$content = preg_replace('/<br[/s]*//>/i', '', $content);
$content = str_replace('style="line -height:1.5;"', '', $content);
$content = str_replace('line -height:1.5;', '', $content);
$excerpt = preg_replace('/<(p|h3|h4)>[/s]*(<strong>)?[/s]*(<br[/s]*//>)?[/s]*(<//strong>)?[/s]*<//(p|h3|h4)>/is', '<p>&nbsp;</p>', $excerpt);
$excerpt = preg_replace('/<br[/s]*//>/i', '', $excerpt);
$excerpt = str_replace('style="line -height:1.5;"', '', $excerpt);
$excerpt = str_replace('line -height:1.5;', '', $excerpt);

$seo_keywords = isset($_POST['seo_keywords']) ? addslashes(trim($_POST['seo_keywords'])) : '';
$seo_description = isset($_POST['seo_description']) ? addslashes(trim($_POST['seo_description'])) : '';

发表评论

电子邮件地址不会被公开。 必填项已用*标注

您可以使用这些HTML标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>