News:

Wondering if this will always be free?  See why free is better.

Main Menu

Automatically Code a Link

Started by Rohan_, May 29, 2009, 05:05:11 PM

Previous topic - Next topic

kat

Well, they're clever in here, so you might just get lucky.  :)

Rohan_

thanx very much . i m waiting here 4 someone ;D
Proud To Be An Indian

Rohan_

Proud To Be An Indian

Arantor

#23
If you're using 2.0, find Sources/Subs.php, and find this block:


if (!isset($disabled['url']) && (strpos($data, '://') !== false || strpos($data, 'www.') !== false))
{
// Switch out quotes really quick because they can cause problems.
$data = strtr($data, array(''' => '\'', '&nbsp;' => $context['utf8'] ? "\xC2\xA0" : "\xA0", '&quot;' => '>">', '"' => '<"<', '&lt;' => '<lt<'));
$data = preg_replace(array('~(?<=[\s>\.(;\'"]|^)((?:http|https|ftp|ftps)://[\w\-_%@:|]+(?:\.[\w\-_%]+)*(?::\d+)?(?:/[\w\-_\~%\.@,\?&;=#+:\'\\\\]*|[\(\{][\w\-_\~%\.@,\?&;=#(){}+:\'\\\\]*)*[/\w\-_\~%@\?;=#}\\\\]?)~i', '~(?<=[\s>(\'<]|^)(www(?:\.[\w\-_]+)+(?::\d+)?(?:/[\w\-_\~%\.@,\?&;=#+:\'\\\\]*|[\(\{][\w\-_\~%\.@,\?&;=#(){}+:\'\\\\]*)*[/\w\-_\~%@\?;=#}\\\\])~i'), array('[url]$1[/url]', '[url=http://$1]$1[/url]'), $data);
$data = strtr($data, array('\'' => ''', $context['utf8'] ? "\xC2\xA0" : "\xA0" => '&nbsp;', '>">' => '&quot;', '<"<' => '"', '<lt<' => '&lt;'));
}


Replace it with:

if (!isset($disabled['url']) && (strpos($data, '://') !== false || strpos($data, 'www.') !== false))
{
// Switch out quotes really quick because they can cause problems.
$data = strtr($data, array(''' => '\'', '&nbsp;' => $context['utf8'] ? "\xC2\xA0" : "\xA0", '&quot;' => '>">', '"' => '<"<', '&lt;' => '<lt<'));
$data = preg_replace(array('~(?<=[\s>\.(;\'"]|^)((?:http|https|ftp|ftps)://[\w\-_%@:|]+(?:\.[\w\-_%]+)*(?::\d+)?(?:/[\w\-_\~%\.@,\?&;=#+:\'\\\\]*|[\(\{][\w\-_\~%\.@,\?&;=#(){}+:\'\\\\]*)*[/\w\-_\~%@\?;=#}\\\\]?)~i', '~(?<=[\s>(\'<]|^)(www(?:\.[\w\-_]+)+(?::\d+)?(?:/[\w\-_\~%\.@,\?&;=#+:\'\\\\]*|[\(\{][\w\-_\~%\.@,\?&;=#(){}+:\'\\\\]*)*[/\w\-_\~%@\?;=#}\\\\])~i'), array('[CODEBBC]$1[/CODEBBC]', '[CODEBBC]$1[/CODEBBC]'), $data);
$data = strtr($data, array('\'' => ''', $context['utf8'] ? "\xC2\xA0" : "\xA0" => '&nbsp;', '>">' => '&quot;', '<"<' => '"', '<lt<' => '&lt;'));
}


Note you have to edit CODEBBC and make that code instead otherwise it doesn't get posted correctly.

Rohan_

i am using 1.1.8 ......

please read my post in this topic that what i want
Proud To Be An Indian

Arantor

First up, don't use 1.1.8, it has a security hole. Secondly I'm sorry I didn't read every single post in this thread, I thought I'd just try and answer it quickly for you.

However if you checked Subs.php you'd actually find that the code is the same. I did fix the posting error in my post above which would make it easier for you.

Rohan_

is that do like this ..

if someone posts links without hitting enter after every link like this

www.a.com
www.a.com

these are the links  without space so i want them in single code block  like this
www.a.com
www.a.com


and if someone post link with hitting enter like this

www.a.com

www.a.com

there is space after every link so i want them in different code blocks like this
www.a.com

www.a.com
Proud To Be An Indian

Arantor

That's not what you asked for earlier on unless I really really misread you.

And is a *lot* more work.

Rohan_

is this possible :( ..

my friend have a vb forum and if i post a link there so it automatically changes in codes like i said earlier
Proud To Be An Indian

Arantor

Oh it's possible, but is an awful lot of work. And I do mean a *lot* of work.

I don't have time right now to sit and write the code to come up with this.

Rohan_

hmm okay ill wait for ur time ... whenever u get time do this for me .. i am waiting :)

and thanks a ton for helping me in my lot of topics
Proud To Be An Indian

[SiNaN]

They are each different links, no matter there is a space, line break or something different. You need to spend a reasonable amount of time to achieve it and I -personally- don't think it is worth to it. You may want to try Help Wanted (not for support) board.
Former SMF Core Developer | My Mods | SimplePortal

Rohan_

ok so i updated to 1.1.9 now .. any other way to get this option or we have to leave it ??
Proud To Be An Indian

[SiNaN]

Former SMF Core Developer | My Mods | SimplePortal

Rohan_

Please help me .. now i am really in need for this feature .. i am giving a example again .. please help me

example .. if i post www.abc.com so it must be coded in single code box like this
www.abc.com

if i post www.abc.com
www.abc.com
www.abc.com
so i want these 3 links in single box too like this
www.abc.com
www.abc.com
www.abc.com


and if i post like
www.abc.com
and mirror
www.abc.com

so now the links got a text between then now i want them in diff boxes but and mirror not to be coded .. like this
www.abc.com
and mirror
www.abc.com

There are lot of SMF users who wants this feature .. so dont think you are doing this only for me .. i promise you will get a big thanks from a lot of people
Proud To Be An Indian

Arantor

This would be a big job to do reliably.

I may take a look at this - but NOT for a while, please do not bump me about it because if I do it, it will probably be a paid-for mod, given how much work I think will be involved in doing it.

Rohan_

Arantor Please Please do this for me .. u do a lot of work here .. this is the big thing that i needed in my forum i really need this .. just do this for me i dont want any other helps about my forum .. i will not disturb u again .. and i am very sorry i really can't pay because i dont have any way to pay online . there are a lot of SMF users who want this feature not only me.. PLease Do this PLEASE i Beg you
Proud To Be An Indian

Joshua Dickerson

Come work with me at Promenade Group



Need help? See the wiki. Want to help SMF? See the wiki!

Did you know you can help develop SMF? See us on Github.

How have you bettered the world today?

Rohan_

Proud To Be An Indian

Rohan_

Arantor .. You helped me a lot .. just this one more .. i am starting to add ads and donation system in my site and my site is getting popular .. whenever i get money i promise i will give you 100$ .. its my promise for all your help :) Please do this
Proud To Be An Indian

Advertisement: