Thursday, May 15, 2008

Wordpress Blogroll Icon

After a long pause I came back with this tweak for wordpress. You folks might be surprised to see wordpress related post in a blogspot. However, here it comes, since I work a lot with wordpress these days. :)

I came across this wordpress tweak when one of my client wants a Blogroll Icon to be displayed along with the blogroll link. So here's the steps on 'How to show a Blogroll Icon' in wordpress blog. Originally, what you have with wordpress blogroll is a list of links to websites and blogs. So to show image beside the blogroll link (most probably on the right side of the link text), perform the following steps.

Step1:
First you need to get the plugin ZocPowerblogroll from his website. Download the plugin and this plugin will do most of the work for us.

Step2:
Before activation of the plugin, you have to put this funtion in your 'sidebar.php'. Placed this function

'<?php wp_zoc_powerblogroll(); ?>'

in your sidebar where you want the blogroll to appear. If your template is widgetized, you need to keep this function outside of the widget 'if' condition, place before or above this 'if' condition

<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('lsidebar') ): ?>

Step3:
Load the plugin in the plugin directory, activate the plugin and you are ready to go. This plugin is compatible upto wordpress version 2.5.x. So you will not have any problem here. You may want to change how the blogroll is displayed by adding simple CSS code in the 'style.css'.

Step4:
Now, to show the icon in the blogroll, you need to have the icon files. You have two options, you can upload the icons directly to your server in your wp-content directory or you can get the links of an icon from freeicon websites. Now, you need to include the link of the icons in your blogroll links.

Step5:
Log in to the admin panel and go to Manage»Link (for wordpress 2.5 and later) or Blogroll in wordpress 2.3.x. Click on the edit blogroll link option, now you have the edit-link page, expand the advance tab and you will find an input form for 'Image Address'. You have to paste the link here. Now save the blogroll link and check your blog or website again, the icon will appear on the right side of the link you have just edited.

The modification:
Now, you have the icon appeared on the blogroll, but there is one simple modification I made on the plugin. In the input form for Image address, the plugin originally accept or allow only the hyperlink like http://www.sitename.com/iconfilename for the icon location. If you upload your icon file in the wp-content directory (/wp-content/icons/), you cannot specify the path of the icon like this (/wp-content/icons/iconfilename.xxx) for the 'Image Address' using this plugin. So the following modifications have been made. It's a simple modification, first find the following lines in the plugin file (zoc_powerblogroll.php).


if (substr($book->link_image,0,4) == 'http' && $showLinkFavicon)
echo "<a href=\"". $book->link_url ."\"><img src=\"".$book->link_image."\" alt=\"".$book->link_name." website\" /></a>\n";


After you find this lines, make the modification as below, or replaced the above lines with the code below or download the modified plugin here.


if (substr($book->link_image,0,4) == 'http' && $showLinkFavicon)
echo "<div class=\"blogroll_image\"><img src=\"".$book->link_image."\" alt=\"".$book->link_image." website\" /></div>";

elseif ($showLinkFavicon)
echo "<div class=\"blogroll_image\"><img src=\"" . get_settings('home') . $book->link_image . "\" alt=\"".$book->link_name." website\" /></div>";


You can check an example of the PowerBlogrollmodified here
[http://portaldemo.wpqueen.com]

Wednesday, April 23, 2008

Word wrap in firefox



I came across this problem in Firefox when I put a long link in my post. When there is a long link in your post, Firefox cannot display it properly. Firefox cannot wrap it within the content division and the link will flow out of the division or the last part of the link will not be visible in the post area. However this problem is not there in Microsoft Internet Explorer since word wrap is Microsoft proprietary extension to CSS which is introduced in IE 5.5.

Here the reason why I talk about link specifically is that there cannot be any spaces within a link, so we need word wrap here, that is not taken care in Firefox. When we write a normal paragraph, we usually put white spaces or spaces between each word, so we don't need to consider the wrapping of word in normal paragraph. As i have said, in a link there is no space, so we need to add a simple code in our css. First, we have to put our link inside the CODE tag as shown below

<code>YourLinkHere</code>

I choose the CODE tag because we usually use this tag to include code within our post, so that the browser will not parsed the code inside the CODE tag and it will display as it is. The next thing is writing the css code, you have to add this css code in your css style.

code {
display:block;
font-size:14px;
line-height:1.2em;
overflow-x:auto;
overflow-y:hidden;
}


This is how firefox will display it:


Sample link : http://2.bp.blogspot.com/_e6-Q9EUKoD8/AAAAAAAAAFU/SA8meOsUSOI/SA8meOsUSOI/SA8meOsUSOI/AAAAAAAAAFU/txDTADCZQO8/s400/wordwrap2.jpg
http://2.bp.blogspot.com/_e6-Q9EUKoD8/AAAAAAAAAFU/SA8meOsUSOI/SA8meOsUSOI/SA8meOsUSOI/AAAAAAAAAFU/txDTADCZQO8/s400/wordwrap2.jpg


Now you have to put your long link inside the CODE tag everywhere you want to attach a link in your post. In Firefox, the link (only if it is too long) will now be within a block element that can be scrolled in x-direction. This code is effective only when the link is long enough to flow out of the boundary.

The next thing you need to do is to add one more css code for Internet Explorer. Without the above code, IE already wrap the text correctly and display it properly. But, since you have change the display style of your CODE tag, you need to give IE the default display style back. To do this add the css code below and this css will work only if our website is viewed in Internet Explorer (you have to add the if condition).

<!--[if IE]>
<style type="text/css">
.post-body code {
display:inline;
word-wrap: break-word;
}
</style>

<![endif]-->

This is how Internet explorer will display it:


Now, this css will override the previous css written for Firefox if Internet Explorer is used, and IE will get its default word wrap property again.

Friday, April 18, 2008

Demonoid is back online

demonoid.com

One of the most popular and reliable torrent tracker demonoid.com is back online after three months downtime. Demonoid was shutdown by the CRIA in its fight against intellectual property theft.

Torrent users are happy with demonoid being back online again since demonoid is one of the most reliable torrent tracker in the torrent world.

It has been three months since the popular (semi)private BitTorrent tracker Demonoid went offline. Since then, there has been a lot of speculation about its future, and many feared that the site would never return. Totally out of the blue, however, the tracker is now responding again.
torrentfreak.com

Wednesday, April 16, 2008

Repairing Nvidia GeForce 8500 GT Manually

I have found this graphics card with its cooling fan physically damaged. Because of this the inductor was burnt. This is how we fixed the cooling fan. Its sound quite funny, so I just wanna post it here. First a computer chassis fan is taken for the replacement that work quite well. Now the original fan is removed, then to fit the chassis fan, the chassis fan housing is removed using a hexa blades. Now the fan is then glued inside the heat sink of the graphics card using super glue. After this the wiring is done to get power supply for the fan. Then its done, you can continue to use the card which is shown below. :)