[HBD] Mask outgoing/external links with TinyURL api

本帖由 Xiao.T2010-06-09 发布。版面名称:vBulletin 3.8.X 英文插件

  1. Xiao.T

    Xiao.T 管理员 技术员

    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 的点赞。