Jump to content

Recommended Posts

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.