S3NTYN3L Posted December 5, 2010 Share Posted December 5, 2010 I need my LMGTFY mod to not only point to lmgtfy, but to create and get its resultant url from tinyurl. I've found this floating around the net: <?php $url = "http://vijayjoshi.org"; $tiny = file_get_contents("http://tinyurl.com/api-create.php?url=$url"); echo 'Original url : '.$url; echo '[br /]'; echo '[br /]'; echo 'TinyURL (Click to test) : <a href="'.$tiny.'" target="_blank">'.$tiny.'[/url]'; ?> Which I've narrowed down to: $lmgtfyurl = "http://lmgtfy.com/?q=$1"; $tiny = file_get_contents("http://tinyurl.com/api-create.php?url=$lmgtfyurl"); And I think I can use it in the lmgtfy bbc like this, somehow: 'content' => '<a href="'.$tiny.'" class="bbc_link new_win" target="_blank">$1[/url]', Now, this doesn't break the forum, but it also doesn't work. It doesn't work because I've no idea how to make the function needed... I don't have all that much experience with PHP. My mod is really just an edit of the default url bbc found in SMF... My smf mod can be found here: http://custom.simplemachines.org/mods/index.php?mod=2814 Any help is greatly appreciated! Link to comment https://forums.phpfreaks.com/topic/220702-need-help-with-smf-bbcode-mod/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.