[ABD] Shorten URL's for forum links

Any abandoned MODs will be moved to this forum.

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

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
User avatar
topdown
Registered User
Posts: 635
Joined: Wed Sep 19, 2007 5:16 pm
Location: NE Wisconsin
Name: Jeff Behnke
Contact:

[ABD] Shorten URL's for forum links

Post by topdown » Wed May 19, 2010 5:50 pm

Modification Name: [Dev] Shorten URL's for forum links
Author: topdown

Modification Description:: This mod will allow you the option of using URL shortening for your topic and post links.
For instance, http://www.example.com/forums/viewtopic ... 3&t=831813 (60 characters) might be abbreviated to http://example.com/nyf9b
Current plan is 2 API options tinyurl and bitly..

Modification Version: In development

Requirements: cUrl required, PHP5 may be required

Features: Feature List
  • ACP Options
  • On/Off options
  • Topics & Posts or just one
  • API options tinyurl and bitly, possibly more if requested
  • More to come
Modification Repository: http://github.com/topdown/phpbb_mods/tree/shorty_url
Last edited by topdown on Thu May 20, 2010 5:49 am, edited 3 times in total.

User avatar
topdown
Registered User
Posts: 635
Joined: Wed Sep 19, 2007 5:16 pm
Location: NE Wisconsin
Name: Jeff Behnke
Contact:

Re: [Dev] Shorten URL's for forum links

Post by topdown » Wed May 19, 2010 5:52 pm

If there are any other popular API's that you would like in this, please post them below and I will consider adding them as options.
They must have an accessible API..

User avatar
heredia21
Registered User
Posts: 942
Joined: Sun Apr 18, 2010 6:14 pm
Contact:

Re: [Dev] Shorten URL's for forum links

Post by heredia21 » Wed May 19, 2010 6:58 pm

Cant wait. This should be huge. Because the current/default urls are way too long. I think bit.ly urls would be ideal.
Best BlackBerry website for all users! BlackBerry News - http://blackberryempire.com

User avatar
Dog Cow
Registered User
Posts: 2495
Joined: Fri Jan 28, 2005 12:14 am
Contact:

Re: [Dev] Shorten URL's for forum links

Post by Dog Cow » Fri May 21, 2010 5:57 pm

topdown wrote:other popular API's that you would like in this, please post them below and I will consider adding them as options.
Yeah. Make your own. Don't rely on some external service. Make a new db table called short_urls, with hash_id, url, and a two-column index.

SELECT hash_id, url FROM short_urls WHERE hash_id = 'foo'
Moof!
Mac GUI Vault: Retro Apple II & Macintosh computing archive.
Inside Allerton bookMac GUIMac 512K Blog

User avatar
bonelifer
Community Team Member
Community Team Member
Posts: 3479
Joined: Wed Oct 27, 2004 11:35 pm
Name: William
Contact:

Re: [Dev] Shorten URL's for forum links

Post by bonelifer » Fri May 21, 2010 8:05 pm

It would be nice if it could support urlShort or YOURLS, so that users can control their short url's locally.

This one is very simple:
http://mavrev.org/urlshort/

Must more advanced:
http://yourls.org/
Knowledge Base | phpBB Board Rules | Search Customisation Database
Image
Please don't contact me via PM or email for phpBB support .

Glodenox
Registered User
Posts: 23
Joined: Tue Feb 24, 2009 7:29 pm

Re: [Dev] Shorten URL's for forum links

Post by Glodenox » Sat May 22, 2010 10:01 am

I've set up something similar for a board that I manage, apart from hashing the topic number. I've put it under a subdomain like this: t.server.com (t = topics). That subdomain is just a directory on the server, where I've put an index.php file which contains this content (and of course some other content as well, but it hasn't been made so it can be re-used, so this is all you'll get - at least for now):

Code: Select all

if ($topic_id != 0)
{
	$sql = "SELECT topic_id, forum_id
		FROM phpbb_topics
		WHERE topic_id = $topic_id";
	$result = $db->sql_query($sql);
	if ($db->sql_affectedrows() == 0)
	{
		trigger_error('NO_TOPIC');
	}
	else
	{
		$topic_data = $db->sql_fetchrow($result);
		if ($topic_data['forum_id'] == 0)
		{
			header("Location: http://[insert URL to forum here]/viewtopic.php?t={$topic_data['topic_id']}");
		}
		else
		{
			header("Location: http://[insert URL to forum here]/viewtopic.php?f={$topic_data['forum_id']}&t={$topic_data['topic_id']}");
		}
	}
}
else
{
	trigger_error('NO_TOPIC');
}
And with this bit of .htaccess I manage to redirect all requests to that subdomain (so basically to that directory on the site) towards the index.php:

Code: Select all

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
If it's of any use to you, feel free to use it. If there are any comments to my approach, feel free to say them :) I know it's a bit dirty code, but it does the trick and that was all that I needed back then.

Greeting,
Glodenox

User avatar
ac_roma
Registered User
Posts: 307
Joined: Thu Mar 08, 2007 2:48 pm
Location: egypt,alexandria
Contact:

Re: [Dev] Shorten URL's for forum links

Post by ac_roma » Sat May 22, 2010 12:00 pm

it's very good mod and useful too much

i will test it

thanks :)

myju
Registered User
Posts: 105
Joined: Wed Feb 03, 2010 1:54 am
Location: Dublin, Ireland.
Contact:

Re: [Dev] Shorten URL's for forum links

Post by myju » Fri May 28, 2010 7:39 pm

I'm very much looking forward to this mod. I think it'll be a very popular mod as short urls are all the rage now with twitter.

Suggestion: It would be great if the user can click on an image and it automatically fast shares the topic/post to their twitter/facebook. Senky's Share Topic mod does this but at present it doesn't shorten the urls, so maybe integrating the relevant code from the Share Topic code into this mod would be great.

User avatar
topdown
Registered User
Posts: 635
Joined: Wed Sep 19, 2007 5:16 pm
Location: NE Wisconsin
Name: Jeff Behnke
Contact:

Re: [Dev] Shorten URL's for forum links

Post by topdown » Fri May 28, 2010 8:01 pm

That is actually a bit backwards :)

They would integrate this mod in theirs as this mod is a utility for the board and other mods.
It will be simple for them to integrate when it's finished.

I will hopefully have the first alpha ready soon.

TfH
Registered User
Posts: 5
Joined: Mon May 10, 2010 4:37 am

Re: [Dev] Shorten URL's for forum links

Post by TfH » Sat May 29, 2010 8:49 pm

This is interesting, will test this out. I have been thinking using some freeware script, but this sounds cooler.

myju
Registered User
Posts: 105
Joined: Wed Feb 03, 2010 1:54 am
Location: Dublin, Ireland.
Contact:

Re: [Dev] Shorten URL's for forum links

Post by myju » Mon May 31, 2010 1:21 am

topdown wrote:That is actually a bit backwards :)

They would integrate this mod in theirs as this mod is a utility for the board and other mods.
It will be simple for them to integrate when it's finished.

I will hopefully have the first alpha ready soon.
Thanks for the reply Jeff, sounds great. 8-)

User avatar
ameisez
Registered User
Posts: 1166
Joined: Sun Nov 04, 2007 7:04 am

Re: [Dev] Shorten URL's for forum links

Post by ameisez » Wed Jun 02, 2010 8:39 am

Feature request.

Make the urls domain intelligent so that all internal urls (within phpbb install) will remain intact even if the domain has changed or phpbb folder was moved.

A link counter will also be nice to show how many times the link was clicked. Permission based is better so that admin can select who sees the counter

:)
PHPBB on HOSTGATOR SERVER. MY PERSONAL CHOICE ;)
Need phpBB images and buttons? HIRE ME
my MOD: BB3 Media Player | a phpbb based media player

User avatar
Eragon
Registered User
Posts: 218
Joined: Tue Oct 07, 2008 1:57 pm

Re: [Dev] Shorten URL's for forum links

Post by Eragon » Sun Sep 05, 2010 12:55 pm

bump - any news ?

User avatar
Neuropass
Registered User
Posts: 1158
Joined: Fri Apr 17, 2009 2:02 pm
Location: SciTE4AutoIt3

Re: [Dev] Shorten URL's for forum links

Post by Neuropass » Thu Dec 16, 2010 4:06 am

bump

TwiztedIndian
Registered User
Posts: 53
Joined: Sat Dec 27, 2008 8:25 pm

Re: [Dev] Shorten URL's for forum links

Post by TwiztedIndian » Tue Apr 26, 2011 10:00 pm

I would imagine since its almost been a year since the developers last post that his is abandoned. Unfortunate.

I'm looking for a way to integrate YOURLS into phpbb or something similar to YOURLS

Locked

Return to “[3.0.x] Abandoned MODs”