Picasa photos in your BlogEngine site

February 8, 2009 19:10 by bryan

I've been having a play with Picasa API, and come up with this Extension for BlogEngine.

All you have to do is pake the picture.cs file and place it in "\App_Code\Extensions" folder, and it takes care of everything for you.

Picture.zip (1.92 kb)

How it works

First the extension will use the admin email address and then add all the newletter e-mail address to a user list, then check with Picasa to see if they have an account.  The extension then has a list of user with valid Picasa Albums.

When you open an article the extension will go over all the Tags and see if any of the Picasa Albums in your user list has the same tags, if it does then the photos will be added to the article.

I do Cache the objects, so once the initial load of the article has taken place it is stored in Cache, as it can take some time to compile the list of photos depending how many active user Picasa Albums you have.

One enhancement I would like to include is for the loading of the photos to happen behind the scenes and show a wait icon while the extension goes and gets the photos from Picasa.  But I'm not sure how to do this in an Extension, if you know please let me know too.

I've got it working on my Village Website

http://www.bromham.org.uk/


Picasa Google's web album

January 31, 2009 07:08 by bryan

I've always wanted to hook in to Goolges Picasa Web Album to allow for sites to store and display photos from Picasa, and I have just found a great blog from Richard Nilsson on the startings of building a photo album on your site, well worth a visit.

Google also has a Picasa Web Albums Data API for .NET, so what ae we waiting for?


My Theme made it in to the BlogEngine Themes

December 18, 2008 09:02 by bryan

After my work creating the Mad Tri web site, I submitted the theme it to the BlogEngine team a few months ago and they have included it in their Theme pack, what a lovely surprise.

The BlogEngine team are going to be working hard over Christmas, with updating the BlogEngine and release a new release. more...

I too are going to the working over the Christmas on an Enhanced Newsletter and a Resource Editor to enable changes to Internationalization from the web, power to the BlogEngine 


Newsletter Enhancements

October 21, 2008 13:10 by bryan

After using the BlogEngine Newsletter, I noticed that it was not easy to unsubscribe from the newsletter, so I went to task and produced an enhanced Newsletter so you can unsubscribe from the newletter from the incoming email.

As a result I also increased what is being sent on the e-mail, to provide more information for the subscriber.

One other feature I added was that is a post is saved but in an unpublished state an e-mail is sent to the administrator informing them of a new unpublished post. 

Upzip this attached file and place the folder in the widgets directory of the application.  Be sure to over right or replace the existing Newsletter otherwise people will receive two emails for each post.

Newsletter.zip (4.23 kb)


iPhone Theme for BlogEngine

October 13, 2008 12:23 by bryan

I've created a simple iPhone Theme for the BlogEngine, using both Style Sheet, with a few tweeks, from the iUI Project Members, and a simple javaScript accordian by dezinerfolio.com

 

Just places iPhone folder in the Themes directory of the BlogEngine. 

iPhone.zip (29.91 kb)

This is the first pass at an iPhone theme, there are still features I'd like to put in, such as Previous and Next links, Pages, Categories, but not had time to do that at the moment. 

Further information on CSS for the iPhone can be found here


Knowing when something has gone wrong

October 9, 2008 09:45 by bryan

I don't know about you, but when I am looking after a website I like to know if something has gone wrong on the website, mainly so you can fix it as soon as it happens and resolve the issue before the user of the website gets feed up and goes somewhere else.

Within ASP.NET you can configure the Global.ASAX Application_Error to capture an exceptions that are happening on you web site, so why not catch the exception and then e-mail it to the administrator of the website.

The example below works well with BlogEngine, as it uses the prebuilt settings and more importantly the Async sending of emails.

void Application_Error(object sender, EventArgs e)
    {
        
            Exception objErr = Server.GetLastError().GetBaseException();
            string err = "<b>Error Caught in Application_Error event</b><hr><br>" +
                    "<br><b>Error in: </b>" + Request.Url.ToString() +
                    "<br><b>Error Message: </b>" + objErr.Message.ToString() +
                    "<br><b>Stack Trace:</b><br>" +
                              objErr.StackTrace.ToString();
 
            System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage();
 
            string from = BlogSettings.Instance.Email;
 
            mail.To.Add(BlogSettings.Instance.Email);
            mail.From = new System.Net.Mail.MailAddress(from, from);
 
            mail.Subject = String.Format("Error in the Site - {0} Error", BlogSettings.Instance.Name);
 
            mail.Body += String.Format("{0}<br/><br/><a href='{1}'>{1}</a><br/><br/>", System.DateTime.Now.ToString(), Request.Url.ToString());
            mail.Body += "<b>Error Caught in Application_Error event</b><hr><br>" +
                          "<br><b>Error in: </b>" + Request.Url.ToString() +
                          "<br><b>Error Message: </b>" + objErr.Message.ToString() +
                          "<br><b>Stack Trace:</b><br>" + objErr.StackTrace.ToString();
            mail.Body += "Server Variables<br/><br/>";
 
            foreach (string x in Request.ServerVariables)
            {
                mail.Body += x + " - " + Request.ServerVariables[x] + "<br/>";
            }
 
            Utils.SendMailMessageAsync(mail);
    }

BlogEngine Maintenance

September 28, 2008 08:53 by bryan

One thing I have found frustrating about the BlogEngine, when you are developing is I have to go on the the server to recycle the application pool if I need to refresh the object loaded in memory.

In addition I wanted a way to find out how may posts, pages and files the BlogEngine held in the application.  Also find out the amout of hard disc space they used would be useful.

So I went ahead and wrote a Maintenance section 

Installation is quite simple copy the admin/Maintenance folder in to the admin/maintenance folder.

Ammend the web.sitemap to include the maintenance

<siteMapNode url="~/admin/Pages/Maintenance.aspx" title="Maintenance"  description=""  roles="administrators"/>

When you login as an administrator you will find the maintenance section appear.

maintenance.zip (3.83 kb)

 


Embed Picasa slideshows into BlogEngine.net

September 15, 2008 17:30 by bryan

I was having a problem embedding a slide show from Picasa into my BlogEngine.net editor. Basically, the editor kept stripping the embed html.  The trick is to edit \admin\tinyMCE.ascx file.  You need to modify the extended_valid_elements entry. Apparently this is used to define valid html tags for the tinyMCE editor. Here are my additions in red:

extended_valid_elements : "hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style],

script[charset|defer|language|src|type],code,iframe[src|width|height|frameborder|name|style],

embed[type|src|width|height|flashvars|pluginspage]",

Have fun!


Using BlogEngine.net as a General Purpose Content Management System

May 30, 2008 14:32 by bryan

So I keep running into the same problem - I am building a small website for somebody and I need to provide them with a way to update the content of their site so I don't have to. Basically, I need a lightweight and flexible content management system that is easy to use.

If The Shoe Fits...

When I first thought of a lightweight CMS, I thought of graffiti. It sounds like exactly what I need. So I downloaded the express edition and started evaluating it. It seemed like a nice product and all is not free for commercial use ($399 is the cheapest commercial licence) and I can't afford that price tag when building small websites.

Enter BlogEngine.net. My favorite blogging platform. There, I said it.  Well, I use it to run my blog and I am constantly tinkering around with the site all of the time because I enjoy using BlogEngine.net so much.

I thought that BlogEngine.net has all of the key pieces I needed for my lightweight CMS:

  1. A WYSIWYG Editor
  2. A Metaweblog interface
  3. Tons of extensibility

Basic Idea

I decided to base my CMS implementation on the concept of pages. Most blog engines have two distinct types of content: pages and posts. Posts are the typical type of content that becomes part of your blogs feed whereas pages are usually static content which can be anything outside of a blog post (for example an 'About Me' page). BlogEngine.net already has everything I need to get the content of page created and persisted in a data store (it supports xml and sql server out of the box). I decided to write a web control which I can place on any webpage and include the contents of a given page from the data store.

I made a control called PageViewer which you can place on the page like this:

<blog:PageViewer ID="view" runat="server" DisplayTitle="false" PageId="167eb7f3-135b-4f90-9756-be25ec10f14c" />
This control basically just looks up the page using the given id (this functionality is all provided by the existing BlogEngine.Core library) and displays its content. Here is the rendering logic
if (PageId != Guid.Empty)	
page = BlogEngine.Core.Page.GetPage(PageId);if (page != null){	ServingEventArgs arg = new ServingEventArgs(page.Content,ServingLocation.SinglePage);BlogEngine.Core.Page.OnServing(page, arg);	if (arg.Cancel)	Page.Response.Redirect("error404.aspx", true);	
if (DisplayTitle)	{		writer.Write("<h1>");		writer.Write(page.Title);		writer.Write("</h1>");	}	
writer.Write("<div>");	writer.Write(arg.Body);	writer.Write("</div>");}
This code is pretty straight forward - all it does is get an instance of the page and then display its title in <h1> a tag and its body in <div> tag. This logic is actually straight from the existing page retrieval code that already exists in BlogEngine.net. This web control is pretty much the only new code I had to write. The rest of the project mostly involves moving files around and removing parts of the BlogEngine.net framework that I don't need.

Armed with this control, we are ready to start converting the static pages from the old version of the website to be BlogEngine.net pages which can be stored and retrieved using the BlogEngine.Core classes.

Themes

It's also worth noting that there are many themes available for BlogEngine

themes4blogengine.net