HashOut

Excluding the first post from Expandable Post Summaries hack for Blogger

In continuation of my earlier post Excluding the first post from a Peek-a-boo style post body contents-hack for Blogger let me show you how to implement this same trick for the Expandable Post Summaries hack for Blogger.

Just like the Peek-a-boo exclusion trick we will use the getElementsByClassName function to fetch the full contents of the first post and make it visible. But before you proceed further you need to have the Expandable Post Summaries Hack already implemented on your blog.


Once you have done that:

  1. Copy and paste the getElementsByClassName JavaScript function between the <head></head> tags.
  2. Then search for the posts loop. It should look somewhat like this:
    <b:loop values='data:posts' var='post'>
    <b:if cond='data:post.dateHeader'>
    <h2 class='date-header'><data:post.dateHeader/></h2>
    </b:if>
    <b:include data='post' name='post'/>
    <b:if cond='data:blog.pageType == "item"'>
    <b:include data='post' name='comments'/>
    </b:if>
    </b:loop>

    Now add the following lines of JavaScript code immediately after that.
    <script type='text/Javascript'>
    &lt;!--
    getElementsByClassName("fullpost")[0].className = "";
    getElementsByClassName("contreadlink")[0].style.display = "none";
    -->
    </script>

  3. Finally add a class to the Continue Reading link so that we can hide the link for the first post.

    Search for this tag:
    <b:if cond='data:post.url'> » <a expr:href='data:post.url' title='Permanent Link'>Continue reading</a></b:if>

    and replace it with
    <b:if cond='data:post.url'><span class="contreadlink"> » <a expr:href='data:post.url' title='Permanent Link'>Continue reading</a></span></b:if>


Thats it, you're done!

If you have a better way to achieve the end result, do let us know.
» Continue reading

Read more on , ,

Some tips to keep your CDs and DVDs clean and your players healthy

Recovering / Recovery of Damaged / Destroyed / Scratched CDs and DVDs.Be it the Beatles CD you play in the car, the precious Spiderman 3 DVD you got for your birthday or the CD-ROM with the snaps from your last holiday, chances are you have no idea what to do if the toddler in your life leaves her mark on any of them, let alone how to care for a disc at the best of times. Some tips from the Optical Storage Technology Association:
  1. Always hold CDs and DVDs by the outside edge or the centre hole.
  2. Store discs in plastic cases in a box, drawer or cabinet away from light, heat, dust and humidity.
  3. Blow off any dust that settles on discs to keep it out of your player.
  4. Clean discs using a soft, dry, lint-free cloth or camera lens tissue. Gently wipe from the centre to the outer edege in a straight line; do not rub in circles or around the disc.


CD cleaning fluids may help to remove sticky fingerprints.
» Continue reading

Read more on ,

Excluding the first post from a Peek-a-boo style post body contents-hack for Blogger

I had earlier written a post on Peek-a-boo post body contents-hack for New Blogger in response to which many asked for a way to exclude the first post from the hack. That is displaying the full contents of the first post alone.

Here I will show you a hack to implement this using JavaScript. If you have not already implemented the hack as given in the previous post, do so first.

Then insert the following lines of JavaScript code anywhere between the <head></head> tags. Preferably add them after the expandcollapse function between the same script tags.
<script type='text/Javascript'>
&lt;!--
function getElementsByClassName(clsName) {
var retVal = new Array();
var elements = document.getElementsByTagName("*");
for(var i = 0;i &lt; elements.length;i++){
if(elements[i].className.indexOf(" ") >= 0){
var classes = elements[i].className.split(" ");
for(var j = 0;j &lt; classes.length;j++){
if(classes[j] == clsName)
retVal.push(elements[i]);
}
}
else if(elements[i].className == clsName)
retVal.push(elements[i]);
}
return retVal;
}
-->
</script>


Then search for the posts loop. It should look somewhat like this:

<b:loop values='data:posts' var='post'>
<b:if cond='data:post.dateHeader'>
<h2 class='date-header'><data:post.dateHeader/></h2>
</b:if>
<b:include data='post' name='post'/>
<b:if cond='data:blog.pageType == "item"'>
<b:include data='post' name='comments'/>
</b:if>
</b:loop>


Now add the following lines of JavaScript code immediately after that.

<script type='text/Javascript'>
&lt;!--
getElementsByClassName("posthidden")[0].className = "postshown";
getElementsByClassName("showhidelink")[0].innerHTML = "";
-->
</script>


And finally we have to make a slight modification to the peek-a-boo hack by adding a showhidelink class to the [+/-] show/hide this post anchor tag.

Search for this tag:
<a expr:href='"javascript:expandcollapse(\"" + data:post.id + "\")"'>


and replace it with
<a class='showhidelink' expr:href='"javascript:expandcollapse(\"" + data:post.id + "\")"'>


Thats it, you're done!

However, for this trick to work, scripting needs to be enabled else the visitor will see the first post hidden just like the previous hack.

This trick can be similarly applied to the Expandable post summaries hack. I shall write about implementing this trick with that hack sometime soon.

I believe a lot can be improved upon this hack too! May be there is a better way to do it. This was just what I came up with. If you have a better solution do hash out!
» Continue reading

Read more on , ,

How to get a quick passport size photo?

How to get a quick passport size photograph?Need a quick passport size photo? Simply take a digital photo of your face in front of a white background and upload it online to ePassportPhoto.com. You can crop it on the site and you'll get an image file to save back to your own computer. If you own a digital camera and color printer, the service will cost you noting. What's more, you can keep snapping photos until you're happy with the result. » Continue reading

Read more on , , , ,

Avoid Man-to-Man Deals at Work

Tips for better successful management of business deals and reduce risk of failure.If you are planning to ask for a pay rise or want to secure a business deal, try to bargain with someone of the opposite sex.

European researchers have found that women negotiate better with men and vice versa, but that both men and women become over-competitive when dealing with someone of the same gender.

Talks between a mixed-gender pair lead to significantly more co-operation, resulting in mutually beneficial business outcomes, the researchers say.

They suggest that companies can use this knowledge to their benefit, by strategically selecting the gender of their representatives. » Continue reading

Read more on , ,

Tips for printing Digital Photos

Tips to print Digital PhotosCapture great memories and moments with tips on printing digital photos.

Fan your paper first
Before you put it into the paper tray, bend the stack and run your finger along the edge. This ensures the sheets feed flawlessly.

Select the right paper setting
Many HP photo printers with optical sensors for paper type allow you to select the actual name of the paper you are using. Use it to enhance paper feed and print quality.

Don't stack your photos
Don't stack your photos before they are totally dry. This may cause the photo below to stick onto the back of the one above.

Leave them to dry before storing
Resist the temptation to slot your phtos into a photo album the moment they are printed. Air them in a cool place to dry them before storing.

Keep them protected
Exposing your photos to air and moisture causes them to fade or turn yellow. Store your photos in an album or photo frame to protect them.
» Continue reading

Read more on , , ,

How to spot an email hoax

How to filter an internet hoax.
The Internet is a great way to share information, but also to spread lies and mischievous nonsense. When you get an unsolicited email, these warning signs, from urbanlegends.about.com, should ring alarm bells:
  1. The text was not originally written by the person who sent it to you.
  2. Phrases such as "This is NOT a hoax..."
  3. ...Or "Forward this to everyone you know."
  4. Overly emphatic language or heavy use of CAPITALS and exclamation marks!!!!!!!!
  5. Language that seems more geared to persuade than to inform.
  6. Claims to offer important information you've not heard before from legitimate sources.
  7. Subtle jokes that might suggest leg pulling.
  8. No reference to outside sources nor links to websites with corroborating information.
  9. Replies with "Re:" in the subject title from people you haven't written to.
» Continue reading

Read more on , , ,