SimplePortal
Development => Feature Requests => Topic started by: TigPT on January 13, 2010, 08:29:41 PM
-
First of all, gratz for your great work.
Would be great if you could add a auto tiny url converter like tiny url or goo.gl service so che urls past in the chat box don't become so borring in space and sometimes breaking the layout.
Anyone else think that this will be a interesting feature?
Anyone know if it will be easy to implement and want to start it?
(sadly i don't have know-how for that so i do my best with brainstorming :))
-
Really there is no need to use an external service like tinyurl. Instead you could just replace the link with the text link (e.g link (http://www.simpleportal.net))
I think this'd be a good idea though
-
Making a mod for this now. Will most likely be added to the next version of SP.
-
thanks for the feedback. Think it will be a lot interesting.
-
This should work fine. The only thing it doesn't do is update with AJAX. So when you first post with AJAX you won't see the link converted however everyone else would and you will once the page is loaded again.
Package attached.
EDIT: removed package, was broken.
-
Think that will be very good for now. Just bad that i installed it and it seems to not be working.
Installed all fine but when i past a big url like this one it keeps the same.
http://lusorobotica.com/index.php/topic,1908.0.html
-
You need to set it in the shoutbox settings btw.
I probably should have mentioned that...
-
You need to set it in the shoutbox settings btw.
I probably should have mentioned that...
I did inserted the url "link" in the settings, but it replaces de url too.
Check out our checkbox:
http://lusorobotica.com/index.php
And as i can look at code, it looks like it only will work for inside links, and not for external ones. Am i right?
-
Ah crap. I have the same problem. I'll quickly fix it...
-
No problem. Thats why we are a community, to help each others.
Thanks a lot for being development a feature that i would like but can't do myself :P
-
It is a problem with my REGEX. I'm too tired to fix it now, I'll just make more mistakes. Should be done by this time tomorrow though.
*goes to sleep*
-
Sure, sleep well.
-
Ok this should work fine now...
Attached.
-
I'm getting a error installing the package:
. Adicionar Depois ./Sources/Subs-Portal.php Teste falhado
Encontrar [Seleccione]
while ($row = mysql_fetch_assoc($request))
{
Adicionar Depois [Seleccione]
// Convert links...
if (!empty($parameters['link']))
$row['body'] = preg_replace('#(([a-zA-Z]+://)([a-zA-Z0-9?&%.;:/=+_-]*))#', '' . $parameters['link'] . ' (http://$1)', $row['body']);
-
*sigh*
Can you translate that for me?
-
Translation
. Add after ./Sources/Subs-Portal.php Test Faild
Find [Seleccione]
while ($row = mysql_fetch_assoc($request))
{
Add after [Seleccione]
// Convert links...
if (!empty($parameters['link']))
$row['body'] = preg_replace('#(([a-zA-Z]+://)([a-zA-Z0-9?&%.;:/=+_-]*))#', '' . $parameters['link'] . ' (http://$1)', $row['body']);
-
Oh you are on an old version of Simple Portal? This mod is only tested on SMF 2.0 RC2 + SP 2.3.1 and SMF 1.1.11 + SP 2.3.1
-
I'm running SMF 2.0 RC2 and SP 2.3.1
http://lusorobotica.com/
-
Hmmm, I will have another look at it tonight. Actually looking at your post I think it might be a simple typo. I'll get onto it as soon as possible.
*hates making stupid mistakes*
-
Although it can be optimized more, this should do it:
./Sources/Subs-Portal.php
$shouts[$shout['id']]['text'] = censorText($shouts[$shout['id']]['text']);
$shouts[$shout['id']]['text'] = censorText($shouts[$shout['id']]['text']);
$shouts[$shout['id']]['text'] = preg_replace('~<a([^>]+>)([^<]+)</a>~', '<a$1[link]</a>', $shouts[$shout['id']]['text']);
-
it looks like that ajax was in infinit loop and my hosting team shouted down the server due to the extreme bandwith consuption. :|
Any help on how to remove it is apreciated ;)
-
HostGator worked very well and the server is back on. I disabled the shoutbox for now, and backuped everything in order to format and reinstall.
Need it as fresh as possible so i will not be testing this new mod in the working copy of it :P
By the way, don't use it for now since it have that bug in the ajax causing a infinit loop of calls.
-
Although it can be optimized more, this should do it:
./Sources/Subs-Portal.php
$shouts[$shout['id']]['text'] = censorText($shouts[$shout['id']]['text']);
$shouts[$shout['id']]['text'] = censorText($shouts[$shout['id']]['text']);
$shouts[$shout['id']]['text'] = preg_replace('~<a([^>]+>)([^<]+)</a>~', '<a$1[link]</a>', $shouts[$shout['id']]['text']);
Yeah I was going to do that but I am shit at regex and took the lazy way out.
-
HostGator worked very well and the server is back on. I disabled the shoutbox for now, and backuped everything in order to format and reinstall.
Need it as fresh as possible so i will not be testing this new mod in the working copy of it :P
By the way, don't use it for now since it have that bug in the ajax causing a infinit loop of calls.
I don't think it is infinite AJAX loops, but might be this:
http://simpleportal.net/index.php?topic=4126.msg26219#msg26219
In any case, please start a new topic about your issue.