Advertisement:

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

MrPhil

  • Guest
Re: Automatically Code a Link
« Reply #40 on: September 02, 2009, 12:29:29 PM »
Rohan, what are you trying to accomplish by turning URLs into [code] blocks? Are you trying to set off a link into something distinctive looking, or simply trying to keep them from turning into valid links? If the latter, the easiest way is to wrap them in [nobbc] tags. The next easiest way would be to modify SMF so that "bare" URLs without a [url] or [iurl] tag don't get turned into links. I haven't looked around, but there must be something in SMF to detect a URL and issue <a href="... you would just disable that feature. Do you want any "bare" URL (e.g., embedded in a sentence) to be so disabled, or just those all by themselves, one to a line?

I'm just trying to think if there may be an easier way to meet your objective than to detect all lone "bare" URLs and wrap [code] around them. If one could find the code in SMF to locate a bare URL and turn it into a link, I suppose it could instead be turned into a <span style="background-color: #CCCCFF; border: solid 1px black;">bare URL</span>. Of course, that would work in-line, but the box would not stretch clear across the page (maybe that could be done with some additional CSS in the style).

Offline Rohan_

  • Sophist Member
  • *****
  • Posts: 1,328
  • Gender: Male
  • I Love SMF :)
Re: Automatically Code a Link
« Reply #41 on: September 02, 2009, 05:32:49 PM »
MrPhil ... i need as i said .. please
Proud To Be An Indian

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,392
    • StoryBB/StoryBB on GitHub
Re: Automatically Code a Link
« Reply #42 on: September 02, 2009, 06:11:34 PM »
First up, a bare link is converted into [url][/url] tags in Subs.php.

So the first mod would be to convert url tags to not display as url tags, but display much like code tags.

Then the trick is to figure out how to unify them together. This is a modification that affects every aspect of the bbcode processing system, and if done incorrectly will break your forum very very badly.

I'm still not sure why you need this, but I'll add it to my to do list for 'sometime'. I cannot and will not guarantee a time, but I can guarantee it'll be a paid-for mod when I do it.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Rohan_

  • Sophist Member
  • *****
  • Posts: 1,328
  • Gender: Male
  • I Love SMF :)
Re: Automatically Code a Link
« Reply #43 on: September 02, 2009, 10:19:29 PM »
Arantor :( Please Big Bro i cant pay now i really dont have money online anywhere .. whenever i get money i will pay you .. Please Please do it for me ..
Proud To Be An Indian

Offline Joshua Dickerson

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,777
  • Gender: Male
    • joshuaadickerson on GitHub
    • joshuaadickerson on LinkedIn
Re: Automatically Code a Link
« Reply #44 on: September 03, 2009, 06:54:48 AM »
Stop begging. I am pretty sure he said NOT to bump him.
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?

Offline Rohan_

  • Sophist Member
  • *****
  • Posts: 1,328
  • Gender: Male
  • I Love SMF :)
Re: Automatically Code a Link
« Reply #45 on: September 03, 2009, 07:07:26 AM »
:(:(:(:( Please
Proud To Be An Indian

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,392
    • StoryBB/StoryBB on GitHub
Re: Automatically Code a Link
« Reply #46 on: September 03, 2009, 07:21:56 AM »
Rohan_, I specifically asked NOT to be bumped because I have other things on. Repeatedly posting in this thread won't make it happen any faster.

Please do NOT keep bumping this thread. I am not inviting further discussion on doing this at this time because no discussion is necessary. I will look at it as time permits, no sooner no matter how much you ask.

If you persist in asking I will lock this thread because it serves no purpose to keep bumping.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Rohan_

  • Sophist Member
  • *****
  • Posts: 1,328
  • Gender: Male
  • I Love SMF :)
Re: Automatically Code a Link
« Reply #47 on: September 03, 2009, 08:40:49 AM »
i didn't bumped in any post i just replied to other poster without quoting .. as a Friend or as a Younger Bro i just can request you . i cant do anything more than requesting . so i am saying again that please do this A S A P
Proud To Be An Indian

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,392
    • StoryBB/StoryBB on GitHub
Re: Automatically Code a Link
« Reply #48 on: September 20, 2009, 01:03:42 PM »
Are you still in need of this?

To be honest, I'm not sure of its purpose, but I think you would be able to achieve it by adding a quick check to Subs.php's parse_bbc function.

What exactly happens right now with your URL tags?
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Rohan_

  • Sophist Member
  • *****
  • Posts: 1,328
  • Gender: Male
  • I Love SMF :)
Re: Automatically Code a Link
« Reply #49 on: September 20, 2009, 03:18:35 PM »
they just convert in a clickable link .. but i want my links in code blocks ( also not clickable )
Proud To Be An Indian

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,392
    • StoryBB/StoryBB on GitHub
Re: Automatically Code a Link
« Reply #50 on: September 20, 2009, 04:39:09 PM »
So did you use the tips earlier in this thread to make them into code blocks?

I'm still not entirely sure what the benefit of doing this is, by the way.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Rohan_

  • Sophist Member
  • *****
  • Posts: 1,328
  • Gender: Male
  • I Love SMF :)
Re: Automatically Code a Link
« Reply #51 on: September 21, 2009, 12:15:45 AM »
what tips ? there is no way to do this yet
Proud To Be An Indian

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,392
    • StoryBB/StoryBB on GitHub
Re: Automatically Code a Link
« Reply #52 on: September 21, 2009, 02:54:42 AM »
Really?

Funny that, since I actually answered that point... um... 2 months ago.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Rohan_

  • Sophist Member
  • *****
  • Posts: 1,328
  • Gender: Male
  • I Love SMF :)
Proud To Be An Indian

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,392
    • StoryBB/StoryBB on GitHub
Re: Automatically Code a Link
« Reply #54 on: September 21, 2009, 03:29:39 AM »
My question was about moving individual links into code blocks, nothing more. Which as far as I can see the tips I already gave you would do just that.

Is that not the case?
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline SAFAD

  • Full Member
  • ***
  • Posts: 679
  • Gender: Male
  • away
    • أكاديمية صفد سوفت
Re: Automatically Code a Link
« Reply #55 on: September 21, 2009, 04:01:16 AM »
yes Arnator this is what i think he is talking about
else i think he wan't some css touches to make some cool boxs around the link
Best Regards
Sadaoui "SAFAD" Abderrahim - Lead Developer @ Electron Inc.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,392
    • StoryBB/StoryBB on GitHub
Re: Automatically Code a Link
« Reply #56 on: September 21, 2009, 04:05:50 AM »
Oh, I know what he wants. I'm just trying to work out if he's applied the first half of the tip that would simplify matters going forward.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline SAFAD

  • Full Member
  • ***
  • Posts: 679
  • Gender: Male
  • away
    • أكاديمية صفد سوفت
Re: Automatically Code a Link
« Reply #57 on: September 21, 2009, 04:09:11 AM »
You Are The Man  :)
P.S: Don't Even Think About It ;)
Best Regards
Sadaoui "SAFAD" Abderrahim - Lead Developer @ Electron Inc.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,392
    • StoryBB/StoryBB on GitHub
Re: Automatically Code a Link
« Reply #58 on: September 21, 2009, 04:12:32 AM »
The irony is that I still don't really understand the benefit or need, though I'm well aware of other sites that use something similar and can't help but wonder if it is for a particular style of site I do not care for.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Rohan_

  • Sophist Member
  • *****
  • Posts: 1,328
  • Gender: Male
  • I Love SMF :)
Re: Automatically Code a Link
« Reply #59 on: September 21, 2009, 06:15:09 AM »
Note you have to edit CODEBBC and make that code instead otherwise it doesn't get posted correctly. 


? u mean to change codebbc to code ?

and i think that code is for 2.0 but i am using 1
Proud To Be An Indian