One stop shop for BlogEngine 1.3 extensions

One stop shop for BlogEngine 1.3 extensions,第1张

概述http://tellingmachine.net/post/One-Stop-Shop-for-BlogEngine-Extensions.aspx   I just finished upgrading my blog to BlogEngine version 1.3. While in the process of porting it to the new release, I spen

http://tellingmachine.net/post/One-Stop-Shop-for-BlogEngine-Extensions.aspx

 

I just finished upgrading my blog to BlogEngine version 1.3. While in the process of porting it to the new release,I spent some time experimenting with the extensions and the new BlogEngine 1.3 Extension Manager. I trIEd to keep track of most of the extensions that get posted on CodePlex and I thought I write a blog post that Lists all the extensions that I found and demonstrates them in this post,if applicable. This way BlogEngine fans that don't keep track of all the traffic on CodePlex would get be able to quickly check the availability of a specific add-on for BlogEngine.

 

The Tools

The whole article was written with the current release of windows life Writer and the Code Snippet plugin for Windows Live Writer. The vIDeos that I use for this post where created with Microsoft MovIE Maker 2.1.

 

Extension Manager screen shot

After I deployed all the extensions that I found,I took the following screen shot. On this screen shot you will notice that some extensions are using the old format of adding a tabs to the extensions settings pages like the ,where others integrate into the new

 

Before you start KNown BUGs

I was using the 1.3.0.0 version of BlogEngine,which has a BUG in the Extension Manager (http://www.codeplex.com/blogengine/WorkItem/View.aspx?WorkItemId=4910). Please get a later release that has a BUG fix for this issue. Otherwise you will get an "System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection Parameter name: index" error. I merged the changes from the 1.3.0.12 (9268) change set.

New BUGs

I also found two BUGs related to saving extension settings to the extensions.xml file. The first issue is that a Save operation seems to succeed although the extensions.xml file is write protected. I also found that the content of extensions.xml is sometimes incomplete. Some elements and closing Tags are missing. It seems to be a good practice to have a backup of extensions.xml handy. I looked at the source code and I discovered that there is a "catch all and continue normally" during in the SaveXML() method of the manager.cs file. This explains that you can write to a write protected file and that a bad behaving extension can corrupt the extension.xml file without any warning. The thumbnailer extension has a BUG for example that would cause such a corruption. The result is that some one would wonder why extension settings are always reset to the defaults.

Compatibility issues

Currently all the extensions that I tested dIDn't follow any consistent guIDelines of where to put what kind of files. The supporting files are located all over the place. This makes it a little bit harder to maintain the extension plug-ins. I found one compatibility issue between the mp3player extension and the Silverlight media player extension. Both download a JavaScript file called Player.Js. This leaves the second control without the correct JavaScript file,if both are used on the same page or post. I renamed the file used by the mp3player extension to mp3player.Js and changed the extension source code accordingly to workaround this issue.

Kudos to the extension authors

Almost all extensions that I tested worked well. There was one extension that was not using the ExtensionsSettings framework appropriately and ended up exposing a design issue with the BlogEngine Extension Manager itself.

 

AkismetExtension

Description: Passes comments to Akismet for valIDation

Author's Blog: Justin Etheredge

link to provIDer of 3rd party service: http://www.akismet.com

Related links: http://www.wordpress.com

Supported Versions: 1.2 and 1.3

Remarks: N/A

Demo:

 

BBCode

Description: Converts BBCode to xhtml in the comments

Author's Blog: BlogEngine.NET

link to provIDer of 3rd party service: N/A

Related links: N/A

Supported Versions: 1.2 and 1.3

Remarks: N/A

Demo:

 

BreakPost

Description: Breaks a post where [ m o r e ] is found in the body and adds a link to full post

Author's Blog: BlogEngine.NET

link to provIDer of 3rd party service: N/A

Related links: N/A

Supported Versions: 1.2 and 1.3

Remarks: N/A

Demo:

 

CodeFormatterExtension

Description: Converts text between [ c o d e : c # ] and [ / c o d e ] Tags to formatted Syntax highlighted code (beta)

Author's Blog: www.manoli.net

link to provIDer of 3rd party service: N/A

Related links: http://rtur.net/blog/post/2007/11/Insert-Code---your-options.aspx

Supported Versions: 1.3

Remarks: The Tags should not be visible after the formatting,but in this case the result is appreciated.

Demo:

 

 

public voID AddValue(string val)
{
    if (_values == null)
        _values = new StringCollection();
    _values.Add(val);
}

 

 

 

copyCodetoClipboard

Description: Adds a link to Syntax highlighted code to copy it to the clipboard.

Author's Blog: Troy Goode

link to provIDer of 3rd party service: N/A

Related links: http://lvildosola.blogspot.com/2007/02/code-snippet-plugin-for-windows-live.html

Supported Versions: 1.3

Remarks: Requires Windows Live Writer Code Snippet PlugIn. Also make sure that you check the "Use Container" and un-check the "Embed Style" options before you insert the code snippet. Add the content of the attached *.CSS files to the styles.CSS of your theme. Modify the Tags of the new styles so they match your theme. Make sure that the path to the "_clipboard.swf" file is set correctly and test your site with firefox. The regex engine that scans the input source file gets exponentially slower by the size of the input source code string. Don't make them too big.

I also needed to make a small change to the source code itself. windows live Writer strips out the line breaks between the pre ending tag and a new pre beginning tag. I added a line of code that would inject the line break back in between the pre Tags. This way the regex that is supposed to strip the line numbers off,will be applIEd successfully. See the source code change in the following source window at line 19.

Demo:

 

 

   1: private voID InsertcopyCodelink( ServingEventArgs e)
   2:     {
   3:         if( !string.IsNullOrEmpty(e.Body) )
   4:         {
   5:  
   6:             //### find code-div
   7:             string postID = GuID.NewGuID().ToString().Replace( "{","" ).Replace( "}","" ).Replace( "-","" );
   8:             string toFind = "<div class=/"csharpcode-wrapper/">";
   9:             int index = e.Body.IndexOf(toFind);
  10:             while( index != -1 )
  11:             {
  12:  
  13:                 //### grab code out of code-div
  14:                 int end = e.Body.IndexOf( "</div>",index ); //### the first </div> should be the end of "csharpcode"
  15:                 end = e.Body.IndexOf( "</div>",end ); //### the next </div> should be the end of "csharpcode-wrapper"
  16:                 string code = e.Body.Substring(index,end - index);
  17:  
  18:                 //### add new line /r/n between </pre><pre in case windows live Writer stripped it out before publishing
  19:                 code = code.Replace("</pre><pre ","</pre>/r/n<pre ");
  20:                 
  21:                 //### parse code out of code-div
  22:                 int codeStart = code.IndexOf("<pre ");
  23:                 int codeEnd = code.LastIndexOf("</pre>") + 6;
  24:                 code = code.Substring(codeStart,codeEnd - codeStart);
  25:                 code = Regex.Replace( code,@"<(.|/n)*?>",string.Empty ); //### strip HTML
  26:                 code = code.Replace( "&#160;","" ); //### remove unnecessary &#160;s from the blank lines
  27:                 code = code.Replace( "&nbsp;"," " ); //### convert &nbsp;s to spaces
  28:                 code = Regex.Replace( code,@"^(/s*)(/d+): ","" ); //### remove line numbers on first line
  29:                 code = Regex.Replace( code,@"(/n)(/s*)(/d+): ","/n" );  //### remove line numbers on subsequent lines
  30:  
  31:                 //### create copy link
  32:                 string insertScript = @""text/JavaScript"">;
  33:                     <script type="
  34:                         var copyToClipboard@INDEX = copyToClipboard_Strip('@CODE');
  35:                     </script>"
  36:                 string insertdiv = @"<div str">"copyToClipboard"" str">"@STYLE""><div><a href=""JavaScript:voID(0);"" onclick=""copyToClipboard_VIEwPlain(copyToClipboard@INDEX);"">@POPUPTEXT</a> | <a href=""JavaScript:voID(0);"" onclick=""copyToClipboard_copy(copyToClipboard@INDEX);"">@copYTEXT</a></div></div>";
  37:  
  38:                 //### set values for copy link and insert above/below code
  39:                 string insert = insertdiv + OutputCommonMethods() + insertScript;
  40:                 insert = insert.Replace( "@STYLE",settings.GetSingleValue("style") );
  41:                 insert = insert.Replace( "@POPUPTEXT",settings.GetSingleValue("popupText") );
  42:                 insert = insert.Replace( "@copYTEXT",settings.GetSingleValue("copyText") );
  43:                 insert = insert.Replace( "@INDEX",postID + "_" + index.ToString() ); //### use index of code-div as a unique ID to allow multiple code-divs on this post
  44:                 insert = insert.Replace( "@CODE",code.Replace( "//","////" ).Replace( "'","//'" ).Replace( "/r/n","//r//n" ).Replace( "//r//n//r//n//r//n","//r//n" ) );t find this same code-div again
  45:                 if( settings.GetSingleValue("aboveBelow").Tolower() == "above" )
  46:                     e.Body = e.Body.Insert( index,insert );
  47:                 else
  48:                     e.Body = e.Body.Insert( e.Body.IndexOf( "</div>",end + 1 ) + 6,insert );
  49:  
  50:                 //### prep index to find next code-div
  51:                 index = index + insert.Length + 1; //### ensure we don'
  52:                 if( index > e.Body.Length ) break;
  53:                 index = e.Body.IndexOf( toFind,index ); //### find any other code divs
  54:  
  55:             }
  56:         }
  57:     }

 

 

DotNetKicks

Description: Adds a DotNetKicks button to a post where the token [ d o t n e t k i c k s]  is found.

Author's Blog: Sean Blakemore

link to provIDer of 3rd party service: N/A

Related links: N/A

Supported Versions: 1.2 and 1.3

Remarks: N/A

Demo:

 

DownloadCounter

Description: Counts the number of downloads from your blog and displays the statistics on the extension admin page.

Author's Blog: RTUR.NET

link to provIDer of 3rd party service: N/A

Related links: N/A

Supported Versions: 1.3

Remarks: N/A

Demo:

 

flvplayer

Description: Plays Flash VIDeo files in an embedded player using JW_FLV_Player

Author's Blog: Matthew J. Sherman

link to provIDer of 3rd party service: N/A

Related links: JW_FLV_Player

Supported Versions: 1.2 and 1.3

Remarks: Embedding a player that plays test.flv is as easy as adding a [ f l v : t e s t . f l v ] tag to your post. Flash VIDeo files (flv) can be encoded using Adobe Flash Professional CS3.

Demo: [flv:barsandtone.flv]

 

lightBox

Description: Adds support for using the lightBox Js library for displaying images

Author's Blog: René Kuss

link to provIDer of 3rd party service: N/A

Related links: LightBox Project

Supported Versions: 1.3

Remarks: Add image to post and add the following attribute rel="lightBox" to the image <a> link tag. For a serIEs of images add the attribute rel="lightBox[lamps]" to each <a> link of the serIEs.

Demo: Single image

Demo: Image set

 

mp3player

Description: Flash mp3 audio player

Author's Blog: RTUR.NET

link to provIDer of 3rd party service: N/A

Related links: Audio Player Wordpress plugin

Supported Versions: 1.3

Remarks: Embedding a player that plays test.mp3 is as easy as adding a [ m p 3 : t e s t . m p 3 ] tag to your post. This player uses a JavaScript file called Player.Js. The Silverlight extension uses a file with the same name. This file name clash Could cause a player control to throw a JavaScript error and not be rendered.

Demo:

[mp3:test.mp3]

 

Odiogo

Description: Adds an Odiogo 'Listen' image button to the top of all posts.

Author's Blog: Mads Kristensen

link to provIDer of 3rd party service: Odiogo

Related links: N/A

Supported Versions: 1.3

Remarks: The Odiogo service subscribes to your blog,reads blog posts and converts them into mp3 files. This service also adds your blog as podcast to iTunes. You need to sign up with Odiogo and receive an API Key that is used in the extension source code.

Demo: Checkout the "Listen Now" Odiogo button at the beginning of each post

 

Quickerlinks

Description: Replaces Keywords with links.

Author's Blog: ckincincy

link to provIDer of 3rd party service: N/A

Related links: N/A

Supported Versions: 1.3

Remarks: Edit the mapPing in the extension manager page. In this case t e m a will be replaced by tema . Make sure that you enter a value for the "CollectClickStats" attribute. Otherwise windows live Writer will complain that the "string is not a valID boolean value" during the publishing process.

Demo:

 

Resolvelinks

Description: auto resolves URLs in the comments and turn them into valID hyperlinks.

Author's Blog: BlogEngine.NET

link to provIDer of 3rd party service: N/A

Related links: N/A

Supported Versions: 1.2 and 1.3

Remarks: N/A

Demo: See also my own comment at the end of the post.

 

SendCommentMail

Description: Sends an e-mail to the blog owner whenever a comment is added.

Author's Blog: BlogEngine.NET

link to provIDer of 3rd party service: N/A

Related links: N/A

Supported Versions: 1.2 and 1.3

Remarks: N/A

Demo: N/A

 

SendPings

Description: Pings all the Ping services specifIEd on the PingServices admin page and send track- and Pingbacks.

Author's Blog: BlogEngine.NET

link to provIDer of 3rd party service: N/A

Related links: N/A

Supported Versions: 1.2 and 1.3

Remarks: N/A

Demo: N/A

 

SilverlightPlayer

Description: Adds a Silverlight vIDeo player to the post.

Author's Blog: Sean Blakemore

link to provIDer of 3rd party service: N/A

Related links: N/A

Supported Versions: 1.3

Remarks: Embedding a Silverlight player that plays somevIDeo.wmv is as easy as adding the tag [ s i l v e r l i g h t : s o m e v i d e o . w m v ] to your post. Add the somevIDeo.wmv file into the Silverlight folder of your blog engine application. Make sure to add the mime type for xaml,extension - .xaml,mime type - application/xaml+xml to your server. The  Silverlight player doesn't seem to play any kind of WMV files. I created one by converting a MPG file from my digital camera to a WMV file using the windows XP MovIE Maker 2.1 software. This one worked. This player uses a JavaScript file called Player.Js. The mp3player extension uses a file with the same name. This file name clash Could cause a player control to throw a JavaScript error and not be rendered.

Demo:

[silverlight:RollRobiRollVerySmall.wmv]

 

SmilIEs

Description: Converts ASCII SmilIEs into real SmilIEs in the comments.

Author's Blog: BlogEngine.NET

link to provIDer of 3rd party service: N/A

Related links: N/A

Supported Versions: 1.2 and 1.3

Remarks: N/A

Demo: See my own comment at the end of the post.

 

Snaplinks

Description: Replaces Snap keywords with SPAN tag to enable Snap links on regular text.

Author's Blog: Chris Blankenship

link to provIDer of 3rd party service: Snap

Related links: Clarence Klopfstein and Mads Kristensen. The following link points to the different kind of shap shots available: Shapshot Menu

Supported Versions: 1.2 and 1.3

Remarks: You need to sign up with Snap.com and copy some JavaScript into your page header before you can take advantage of this extension. Once this done,it is as simple as embracing a URL in by the following opening and closing Tags: [ s U R L] url [ / s U  R L ]. Instead of using an URL different sets of Tags take the embraced string as a key to query some well kNown web sites. Here are some more markup examples:

[ s Y o u T u b e ] YouTube vIDeo ID [ / s Y o u T u b e ]

[ s W i k i p e d i a ] search keyword [ / s W i k i p e d i a]

[ s S t o c k ] stock symbol [ / s S t o c k ]

 

Demo:

A snap shot of an URL: http://www.dotnetblogengine.net

A snap shot of a YouTube vIDeo ID: ATlYBwBNApc

A snap shot of a Wikipedia key word: Luxor

A snap shot of a stock symbolaapl

 

thumbnailer

Description: Creates thumbnail images for blog posts and pages while the content is being saved.

Author's Blog: René Kuss

link to provIDer of 3rd party service: N/A

Related links: N/A

Supported Versions: 1.3

Remarks: To create a thumbnail picture of the referenced image just add the following tag to the img link as attribute: [thumb:height=50,wIDth=50,link=lightBox]

Demo: This extension can't be demonstrated using windows live Writer as blog editor. But windows live Writer has this feature already built in. I encountered a BUG with this extension and ended up disabling it. Unfortunately the BE Extension Manager catches all exceptions and ignores them,but if you set a break point into the catch block of the SaveXML() method in Manager.cs then you will see that the thumbnailer extension causes an exception that will actually end up corrupting the extension.xml file and force BE to load the defaults for all other extensions that are installed.

 

YouTube

Description: Embeds Youtube vIDeos into posts and pages.

Author's Blog: Mads Kristensen

link to provIDer of 3rd party service: YouTube

Related links: N/A

Supported Versions: 1.3

Remarks: The extension replaces the [ y o u t u b e : vIDeo ID] tag with the appropriate HTML to embed a YouTube flash vIDeo.

Demo:

[youtube:ATlYBwBNApc]

总结

以上是内存溢出为你收集整理的One stop shop for BlogEngine 1.3 extensions全部内容,希望文章能够帮你解决One stop shop for BlogEngine 1.3 extensions所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1075603.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-26
下一篇 2022-05-26

发表评论

登录后才能评论

评论列表(0条)

保存