2018年6月8日 星期五

ckeditor 文字編輯器筆記

CK編輯器

https://ckeditor.com/ckeditor-4/

參考資料:
https://pjchender.blogspot.com/2015/11/ckeditor.html

http://yuci119.blogspot.com/2014/04/ckeditor.html



怕忘記,記錄在這邊

1.在</title>與</head>中間

<script src="http://網址/ckeditor/ckeditor.js"></script>
<script>
   function processData(){
   // getting data
   var data = CKEDITOR.instances.content.getData()
     }
 </script>

2.在表單中修改3個地方

2.1接收頁
<FORM NAME="MyForm" Action=接收頁.php Method=POST>

2.2內文NAME content
<TR><TD>內文:</TD><td ><textarea rows="20" name="content" cols="90"></textarea></TD></TR>

2.3 增加 on click
<TR><TD><input type="submit" value="送出" name="B1" onclick = "processData()"></TD></TR>

3.在from後
<script>
CKEDITOR.replace( 'content', {});
</script>

4.完整版編輯功能全出現
修改config.js

將全功能開啟
//全功能
config.toolbar_Full = [
   ['Source','-','Save','NewPage','Preview','-','Templates'],
   ['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print', 'SpellChecker', 'Scayt'],
   ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
   ['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'],
   '/',
   ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
    ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],
    ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
    ['Link','Unlink','Anchor'],
   ['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'],
   '/',
    ['Styles','Format','Font','FontSize'],
    ['TextColor','BGColor']
];

我只要部分功能

CKEDITOR.editorConfig = function( config ) {

//設定視窗高度及寬度

config.height = 400; //可以這樣寫
config.width = 600; //也可以這樣寫

//關閉尺寸縮放,固定尺寸,讓使用者無法拉動區塊改變尺寸
config.resize_enabled = false;

// 語言
config.language = 'zh-tw';

// 背景顏色
config.uiColor = '#FFFFFF';

//字體
config.fontSize_sizes = '12/12px;13/13px;16/16px;15/15px;18/18px;20/20px;22/22px;24/24px;36/36px;48/48px;'

//字形

config.font_names = 'Arial;Arial Black;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana;新細明體;細明體;標楷體;微軟正黑體';


config.toolbar = [
   ['Source','-'],
   ['Cut','Copy','Paste','-'],
   ['Undo','Redo','-','RemoveFormat'],
   ['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'],
   '/',
   ['Bold','Italic','Underline','Strike','-'],
    ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],
    ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
    ['Link','Unlink','Anchor'],
     '/',
    ['Styles','Format','Font','FontSize'],
    ['TextColor','BGColor']
];


};

2018年6月4日 星期一

X畢業設定

1.畢業證書號碼設定0開始
2.學校設定內壢國中--->存檔
3.成績加權設定--->1

2018年1月23日 星期二

UEFI WIN7 GHO還原

使用DiskGenius,先確定硬碟切割為GPT格式(GUID)

 勾選ESP分區(UEFI引導)、MSR(微軟系統自己用),其他大小隨便,通常是CD
 確定有磁碟機,紀錄ESP磁碟機,等一下要將EFI資料夾寫入這邊
使用NTBOOTautofix v2.5.7這套軟體,修復ESP分區

2017年8月30日 星期三

限制phpmyadmin訪問IP

※centos7

vim /etc/httpd/conf.d/phpMyAdmin.conf

找到IP

修改存檔

systemctl restart httpd



※centos5

引述來源
https://www.youyong.top/article/1158e344719b

1、进入phpMyAdmin目录,找到config.inc.php,如果没有,可以将根目录下的config.sample.inc.php复制为config.inc.php。
2、编辑config.inc.php,添加下面两行代码,其中192.168.0.1是允许访问 phpMyAdmin 的IP,Access denied是未经授权访问时的提示信息
  1. $ip_prefix = '192.168.0.1';
  2. if (substr($_SERVER['REMOTE_ADDR'], 0, strlen($ip_prefix)) != $ip_prefix ) die('Access denied');
先用whereis 搜尋phpmyadmin的位址
/usr/share/phpmyadmin/
然後編輯config.inc.php
加上上面敘述,便可以鎖


2015年12月17日 星期四

限制SSH IP 及修改port

vi /etc/hosts.allow

sshd:192.168.0.100:allow
sshd:192.168.0.*:allow                   //允許單一IP或網段
sshd:all:deny                                 //擋全部

centos5
service sshd restart

centos7
systemctl restart sshd

修改port

vi /etc/sshd/sshd_config