How to add a new (FTW.ro) button to SexyBookmarks Plugin 2.6.1

Last week a good old friend of mine asked me if there’s a way to add another (?!?!) button/site to the SexyBookmarks site. I was a bit shocked: SexyBookmarks can “share”/”bookmark” your post to almost 54 sites/social networks/web applications. So why another one?! The answer came quick: because it’s not in that list, you moron! Okie, okie. Got it! It is about FTW site, which is some kind of article aggregator, dedicated to romanian bloggers. Okie! Now that makes sense, and it seems that my friend really needs that kind of feedback.

So, what do you need to start:

  1. latest version of WordPress, mine is 2.8.6
  2. latest version of SexyBookmarks, mine is 2.6.0.1 2.6.1
  3. latest version of One Half Hour Available :)

Lets begin:

  1. We’ll have to modify a few files that are in the plugin’s folder …/wp-plugin/plugins/sexybookmarks/, declared as {root} in the following lines:
    • {root}/includes/public.php
    • {root}/includes/bookmarks-data.php
    • {root}/css/admin-style.css
    • {root}/css/style.css
    • {root}/images/sexy-sprite.png
  2. In {root}/includes/public.php add the following block of elseif code at line 457:
    457
    458
    459
    460
    461
    462
    463
            elseif ($name=='sexy-ftw') {
                $socials.=bookmark_list_item($name, array(
                    'post_summary'=>$post_summary,
                    'permalink'=>$perms,
                    'title'=>$title,
                ));
            }
  3. In {root}/includes/bookmarks-data.php add the following array element at line 359:
    359
    360
    361
    362
    363
        'sexy-ftw'=>array(
            'check'=>__('Check this box to include ', 'sexybookmarks').__('FTW', 'sexybookmarks').__(' in your bookmarking menu', 'sexybookmarks'),
            'share'=>__('Share this on ', 'sexybookmarks').__('FTW', 'sexybookmarks'),
            'baseUrl'=>'http://www.ftw.ro/node/add/drigg/?url=PERMALINK&title=TITLE',
        ),
  4. In {root}/css/admin-style.css add the following code at line 186:
    186
    label.sexy-ftw{ background-position:-5120px top !important; }
  5. In {root}/css/style.css at line 84 35, there’s a very long-lined list of CSS selectors. Add the following two, just before the curly opening brace:
    35
    ..., li.sexy-ftw,  li.sexy-ftw:hover {

    and

    182
    183
    li.sexy-ftw { background-position:-5120px bottom !important; }
    li.sexy-ftw:hover { background-position:-5120px top !important; }
  6. Add this image into the images folder and override the current {root}/images/sexy-sprite.png

Now that everything went well :D (hoping so), do your settings into the plugin preferences page and bring the FTW icon into the bar! Be happy and wait for feedback from FTW! :)