February 2009

PHP: Generating Summary Abstract from A Text or HTML String, Limiting by Words or Sentences

On index or transitional pages, such as homepage or category pages of WordPress, you don’t want to show the full texts of your deep content pages yet but just a content snippet of the first few sentences or words as a summary with a read more link to the actual article. This is generally good …

PHP: Generating Summary Abstract from A Text or HTML String, Limiting by Words or Sentences Read More »

WordPress: Show Recent Posts on Homepage or in Sidebar

There used to be a plugin to grab and display most recent blog posts from WordPress database. Well, while you still can use it to get recent posts and them shown on homepage or in sidebar, you can now conveniently add a recent post widget from the WordPress control panel => Appearance => Widgets if …

WordPress: Show Recent Posts on Homepage or in Sidebar Read More »

CSS: Text over Image – Add Text Caption to Images

Putting text over image or pictures is a good way to give simple title information to that image or declare copyrights without tampering with the image itself. Real texts on an image with CSS This lovely image gladly demonstrates how I (this text) can be flying over her face. It’s very kind of her but …

CSS: Text over Image – Add Text Caption to Images Read More »

PHP: Drop Down List with Select

Populating a drop down list control <select> from a php array is easy, the following function would do it with a breeze. Assuming an array of IT companies: $companies = array( ‘Microsoft’ => 1, ‘Google’ => 2, ‘Apple’ => 3 ); Feed it as a parameter to the php function below: function generateSelect($name = ”, …

PHP: Drop Down List with Select Read More »

CSS: Double Border

In pure CSS solutions, a double border can be achieved via either a combination of single borders or a single double border style. 2 single borders The HTML: <div class="wrap-1"> <div class="wrap-2"> </div> </div> The CSS: .wrap-1 { border:1px solid blue; padding:1px; /* how far away 2 borders are drawn, remove this line to make …

CSS: Double Border Read More »

CSS: Difference between opacity:0, visibility:hidden and display:none

If you are going to make part of the page totally transparent, there are essentially 3 CSS ways to achieve element transparency: opacity:0 (needs 2 more hacks for different browsers) visibility:hidden display:none Bob, the man! Let me take the example of Bob sitting in a chair to explain how these styles are different from each …

CSS: Difference between opacity:0, visibility:hidden and display:none Read More »

CSS: Styling File Upload / Select Input Control <input type="file" … />

Let’s face it, the native implementations of file uploading control of HTML form is ugly, throughout most of the browsers, and not consistent at all. Plus, <input type=”file” … /> just doesn’t play by quite a few of the CSS input styling rules such as border and background, making it a even bigger challenge. Now …

CSS: Styling File Upload / Select Input Control <input type="file" … /> Read More »

Log Walking – Walk through your website logs and be in the shoe of a visitor

Well, just came across a rather insightful post by ronburk at Webmaster World, which by the way, is probably the most resourceful place for any veteran webmaster. Consumer behavioral analysis is one of the most important part of any marketing campaigns in any industry. The better you get to know your customers, the better you …

Log Walking – Walk through your website logs and be in the shoe of a visitor Read More »

JavaScript: Show & Tick a Specific Local Time Clock (Fixed Time Zone) instead of Client Time

When I’m coding for a new sub site where I need to show the local time of mine and my developers’ wherever the visitors are. Things get a little bit more tricky. Time basics in JavaScript and PHP To offset time zone differences in calculation, both JavaScript and PHP specs have time stamps representing the …

JavaScript: Show & Tick a Specific Local Time Clock (Fixed Time Zone) instead of Client Time Read More »

Scroll to Top