Posts Tagged ‘Tips’

Create A Safely Remove Hardware Desktop Icon

Posted on December 2007 at about 6:01 PM by hwa

Ever though of creating a Safely Remove Hardware icon on your desktop? You may ask why because the icon will usually appear at the taskbar, but for some odd reason, mine will not always appear, so sometime i have no other choice but to pull the USB stick right away. I don’t know what caused this happen, it’s Windows anyway and apparently i’m not the only one who facing this problem.

However, i found this simple workaround, which is create a shortcut on your desktop to open the Safely Remove Hardware menu, this is how you do it:-

  • On your desktop, right click then choose New > Shortcuts after that copy and paste the following:

%windir%\system32\rundll32.exe shell32.dll,Control_RunDLL hotplug.dll

  • Press next, you will be ask to give a name for your shortcut, any name will do, or just name it Safely Remove Hardware, then press finish.

That’s it! You are done, the shortcut should appear on your desktop. But for now you probably in love with your new shortcut, so you feel like want to make it fancier a bit, and here is how you can add an icon for it:-

  • Right click on your shortcut then choose Properties.
  • Go to the Shortcut tabs and click on the button Change Icon….
  • A menu should appear with a bunch of icon for you to choose, you can pick any icon from here OR you may paste the following and press enter for the Windows Safely Remove Hardware icon.

%windir%\system32\HotPlug.dll

Hope this helps. 🙂

WordPress 2.1 Visual Rich Editor Easter Egg

Posted on February 2007 at about 8:36 PM by hwa

For those who are using WordPress 2.1 WYSIWYG editor, ever wonder why there are so less buttons for the visual editor? Well actually you can toggle the advance button by pressing Alt+Shift+V for Firefox user or Alt+V for Internet Explorer user.

Thanks to Chris for this great easter egg! 😀

AdSense-Deluxe And ButtonSnap Fix

Posted on November 2006 at about 1:23 AM by hwa

If you are using AdSense-Deluxe together with other WordPress plugins that is using ButtonSnap Class Library to create Quicktags button for WordPress Editor, then most probably the buttons created by ButtonSnap won’t show up.

However, after playing around with the JavaScipt inside AdSense-Deluxe (shame to say that i’m not very familiar with JavaScipt 😳 ), finally i came out a solution that’s extremely easy and still maintain the AdSense-Deluxe drop down option in WordPress Editor.

Follow these simple step to do the AdSense-Deluxe and ButtonSnap fix:

Step 1: Open up adsense-deluxe.php with your favorite editor, then search for the following two line.

  1. if (document.getElementById('quicktags') != undefined){
  2. document.getElementById('quicktags').innerHTML +=
  3. ...

Step 2: Then replace the quicktags with ed_toolbar, become like this.

  1. if (document.getElementById('ed_toolbar') != undefined){
  2. document.getElementById('ed_toolbar').innerHTML +=
  3. ...

After that you are done, the button created by ButtonSnap should appear together with AdSense-Deluxe drop down option.

Notes: I tried this plugin in WordPress 2.1 Ella but it doesn’t work for me, so i guess this fix doesn’t apply to WordPress 2.1.

Search And Replace In WordPress Post

Posted on November 2006 at about 12:29 AM by hwa

Upon trying to achieve XHTML 1.0 Strict, one of the thing i found out that i had been doing wrong all this while is that i put target=”_blank” HTML tag in most of my post link, this is not a valid XHTML for Strict and it won’t pass the validation, but i had been doing this since the very first day i blog! It will be troublesome if i’m going to search for every post and take away the target=”_blank”!! So i guess the only way to do this easily is by using the MySQL query, i went to Google around and found this very useful SQL query in Lorelle’s blog.

Before proceed to make any changes to your WordPress database, it’s always a good idea that you backup your database first, who know you might missed out something and screw up your database, it’s always better to prevent than cure right? 😉

Continue with the search and replace, in order to do search and replace in WordPress database, you can use the REPLACE syntax in SQL query, the full line would like the following:

  1. UPDATE wp_posts SET post_content = REPLACE (
  2. post_content,
  3. 'Item to replace here',
  4. 'Replacement text here');

Where wp_posts is your WordPress database post table and post_content is your post content table field, most of the time you don’t need to change this two value.

The thing you need to change is obviously the Item to replace here, which is the text you want to search, it can be multiple string as long as the string is within the single quote, and Replacement text here is the text you want to replace, also can be multiple string as long as it’s within the single quote.

So in my case, i want to strip away target=”_blank” and replace it with nothing, so i do this:

  1. UPDATE wp_posts SET post_content = REPLACE (
  2. post_content,
  3. ' target="_blank"',
  4. '');

Note that the i didn’t put anything for replace string, because i want to delete target=”_blank”, it’s a two single quote.

Again i would like to say, it’s a good practice that you backup your database always, once you screw up your database there is no turning back, and i will take no responsibility if something happen to your database, so do this at your own risk! 🙂

Adding Google And Slashdot To Sociable

Posted on October 2006 at about 7:36 PM by hwa

To add Google and Slashdot into your Sociable WordPress Plugin, please do the following:

Slashdot:
To add Slashdot into your Sociable, copy and paste to following code into the “$sociable_builtin_known_sites” array in “sociable.php”:

  1. 'Slashdot' => Array(
  2.   'favicon' => 'slashdot.png',
  3.   'url' => 'http://www.slashdot.org/bookmark.pl?
  4.    url=PERMALINK&title=TITLE',
  5. ),

Next copy and paste the following into “$sociable_files” array:

  1. 'images/slashdot.png',

Then save the Slashdot icon below and upload it into “sociable/images/” in your WordPress plugin folder.

Slashdot

After that go to “Admin->Options->Sociable” and click “Restore Built-in Defaults” for the icon to appear in the option page.

Google:
To add Google, copy and paste the following code into the “$sociable_builtin_known_sites” array in “sociable.php”:

  1. 'Google' => Array(
  2.   'favicon' => 'google.png',
  3.   'url' => 'http://www.google.com/ig/add?
  4.    feedurl=PERMALINK&blocked=TITLE',
  5. ),

Next copy and paste the following into the “$sociable_files” array:

  1. 'images/google.png',

Save the following Google icon and upload to “sociable/images/” in your WordPress plugin folder.

Google

Lastly go to “Admin->Options->Sociable” and click “Restore Built-in Defaults” for the icon to appear in the option page.