Posts Tagged ‘Hacks’

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.

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.