Dashboard plugin for Frog CMS now provides simple API for other developers to log their events. Whenever you want to log something to dashboard just trigger a log event. Include your message as parameter.

Observer::notify('log_event', 'Something was done by :username.');

In your message you can include string :username to log the user name.

Read the rest of this entry

Bloggers Meeting at Altex

April 20th, 2009

Altex together with Pärnu Turunduskonverets organized a small bloggers meeting. Aim was to discuss same subjects which will be present in the real conference.

  • How to achieve big things in Internet with small amount of money?
  • How to convince your boss to invest in online marketing?
  • How to achieve competitive edge during recession?
  • Who will survive recession better – online or offline stores?

DISCLOSURE: People who attended the bloggers were kindly asked (but not required) to mention and link to the conference page in a blog entry. Least we can do as a thanks to nice food and beverages.

Read the rest of this entry

Last weekend Kuldmuna awards were given out. Someone is going to be offended by saying this. Level of most of entries shortlisted in Internet design and Digital advertising categories were shamefully low. I know there have been better projects in Estonia during last year. How did this happen?

DISCLAIMER: I work in advertising agency myself. I have been working in advertising agency or online department of advertising agency for last 11 years. Good to remember when you work in advertising and feel offended by reading this.

Read the rest of this entry

Lazy Load Inside Container

February 13th, 2009

Matthew Crumley contributed nice patch to Lazy Load plugin which makes it work with containers. If you have a container which has a scrollbar.

#container {
    height: 600px;
    overflow: scroll;
}

Images which are not visible are not loaded until you scroll to them. Check demo page for horizontal and vertical scrolling.

To use new feature you can give the container as jQuery object.

$("img").lazyload({         
     placeholder : "img/grey.gif",
     container: $("#container")
 });

Mathew also patched a bug where IE was not always loading images. To upgrade download the latest source, minified or packed.

Yesterday Priit Haamer of Fraktal notified me about Spotlight searchable Ruby on Rails documentation he had made. Absolutely brilliant idea. When I saw it I knew I have to do same thing for jQuery.

Why Is It cool?

You can just hit Apple + Space to enter spotlight and search for jQuery function.

Press and hold Apple + Control + D over any function in TextMate (or Safari, iChat, Mail etc.) to get info popup.

Read the rest of this entry

One of the things I like about Mephisto is the asset management. Especially the way how you insert image URLs by dragging thumbnail from sidebar to content area. Frog CMS lacked easy way for inserting images (or any other files). Obvious thing to do was implement Mephisto style asset management as a plugin.

It is not one to one copy on how Mephisto does it. Instead of tagging assets you can categorize them by uploading to different folders. There is also extra pulldown to select which assets to show in sidebar while editing.

Plugin depends on Image Resize and jQuery plugins to work. Full installation instructions on project page.

Send Emails from Frog CMS

November 28th, 2008

I needed a mailer backend which can handle complicated forms with any number of arbitary form fields. I also needed to be able to fully control the layout of sent emails. Something similar as oldie but goldie cgiemail.

Here comes Email Template plugin for Frog CMS.

It provides new page type called named Email template. You can POST your forms to this page type. Page contains the layout of the mail including the headers. Template then parses POST:ed data and sends the email.

To: Somebody <somebody@example.com>
From: <?php print $_POST['name'] ?> <<?php print $_POST['email'] ?>>
Subject: Frog Mail

1. Contact info

Name.............: <?php print $_POST['name'] ?> 
Company..........: <?php print $_POST['company'] ?> 
Email............: <?php print $_POST['email'] ?> 

2. Message

<?php print $_POST['message'] ?>

--
Sent by <?php print $_SERVER['REMOTE_ADDR'] ?>

Plugin assumes your PHP mail() function works properly. Currently it only supports plain text emails. Download and installation instructions at the project page. All feedback welcome.

Ultrafast Frog With Funky Cache

November 21st, 2008

Funky caching is technique popularized by PHP.net site. It was first mentioned by Rasmus Lerdorf in 2002 PHPCon slides (page 25). Content is cached as static file on the first access. All following requests are served using the cached static file. Editing a page will automatically expire cached files. Page is then re-cached on the next hit.

Frog CMS is PHP port of Rails based Radiant CMS. Radiant is great but there is always the hosting problem. Even with mod_rails existing it is still easier to get quality PHP hosting. Both Frog and Radiant are the only CMS’es I can say I like. Expression Engine I can live with. Edicy looks really promising. Everything else I rather not touch.

Read the rest of this entry

Static Maps API has URL length limit of around 2048 characters. You can hit this limit quickly when adding lot of markers. You can keep URL short by clustering markers together.

Square Based Clustering

Clustering is usually done by dividing map to squares. Square size depends on map zoom level. Markers inside a square are then grouped into cluster. This technique has some limitations. Look at the following image.

Two markers are close to each other. In fact they are so close they are overlapping. Both markers are also the only marker inside their square. Because markers are in separate square they wont be clustered.

Read the rest of this entry

Most of the code from previous Static Maps experiments is now put into one clean package. Previously I showed you how to work with markers and bounds. Now we go forward and add zoom and pan controls. It takes only few lines of code. If you just started reading the series check the theory how it works. As a bonus lets add infowindows / bubbles too.

Note! Image above is just a screenshot. You can test final result in the demo.

Create Map and Some Markers

Start by creating new map object and set the size. We also need to give our API key. Markers are positioned on map using location object. Location can be latitude and longitude represented by Google_Maps_Coordinate object. Location can also be map x and y represented by Google_Maps_Point object.

Read the rest of this entry

Simple Static Maps With PHP

October 10th, 2008

Lately I have been playing with Google Static Maps API a lot. Writing the same things again and again is tedious job. I decided to put the code together as one clean extendable package. Writing object oriented interface for generating URL is trivial. Real meat is having working zoom and pan controls on static map with just 9 lines of code (demo now includes also clickable markers and infowindows).

Code is still alpha quality. API might change any time. But here is a quick walkthrough of current features. We will build the map you see above step by step.

Read the rest of this entry

I made quick fix to Mephisto Sitemap plugin. Now it works with lates Mephisto 0.8 (Drax). All old plugins got broken when Mephisto changed to Rails Engines based plugin system.

Install by issuing the following command in your Mephisto root.

script/plugin install 
http://svn.appelsiini.net/svn/rails/plugins/mephisto_sitemap/

After installing remember to restart you WEBrick or Mongrel.

I have been running my own hardware since early 90’s. Hardware has always been produced by Sun Microsystems. Yes, I am a Sun fanboy. Times change and I am forced to retire my old hardware. So I went for shopping for decent VPS. Tried Media Temple first. Gandi was still invitation only. In the end chose Slicehost. Here are the reasons why.

Download Speed to Europe

I do have a small problem with having my hosting physically located in Northern America. I was worried of getting low download speed to Europe. I tested this from several hosts located in Finland and Estonia. Slicehost was always faster than Media Temple.

Read the rest of this entry

Golden Hammer 2008

September 23rd, 2008

Today I arrived to sunny Riga to attend 9th Golden Hammer festival. I was invited to be Head of Digital Media Jury. Something I am really looking forward to.

As usual organization of all things has been top notch. Baltic people are absolutely great at organizing events. If any of you readers are here this week drop me a line or tweet. On thursday there will be BadAd party which is definitely worth visiting too.

Between Hosts

September 19th, 2008

I am in process of moving to a new host. If you see this you read content from the new server. Some things (especially WTF-8) might be broken. Would be great if you leave a comment when you find a broken demo or page.