Showing posts with label blog template. Show all posts
Showing posts with label blog template. Show all posts

Friday, August 7, 2009

Numbering your Comments in the Blogger Blog

I am trying to keep my blogs in the simple informational style. That means, I am looking for interesting information on the Web and I am sharing with you. In most cases, it is a one-directional process, and I do not get a lot of comments. However, if you blog in more communicational and controversial manner, amount of comments you receive could be huge. If that is the case, the comments numbering might be an excellent idea.

Possible Advantages:
* It is a nice way of differencing/identifying each comment (it’s a great feature for giveaway posts!).
* It allows you to get the permalink of each comment, and this may work for future references (e.g.: “You should read this comment [URL goes here], I found it very interesting.”)
* Indispensible for design purposes.

Possible disadvantages and limitations:
* If your comments are paginated, the counter will reset in each comment page. In Blogger, comments are paginated if they surpass the 200.
* The process requires code modification in several places, so that is not recommended for the beginner bloggers.

Results:

Image and video hosting by TinyPic


Steps involved in implementing this trick
1. Login to your Blogger Dashboard
2. Go to Template >Edit HTML
3. Choose to expand your Widget templates.
4. Find this line of Code
<dl id='comments-block'>
and replace it with
<dl id='comments-block'>
<script type='text/javascript'>var CommentsCounter=0;</script>
5. Now find this line of code
<dt expr:class='&quot;comment-author &quot; + data:comment.authorClass' expr:id='data:comment.anchorName'>
and replace it with
<dt expr:class='&quot;comment-author &quot; + data:comment.authorClass' expr:id='data:comment.anchorName' style='clear: both;'>
6. Now find this line of code
<data:commentPostedByMsg/>
and replace it with
<data:commentPostedByMsg/>
<span class='numberingcomments' style='float: right; font-size: 20px;'>
<a rel='nofollow' expr:href='data:comment.url' title='Comment Link' style='text-decoration:none'>
<script type='text/javascript'>
CommentsCounter=CommentsCounter+1;
document.write(CommentsCounter);
</script>
</a>
</span>

So you should have it working in just 3 replacement steps. If everything went well, you should now have a numbered commenting system on your blog.




Sources and Additional Information:

Wednesday, April 15, 2009

Tweaking Color Schemes of AdSense Blocks with Portable Freeware

When you plant Google AdSense ads blocks on your blog or website, you might need to tweak the suggested colors in your template to fit better to your page. In some cases, you want it to blend in the page design; in some cases, you want it to be as bold as possible. Finding the appropriate colors might be challenging, especially, if you want it to be exact match. Identifying the type of color can be very difficult, but with Just Color Picker, you can get the exact color value of any pixel. Jpicker is small, portable, and absolutely free utility that will assist you in picking the right colors.

After starting to use the utility for Google AdSense ads tweaks, I found it very convenient for other design purposes, as tweaking my Blogger templates. The initial experiments show very interesting patterns, proving that even small changes in the sites GUI might be useful for the overall site effectiveness.


Features
  • Five formats of color value: HTML, RGB, HEX, HSB/HSV, and HSL.
  • 3x, 9x and 15x zoom of any screen area.
  • Picked colors history. History saving function for future use of the picked colors. Removal of colors from the history.
  • RGB and RYB color wheels to display triads and complementary colors.
  • Two harmonious color finders. With this feature you can easily pick harmonious colors, for example, for your web site. Just choose your favorite color and the color picker will find the best colors harmoniously matched with yours.
  • RGB & HSV color mixers to edit a picked color.
  • Gradient between two latest-picked colors to allow you to pick a color from a wide range between the chosen colors.
  • Optional stay-on-top.
  • User-defined hotkey to capture color info (Alt+X by default).
  • Copying the color value or its selected part to the clipboard just by button click.
  • No installation required. Just Color Picker is a portable application and can be run directly from a USB stick.
  • Multilingual interface Bulgarian, Croatian, Czech, Danish, Dutch, English, Finnish, French, German, Greek, Hungarian, Italian, Norwegian, Polish, Portuguese, Russian, Slovak, Spanish, Swedish and Turkish.
Website: http://www.annystudio.com/jcpicker.zip

Download: http://www.ziddu.com/download/4315421/jcpicker.exe.html

Wednesday, December 3, 2008

Dynamic Tree DTree for Blogger Blog

In course of my experiments to bring normally dynamic content in the Blogger blog to the appearance and functionality of the static Websites, I was trying to implement the Blogger hack, allowing displaying the blog Table of Content in the Windows Explorer similar interface. While there are multiple scripts available online for this modification, I had to try several of them before I actually found one, which worked right away with relative simplicity. It is my pleasure to offer it to you. All credit for this excellent script is to the author of The Blogger Guide. I will repost the article without modification in respect to the script developer.

A tree control (i.e. the GUI element found in the left pane of Windows Explorer) provides a useful way of organizing a set of hierarchical items. This article will present a method to incorporate such a tree control in to Blogger blogs.

Before we proceed, let’s take a look at how our final tree will look like.


Now let’s see how to include a tree like the above in your blog.

Step 1
First step is to include two resources, a JavaScript file and a CSS file, in to the Blogger template. Copy the following two lines of code and insert them in to the head section of your template.

<link href=’http://thebloggerguide.googlepages.com/dtree.css’ rel=’StyleSheet’ type=’text/css’/>
<script src=’http://thebloggerguide.googlepages.com/dtree.js’ type=’text/javascript’/>


You can copy it immediately under the <head> tag as shown in the figure below. (These two resources are hosted on the Blogger Guide companion site. Don’t worry, there is no tracking code or any thing of that sort there. It’s used purely for hosting files referred to from these articles)


Save your template and exit Edit HTML mode.

Step 2
Next step is to write the code necessary to create the tree. I will first present a sample code and then explain it.

<div class="dtree">

<p><a href="javascript: d.openAll();">open all</a> | <a href="javascript: d.closeAll();">close all</a></p>

<script type="text/javascript">
<!--

d = new dTree(’d’);

d.add(0,-1,’Favorite Articles’);
d.add(1,0,’3 Columns’);
d.add(2,1,’3 Columns Explained’,’http://bguide.blogspot.com/2008/02/three-column-templates-explained.html’);
d.add(3,1,’Skeleton of a Template’,’http://...’);
d.add(4,1,’Adding a Third Column’,’http://...’);
d.add(5,1,’Layout Wire Frame Editor’,’http://...’);
d.add(6,1,’3 Columns with LR Sidebars’,’http://...’);
d.add(7,0,’Blog Traffic’);
d.add(8,7,’How to Monitor Visitors’,’http://...’);
d.add(9,7,’Feedjit’,’http://...’);
d.add(10,7,’Exclude Your Traffic from GA’,’http://...’);
d.add(11,0,’Customizations’);
d.add(12,11,’Add a Custom CSS class’,’http://...’);
d.add(13,11,’Related Posts Table’,’http://...’);
d.add(14,11,’Limit Widgets to Specific Pages’,’http://...’);
d.add(15,1,’3 Column Step by Step Guides’,’http://...’);

document.write(d);

//-->
</script>
</div>


The first line defines a generic div element and applies the class dtree in to that. This CSS class is defined in the dtree.css file which we included in Step 1 above. Next line inserts two buttons (in fact, links) to Expand and Collapse all the nodes in the tree. Thirdly, you find a Javascript enclosed within a <script> element. The first line in the script, d = new dTree(’d’), creates a new tree object to which we can insert nodes. The following lines which start with d.add(...) are the statements that insert all the nodes in to the tree. Then the last line of the script, document.write(d), renders the created tree on to the browser.

The add() function of the dTree takes in several parameters. The first 3 parameters are required (i.e. you must provide values for them) and the other parameters are optional. The above example uses the following 4 parameters.

  • Node ID - A unique numerical ID number. Assign a sequentially increasing number to each new node.
  • Parent Node ID - If you want to create a child node, then the ID of the parent node should be given here. This will be ’-1’ for the root node. (See the first d.add(...) line in the example)
  • Node Name - A textual description for the node
  • Node URL - If you want the node to link to some resource (e.g. an HTML page or some online image), provide the URL of the that resource as the 4th parameter.
For a full description of the add() function see here. You don’t have to provide consecutive (or adjacent) IDs for all the child nodes at a given level. For example, node 15 of the above snippet is attached as a child of node 1 called ’3 Columns’. You can have the nodes anywhere as long as you maintain the uniqueness of the node IDs and provide the correct parent node IDs. Step 3 Once you finish adding the nodes, copy the entire code starting from the <div class="dtree"> to the corresponding </div>. Then insert the entire code using an ’Add HTML/Javascript Element’ widget of the ’Add Page Element’ option. Place the widget where you want the tree to appear. Save the template and view your blog. You will have the tree sitting nicely in your blog! One limitation is the fact that node names do not wrap at the edges. So you have to give names that fit withing the width of the containing sidebar (or whatever location). Let me know what you think of it and also if you come across any problems when installing it.

Acknowledgment: I have used the free tree control offered by Geir Landr҆ at Destroydrop. The original files have been slightly modified to make them available online, to be used inside Blogger.

Note: You are free to use the resources used in Step 1. But if you do use, please link to this article from your blog.

If you want to see the practical implementation of this script, you can visit my new blog Data Recovery Techniques.

Wednesday, October 1, 2008

How to include social bookmarking submission after every post?

Every blog owner will benefit from sustaining the readers on the blog content. To reach this goal, it should be offered an easy and convenient way to subscribe to the blog through RSS reader and to allow submitting it to the Social Bookmarking sites. Social Bookmarking is indeed a great way to increase the blog exposure, bringing multiple benefits to the owner. Not just the reader preserves the post for further review and follow-up, but also the bookmark itself starts its own independent way of online existence. It will be indexed by Search Engine spider and will allow one more point of access to the blog content. It is just multiplying your blog exposure legally, with no additional efforts, and with no need to post duplicate your content on multiple sites.

Bloggerplugins offer a nice way to include small buttons after every post, allowing direct submission to the most popular social bookmarking sites with one click, without leaving the blog post.

To enable this option on your blog you should go through several simple steps of blog template code update:

1. Enter Blogger template in Layout section.
2. Choose Edit HTML.
3. Before doing any code modification, backup the entire template to the safe, easy identifiable location on your Hard Drive. If anything goes wrong, you can easily come back to your original template without loosing your blog structure.
4. Expand the widget template.
5. In the template:
a. Locate

<head>

b. Replace with

<head><script src=’http://files.bloggerplugins.org/simpletricks.js’></script>

c. Locate string

<p class=’post-footer-line post-footer-line-3’>

d. Place the following code below that line:

<!-- Social Bookmarking Icons Start www.bloggerplugins.org-->

<style type=’text/css’>

.bookmark img { border: 0;

padding:0px; }

.bookmark a:hover {

position: relative;

top: 1px;

left: 1px; }

</style>

<span class=’bookmark’>

<table align=’left’ border=’0’ cellpadding=’0’ width=’100%’>

<tr>

<td style=’vertical-align:middle’ valign=’middle’ width=’30%’>

<div expr:id=’"sbtxt"+data:post.id’>Bookmark this post<a style="text-decoration:none;" href="http://www.bloggerplugis.org">:</a></div><script type=’text/javascript’>showsbtext(&quot;sbtxt&quot; + &quot;<data:post.id/>&quot;,0)</script>

</td>

<td>

<a rel="nofollow" expr:href=’"http://www.stumbleupon.com/submit?url=" + data:post.url + "&amp;title=" + data:post.title’ expr:onmouseout=’"javascript:showsbtext(’"sbtxt" + data:post.id + "’",0);"’ expr:onmouseover=’"javascript:showsbtext(’"sbtxt" + data:post.id + "’",19);"’ target=’_blank’><img alt=’StumpleUpon’ src=’http://files.bloggerplugins.org/icon_sb_stumb.gif’/></a> <a rel="nofollow" expr:href=’"http://ma.gnolia.com/bookmarklet/add?url=" + data:post.url + "&amp;title=" + data:post.title’ expr:onmouseout=’"javascript:showsbtext(’"sbtxt" + data:post.id + "’",0);"’ expr:onmouseover=’"javascript:showsbtext(’"sbtxt" + data:post.id + "’",6);"’ target=’_blank’><img alt=’Ma.gnolia’ border=’0’ src=’http://files.bloggerplugins.org/icon_sb_mag.gif’/></a>

<a rel="nofollow" expr:href=’"http://digg.com/submit?phase=3&amp;url=" + data:post.url’ expr:onmouseout=’"javascript:showsbtext(’"sbtxt" + data:post.id + "’",0);"’ expr:onmouseover=’"javascript:showsbtext(’"sbtxt" + data:post.id + "’",1);"’ target=’_blank’><img alt=’DiggIt!’ src=’http://files.bloggerplugins.org/icon_sb_dig.gif’/></a> <a rel="nofollow" expr:href=’"http://del.icio.us/post?url=" + data:post.url + "&amp;title=" + data:post.title’ expr:onmouseout=’"javascript:showsbtext(’"sbtxt" + data:post.id + "’",0);"’ expr:onmouseover=’"javascript:showsbtext(’"sbtxt" + data:post.id + "’",2);"’ target=’_blank’><img alt=’Del.icio.us’ src=’http://files.bloggerplugins.org/icon_sb_del.gif’/></a> <a rel="nofollow" expr:href=’"http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Description=&amp;Url=" + data:post.url + "&amp;Title=" + data:post.title’ expr:onmouseout=’"javascript:showsbtext(’"sbtxt" + data:post.id + "’",0);"’ expr:onmouseover=’"javascript:showsbtext(’"sbtxt" + data:post.id + "’",3);"’ target=’_blank’><img alt=’Blinklist’ src=’http://files.bloggerplugins.org/icon_sb_bli.gif’/></a> <a rel="nofollow" expr:href=’"http://myweb2.search.yahoo.com/myresults/bookmarklet?u=" + data:post.url + "&amp;=" + data:post.title’ expr:onmouseout=’"javascript:showsbtext(’"sbtxt" + data:post.id + "’",0);"’ expr:onmouseover=’"javascript:showsbtext(’"sbtxt" + data:post.id + "’",4);"’ target=’_blank’><img alt=’Yahoo’ src=’http://files.bloggerplugins.org/icon_sb_yah.gif’/></a> <a rel="nofollow" expr:href=’"http://www.furl.net/storeIt.jsp?u=" + data:post.url + "&amp;t=" + data:post.title’ expr:onmouseout=’"javascript:showsbtext(’"sbtxt" + data:post.id + "’",0);"’ expr:onmouseover=’"javascript:showsbtext(’"sbtxt" + data:post.id + "’",8);"’ target=’_blank’><img alt=’Furl’ src=’http://files.bloggerplugins.org/icon_sb_fur.gif’/></a> <a rel="nofollow" expr:href=’"http://www.technorati.com/cosmos/search.html?url=" + data:post.url’ expr:onmouseout=’"javascript:showsbtext(’"sbtxt" + data:post.id + "’",0);"’ expr:onmouseover=’"javascript:showsbtext(’"sbtxt" + data:post.id + "’",9);"’ target=’_blank’><img alt=’Technorati’ src=’http://files.bloggerplugins.org/icon_sb_tec.gif’/></a> <a rel="nofollow" expr:href=’"http://www.simpy.com/simpy/LinkAdd.do?href=" + data:post.url + "&amp;title=" + data:post.title’ expr:onmouseout=’"javascript:showsbtext(’"sbtxt" + data:post.id + "’",0);"’ expr:onmouseover=’"javascript:showsbtext(’"sbtxt" + data:post.id + "’",10);"’ target=’_blank’><img alt=’Simpy’ src=’http://files.bloggerplugins.org/icon_sb_sim.gif’/></a> <a rel="nofollow" expr:href=’"http://www.spurl.net/spurl.php?url=" + data:post.url + "&amp;title=" + data:post.title’ expr:onmouseout=’"javascript:showsbtext(’"sbtxt" + data:post.id + "’",0);"’ expr:onmouseover=’"javascript:showsbtext(’"sbtxt" + data:post.id + "’",11);"’ target=’_blank’><img alt=’Spurl’ src=’http://files.bloggerplugins.org/icon_sb_spu.gif’/></a> <a rel="nofollow" expr:href=’"http://reddit.com/submit?url=" + data:post.url + "&amp;title=" + data:post.title’ expr:onmouseout=’"javascript:showsbtext(’"sbtxt" + data:post.id + "’",0);"’ expr:onmouseover=’"javascript:showsbtext(’"sbtxt" + data:post.id + "’",17);"’ target=’_blank’><img alt=’Reddit’ src=’http://files.bloggerplugins.org/icon_sb_red.gif’/></a> <a rel="nofollow" expr:href=’"http://www.google.com/bookmarks/mark?op=add&amp;bkmk=" + data:post.url + "&amp;title="+data:post.title’ expr:onmouseout=’"javascript:showsbtext(’"sbtxt" + data:post.id + "’",0);"’ expr:onmouseover=’"javascript:showsbtext(’"sbtxt" + data:post.id + "’",20);"’ target=’_blank’><img alt=’Google’ src=’http://files.bloggerplugins.org/icon_sb_goo.gif’/></a>

</td>

</tr>

</table><br/>

</span>

<!-- Social Bookmarking Icons End www.bloggerplugins.org-->

6. Save the modified template.
7. If the operation was successful, you should see the line of social bookmarking icons after each post.