Tuesday, November 25, 2008

Don't kick your visitors's IE 6 and below out of your css layout

Delicious 0
Designing one css layout to make it Cross-Platform compability is so crazy, maybe you like the Firefox with powerfull support css and the IE7 cool and stupid web browser but nowaday someone's still using the poor browsers like IE 6, even IE 5. How to make all your web visitors happy when you display your css layout. It's not simple likes saying "This web displays best in Firefox and IE 7 above" at the bottom of your webpage like everyone are doing. No, it's stupid. Dont do that. Please make it's compability to all web browser as you can, to all is hard for you but at least, dont kick the IE 6 and below out of your css layout.

Use IE PNG Fix



This script adds near-native PNG support with alpha opacity to IE 5.5 and 6. Now you can have full translucency and no more ugly grey borders! It requires only one line in your CSS file, and no changes to your website HTML. <IMG> tags and background images are both supported.
I won’t go deep into explaining how this works as you can easily find more info on the author’s site. Suffice to say that you need to call the iepngfix.htc file as an ie-only dhtml behaviour attribute on the img element and/or any other element where you may want to use png background images on.
The only problem with this script is that it won’t work with repeating background images.

I just give you an example:

img, h1, div .PNG-bg-class {
    behavior: url(../iepngfix.htc);
}

Apple website is using this script to make PNG background work well in IE 6 and below.



How to make IE 6 and below versions support :hover events.

IE 6 and below dont support :hover events other than links. But, you can make it work well with script name Whatever:hover. It's another htc script, so that you can do it easily like PNG script above.

body { behavior:url("../csshover.htc"); }

Go to Whatever:hover script homepage to check some information.



When needed, separate your css properties to each web browser supporting.

Ah ha, this is so cool and useful for web designers. I wont go deep in this solution, but i will explaint an example for you to understand. So, you make an DIV tag and you need it margin left exactly 20px, ok i create one for example.

.yourdiv {
   margin-left: 20px; /* all browsers including Mac IE */
   *margin-left: 22px; /* IE 7 and below */
   _margin-left/**/: 18px; /* IE 5.0 */
   _margin-left:/**/ 22px; /* IE 5.5 only */
   _margin-left/**/:/**/ 18px; /* IE 6 only */

   background-color: #fff;
}

Why's that different about value? Because, sometime when you margin some div tag via css, maybe it work well, but maybe Firefox work perfect, but the IE 7 still just margin a bit or do nothing (example above happened to me many times: margin left 20px, Firefox is ok, IE 7 just margin 15px, IE 6 do nothing ...). Just follow that rule above and you can target css properties to each IE version you want.

You can do that by using conditional comments, here is the complete syntax for using:

<!--[if IE]>
do some of your css here if web browser is IE.
<![endif]-->

<!--[if IE version]>
replace version with IE verion number 
you want to do some css.
&lt![endif]-->

<!--[if gte IE version]>
replace version with IE verion number 
you want to do some css when IE version > this IE version.
<![endif]--> 

<!--[if lt IE version]>
replace version with IE verion number 
you want to do some css when IE version < this IE version.
<![endif]-->

That all are simple, right? Dont kick the IE out of your css layout. This entry just need to talk about it.

Thursday, November 20, 2008

The ways to create thumbnail image by php with thumbnail generators.

Delicious 0
When you want to display an image into your web page, maybe you need to resize it, make it smaller than the original, such as the headline images, image which represents for a post...That's all images are called Thumbnail. I'll not say much about what thumbnail means in this entry, and not about how to make thumbnail image in PHP because it's just a common skill that everyone who works with PHP can not live without. I just want to show you same useful code to make thumbnail that you dont need to do any coding...and maybe some people not know about PHP can do that easily. That all usefull tools (i dont know i use "tool" here is correct or not, just let me call it "tool") below are Thumbnail Generators.

1. phpThumb()

phpThumb() uses the GD library to create thumbnails from images (JPEG, PNG, GIF, BMP, etc) on the fly.  ImageMagick is used wherever possible for speed. Basic functionality is available even if GD functions are not installed (as long as ImageMagick is installed). It supports almost image formats or any image format ImageMagick can read. The output are, too and even ICO format.

Images can be rotate, cropped. Output is antialiased into the alpha channel where appropriate when PNG output is selected. Quality can be auto-adjusted to fit a certain output byte size.

This script support a large number of filters can be applied. It's an excellent set of free PHP scripts which can process and generate thumbnails very easily.



2. Zubrag Thumbnail Creator / Generator

PHP Thumbnail Creator is designed to generate thumbnails from JPG, GIF, or PNG images. Script can save rendered thumbnail as file on your server or output it directly to the browser.  There're nothing special from this tools, it's just a normal thumbnail generator. It supports JPG, PNG, GIF image type but depends on GD2 library. You can customize default value from source code. Script can also help you if you need to show few thumbnails based on the same source image but in different sizes, when you cannot afford saving created thumbs on your server for some reason.



3. PHP Thumbnail generator with shadow


This one is simple, simple to use, but the main feature it supports is so amazing. It can drop soft shadows below the thumbnails. Because the simplified of this tool, it just support 2 image type: PNG and JPG. PNG transparency is allowed, but when IE Browser is not version 7 or above, it will be detected and convert to JPG format instead. Absolutely, it can save the images in server in cache folder like others can do.




4. TimThumb PHP Script of Tim McDaniels

Just a simple script but is the most useful tool people using. Make a thumbnail, crop size or not and the quality of output. Main feature is users dont have to do nothing, if users want to crop the image, it will automatically crop width size if width size is larger than the height or do the same with height. This tool is the most popular tool to create thumbnail image by Wordpress users. It's supports cache, too.

Support: JPG, PNG (Resize a PNG with transparency and you'll get a white background), GIF (Reducing a GIF in quality will discard the transparency of the image, resulting in a black background)



5. Drop Shadowed Thumbnail Creator

This class allows you to very easily create thumbnails of images, on which you can also apply a drop-shadow effect. You can control the colour of the background so that drop-shadow will fit better onto your page and the size of the thumbnail.

You can resize in an absolute or relative way (to a certain size or by a certain size), both as a pixel number or a percentage.



6. jQuery easyThumb


jQuery easyThumb is a plugin for jQuery. The easy description is that it turns a list of full-scale images to a list of thumbnails on-the-fly. It uses a php-script to return a thumbnail for each image, and jQuery to generate the list. Let’s jump right to the installation.

Maybe you cant access the homepage because he is now hosting this script in a stupid host. Let try again later or try google with "jQuery easyThumb", you can find some useful informations about this script.




Final words:

These all tools above is just make us feel quickly when working. If you are a web developer, you can download and add some function to. Because of creating thumbnail in PHP with GD library support is just a common skill with php programmer, so if you are new to PHP, want to work with image, you should take a look at GD Functions in php manual page.


Bonus:

Monday, November 17, 2008

10 tips help you design your own professional Blogger layout

Delicious 0
Hi, today i will help you design your own professional Blogger layout, yep, really professional... If you are running Blogger as your own homepage. Whatever your blogger content is, your blogger must be friendly to visitors. The first, you already created your blog and you see that, layouts from Blogger Gallery is so boring, it's not as your style. Ok, why didn't design own layout for yourself with your style? Here we go...


1- You should not miss the resources from google account.

  • Picasa Web:  It's your images hosting. when you make an entry from blogger, all images in your post you uploaded will be store in your Picasa Web account. It's really cool because you can use this account to store all images in layout designed for Blogger, please check my layout, all images i stored in my picasa web.
  • Googlepages: When you design layout, you can create some javascipts and you dont have your own hosting to store it. No problems, just create your one page in Google Pages with your google account and upload all your javascipts file to it. Note: you can upload images, too. Because, sometime picasa web will not accept your image with some stupid reason, you can upload it, so, google page is cool to do. And... create your own favicon, upload it here, because picasa dont allow you to upload .ico file. But Picasa Web is still best solution to store your images in blogger.
2- Navigate the visitor with your layout menu:

By default, Blogger dont have any widget to create menu for your blogger layout, but it's ok, you can edit source code of blogger, make it easy.
The normal menu code will be liked following:

<ul>
  <li class="item"><a href="your home page url" title="Your home adress">Home</a></li>
  <li class="item"><a href="link 2" title="Title 2">Link 2</a></li>
  <li class="item"><a href="link 3" title="Title 3">Link 3</a></li>
</ul> 

and the css:


ul {
margin: 0px;
padding: 0px;
list-style-type: none; 
list-style-image: none; 
float: left;
}
ul li {
float: left; 
display: block; 
padding-left: 0px; 
} 

the property "float: left" of li tag to make your menu horizontal if you wana create your menu vertical, just remove this property.
Now, make your menu professionally, style it with corners and add some property to css style, example:
By default:

On hover:

The images you need are: sortnav_left.gif  and sortnav_right.gif:
The complete source code:

HTML:

<ul class="sortnav">
<li><a class="module-link" href="your home page url">Home</a></li>
  <li><a class="module-link" href="#">Link 2</a></li>
  <li><a class="module-link" href="#">Link 3</a></li>
</ul> 

and CSS:


ul.sortnav {
 font-size:10px;
 font-weight:bold;
 text-align:right;
 float: right;
}

ul.sortnav li {
 *padding-top:0; 
 *padding-bottom:0;
 float: left;
 display: block; !important
 padding: 0px;
 margin-right: 10px;
}
.sortnav a.module-link:focus { color:#000; text-decoration:none; }

.sortnav  li:hover {
 background-image: url(images/sortnav_right.gif);
 background-repeat: no-repeat;
 background-position: right center;
 color: #FFFFFF;
}

.sortnav a.module-link:hover {
 color: #FFFFFF;
 background-image: url(images/sortnav_left.gif);
 background-repeat: no-repeat;
 background-position: left center;
}
.sortnav a {
 color:#282828;
 outline:none;
 padding-right: 12px;
 padding-left: 12px;
 padding-top: 5px;
 padding-bottom: 5px;
 display: block; !important
} 

3- Style your Blogger Category:
There're no category module for Blogger user, but you can use Label module instead, that's ok!
Firstly, you should know that your Label Widget will rendered as unorder-list while added to your layout. From inside your blogger layout manager, you can choose what style your Label widget will display such as: Alphabetically or By Frequency. It's up to you. And, if your Blogger Layout is 2 columns and the sidebar section with width more than 300px, you should make your Label display as 2 column, it's cool.




How to do? just simple by adding into your css style with some code like:


#categories-widget ul li {
background: none;
float: left;
width: 40%;
margin-left: 22px;
padding-left: 0px;
} 

Ok, now, your Label Widget look cooland professionally, right?

4- Custom search engine on your Blogger template:
Credit to Woork.
Your Blogger will be cool if you add the search engine form on your Blogger Layout. You only have to add these lines of code on your template changing the form action URL with the URL of your site:


<form action='http://yoursite.blogspot.com/search' method='get'>
<input name='q' size='24' type='text'/>
<input name='submit' type='submit' value='search'/>
<input name='max-results' type='hidden' value='4'/>
</form> 

The input hidden field "max results" set the number of results you want to display on your page after a search.


<input name='max-results' type='hidden' value='4'/>

5- Remove Blogger Navbar:

Fortunately, hiding the blogger navbar from new blogger is also as simple as the old one. Just add the following lines anywhere in your Blogger template [enclosed by <style> tags] and the blogger banner will be gone forever.

#navbar-iframe {
height:0px;
visibility:hidden;
display:none;
}

6- Customize your Blog post body and your blogger comment block:
You look anywhere in your layout, but you cant find which part of post body should be style? It looks complicated? Dont worry, follow me...Here we go:
Firstly, make an entry, add some content, whatever you want...it's just a test. Why did i talk you to post an entry? for what? Because when you had posted an entry, you can see that in the blog page, and? the complete source code that the blog post rendered will be easy to view by simply using your web browser with View Sources. And now, if you using Dreamweaver(that's i recommended) to edit your layout, you have already create layout with basic HTML file, you copy all the source code of Blog post body to your layout you're designing to style it. Which parts of source code need to copied? That are all code between...

<div class='widget Blog' id='Blog1'>
....
</div>

Some css you should style to make your blog post comfortable and professionally:

Blog post inside, customize these below to style your post body and labels:

.date-header {
  ..
}


.post-title {
..
}


h3.post-title a {
..
}


.post a {
..
}


.post {
  ..
}



.post-body {
..
}


.post-footer {
..
}


.post-labels {
..
}

The comment and blog pager:


#blog-pager {
  text-align: center;
  }

  #comments-block {
  ..
  }

  #comments h4 {
  ..
}

.comment-author {
..
}

.comment-right-post {
..
}

.comment-timestamp {
..
}

dd.comment-body {
  ..
}

dd.comment-footer {
..
}

h3.post-publisher {
..
}


You can re-arrange all parts inside your post body to make it look nice. Just stylesheet it with these css above. So, the default comment is so boring, take a look some comment part:

My comments:


Woork comment (My favorite in blogger):


and the original comment (i dont like that :D )


You dont need style it if you want your visitor look at your comment block ;). If you have any problems when you styling your comment block, ask me, i can help you.


7- Add social button to your blogger to increase traffic:
If you have a blog, the most simple way to increase your traffic is using Social Networks. There're so many post about adding social button to your web page or blogger layout, i dont need to talk about this anymore, take some tutorial around the internet:
Ah, something important when you add social buttons to your blogger post is:

data:post.url : this is your blog post page url
data:post.title : this is your blog post title

and the code to add should be, example with Digg:


<a expr:href='&quot;http://digg.com/submit?url=&quot; + data:post.url + &quot;&amp;title=&quot; + data:post.title'><img alt='Digg it' border='0' src='link to digg icon'/></a>

And now, take a look some blogger user make social buttons.

Weblogian.com

Blogspottutorial


And my Blogger (who did not comment after read will be kick ass, just kidding ^^)


So, it's cool, right? adding social to increase your traffic because visitor is lazy =))

8- Customize all unorderlist in your blogger layout:
Some un-orderlist in your blogger layout are:
  • Menu and Categories (Label Widget): i have talked above.
  • Recent entries and recent comments: Using feedburner to make your blog feed. And when adding code from feedburner, it's rendered as un-orderlist style.
  • Twitter: if you use twitter to update your recent doing, it same as feedburner, render un-orderlist, too.
  • And some list you want to use, style all.
The un-orderlist in my blogger was styled like that:


The css code:


.widget-inside ul {
    margin: 0px;
}
.widget-inside li {
    background-image: url(images/arrow.gif);
    background-repeat: no-repeat;
    background-position: left 8px;
    padding-left: 10px;
    border-bottom-width: 1px;
    border-bottom-style: solid;
    border-bottom-color: #e5e5e5;
    padding-top: 3px;
    padding-bottom: 3px;
    font-size: 11px;
}
    .widget-inside ul li a {
    color: #666666;
}
    .widget-inside ul li a:hover {
    color: #000000;
    text-decoration: none;
} 

9- Add email subscribe in your blogger layout:
It will increase your traffic and readers want RSS updates, they are easier to manage, to search and follow. And when readers wanted them, bloggers provide. In design, your email subscibe form should be large and easy to find and easy to enter ^^.
Some awesome email subscribe form you should take a look: 10 RSS Subscription Box Designs Dissected

10- Well-format your XHTML layout:
Sometime, when you edit or design your blogger layout, if everything ok, click on Save Template in blog layout manager, but it says:


Oh god, how can we know where the element missed in hold long code like that? So, so, so....what can we do now?? Dont worry, you'd better use any XML editor to fix this problem. Here is use XMLwriter to check if is well-formated.
Copy all your code, simply check the checkbox "Expand Widget Templates" and Ctrl + A, and copy all, open XMLwriter, create new document (XHTML document) then paste all code into, save it.
Then click:


The XMLwriter will see you where the error make your code not well-formated. Fix it, then update your blogger layout. It's ok, stupid error from blogger will not appear again.



Bonus: complete resources for blogger:
 I hope with my post, you can design your own professional blogger layout yourself, if you have any questions or helps, just let me know, i will help you all i can do. I love Blogger and you all.

Saturday, November 08, 2008

BRounded - Professional Blogger Layout for free download

Delicious 0
This is my second layout i designed for Blogger user. I love Blogger so much so i cant stop working on it. If you downloaded my first layout in previous post, you should not miss this layout. I this working, i dont design for new to CSS and Web Design, you can download it, but if you want to use it, you must be familiar with CSS and XHTML. So, take a look at new layout, when you have been download and replace with your old layout, your blogger will be as follow...

 
So, now, check a demo or download it now, it's free.
After download and replace your layout, you must customize your new layout.
Search somewhere in layout, replace all my links, such as: twitter, feedburner, facebook, flickr ... by your links
In my rar file for downloaded, i attached all images that this layout needs to work, you can re-uploaded all those images in your one picassaweb or any image hosting you know, or images from my picassaweb, no need to do anymore.

Create your one new widget in sidebar:
If you want to create your one new widget, you need to know that in my layout, a widget must be following format:

<h4><span class='feed-small-right'><a href='your link'>This title will be display at the top-right at each widget</a></span>Widget Title</h4>
<div class='featured_inner'>
<div class='section-w'>
                Your widget content will be here.
</div>
</div>
<br/>
<br/> 

So, because of that XHTML file layout was copied exactly from my layout at http://cafemen.blogspot.com, dont say it's not well-formated.
If you want to help to install this layout, tell me, i can help you. If anything goes wrong, tell me, i'll fix it. And if you like this layout, just buy me one Caribou Coffee =.=

Tuesday, November 04, 2008

Contact me

Delicious 0
Form View Counter