Showing posts with label Blog. Show all posts
Showing posts with label Blog. Show all posts

13 June 2008

Adding a RSS subscribtion message under posts


from here

Labels:


A friend of mine wanted to know how to add RSS subscription messages under the posts like mine , i saw this messages on BlogOhBlog.com and i wanted to do the same , here how to do it.

If you want a rss subscription message same as mine, go to edit html , expand your widgets and , copy and paste the codes below after this line

<p><data:post.body/></p>



<br/>
<br/>
<div style='padding:5px; border:1px solid #999999; background-color:#efc954; margin-top:1px;'><img align='left' src='http://sdf789zzxx.googlepages.com/rss_tekil.png'/>If
you enjoyed this post,<a href='YOUR-FEED-URL-GOES-HERE'><b>
make sure you subscribe to my RSS feed! </b></a
></div>


Tips
  1. You had better host this image on your googlepages,photobucket or imageshack account to prevent bandwith from exceeding.
  2. You can change border color and background color also the message and image align , thats why i coloured changable lines.
  3. Before saving template , preview it , if you like it then save it . This trick will not cause any problem in your blogger template.
  4. This can be used in blogger classic templates and blogger xml templates.
  5. Do not hesisate to ask question :)
Zemanta Pixie

12 June 2008

Blogger Feeling Lucky Widget (Random Post)


from phydeaux3

I wouldn't have thought many people would think something like this would be useful, but a recent post on Techcrunch goes ape over wordpress having a 'random post' widget now. I figured if wordpress has one, New Blogger should as well.

With that in mind, here is the Blogger Feeling Lucky widget. Since we are in the Google family, I thought using the 'feeling lucky' nomenclature was appropriate. It's a silly little widget that adds a link to a random post on your blog. It is available in one-click add a widget to your Layouts template, or for classic templates the raw code is available to add that works as well. Also, a slightly tweaked version of the code also allows FTP Blogger blogs to join in the fun. All the things you need to install are explained on the setup page, although it's pretty simple. Currently I have it installed under the sidebar search box, via the manual code provided for exact placement.

Blogger Feeling Lucky Widget Install Page

Ricardo Santos has made a Portuguese translation available at Widgets para o blogger - Phydeaux3

Notes

For those that may be interested, here's how it works. Nothing really earth shattering going on. In the initial page load, the scripts make a json call to the feed url. Here I'm only interested in getting the total number of posts in the blog, so the call is made to the summary feed (to keep load time minimal) and with only one entry returned. The total number of posts is returned in New Blogger in the openSearch:totalResults field, so take the total number of posts and then use standard means to generate a random number within that range. Then the link is created using that number as it's variable.

Now at this point we don't have a valid url yet, just a number. So when the link is clicked, another quick json call is made, using the random number generated as the start-index parameter to get that entry in the feed only, a quick parse of the results to grab that entries url, then good old document.location (Thanks to Pete changed to window.location and a few other small tweaks to keep the back button working) to switch to it.

Old Blogger did have a similar tweak by Mario Brhemenz, but like a lot of our Old Blogger stuff relied on an outside service (del.icio.us)to work. I don't know that I've seen one for New Blogger before.

I think everything works as it should, but if you find any issues lemme know.


Zemanta Pixie