[ABD] Show Title From External Links

Any abandoned Extensions will be moved to this forum.

WARNING: Extensions in this forum are not currently being supported or maintained by the original Extension author. Proceed at your own risk.
Forum rules
IMPORTANT: Extension Development Forum rules

WARNING: Extensions in this forum are not currently being supported nor updated by the original Extension author. Proceed at your own risk.
User avatar
Mickroz
Registered User
Posts: 655
Joined: Thu Mar 06, 2003 11:20 pm
Location: Netherlands
Contact:

[ABD] Show Title From External Links

Post by Mickroz » Sun Nov 06, 2016 7:10 pm

Show Title From External Links

Author: Mickroz

Extension Version: 1.0.2 (unstable)

Description:
This extension will allow the display of the links page title on your forum when a link is posted

Precaution:
As the ext is still in development, major changes still can be applied which could require full extension purging and reinstallation, so use it on your own risk. DO NOT install it on production boards. For testing purposes only.

Requirements:
  • PHP >= 5.3.3
  • phpBB >= 3.1.0
3.0 MOD Authors:
This is a extension based on the Show Title From External Links MOD, written by: RMcGirr83

Installation:
  1. Download the latest release
  2. Create a new folder in the /ext/ directory, named: mickroz (If it doesn't exist already)
  3. Create a new folder in /ext/mickroz/ named linktitles
  4. Copy the contents from the linktitles-master folder from your download into
    /ext/mickroz/linktitles/
  5. The main extension class should now be at: root/ext/mickroz/linktitles/composer.json
  6. Nagivate in the Administration Control Panel (ACP) to Customise -> Manage Extensions
  7. Look for Show Title From External Links in the Disabled Extensions list and click Enable!
Download:
Download

Screenshots:
none yet
Last edited by Mickroz on Thu May 31, 2018 2:39 pm, edited 2 times in total.
I don't need to "get a life." I'm a Gamer, I have lots of lives!
Q: Whats a hash and a root password?
A: hash gets you high, root password gives you god powers, combine the 2 and you are invincible.

User avatar
3Di
Registered User
Posts: 12992
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: [DEV] Show Title From External Links

Post by 3Di » Sun Nov 06, 2016 7:29 pm

Since you are using cURL you should provide the code that checks if it is present or not, because not all server configurations (hosters) give it available somehow. If not present then there are different alternatives:

1 - simply stating you need cURL isn't enough (and you didn't), people tend to install extensions and then blame you in case of errors related.. and you didn't code an error check too.

2 - provide an ext.php file that will block the installation if the required stuff isn't present, coding there the above cited check-in.

3 - Provide a fallback, an alternative if cURL isn't present (seems to me the best option).

If you are interested you can have a look at some thing I coded for an ext of mine, the following highlighted lines show you a simple function you could use for this approach, the whole file/ext could also be of interest for this case since I am using file_get_contents as a fallback.

https://github.com/3D-I/IP-Country-Flag ... hp#L73-L82
Want to compensate me for my interest? Donate
Please PM me only to request paid works. Thx.
Extensions, Scripts, MOD porting, Update/Upgrades
My development's activity º PhpStorm's proud user

User avatar
Mickroz
Registered User
Posts: 655
Joined: Thu Mar 06, 2003 11:20 pm
Location: Netherlands
Contact:

Re: [DEV] Show Title From External Links

Post by Mickroz » Sun Nov 06, 2016 8:33 pm

Thats why its still in dev 3Di ;)
I never really thought that curl wasn't a default thing on a server.
I had trouble with file_get_contents() (as the original mod used) and therefor fallback to curl.

It makes sense what you are saying, initially I had an error check for curl, but I removed it for testing, and not placed it back.
I will check your code to see what you mean, thanks for reporting.
I don't need to "get a life." I'm a Gamer, I have lots of lives!
Q: Whats a hash and a root password?
A: hash gets you high, root password gives you god powers, combine the 2 and you are invincible.

User avatar
3Di
Registered User
Posts: 12992
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: [DEV] Show Title From External Links

Post by 3Di » Sun Nov 06, 2016 8:37 pm

I am just encouraging your dev, trying to be constructive. I know what a DEV prefix stands for. ;)
If you are not finding an anternative fallback to cURL though, the option 2 should cover it.
Regards.
Want to compensate me for my interest? Donate
Please PM me only to request paid works. Thx.
Extensions, Scripts, MOD porting, Update/Upgrades
My development's activity º PhpStorm's proud user

User avatar
Mickroz
Registered User
Posts: 655
Joined: Thu Mar 06, 2003 11:20 pm
Location: Netherlands
Contact:

Re: [DEV] Show Title From External Links

Post by Mickroz » Sun Nov 06, 2016 8:43 pm

I know, I was just kidding, and im thankful for you comment.
I think I will go like you have done it, seems doable.
Thanks.
I don't need to "get a life." I'm a Gamer, I have lots of lives!
Q: Whats a hash and a root password?
A: hash gets you high, root password gives you god powers, combine the 2 and you are invincible.

koraldon
Registered User
Posts: 483
Joined: Sat Jun 30, 2007 12:42 pm

Re: [DEV] Show Title From External Links

Post by koraldon » Mon Nov 07, 2016 12:07 pm

Hi,
sounds great - does it work with ELONW ?
Any option to maybe combine the two extensions?

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 20955
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: [DEV] Show Title From External Links

Post by RMcGirr83 » Mon Nov 07, 2016 12:15 pm

It should work with ELONW version that is sitting in the queue. Concerning the code

Code: Select all

    public function get_url($url)
    {
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_USERAGENT, 'LinkTitles');
        $data = curl_exec($ch);
        curl_close($ch);
        
        return $data;
    }
you should ensure that something is returned (server not down), eg.

Code: Select all

    public function get_url($url)
    {
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_USERAGENT, 'LinkTitles');
        curl_setopt($ch, CURLOPT_TIMEOUT, 5);
        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
        $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
        $data = curl_exec($ch);
        curl_close($ch);
        // if nothing is returned (server is down)
        if ($httpcode != 200)
        {
            return false;
        }
        return $data;
    }
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

User avatar
Mickroz
Registered User
Posts: 655
Joined: Thu Mar 06, 2003 11:20 pm
Location: Netherlands
Contact:

Re: [DEV] Show Title From External Links

Post by Mickroz » Mon Nov 07, 2016 12:40 pm

yes it should work with ELONW, i have it running side by side here.
thanks Rich, i had this:

Code: Select all

$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
	curl_close($ch);
	return ($httpcode>=200 && $httpcode<300) ? $data : false;
will add the other two lines

Code: Select all

curl_setopt($ch, CURLOPT_TIMEOUT, 5);
        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
aswell.

EDIT: updated code with suggestions made by 3Di and RMcGirr83.
I don't need to "get a life." I'm a Gamer, I have lots of lives!
Q: Whats a hash and a root password?
A: hash gets you high, root password gives you god powers, combine the 2 and you are invincible.

User avatar
Volksdevil
Registered User
Posts: 2414
Joined: Sun Oct 03, 2010 2:03 pm
Location: Lancashire, UK
Name: Neil
Contact:

Re: [DEV] Show Title From External Links

Post by Volksdevil » Tue Nov 08, 2016 8:50 pm

Seem to have a small issue with thi when links are wrapped around images. Such as photobucket, example below:

Code: Select all

[url=http://s1239.photobucket.com/user/xbox360guru/media/AEB%20%20Build/20161105_210812.jpg.html][img]http://i1239.photobucket.com/albums/ff512/xbox360guru/AEB%20%20Build/20161105_210812.jpg[/img][/url]
A link/image like that doesn't show anything in the post.
My phpBB Extensions
Finally found great Website Hosting from Image KUALO!
Do NOT use 123-reg.co.uk - Incapable of running phpBB!
:ugeek: TekNeil - Streamer on Mixer | My Volkswagen Corrado G60

User avatar
Mickroz
Registered User
Posts: 655
Joined: Thu Mar 06, 2003 11:20 pm
Location: Netherlands
Contact:

Re: [DEV] Show Title From External Links

Post by Mickroz » Tue Nov 08, 2016 9:17 pm

hmm yeah, for some reason it skips the check and therefore returns no text, will check this further.

EDIT: i changed it so that only link texts starting with http get overwritten, else the old text is used, this should fix the images too.
I don't need to "get a life." I'm a Gamer, I have lots of lives!
Q: Whats a hash and a root password?
A: hash gets you high, root password gives you god powers, combine the 2 and you are invincible.

kim902
I've Been Banned!
Posts: 59
Joined: Wed Nov 09, 2016 5:49 pm

Re: [DEV] Show Title From External Links

Post by kim902 » Fri Nov 11, 2016 3:03 pm

How many links can one post before the page posts slow ?
Hardest thing in life is accepting some one else has done it better.

User avatar
Mickroz
Registered User
Posts: 655
Joined: Thu Mar 06, 2003 11:20 pm
Location: Netherlands
Contact:

Re: [DEV] Show Title From External Links

Post by Mickroz » Fri Nov 11, 2016 3:18 pm

don't know,haven't done any calculations, depends on too much factors to be honest.
I don't need to "get a life." I'm a Gamer, I have lots of lives!
Q: Whats a hash and a root password?
A: hash gets you high, root password gives you god powers, combine the 2 and you are invincible.

koraldon
Registered User
Posts: 483
Joined: Sat Jun 30, 2007 12:42 pm

Re: [DEV] Show Title From External Links

Post by koraldon » Sun Nov 20, 2016 8:42 pm

Installed on my live site, seems to be working great - thanks :)
No conflict with ELONW 1.0.4.

User avatar
Mickroz
Registered User
Posts: 655
Joined: Thu Mar 06, 2003 11:20 pm
Location: Netherlands
Contact:

Re: [DEV] Show Title From External Links

Post by Mickroz » Sun Nov 20, 2016 8:44 pm

great, let me know if you ran into problems ;)
I don't need to "get a life." I'm a Gamer, I have lots of lives!
Q: Whats a hash and a root password?
A: hash gets you high, root password gives you god powers, combine the 2 and you are invincible.

koraldon
Registered User
Posts: 483
Joined: Sat Jun 30, 2007 12:42 pm

Re: [DEV] Show Title From External Links

Post by koraldon » Mon Nov 21, 2016 12:28 pm

No problem atm.
Not sure if this is the right place, but currently using 3 extensions to manage links: This one, ELONW and Local URL To Text
Would be great to somehow combine them into a single extension with ACP to enable/disable features, will simplify the overhead.

Locked

Return to “Abandoned Extensions”

Who is online

Users browsing this forum: No registered users and 9 guests