Automatically Code a Link

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

Previous topic - Next topic

Rohan_

Please tell me how can i do this.. i wanna make a setting that if anyone post a url it automatically can change in code not in a link:) i am using 1.1.8
Proud To Be An Indian

MrPhil

I'm not quite following your request. Could you give an example of how you would like this to work?

Mraza

you mean if somebody will type like this :

http://www.simplemachines.org

it will become like this:

http://www.simplemachines.org


????
Signature:
Old Software Engineers Never Dies, They Just Log Out...
! ! ! ! ! 5 Best Movies Thread ! ! ! ! !

Rohan_

yeah mraza i want like this .. if anyone post a url e.g www.abc.com it will convert to www.abc.com automatically .... how can i do this ?
Proud To Be An Indian

kat

Simple. Use the "Censored words" feature.  :)

You'd probably have to make quite a few entries, though.

MrPhil

Whenever someone types in a URL that would otherwise automatically be made into a link, you want to 1) turn it into a CODE block per your example, or 2) just suppress its turning into a link and leave it as plain text? I don't know of any built-in way to do either, but it should be possible for a mod that does either.

If you want to do it on a case-by-case basis, [nobbc]www.abc.com[/nobbc] may do the job for you. If you want all cases not changed into links, it will probably require a mod.

kat

I was thinking along the lines of substituting "http://" with "{code}http://" and ".com" with ".com{code}" and the like.

Depends how far you want to take that, I guess.

They do that kinda thing on wa*ez sites.



Or, so I'm told. ;)

NHWD


Mraza

Signature:
Old Software Engineers Never Dies, They Just Log Out...
! ! ! ! ! 5 Best Movies Thread ! ! ! ! !

greyknight17

Rohan_, did you try the above mentioned mod? It seems to be exactly what you need.

I will mark this topic as solved. If you still have problems, feel free to mark it as unresolved again.

Rohan_

thats not exactly i  want ...

i want if the links are like this ..

www.abc.com
www.abc.com
www.abc.com
www.abc.com

... see there is no space after a link line they are continues so i want them in a single code block . and if someone posts like this


www.abc.com

www.abc.com

www.abc.com

.. so i want these in different code blocks coz there is space after every url
Proud To Be An Indian

Rohan_

Proud To Be An Indian

kat

I really don't understand, at all.

Mind you, being old, posts without punctuation confuse me, anyway. ;)

Rohan_

hey i mean 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

kat

If I've got you right, I think I'd still use censored words.

If you substitute, say "www." with "{code}www." (Using squared brackets, obviously) and ".com" with ".com{/code}", that would work, I think.

Obviously, you'd have to cover .org sites and any others you might use.

Rohan_

noo it cant work coz if the link is
http://rapidshare.com/files/250895851/xxxxxxxx.xxx

so its not come in code block ....

ok just give me a trick to code all my links in a single block . like this

www.a.com
www.a.com
www.a.com

TO

www.a.com
www.a.com
www.a.com
Proud To Be An Indian

kat

#16
Without some coding, I don't think you can.

If you run the sort of forum that I think you do, it might be better to use this:

http://custom.simplemachines.org/mods/index.php?mod=228

You'll still need to make your members use it, though.

EDIT:

Aren't RS links all ended with "html"?

If so, you could still use the censoring, to achieve that.

Rohan_

RS links end with the extension of the file we upload ..

its not only the RS matter .. there are lot of File Hosts ..

my friend haves a Vb forum  and when i post a link it will automatically get coded .. i want that in my smf .. please find a way . thanks
Proud To Be An Indian

kat

Actually, I think you're most likely to get the help you want in the coding board.

http://www.simplemachines.org/community/index.php?board=60.0

Want me to move this to that board, for you?

Rohan_

i dont know about that move it if u like .. i just need that option :) and u are the boss
Proud To Be An Indian

Advertisement: