Main | Prev 1 2

Weblog Archives

September 12, 2006

Incorrect display of RSS items on Lilina 0.9 and fixed it.

    On my RSS page, I found it cannot display correctly some items from blogs based on WordPress. I have thought that it's the blog owner's problem that they should put some basic HTML tags(p,br etc) into their post. But after I check the rss display on feedburner.com, I found there are two copies of the entry body in the rss XML output, one is not processed by feed-burner, and the another copy is formated by feedburner that with right HTML tags in it. The problem is that lilina just display the unformatted part, if it display the formatted part, the the display is consistently with the original page.

    So I did some modification of the index.php file, replace the following

$summary = $item['summary'];   
if (!$summary) $summary = $item['atom_content'];       

    with

$summary = $item['atom_content'];     
if (!$summary) $summary = $item['summary'];   

    I begin to know why my friend Fenng choose Planet as the platform of his cnoug.net, Lilina does have performance problem, the display problem could be another reason.

    My another site IamDBA.com becomes a RSS aggregation of mainly China Oracle DBAs, still based on Lilina. The only issue is that access speed of DreamHost is a little slow in China.

September 18, 2006

Fasten tags based search by caching the result in Movable Type 3.3x

    Blog platform MT-3.3x provide useful tags feature, and you can search by tags easily. But if you deploy your blog on DreamHost, your blog will not response so quickly due to limited resource, in China it take us at least 4 seconds to get the query result. I am trying to relsove the problem by cache the tags based search result, usually tags based search result will not change a lot, unless you publish new entries, and there will not be so much tags in a blog, so cache them is a good solution.

    I make a copy of "Search.pm" file, I named it with "NewSearch", it will cache the tags based search result, the default cache file retention is 2 days. So for tags based search, only the first access will be a little slow, other clicks will come from the cached files. You could test the search speed here.

    To deploy this feature, please download NewSearch.zip, and extract it, upload the extracted file to "MT_HOME/lib/MT/App", create a "searchcache" directory under "MT_HOME", and finally change the following line in mt-search.cgi:

use MT::Bootstrap App => 'MT::App::Search';

    To:

use MT::Bootstrap App => 'MT::App::NewSearch';

    To fasten your blog search, download and deploy it!

January 24, 2007

My first Movable Type plugin -- RandomImage

    After two weeks of perl study and two days self-study of Movable Type plugin, I wrote a RandomImage plugin, which enable you to publish a random image to your blog items. How does the small picture looks at the left side of the title area? I defined a random image as an image url and a link url, when you click the image, it will open a new window and navigate to the linked url. If you want to implement this plugin, prepare an image list first, save them to a pure text file. As following:

# image_url#link_url

1.jpg#http://.....
2.jpg#http://.....

    Then insert the tag to the template file anywhere you want:

<$MTRandomImage file="path/imagelist.txt"$>

    Every time you rebuild your pages, or somebody post a comment which also result to rebuild the pages, will pick a random image, and insert the following HTML code to you article.

<a href="http://....." target="_blank">
<img src="1.jpg" border="0" />
</a>

    If you are familiar with perl, you could change the code. The idea is a little different with the implementation with Java script. The random is based on rebuild or comment. Enjoy it!

Prev 1 2

About Weblog

This page contains an archive of all entries posted to AnySQL.net English in the Weblog category. They are listed from oldest to newest.

Tools is the previous category.

Many more can be found on the main index page or by looking through the archives.

Creative Commons License
This weblog is licensed under a Creative Commons License.
Powered by
Movable Type 3.34