Automatically Code a Link

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

Previous topic - Next topic

Rohan_

so now ... is it possible to have a function exactly that i requested ?
Proud To Be An Indian

SAFAD

Hmm
if you asked
link
yay
link

yes we can

but

link
link
link

it will take a huge amount of sufring in hell :)
Best Regards
Sadaoui "SAFAD" Abderrahim - Lead Developer @ Electron Inc.

Arantor

It comes back to whether you've implemented what I originally posted and the HTML it generates.
Holder of controversial views, all of which my own.


SAFAD

Best Regards
Sadaoui "SAFAD" Abderrahim - Lead Developer @ Electron Inc.

Rohan_

#84
any chance ..


can we make a code using <br /> ??? if there is a break then make diff code box and if not then make single
Proud To Be An Indian

Arantor

Like everything else it's just not as simple as that since <br /> is added for every line break everywhere in every post that contains an end of line. As I have told you repeatedly this is not a simple change.

It is also one that I cannot see having uses much outside black hat websites and have NO interest in writing or supporting.
Holder of controversial views, all of which my own.


Rohan_

ohh so you are not helping in this topic .. okay then
Proud To Be An Indian

ɔɔɔɔɔɔuɥoɾ

Sorry to bump an old topic.

but..

This would be interesting to try to make actually, not because of why its been used, but simply because its kinda difficult.

I personally think messing around with the tag settings is not the route to go by.

If this is going to work, its going to have to be something that detects links regardless of bbcode.

Something that would scan for the 1st  and last instance of "http://" then add the bbc tag at the beginning of the 1st detection and the end of the last one, but of course with the last one, it would have to wait until it reaches the end of the whole link, maybe it can wait for empty space before adding the tag.

Messing with the tag will always code 1 for 1, you could just get the whole code tag array paste it over the url array then change 'code' to 'url', which would result in every link been coded separately.


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Arantor

Quote from: ♪ JohnCcCcCc ♫ on October 17, 2009, 04:38:57 PM
If this is going to work, its going to have to be something that detects links regardless of bbcode.

Except that there is already detection for this, and they are all wrapped into [url] tags.

Meaning you will be doing it based on code tags whatever. The trick is to figure out when you should collapse the tags or not.
Holder of controversial views, all of which my own.


ɔɔɔɔɔɔuɥoɾ

Well we could disable the auto detection then...
Surely it can be done with a simple find and replace script, for the opening code tag anyway, as for the closing one will be more difficult as the end of links vary, thats where a "next empty space" detection would come into play.


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Arantor

You could do, I suppose, not that I'd encourage that particularly.

But I think you misunderstand how the system works.

IIRC the process correctly, bare URLs are converted at post-time and stored with url tags around them, then it's all displayed at display time separately. Of course, you could examine Post.php and Subs.php yourself to see.
Holder of controversial views, all of which my own.


ɔɔɔɔɔɔuɥoɾ

QuoteIIRC the process correctly, bare URLs are converted at post-time andstored with url tags around them, then it's all displayed at displaytime separately. Of course, you could examine Post.php and Subs.phpyourself to see.

hmm...

Ok I got it.

the URL tags are auto added, so, we run find and replace script to find 1st instance of and last instance of and have them replaced with the opening and closing tags.

Then another find and replace script, to find any remaining or and replace with nothing.

If that's not too much of a time consuming or server hogging process, it should work.

Of course, with every solution there a flaws, like what if someone had 2 sets of multi line links, they all would be coded together.


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Arantor

The idea isn't to replace url with code, btw. You can just make it look the same.

The trick then becomes identifying [/url]end-of-line[url].
Holder of controversial views, all of which my own.


ɔɔɔɔɔɔuɥoɾ

hmm

If we code urls, with the tag we will get.
[url]http://www.something.com[/url]

it would look messy

as apposed to:
http://www.something.com

If we simply change the the code tag array into url array multi-line would not work, not automatically anyway.
http://www.something.com
http://www.something.com
http://www.something.com
http://www.something.com
instead of
http://www.something.com
http://www.something.com
http://www.something.com
http://www.something.com


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Arantor

Then you completely missed the earlier part of this topic. I already dealt with NOT turning url directly to code tags such that they never, ever have 'Code: [select]' at the top.

The trick, as I said two or three pages back, is how to figure out the problem of URL tags being one per line and thus grouped together, which is as I said, finding [/tag]end-of-line[tag]
Holder of controversial views, all of which my own.


ɔɔɔɔɔɔuɥoɾ

Hold on...
This is solved already?
I saw your code in earlier page, but since the topic was going on a few pages after and its not marked as solved, I assumed it was not solved.


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Arantor

The *first* part is solved, making URLs appear in code-like blocks.

The *second* part of folding multiple URLs together is not, as I said a few posts back.

I would note that the reason I refused to develop this was that it was for a warez site.
Holder of controversial views, all of which my own.


ɔɔɔɔɔɔuɥoɾ

oh well,
The 1st part is easy, I mean, like said, just make a replica code array and change to url, simple.

Folding them into on code tag well, this is why i believe its best not to use the tag changing approach, maybe something else can do this without modifying any tags, except for the auto adding url tags.

Oh, and I'm not looking for this to be developed either, I'm just interested in how this can be pulled off :D

I mean, lets see here, would there be away to make it happen without changing any tag settings, besides the one that auto adds the URL tag, I think there could be a way, but at my level, I'm a big distance from figuring it out.


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Arantor

Quote from: ♪ JohnCcCcCc ♫ on October 17, 2009, 06:01:42 PM
oh well,
The 1st part is easy, I mean, like said, just make a replica code array and change to url, simple.

No, just change the URL to act like code. FAR less messy.

Quote
Folding them into on code tag well, this is why i believe its best not to use the tag changing approach, maybe something else can do this without modifying any tags, except for the auto adding url tags.

Believe me, it's by FAR the simplest method.

Quote
I mean, lets see here, would there be away to make it happen without changing any tag settings, besides the one that auto adds the URL tag, I think there could be a way, but at my level, I'm a big distance from figuring it out.

Not without rewriting parse_bbc completely.
Holder of controversial views, all of which my own.


ɔɔɔɔɔɔuɥoɾ

Damn  :-\
Oh well, we'll have to wait until someone has time to figure this whole thing out.


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Advertisement: