Advertisement:

Author Topic: Automatically Code a Link  (Read 20982 times)

Offline Rohan_

  • Sophist Member
  • *****
  • Posts: 1,328
  • Gender: Male
  • I Love SMF :)
Automatically Code a Link
« on: May 29, 2009, 05:05:11 PM »
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

  • Guest
Re: Automatically Code a Link
« Reply #1 on: May 29, 2009, 07:40:45 PM »
I'm not quite following your request. Could you give an example of how you would like this to work?

Offline Mraza

  • Full Member
  • ***
  • Posts: 510
  • Gender: Male
  • I ♥ SMF
Re: Automatically Code a Link
« Reply #2 on: May 29, 2009, 07:46:52 PM »
you mean if somebody will type like this :

http://www.simplemachines.org

it will become like this:
Code: [Select]
http://www.simplemachines.org
????
Signature:
Old Software Engineers Never Dies, They Just Log Out...
! ! ! ! ! 5 Best Movies Thread ! ! ! ! !

Offline Rohan_

  • Sophist Member
  • *****
  • Posts: 1,328
  • Gender: Male
  • I Love SMF :)
Re: Automatically Code a Link
« Reply #3 on: May 30, 2009, 05:00:17 PM »
yeah mraza i want like this .. if anyone post a url e.g www.abc.com it will convert to
Code: [Select]
www.abc.com automatically .... how can i do this ?
Proud To Be An Indian

kat

  • Guest
Re: Automatically Code a Link
« Reply #4 on: May 30, 2009, 05:16:46 PM »
Simple. Use the "Censored words" feature.  :)

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

MrPhil

  • Guest
Re: Automatically Code a Link
« Reply #5 on: May 30, 2009, 05:39:32 PM »
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

  • Guest
Re: Automatically Code a Link
« Reply #6 on: May 30, 2009, 05:47:53 PM »
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. ;)

Offline NHWD

  • Jr. Member
  • **
  • Posts: 304
Re: Automatically Code a Link
« Reply #7 on: May 30, 2009, 06:31:22 PM »
theres already a mod that does tha for you
http://custom.simplemachines.org/mods/index.php?mod=1724

Offline Mraza

  • Full Member
  • ***
  • Posts: 510
  • Gender: Male
  • I ♥ SMF
Re: Automatically Code a Link
« Reply #8 on: May 30, 2009, 09:23:37 PM »
Signature:
Old Software Engineers Never Dies, They Just Log Out...
! ! ! ! ! 5 Best Movies Thread ! ! ! ! !

Offline greyknight17

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 14,890
  • Gender: Male
    • Kevin's Resource Center
Re: Automatically Code a Link
« Reply #9 on: June 29, 2009, 07:27:35 PM »
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.

Offline Rohan_

  • Sophist Member
  • *****
  • Posts: 1,328
  • Gender: Male
  • I Love SMF :)
Re: Automatically Code a Link
« Reply #10 on: June 30, 2009, 04:58:16 AM »
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

Offline Rohan_

  • Sophist Member
  • *****
  • Posts: 1,328
  • Gender: Male
  • I Love SMF :)
Re: Automatically Code a Link
« Reply #11 on: July 02, 2009, 05:56:57 AM »
please help me
Proud To Be An Indian

kat

  • Guest
Re: Automatically Code a Link
« Reply #12 on: July 02, 2009, 09:50:33 AM »
I really don't understand, at all.

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

Offline Rohan_

  • Sophist Member
  • *****
  • Posts: 1,328
  • Gender: Male
  • I Love SMF :)
Re: Automatically Code a Link
« Reply #13 on: July 02, 2009, 02:32:56 PM »
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
Code: [Select]
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
Code: [Select]
www.a.com
Code: [Select]
www.a.com
Proud To Be An Indian

kat

  • Guest
Re: Automatically Code a Link
« Reply #14 on: July 02, 2009, 02:37:44 PM »
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.

Offline Rohan_

  • Sophist Member
  • *****
  • Posts: 1,328
  • Gender: Male
  • I Love SMF :)
Re: Automatically Code a Link
« Reply #15 on: July 02, 2009, 03:20:47 PM »
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

Code: [Select]
www.a.com
www.a.com
www.a.com
Proud To Be An Indian

kat

  • Guest
Re: Automatically Code a Link
« Reply #16 on: July 02, 2009, 03:55:54 PM »
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.
« Last Edit: July 02, 2009, 04:08:11 PM by Kat »

Offline Rohan_

  • Sophist Member
  • *****
  • Posts: 1,328
  • Gender: Male
  • I Love SMF :)
Re: Automatically Code a Link
« Reply #17 on: July 02, 2009, 04:28:24 PM »
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

  • Guest
Re: Automatically Code a Link
« Reply #18 on: July 02, 2009, 04:46:25 PM »
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?

Offline Rohan_

  • Sophist Member
  • *****
  • Posts: 1,328
  • Gender: Male
  • I Love SMF :)
Re: Automatically Code a Link
« Reply #19 on: July 02, 2009, 05:40:23 PM »
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