18. June 2011 12:56 by Jerry in
BlogEngine
The original post is here: http://blog.sumantdubey.com/post/Share-your-posts-on-Facebook-and-Retweet-them-on-Twitter-with-TWITBOOKSHARE-e28093-BlogEngineNET-Extension.aspx
Unfortunately, the extension class is not working with my latest blogengine 2.0, so I enhanced it a little bit, and now it's working.
download here
-
place the cs file at App_Code\Extensions
-
add the css (with notepad) at the end of \themes\the-theme-your-blog-using\style.css
-
go to extension settings page to enable sharing
24. April 2011 22:23 by Jerry in
BlogEngine
From the first day of using BlogEngine, I'm suffering the built-in editor which is the stupid TinyMCE. I finally make up my mind to replace it after upgraded the website to the latest BlogEngine 2.0 version, because it's really slow when typing.
-
download the latest ckeditor and ckfinder for ASP.NET, put CKEditor.NET.dll and CKFinder.dll to the BIN folder of your blogengine website;
and copy the rest stuff to editors folder, like: editors/ckeditor; editors/ckfinder; -
disable any form of http compression, including but not limit to IIS settings (if you had enabled) and blogengine compression, otherwise ckfinder will not working
-
edit blogengine web.config file, to disable the default http compression, search for "CompressionModule", remove or comment the whole line, i.e.
<!--add name="CompressionModule" type="BlogEngine.Core.Web.HttpModules.CompressionModule, BlogEngine.Core"/-->
*BTW, I spent hours to troubleshoot ckfinder, before I disable this setting, I always got an "system error" 1072896748 with ckfinder.
By now, you should proper config ckeditor and ckfinder, make sure you are able to run those samples. You will need to set folder permission, change config files etc, for details, please refer to ckeditor and ckfinder's documentations.
From the next step, will start to integrate blogengine with ckeditor and ckfinder.
-
modify admin/HtmlEditor.ascx
Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="htmlEditor.ascx.cs" Inherits="Admin.HtmlEditor" %><%@ Register Src="tinyMCE.ascx" TagName="tinyMCE" TagPrefix="uc1" %><%--<uc1:tinyMCE ID="TinyMCE1" runat="server" />--%></textarea class="ckeditor" ID="TinyMCE1" style="width:100%" rows="40" runat="server"></script src='/editors/ckeditor/ckeditor.js' type='text/javascript'></script src='/editors/ckfinder/ckfinder.js' type='text/javascript'><script type= "text/javascript" defer="defer">/*var oFCKeditor = new CKeditor( '<%=TinyMCE1.ClientID %>',null,null,"Default" ) ;oFCKeditor.BasePath = "/editors/ckeditor/" ;oFCKeditor.filebrowserBrowseUrl = '/editors/ckfinder/ckfinder.html';oFCKeditor.filebrowserImageBrowseUrl = '/editors/ckfinder/ckfinder.html?type=Images';oFCKeditor.filebrowserFlashBrowseUrl = '/editors/ckfinder/ckfinder.html?type=Flash';oFCKeditor.ReplaceTextarea() ;*/CKEDITOR.replace( '<%=TinyMCE1.ClientID %>',{filebrowserBrowseUrl : '/editors/ckfinder/ckfinder.html',filebrowserImageBrowseUrl : '/editors/ckfinder/ckfinder.html?type=Images',filebrowserFlashBrowseUrl : '/editors/ckfinder/ckfinder.html?type=Flash',filebrowserUploadUrl : '/editors/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Files',filebrowserImageUploadUrl : '/editors/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Images',filebrowserFlashUploadUrl : '/editors/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Flash',filebrowserWindowWidth : '1000',filebrowserWindowHeight : '700'});</script> |
-
modify admin/HtmlEditor.ascx.cs
Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
// --------------------------------------------------------------------------------------------------------------------// <summary>// The admin_html editor.// </summary>// --------------------------------------------------------------------------------------------------------------------namespace Admin{using System.Web.UI;/// <summary>/// The admin_html editor./// </summary>public partial class HtmlEditor : UserControl{#region Properties/// <summary>/// Gets or sets TabIndex./// </summary>public short TabIndex{/*get{return this.TinyMCE1.TabIndex;}set{this.TinyMCE1.TabIndex = value;}*/get { return 0; }set { }}/// <summary>/// Gets or sets Text./// </summary>public string Text{get{return this.TinyMCE1.Value;}set{this.TinyMCE1.Value = value;}}public string EditorID{ get{return TinyMCE1.ClientID;}}#endregion}} |
-
modify admin/Posts/Add_entry.aspx, should be 2 places in AutoSave and SavePost javascript functions
replace "tinyMCE.activeEditor.getContent();" with "CKEDITOR.instances['<%=txtContent.EditorID %>'].getData()" -
modify admin/Posts/EditPage.aspx, similar with above, but only 1 place in SavePage function
change var content = tinyMCE.activeEditor.getContent(); to
var content = CKEDITOR.instances['<%=txtContent.EditorID %>'].getData(); -
modify CheckAuthentication function in editors/ckfinder/config.ascx
to integrate the blogengine authentication, otherwise everyone will be able to upload file to your user file folder if you simply return true:
return Page.User.Identity.IsAuthenticated; -
It's not realted to integration, but it's a security issue that most people forgot,
* to remove all samples in the _samples folder, as well as the _source folder
* it's a good practice to follow the ckfinder's suggestion: in IIS, set Execute Permissions to "none" in the properties of the user files folder (ie. upload folder)
18. July 2010 23:05 by Jerry in
BlogEngine, Cool stuff Having try a few extensions today, finally get one to work:
http://update.to/be/codehighlight/
simply follow the instructions, except the "how to use" section. You have to remove the double quote to get it working.
[ code language=C#]you code here[ /code]