News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

LMGTFY (Let Me Google That FOR You) BBCode

Started by S3NTYN3L, October 29, 2010, 06:48:19 PM

Previous topic - Next topic

S3NTYN3L

Just updated the mod...

The tag now returns a TinyURL, so the LMGTFY link is hidden.


Enjoy! 8)

aishaweb

Quote from: S3NTYN3L on December 08, 2010, 08:43:40 AM
Just updated the mod...

The tag now returns a TinyURL, so the LMGTFY link is hidden.


Enjoy! 8)

Is it possible to have an option to have it both ways?  Some people are very sceptical  about clicking shortened URLs.

Robi052

#22
After upgrade to 3.0 modification dont work. Code open post.

Check here http://www.mojportal.com.hr/forum/obavijesti-administracije/let-me-google-that-for-you/

error log:

2: file_get_contents(http://tinyurl.com/api-create.php?url=http://lmgtfy.com/?q=Kako+koristiti+Google) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: no suitable wrapper could be found

2: file_get_contents() [<a href='function.file-get-contents'>function.file-get-contents</a>]: URL file-access is disabled in the server configuration

JD82

#23
Quote from: aishaweb on December 08, 2010, 10:30:50 AM
Quote from: S3NTYN3L on December 08, 2010, 08:43:40 AM
Just updated the mod...

The tag now returns a TinyURL, so the LMGTFY link is hidden.


Enjoy! 8)

Is it possible to have an option to have it both ways?  Some people are very sceptical  about clicking shortened URLs.
I would also disable TinyURL.
Could someone upload/link an older version where it had not been included?

JD82


S3NTYN3L

Updated mod to v3.5...

There is now an option to select the link output type:
" Use TinyURLs in LMGTFY BBCode links? "
Check the box to use TinyURLs. (default)
Uncheck to use the lmgtfy.com link.

In SMF 1.1.X, the option can be found at: Admin > Features and Options > LMGTFY BBCode
In SMF 2.0 RCX, the option can be found at: Admin > Configuration > Modification Settings > LMGTFY BBCode

Testing & working in 1.1.11, 1.1.12, RC2, RC3 & RC4 with no errors.



@MojPortal:
I've no idea why you're getting the error.
I tested v3.0 in 1.1.11, 1.1.12, RC2, RC3 & RC4 and saw no errors.
Perhaps it's got something to do with your server config as that last line in your post eludes to... :/

Robi052

After upgrade and disallow tinyurl mod working fine and no error

S3NTYN3L

Quote from: MojPortal on December 14, 2010, 06:51:04 AM
After upgrade and disallow tinyurl mod working fine and no error

Yeah, it must have something to do with your server config.

Find your " php.ini " file on your server. (It'll be in the folder where PHP is installed)
Open the " php.ini " file in a text editor and then locate the following setting: " allow_url_fopen "
Set it to " On ", like so: " allow_url_fopen = On "
Save the file...

Set my mod to use TinyURLs again and see if the issue is corrected...

S3NTYN3L

Quote from: S3NTYN3L on December 16, 2010, 01:32:45 AM
Updated mod again...
This time in an attempt to correct errors such as the ones reported by MojPortal.
Everything should be good to go at this point...


Nope, I found out that after saving setting changes in SMF v1.X, the redirection wasn't working properly.

Problem fixed.
NOW we're good to go. ;)

S3NTYN3L

Updated package for SMF 1.1.13, SMF 2.0 RC4 Security Patch & SMF 2.0 RC5 compatibility

S3NTYN3L

Updated package for SMF 1.1.14, SMF 2.0 compatibility

busterone

Nice. Thanks S3NTYN3L   :)
I already had it working on 2.0 with version emulation.   

S3NTYN3L

Updated package for SMF 1.1.15, SMF 2.0.1 compatibility

S3NTYN3L

Updated package for SMF 1.1.16 & SMF 2.0.2 compatibility.

MrNicotine

I'm not sure if this topic is still being checked once in a while, but I'll try a question anyway ;)

I've been using this mod succesfully for a while now, with my own modifications to it.
But there's one thing I've not been able to solve. I have changed the link to a default image, but then it still shows the link.
Is there a way to do this without the link, so only the image shows to click on?

I now have this:

Quote"else
                  $data = \'<a href="\' . "http://www.lmgtfy.com/?q=" . urlencode($data) . \'" class="bbc_link new_win" target="_blank">\' . $data . \'<br><img src="http://www.myforum.image.png" alt="" width="350" height="150" /></a>

Which part is the text part? Or am I looking in the wrong place?
(TinyUrl is turned of)

S3NTYN3L

Sorry for the oh so late reply...

Are you wanting to replace the link this mod outputs with an image that contains the same link?

So, instead of:

[lmgtfy]Search For This[/lmgtfy]
[lmgtfy=Search For This]Cleverly Hidden LMGTFY Link[/lmgtfy]


returning,

Search For This
Cleverly Hidden LMGTFY Link


You want an output of:

:P 8) ??? <--Your_Linkable_Default_Image


I'm doing this from my cell phone at the moment so please forgive any typos in the code.
That said, I believe that you want to replace the " $data " portion found just before the " \'</a>\';') " with your image tag, making sure that the string is properly escaped, of course.
I'd have to get home and actually look at the code on a proper monitor to assist you any further but, it should go something like this:

else
$data = \'<a href="\' . "http://lmgtfy.com/?q=" . urlencode($data) . \'" class="bbc_link new_win" target="_blank"> <img src="http://www.myforum.image.png" width="350" height="150"> </a>\';')



Lastly, bear in mind that you'd have to do things a bit differently for the " unparsed_equals " section of code as the above would only work for the " unparsed_content " section of code in question. If it were me, I'd simply remove the unparsed_equals array altogether and edit the rest of the mod accordingly...


Hope this helps!

MrNicotine

Yep, it certainly did!! It works perfect now, without the text, only image.
Thanks!! ;)

S3NTYN3L

Updated package for SMF 1.1.18, SMF 2.0.4 compatibility

Colin

"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

Advertisement: