[HBD] Mask outgoing/external links with TinyURL api

Xiao.T

Xiao.T

管理员
技术员
2008-05-19
6,006
6,531
Mask outgoing/external links with TinyURL

Warning:
This involves editing main php files so only do this if you feel comfortable doing so.

Open includes/class_bbcode.php

find:
PHP:
 $rightlink = str_replace(array('`', '"', "'", '['), array('`', '"', ''', '[), $this->strip_smilies($rightlink));
Replace with:

PHP:
 $rightlink = str_replace(array('`', '"', "'", '['), array('`', '"', ''', '['), $this->strip_smilies(file_get_contents('http://tinyurl.com/api-create.php?url=' .$rightlink)));


Now all your out going/external links will be in tinyurl format

http://tinyurl.com/2djvq9x
Links do not change in the post itself so if you edit the post the link will be original:

[url ]hxxp://ziy.cc[/url]

Tested and working fine in 3.8.5 and with vBSEO also
 
反馈: DeadFire