vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Extended auto-linker (adds ed2k and sip link recognition) (https://vborg.vbsupport.ru/showthread.php?t=100008)

Symen_4ab 01-05-2006 10:18 AM

The main problem is before the parsing, actually !
If you post an ed2k link with brackets, it will not be parsed at all.

If think the regex used is the cause of this, but as I said, I am lost when it comes to regular expressions.

MRGTB 01-05-2006 10:33 AM

Well I'm not sure if this helps or not.

But I do have ed2k links working on my site no matter if they contain "[]" or not using a simple vBCode command. Of course it will not display the file name, let you add your tag, or even show the file size like this hacks does which is what we want.

But it does work and this is the vBCode I use if it can help this hack in anyway, plus all link using the vBCode way open in the same browser window.

---------------------

Title
ed2k Link

Tag
ed2k

Replacement
PHP Code:

<img src="http://www.garybolton.co.uk/vb/images/editor/ed2k.gif"> <a href="{param}" target="_self"><b>Add ed2k link</b></a

Example
[ed2k]ed2k link goes here[/ed2k]

You have to also disable WORD WRAP length in the vB Options to "0". Otherwise spaces will be inserted into the links due to there long length when word wrap is enabled (which are most). Otherwise most links won't works because word wrap will insert spaces into the links. But that get fixed with it set to "0".

---------------------

While this works with all links that use thr "[]" and opens them in the same browser window, it's only a very basic way to get them working. (maybe java code could be used also in vBCode to add more). But it's no were near what we want.

This hack is good because it enables you to add your own TAG to the file names to advertise your site, as well as showing the file size and file name correctly. Plus there is no need to have to use a [ed2k] tag to post the links.

Symen_4ab 01-05-2006 11:38 AM

Thanks for sharing the bb code Gary, but I would prefer to kame this hack works (but I will make the ed2k tag available as an alternative, for sure !)

I just quit testing different things, and it appears that only the opening bracket poses problems.
I tried to modify some things in the regexp, but it's just too complicated for me :(

edit : The @ character is also a problem, as it sees a part of the link as an email adress

MRGTB 01-05-2006 12:08 PM

Quote:

Originally Posted by Symen_4ab
Thanks for sharing the bb code Gary, but I would prefer to kame this hack works (but I will make the ed2k tag available as an alternative, for sure !)

I just quit testing different things, and it appears that only the opening bracket poses problems.
I tried to modify some things in the regexp, but it's just too complicated for me :(

edit : The @ character is also a problem, as it sees a part of the link as an email adress

Same here, I'm not a coder and all that regex stuff is way over my head. Another problem though is the plugin seems to use vBulletins default setting of opening the links in a new browser window also, which is a real no no really.

Because if you had lets say 5 ed2k links in a thread which you clicked. It would mean you having to close 5 new browser windows after. Which is why they have to open in the same browser window just like the phpbb ed2k hacks do to avoid that.

That can be done using a vBCode because of the "target="_self" command. I'm just looking at javascript now to see if that can be used to expand the ed2k vBcode hack further. As it does work when used in vBCode. But it would still be very limited and really it's this hack that needs to be improved upon as a real solution

LOL

Symen_4ab 01-14-2006 05:37 PM

A quick edit to fix the @ charcater problem (doesn't fix the [ proble, though)...

Add :
Code:

$link = str_replace('@', 'a', $link);
Under

Code:

                if (strtolower($protocolprefix) == 'ed2k://')
                {

In the module.


I tried to do something for the [ problem, but as it doesn't even recognize the link as a link, I don't think I'll be able to do anything :(

MRGTB 01-14-2006 05:55 PM

Quote:

Originally Posted by Symen_4ab
A quick edit to fix the @ charcater problem (doesn't fix the [ proble, though)...

Add :
Code:

$link = str_replace('@', 'a', $link);
Under

Code:

                if (strtolower($protocolprefix) == 'ed2k://')
                {

In the module.


I tried to do something for the [ problem, but as it doesn't even recognize the link as a link, I don't think I'll be able to do anything :(

maybe some other smark coder would be good enough to look this over and fix it seeing as the author is not supporting this hack.

Come you advanced coders, were are you when your needed!

Symen_4ab 01-14-2006 06:53 PM

Seems I was a little drunk when I wrote my last post, it's full of typos..
Anyway, the bracket is more than a hack problem, it's vbulletin's "problem"

If you post an url with a bracket in it, it will break the url parser too !
I don't think brackets are useable in url anyway :(

http://www.vbulletin.org
vs
http://www.vbulle[tin.org

MRGTB 01-14-2006 07:29 PM

Quote:

Originally Posted by Symen_4ab
Seems I was a little drunk when I wrote my last post, it's full of typos..
Anyway, the bracket is more than a hack problem, it's vbulletin's "problem"

If you post an url with a bracket in it, it will break the url parser too !
I don't think brackets are useable in url anyway :(

http://www.vbulletin.org
vs
http://www.vbulle[tin.org

So how comes they work with the BBCode when posted, which I use on my site. I can post ed2k on my site using the bbcode method and "[]" works fine in the links

Symen_4ab 01-14-2006 07:58 PM

True, because when you use a bbcode, vbulletin does not try to auto-recognize something, it just makes everything inside it a link (or something elese, depending of your bbcode).

So :

[*URL]http://www.vbu[lletin.org[/URL]
becomes
http://www.vbu[lletin.org

But if you don't put the URL tags, it doesn't parse it correctly. You can reproduce this anytime you want ;)

MRGTB 01-14-2006 08:14 PM

I'm betting there is no way around that and the same with the links opening in a new browser window problem. Without edits some php files like BBCode etc.

The plugin editing templates can only do so much as is limited by the vbcoding. So this would have to be a plugin with files edits as well. I don't see any other way around that.


All times are GMT. The time now is 02:18 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01283 seconds
  • Memory Usage 1,751KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (1)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete