GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   WP Plugin: Shrink your affiliate links (https://gfy.com/showthread.php?t=950742)

$5 submissions 01-28-2010 01:31 PM

WP Plugin: Shrink your affiliate links
 
Own a WP blog? This is pretty nifty!

http://wordpress.org/extend/plugins/pretty-link/
Shrink, track and share any URL on the Internet from your WordPress website. You can now shorten links using your own domain name (as opposed to using tinyurl.com, bit.ly, or any other link shrinking service)! In addition to creating clean links, Pretty Link tracks each hit on your URL and provides a full, detailed report of where the hit came from, the browser, os and host. Pretty Link is a killer plugin for people who want to mask their affiliate links, track clicks from emails, their links on Twitter to come from their own domain, or generally increase the reach of their website by spreading these links on forums or comments on other blogs.

Nikitos 01-28-2010 03:23 PM

Sounds good. Thanks for sharing! I'll try it.

fris 01-28-2010 03:31 PM

good plugin, I own pretty link pro ;)

cyber 01-28-2010 04:38 PM

Also, if anyone is interested in only the short links without all the other tracking information:

You can have very, very short links like this:

http://www.cutiesr.us/a/4305

That go to their corresponding posts. #4305 is the post's ID, and goes here:

http://www.cutiesr.us/4305-erica-won...fect-tits.html

(your perma link will change depending on your settings, of course).

All you need is the following ...

Create folder "a" in your root.

Inside, create two files, ".htaccess" and "index.php"

Inside the .htaccess file, put:

Code:

Options +FollowSymlinks
RewriteEngine On

RewriteRule ^([0-9]+)$ /a/index.php?id=$1 [R=301,L]

inside index.php put:

PHP Code:

<?
// URL variables
$id = $_GET['id'];
if(!ctype_digit($id)){header("Location: /");}
// Include base WP files and connect to DB
include('../wp-config.php');
mysql_connect(DB_HOST, DB_USER, DB_PASSWORD) or die(mysql_error());
mysql_select_db(DB_NAME) or die(mysql_error());
$result = mysql_query("SELECT * FROM {$table_prefix}posts WHERE ID='{$id}' LIMIT 1");
$row = mysql_fetch_assoc($result);

$url = get_permalink($id);
header("Location: {$url}");
exit();

And whala, you've got your very own short URLs!

edit: hi fris!

crockett 01-28-2010 05:50 PM

Nice little plug-in

$5 submissions 01-28-2010 07:27 PM

Bump for a helpful WP resource

CYF 01-28-2010 07:43 PM

nice stuff :thumbsup

selena 01-28-2010 08:19 PM

I've been using Twitter Friendly Links exclusively for that purpose, but I will have to check this out. If I am reading the OP right, that would do away with me having to use a links.php file to mask affiliate urls.

Coolness, and thanks for sharing!

closer 01-28-2010 08:30 PM

Anyone using the PRO version of this?

If I read well, then you can change all exsisting links with the PRO version?

2012 01-28-2010 08:36 PM

sounds like a blast. thanks !

fris 01-28-2010 10:00 PM

Quote:

Originally Posted by closer (Post 16793386)
Anyone using the PRO version of this?

If I read well, then you can change all exsisting links with the PRO version?

ya plus a bunch of other features, i bought the unlimited pro license

digifan 01-28-2010 11:16 PM

That's very cool!

JeanClaude VanDamme 01-29-2010 01:04 AM

"gocodes" plugin does it well

tranza 01-29-2010 07:02 AM

Seems to be a good one, thanks for sharing!


All times are GMT -7. The time now is 09:44 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123