Modifying Tweet Old Post WordPress Plugin

modifying tweet old post plugin Modifying Tweet Old Post WordPress Plugin

Today I just want to show you how to modify the WordPress plugin Tweet Old Post.

I wanted to add my new URL shortening service 1click.at to this nice plugin.

Well, it is really very easy to do. Here is what files need to be modified:

1. top-admin.php

2. top-core.php

You can find both files in your wp-content/plugins/tweet-old-post folder.

Open top-admin.php with your favourite editor (in my case Notepad++).

Search for the line (should be line 204)

204
<select name="top_opt_url_shortener" id="top_opt_url_shortener" onchange="javascript:showURLAPI()" style="width:100px;">

Now add (directly after the line, if you want)

<option value="1click" '.top_opt_optionselected('1click',$url_shortener).'>'.__('1click', 'TweetOldPost').'</option>

and save the changes to the top-admin.php file.

Open the file top-core.php and search for (should be line 153)

153
//Shorten long URLs with is.gd or bit.ly.

What I did now is added the following code

} elseif ($shortener=="1click") {
 $url = "http://1click.at/api.php?action=shorturl&url={$the_url}&format=simple";
 $response = send_request($url, 'GET');

AFTER line 176

174
175
176
} elseif ($shortener=="tinyurl") {
 $url = "http://tinyurl.com/api-create.php?url={$the_url}";
 $response = send_request($url, 'GET');

Now you can see in the Tweet Old Post admin panel that there is a new URL shortening service called 1click.

Use it, enjoy it icon wink Modifying Tweet Old Post WordPress Plugin

VN:F [1.9.11_1134]
Rating: 0.0/5 (0 votes cast)

6 Comments to “Modifying Tweet Old Post WordPress Plugin”

  1. invocoes 8 May 2010 at 7:49 pm #

    Modifying Tweet Old Post WordPress Plugin http://blog.computer-service-mallorca.co... #webdesign

  2. invocoes 8 May 2010 at 7:49 pm #

    Modifying Tweet Old Post WordPress Plugin http://blog.computer-service-mallorca.co... #webdesign

  3. invocoes 9 April 2010 at 11:17 am #

    Modifying Tweet Old Post WordPress Plugin http://blog.computer-service-mallorca.co... #webdesign


Leave a Reply

*

Maximum 2 links per comment. Do not use BBCode.