Selasa, 27 Maret 2012

Custom 404 Error Pages for Blogger

Custom 404 Error Pages in BloggerYou can see my 404 page here

http://tipsandtricksfor.blogspot.com/seo
http://tipsandtricksfor.blogspot.com/test



"The 404 or Not Found error message is a HTTP standard response code indicating that the client was able to communicate with the server, but the server could not find what was requested." In simple words the page that will be displayed when the actual page is not found is called a 404 Error Page. Till now Blogger’s error page was a plain old design with more of orange in it and was not customizable. Now Blogger Error pages use the same template . This would help template designers in making up custom 404 Pages.This tutorial will help you in setting up a Custom 404 page for your Blog.

By Default, your Blogger Error page will display this error message
custom 404 page for blogger
You can Change this message to something else from the Blogger Settings.
The option is there at Settings > Search preferences > Custom Page not Found
blogger-custom-404-message
If you want more than just a message, then we will have to fill up this text area with some HTML Code.. This is how my Error page Looks like

Instructions

  1. Login to your Blogger account and go to the Template page and proceed to Edit HTML
  2. Click on the Expand Widget Templates Check box so that your entire template comes up
  3. Now Look for </head> and immediately before that paste this snippet
    <b:if cond='data:blog.pageType == "error_page"'>
    <style type="text/css">
    .status-msg-wrap {
    font-size: 100%;
    margin: none;
    position: static;
    width: 100%;
    }
    .status-msg-border {
    display:none
    }
    .status-msg-body {
    padding: none;
    position: static;
    text-align: inherit;
    width: 100%;
    z-index: auto;
    }
    .status-msg-wrap a {
    padding: none;
    text-decoration: inherit;
    }
    </style>
    </b:if>
    This code snippet will reset the default styling given to the Blogger Message Wrapper.
  4. Save the template and go to a page on your blog which doesn’t exist.
  5. You should be able to see the change now. The grey background and the border around the 404 status message would no longer be there.
  6. Now Let’s see how we can improve the look and feel of our 404 page. I would suggest you to use inline CSS styles to improve the look and Feel of your 404 message.Here is a sample HTML template which you can paste into the text box at Search preferences > Custom Page not Found.
    <h3>Your requested page was not found</h3>
    <p>Sorry, we cannot find the page that you are looking for. It might have been removed, had its name changed, or is temporarily unavailable.<br/>
    Please check that the Web site address is spelled correctly.</p>
    <b>Other things to try:</b><br/>
    <ul>
    <li>Go to our <a href="/">home page</a>, and use the menus or links to navigate to a specific post.</li>
    <li>
    <form method="get" action="/search">
    <table width="100%">
    <tr>
    <td><input type="text" style="width:95%;padding:2px;" value="Search this blog.." onfocus="if (this.value == &quot;Search this blog..&quot;) {this.value = &quot;&quot;}" onblur="if (this.value == &quot;&quot;) {this.value = &quot;Search this blog...&quot;;}" name="q"></td>
    <td><input type="button" Value="Search"></td>
    </tr>
    </table>
    </form>
    </li>
    </ul>
  7. It will give you something similar to my 404 page.
  8. If you are creative, you can add more stuff to the 404 pages. You can find a list of really creative 404 pages on HongKiat for inspiration

Detecting an Error Page

Blogger has introduced a new page type called "error_page" and you can detect it using b:if conditional tags.
The following condition checks if a page is an error page or not.
<b:if cond='data:blog.pageType == "error_page"'>
This is an Error Page
</b:if>

Changing the Error Page Title

By default the title of the Blogger Error Page is your Blog Title. If you want to change it to something else, you can Edit your template and change
<title><data:blog.pageTitle/></title>
to
<b:if cond='data:blog.pageType == "error_page"'>
<title>Page Not Found</title>
<b:else/>
<title><data:blog.pageTitle/></title>
</b:if>
If you are using my Title Tag Hack or derivatives of that available on the internet, then you will have to change
<!-- Start -->
<b:if cond='data:blog.url == data:blog.homepageUrl'>
<title><data:blog.pageTitle/></title>
<b:else/>
<title><data:blog.pageName/><b:if cond='data:blog.pageName'> - </b:if><data:blog.title/></title>
</b:if>
<!-- End –>
to
<!-- Start -->
<b:if cond='data:blog.url == data:blog.homepageUrl'>
<title><data:blog.pageTitle/></title>
<b:else/>
<b:if cond='data:blog.pageType == "error_page"'>
<title>Page Not Found</title>
<b:else/>
<title><data:blog.pageName/><b:if cond='data:blog.pageName'> - </b:if><data:blog.title/></title>
</b:if>
</b:if>
<!-- End -–>

Bloggerplugins.org

Selasa, 07 Februari 2012

Some SEO Trick You have to Avoid

wrong SEO tricksAfter i write some SEO blogging tricks in my previous blog posts, i think it's time to discuss few common SEO (search engine optimization) little mistakes . This few wrong SEO tricks will down the visibility of your blog in search engine result page. Because, by doing the right SEO, will increase Google page rank and increase traffic to your blog/website. So you must avoid these SEO mistakes to make descent traffic to your blog or website.

This are some SEO tricks that will make your site fall down from SERP :

1. Hiding content inside images

Some webmasters used to display their content inside the images. Search engines will not be able to read the content inside images.

2. Use excessive Java Script/AJAX

Search Engines can’t understand JavaScript/Ajax. So chance to getting index is less with excessive number of Java script/AJAX. Use HTML/CSS instead of Java/AJAX.

3. Use Flash only websites

Even though the Flash can make an exciting blog, search engines can’t read the content inside the flash. You can make up your blog by flash scripts but never add your content inside the flash scripts. Use HTML instead of flash.

4. Usage of Search engine friendly URLs rather than human friendly URLs.

Don’t use unrelated URLs. Use appropriate URL which can describe your content. Don’t worry about the length of the URL

5. Use automated directory submission software

Never use automated software for directory submission. They will consider them as spams. Your blog will get banned from those directories. Use manual submission as an alternative. Submit to well-established directories by using unique Titles and Descriptions. Then they will not consider as copies.

6. Link exchange programs

This is a time wasting program. No value. You will get nothing. Other thing is your link will be removed after few days without informing you. I did this for this blog and got nothing.

7. Use the same meta title and meta description in every page of the blog

Once you use same title and Meta descriptions for all the posts the search engines will consider all the posts as one post. Then your whole site will not index. So use different Meta tags for different posts. But never use inappropriate Meta descriptions. Place key words inside the content.

8. Use unnecessary key words and usage of excessive key words

Use less competitive keywords rather than using high competitive key words. Then you can get instant traffic from search engines. Use Google Adword key word tool to find appropriate key words

9. Usage of wrong key words

Your key words should match with your content. Key words should summarize the content of your article.

10. Copying someone else’s content and paste it on your site

Never do this, because your site will be penalized by search engines. If you blogging on blogger they will ban your blog as well

11. Poor quality content

Your content should be high in quality. Low quality and duplicated content is penalizing by search engines and you will get nothing by just posting that type of content.

12. Poor site navigation

Your content should be prominent rather than your ads. Pop-up windows should be avoided. Your navigation bar should give links to relevant content

13. Irrelevant links

The links on your site should related to your content and those links should lead to the relevant page

14. Expectation of quick results

SEO is not a quick way to increase traffic to your blog. You need to be patience in order to get results. Sometimes it takes weeks to months to get the desired effect. So you should have sustained motivation to work on SEO.

15. High loading time of the page

Visitors don’t like to waste their time. So you must consider a good hosting plan to improve the loading time of your blog or website.

These are the most common mistakes done by most of the bloggers and site owners. You have to learn and read that carefully. After that you just have to do the right SEO tricks and choose the right SEO tutorial for you to learn.

Stay tune in my blog, i will give you the others SEO secret for you...

Minggu, 05 Februari 2012

Keep Your Adsense Account Safe from Getting Disabled

What is Google Adsense Program?
Adsense LogoGoogle Adsense is a Popular Web Advertising Program that provides a good income source for many websites.Anyone can earn through Adsense, but in a right way. If you follow the wrong ways [Fraudulent Activities], your account will be in great danger and also Google may penalize you [Account Ban]. So, here are the common mistakes that violate Google Adsense TOS.
  1. Never click your own adsense ads or get them clicked for whatever reason. Never use automated clicking tools, or other deceptive software. Google is very smart to detect fraudulent clicks. This is a very popular mistake everyone doing these days.
    Tip: If you want to preview your ads without your impressions or clicks being recorded, Use Google Adsense Preview Tool.
  2. Never change the Adsense code. There is no need of altering the code. If you do so, Google easily knows about it and bans your account.
    Tip: You can change the color and size of your ads in the adsense account itself. After Modifying, Just copy the code and paste it in your site.
  3. Number of Adsense Ad Units to be placed in your website is not more than 3 Text/Image ads, 3 Link Ads and 2 Search Boxes.
    Tip: This will not make your account banned. Even if you place more ads, they will be hided.
  4. You can run competitive contextual text ad or search services on the same site which offer Google Adsense competition in their field. But, they should not resemble Adsense ads.
    Tip: Place the other Publisher ads beneath Google Ads. Best is that always Adsense ads will be on top.
  5. Do not disclose confidential information about your account like the CTR, CPM and income derived via individual ad units or any other confidential information they may reveal to you. However, you may reveal the total money you make as per recent updates to the TOS.
  6. Label headings as “sponsored links” or “advertisements” only. Other labels are not allowed. I have seen many sites label ads with other titles. Dont make your site a target in a few seconds gaze.
  7. Never launch a New Page for clicked ads by default. Adsense ads should open on the same page. You may be using a base target tag to open all links in a new window or frame by default. Correct it now as they do not want new pages opening from clicked ads.
  8. One Account suffices for Multiple websites. You do not need to create 5 accounts for 5 different websites. One account will do. If you live in the fear that if one account is closed down for violation of TOS, believe me they will close all accounts when they find out. You can keep track of clicks by using channels with real time statistics. They will automatically detect the new site and display relevant ads.
  9. Place ads only on Content Pages. Advertisers pay only for content based ads. Content drives relevant ads. Although you might manage some clicks from error, login, registration, “thank you” or welcome pages, parking pages or pop ups, it will get you out of the program.
  10. Do not mask ad elements. Alteration of colors and border is a facility to blend or contrast ads as per your site requirements. I have seen many sites where the url part is of the same color as the background. While blending the ad with your site is a good idea, hiding relevant components of the ads is not allowed. Also do not block the visibility of ads by overlapping images, pop ups, tables etc.
  11. Do not send your ads by email. HTML formatted emails look good and allow placement of these Javascript ads. But it is not allowed as per TOS. You do not want impressions registering on their logs from any email even once. They are watching!
  12. Keep track of your content. So Adsense is not allowed on several non content pages. But it is also not allowed on several content pages too. Do not add it on web pages with MP3, Video, News Groups, and Image Results. Also exclude any pornographic, hate-related, violent, or illegal content.
  13. Do not alter the results after ad clicks or searches – Ensure you are not in any way altering the site which the user reaches to after clicking the ads. Do not frame, minimize, remove, redirect or otherwise inhibit the full and complete display of any Advertiser Page or Search Results Page after the user clicks on any Ad or Search results.
  14. Avoid excessive advertising and keyword stuffing – Although the definition of ‘excessive’ is a gray area and is subject to discretion, yet Google adsense with correct placement, focused content and high traffic will get you much more income than other programs, so excessive advertising is not required. Keyword stuffing does target better focused ads, but overdoing it is not required.
  15. Ensure you Language is Supported – Adsense supports “Chinese (simplified), Japanese, Danish, Korean, Dutch, Norwegian, English, Polish, Finnish, Portuguese, French, Russian, German, Spanish, Hungarian, Swedish, Italian and Turkish”. In addition, AdSense for search is available in Czech, Slovak, and Traditional Chinese. If your web pages language is not supported, do not use the code on such pages.
  16. Maximum 2 referral button per product per page – With the launch of the google adsense referral program, you are allowed to put only 2 referral buttons for adsense referral, adwords referral, Google pack and Firefox with google toolbar referral. Update: This feature is closing Aug 2008.
  17. Do not specify Google ads as your alternate ads. – Several services like Chitika eminimalls allow you to place alternate urls, when a targeted paying ad cannot be displayed. This involved creating an simple html page and putting the ad to be displayed instead. Even Adsense allows an alternate url feature instead of displaying public service ads. But never use Adsense ads as alternate urls. See [Adsense Certified Networks]
  18. Do not confuse with adjacent images – It was a common policy to increase CTR by placing same number of images as the number of text ads, which falsely gave the impression that the text ads represented an explanation to these images. Inserting a small space or a line between the images and ads is not allowed. Make sure that the ads and images are not arranged in a way that could easily mislead or confuse your visitors.
Whenever in doubt, it is better to ask for adsense help from the learned staff of Google Adsense. They are very helpful!

Sabtu, 04 Februari 2012

7 keys to SEO: How to help people find your blog

7 keys to SEO: How to help people find your blog
 Even a novice blogger needs to understand how people use search engines to find the content they are looking for. You want to help people find your posts. This practice is known as search-engine optimization, abbreviated SEO.
I am not expert enough in SEO to cover the matter in depth (for more on the topic, I recommend Danny Sullivan‘s excellent Search Engine Land blog). I will cover some basics for a workshop today for the music staff of the CBC. When you are working on a blog post, consider these factors to help people find your post:
  • Relevance
  • Headline
  • Keywords
  • Google trends
  • Links
  • Photo captions
  • Metadata

1. Relevance.

Don’t litter your post or headline with irrelevant terms that you think might help your Googlejuice (the term for your attractiveness to Google’s search engine). With its downgrading of content farms and its use of “+1” endorsements to enhance search results, Google is trying to improve the search process, so apply all of these techniques only by choosing words and links that are relevant to your post. Don’t drop gratuitous references to Lady Gaga into your post (unless you are doing it for humor, as Gene Weingarten did).

2. Headlines

The headline is the most important part of your post to help search engines find your content. It should include the words people might be most likely to use in trying find content on the topic(s) you are writing about. If you were searching for something like this post, what are the first few words you would type into a search engine? Those words should be in your headline, ideally the first few words of the headline. Often this will be a performer’s name, but it might be the name of a venue, genre or instrument.
Writing a headline for search engines is significantly different from writing a headline for a newspaper. In a newspaper, the reader sees the headline in context: A reader of the Toronto Star or Globe and Mail entertainment section sees “lang” or “Cohen” in a headline and will assume you mean k.d. lang orLeonard Cohen. But people searching for stories about those musicians are likely to type their full names in the search window, so your headline should include the full names. A newspaper headline can be intriguing because you read it in context, seeing it on a news, entertainment or sports page. But a headline that tries to intrigue the reader online actually tends to withhold keywords that search engines want to see in the headline.
On my Hated Yankees blog, before I understood about the importance of headlines to SEO, I wrote a blog post about Don Mattingly, comparing his career achievements to Kirby Puckett’s (they’re nearly identical), and arguing that since Puckett was an automatic Hall of Famer, Mattingly should be, too. My headline would have worked fine in a newspaper, where it would have run on a sports page, probably above photos of Mattingly and Puckett. But to a search engine,You be the judge: Who’s a Hall of Famer? isn’t going to show up high when people are searching for Don Mattingly. I’ve written other blog posts on Yankees who aren’t any more famous than Mattingly (Ron GuidryGraig Nettlesand Thurman Munson) that attracted significantly more readers because I put their names in the headlines, making it easier for people to find them.
It’s also a good idea to include words such as poll or video that people might search for (photo is not as helpful, because so many posts include photos and Google has a separate image search, so people are less likely to include photoin a search term). You can just do this in parentheses after the headline: (VIDEO). By the way, I didn’t do that here, because the videos aren’t really about SEO, so they wouldn’t be relevant to a search. If I were blogging aboutGordon Lightfoot or David Allen Coe, the videos would be relevant and I should mention them in the headline.

3. Keywords

While the headline is the most important part of your content for a search engine, the words in the text also help search engines find your blog post. So make sure that you place keywords people might search for high in your post. It’s best to place the keywords in the first sentence, but that concern should not override your need to write a strong lead. “The Wreck of the Edmund Fitzgerald” was a great song, written before SEO mattered, which is good because it had lousy SEO. The headline probably needed the words “shipwreck” and “Lake Superior.” But the offense was compounded in the lyrics because it never used the term “Lake Superior.” The lake is alternately called “Gitche Gumee,” “Superior” and “the lake,” but to be most attractive to search engines, you want to use the exact phrase people might search for. Good writing should trump clumsy SEO writing, but try to smoothly use the most likely relevant search terms in your blog posts.

4. Google trends

Use Google trends to check for popular keywords. You can enter a few different possible keyword combinations in the search window to see which is the most popular combination. If you enter the first word or two of a search (perhaps an artist’s name) into Google’s home-page search window, the auto-completes that Google provides will show you some popular searches. If one of those searches is relevant, consider using that exact term in your headline and/or in the post.

5. Links

Links are how a search engine’s spiders find your content. Relevant links boost your CEO. They not only help Google find you, but other blogs and sites get “pingbacks” (notifications that you have linked to them), so they might link to you, or blog or tweet about you, which further boosts your SEO. It also helps your SEO if the hyperlinked word (called the anchor text) are relevant. For instance, in point #2 above, I underlined and italicized blog post because that’s where I might have put the link about the Don Mattingly post. You’ll notice that instead, I linked the actual headline. Or I could have linked Mattingly’s name. Those are more relevant, so those links are more helpful to my SEO. Another bad practice is to hyperlink words like click here, rather than linking in relevant anchor text.

6. Photo captions

Photos often have their own URLs, so sometimes they will be the side door into a blog post. Someone searching for an image will find the image and end up reading your post. Or a photo or video might be a blog post by itself. Because the photo and video are not searchable themselves, you need to provide keywords that will help people find them. In the caption of the photo or the introduction to the video, be sure to use the keywords and phrases that people interested in this photo or video might use in a search. Write captions for three different audiences: the search engine itself, the person looking at a page of search results and the person who is actually looking at the photo. Be sure to identify people and places in the photo or video and to answer any questions the photo might raise. Don’t feel you need to state the obvious, unless that might help the search engines find the photo or help someone reading the caption in a page of search results.

7. Metadata

Metadata is essentially data about data. In this case, it’s information about your blog or photo that might not be immediately visible to readers but is visible to search engines. If your content management system allows you to enter tags and SEO keywords, be sure to provide relevant tags and keywords.
Much of my understanding of SEO comes from my former TBD colleague Mitch Schuler, who led a workshop for our staff and later was a guest speaker for my entrepreneurial journalism class at Georgetown University. He hasn’t blogged about SEO, or I would link to him and quote him, but I certainly should attribute much of this blog post indirectly to Mitch (except for any errors, which are mine).
My favorite anecdote about Mitch’s SEO expertise comes from the Discovery Channel hostage situation, which was the first big breaking news story, just three weeks after we launched on Aug. 9, 2010. The suspect was named James Jay Lee, and we initially identified him in our story and headline using all three names, as criminal suspects have been identified by journalists since way before Lee Harvey Oswald, just to avoid any misidentification. Mitch quickly noted that people were searching more for “James J. Lee” than for “James Jay Lee,” so we quickly rewrote our headline to cut the middle name down to just the initial. And we rocked in search results and search traffic that day.
I will use short clips from these two videos to illustrate some points about SEO. This David Allen Coe song makes fun of country music clichés by gratuitously singing about mother, prison, truck, trains and getting drunk. It makes for a fun song, but it’s not good SEO to gratuitously drop irrelevant words into a blog post:

Kamis, 26 Januari 2012

8 Killer SEO Tips To Boost Your Blog

Today I am discussing the Guru SEO Tips that will give a massive increase to your blog's traffic and popularity and boost your traffic and Google Page Rank as well as Alexa And other rankings. Unlike the other Webmasters, I am going to share my 2 year experience of SEO with you.
I read thousands of articles on several blogs and applied and tested them, and the result is what I am going to share with you. I searched with my scope of knowledge and come to the point that 90% of blogs are missing many useful SEO points which can make you a pro Blogger and many blogs have published wrong contents that leads to the drop in Rankings. So below are mentioned the main Goals of SEO which I am using since years and have such Good SEO Rankings and Search Results.
Before starting in detail, you can Tweak Your Blog For SEO so you don't miss anything.

1. The Correct Time To Publish Posts

After regularly publishing 7 post a weak, I saw drop in my Traffic and Alexa Rankings day by day. That was a thinking point for me. The fact was that when I publish my post in between 11:00 AM to 12:00 AM (In Pakistan) the next day I see a massive increase in traffic with a single post at correct time. It is the time when the most of the traffic lands on Internet. So you should post between 11 AM to 12 AM (8 - 10 am in US).
2. Post Length and Summary
In order to place your post well in search results, your post must contain at least 300 Words. It should not be much longer that your visitors refuses to read it and close your blog. If you are writing a very long post, then divide it into 2 or more posts so your visitors don't get confused. Don't continuously write the post, give some spaces and write in paragraphs so it may be easy to read.
3. The Main Points Should Be Written First
You should write the main goals and the main purpose of your article first. Don't discuss anything which is not related to your topic. Just talk to the point.
4. Always Choose Shorter Post Title
Your post title should be as shorter as possible. Place the important words first. Don't worry about grammar, search engines don't look your grammar.
5. Must Include A Picture.
A picture speaks a thousand worlds and give your post a fresh look. Moreover it also optimizes your post by appearing in Google Images. Try to place picture on the top left side of your article like me.
7. Nofollow External Links

Nofollow is a big matter for you. It could be the reason in your PR drop. You should read:

8. Page Loading Speed

This is what every blogger/webmaster needs. Page Loading is a big factor for your traffic lost because most of the visitors don't wait if the page is loading slow, the just close your site and check for any other site. So take it as a serious problem and follow the following tricks:

The most important step to reduce load time is that you should remove the broken javascript src links from your blog code/template. Below is an example of broken javascript source link:
<script src="http://url.yourbrokenurl.com/javascript-src-code">

If there is any broken javascript link in your template, it can reduce your page loading time more than 80%. Check your whole template manually for broken javascript sources. Just press Ctrl + F and search for <script src=" and manually check all your javascripts.

Following these tips wisely, you'll see a huge increase in your PR as well as Traffic.
freshtips

Selasa, 03 Januari 2012

How To Change Blogger Mouse Cursors In Easy Way ( + 1000 Free Cursors )

How to add it.

Go to your blogger account, And navigate to dashboard >> design >> edit html >>
And find the following code,

]]></b:skin>

And exactly before it, add the following code

body, a, a:hover {cursor: url(http://cursors3.totallyfreecursors.com/thumbnails/apple-tmani.gif), progress;}

And now click Save Template

The above step will give you a mouse cursor just like the one in the above demo blog, And because the aim of this tutorial is to give you all control over your blog cursor, So you can just change the red part in the above code
http://cursors3.totallyfreecursors.com/thumbnails/apple-tmani.gif
To What ever cursor url you like, So the code should be

body, a, a:hover {cursor: url(Cursor-Url), progress;}

And the question now is how to get another cursors.

Free sources for +1000 ready to use mouse cursors.

On this 2 links you’ll find more than 1000 free and ready to use cursors well categorized, so you just browse and find your favorite one, once you found your favorite one, replace the red words in the above code with it’s url.

Rabu, 28 Desember 2011

New Year CountDown Widget For Blogs

new year count-down widget2012 is near and I am sure everyone of you is awaiting this moment eagerly. I have modified the countdown widget for Christmas a little to set it for new year. This widget can easily be added to both blogspot or wordpress. Simply copy the code and paste it in your templates. The moment new year starts, the widget will prompt an alert message saying: "Happy New year Everybody!" sharp at 12.00 a.m. The clock disappears the moment new year arrives and prompts the alert message. The clock has military standard format with hours, minutes and ticking seconds. This widget is created using a simple script with no flash. For flash clocks kindly check the Flash clocks collection. Lets add it to blogger.


Live Demo
The widget colors and styles can be completely changed using our Editor before adding it in blogger.
Tip: Paste the entire code given in step#4 inside the HTML editor.


Test and redesign it yourself!


Add count Down Widget To Blogger

  1. Go To Blogger > Design
  2. Click " Add a gadget"
  3. Choose HTML/Javascript widget
  4. Paste the following code inside it,

<style style="text/css">

.lcdstyle{ /*Example CSS to create LCD countdown look*/

background:#fff;

color:#289728;

font: bold 20px arial;

padding: 15px;

border:5px solid #333333;

border-radius:15px;

-moz-border-radius:15px;

-webkit-border-radius:15px;

box-shadow: 5px 5px 5px #CCCCCC;



}

.lcdstyle sup{ /*Example CSS to create LCD countdown look*/

font-size: 120%

}

</style>

<script type="text/javascript">

function cdtime(container, targetdate){

if (!document.getElementById || !document.getElementById(container)) return

this.container=document.getElementById(container)

this.currentTime=new Date()

this.targetdate=new Date(targetdate)

this.timesup=false

this.updateTime()

}

cdtime.prototype.updateTime=function(){

var thisobj=this

this.currentTime.setSeconds(this.currentTime.getSeconds()+1)

setTimeout(function(){thisobj.updateTime()}, 1000) //update time every second

}

cdtime.prototype.displaycountdown=function(baseunit, functionref){

this.baseunit=baseunit

this.formatresults=functionref

this.showresults()

}

cdtime.prototype.showresults=function(){

var thisobj=this



var timediff=(this.targetdate-this.currentTime)/1000 //difference btw target date and current date, in seconds

if (timediff<0){ //if time is up

this.timesup=true

this.container.innerHTML=this.formatresults()

return

}

var oneMinute=60 //minute unit in seconds

var oneHour=60*60 //hour unit in seconds

var oneDay=60*60*24 //day unit in seconds

var dayfield=Math.floor(timediff/oneDay)

var hourfield=Math.floor((timediff-dayfield*oneDay)/oneHour)

var minutefield=Math.floor((timediff-dayfield*oneDay-hourfield*oneHour)/oneMinute)

var secondfield=Math.floor((timediff-dayfield*oneDay-hourfield*oneHour-minutefield*oneMinute))

if (this.baseunit=="hours"){ //if base unit is hours, set "hourfield" to be topmost level

hourfield=dayfield*24+hourfield

dayfield="n/a"

}

else if (this.baseunit=="minutes"){ //if base unit is minutes, set "minutefield" to be topmost level

minutefield=dayfield*24*60+hourfield*60+minutefield

dayfield=hourfield="n/a"

}

else if (this.baseunit=="seconds"){ //if base unit is seconds, set "secondfield" to be topmost level

var secondfield=timediff

dayfield=hourfield=minutefield="n/a"

}

this.container.innerHTML=this.formatresults(dayfield, hourfield, minutefield, secondfield)

setTimeout(function(){thisobj.showresults()}, 1000) //update results every second

}

/////CUSTOM FORMAT OUTPUT FUNCTIONS BELOW//////////////////////////////

//Create your own custom format function to pass into cdtime.displaycountdown()

//Use arguments[0] to access "Days" left

//Use arguments[1] to access "Hours" left

//Use arguments[2] to access "Minutes" left

//Use arguments[3] to access "Seconds" left

//The values of these arguments may change depending on the "baseunit" parameter of cdtime.displaycountdown()

//For example, if "baseunit" is set to "hours", arguments[0] becomes meaningless and contains "n/a"

//For example, if "baseunit" is set to "minutes", arguments[0] and arguments[1] become meaningless etc



function formatresults(){

if (this.timesup==false){//if target date/time not yet met

var
displaystring=arguments[0]+" days "+arguments[1]+" hours
"+arguments[2]+" minutes "+arguments[3]+" seconds left until December
25, 2011 18:25:00"

}

else{ //else if target date/time met

var displaystring=""

}

return displaystring

}

function formatresults2(){

if (this.timesup==false){ //if target date/time not yet met

var
displaystring="<span class='lcdstyle'>"+arguments[0]+"
<sup>days</sup> "+arguments[1]+"
<sup>hours</sup> "+arguments[2]+"
<sup>minutes</sup> "+arguments[3]+"
<sup>seconds</sup></span> "

}

else{ //else if target date/time met

var displaystring="" //Don't display any text

alert("HAPPY NEW YEAR EVERYBODY!") //Instead, perform a custom alert

}

return displaystring

}

</script>

<table><tbody>

<tr>

<td>

<img
style="float:left; "
src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhV3WITmDzow-AzczKAig1Go_Jvu97buAQGZde1TRrYmpmA071esmlz6akl4s1GaETk0Hkw03T2NtEblrghdsWIrA5wZZG3d4H1agHtJfixwUeG5dPQrs3masltA-PlohpXzjBbXCE1Z7U/s400/NEW+YEAR.png"
width="125px"/>

<h1 style="color:#289728; padding-top:40px;">Counting Till 2012 »»</h1><br/>

</td></tr>

<tr><td>

<div id="countdowncontainer"></div>

<br />

<div id="countdowncontainer2"></div>

<script type="text/javascript">

var futuredate=new cdtime("countdowncontainer", "March 23, 2009 18:25:00")

futuredate.displaycountdown("days", formatresults)

var currentyear=new Date().getFullYear()

//dynamically get this Christmas' year value. If Christmas already passed, then year=current year+1

var thischristmasyear=(new Date().getMonth()>=11 && new Date().getDate()>31)? currentyear+1 : currentyear

var christmas=new cdtime("countdowncontainer2", "December 31, "+thischristmasyear+" 0:0:00")

christmas.displaycountdown("days", formatresults2)

</script>

</td></tr>

</tbody></table>


Make these customizations: Use our Color Tool hexadecimal codes
  • To change font color of the clock edit color:#289728;
  • To change border color edit border:5px solid #333333;
  • To change the text color edit color:#289728  4.   Save your widget  and drag it just above your blog posts body.
  • The purple texts can be easily edited to any message you wish to write.
new year widget
    5.   Done!
    Visit your blogs to see a beautiful count down clock that ticks every second!
Happy new year to all our readers and visitors in advance. Hope you make strong resolutions this year. :)