Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Extended auto-linker (adds ed2k and sip link recognition) Details »»
Extended auto-linker (adds ed2k and sip link recognition)
Version: 0.2, by The M.I.P. The M.I.P. is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 3.5.1 Rating:
Released: 11-02-2005 Last Update: Never Installs: 12
Uses Plugins
Is in Beta Stage  
No support by the author.

Extended auto-linker 0.2
20051003 by mip

This plugin extends the auto-parse url option to recognize ed2k and sip (VoIP) links correctly.
ed2k file links are pretty-printed with the file name and a human-readable file size.

INSTALLATION:
Upload and activate plugin as usual.
If you want to automatically include a tag in a parsed ed2k link, you should uncomment line 67 (// $filenametag = ...) and set your desired tag.

NOTES:
This plugin uses (among other things) a slightly modified regex which allows "|" characters inside all auto-recognized URLs as required for ed2k links.

SCREENSHOTS:

Writing a post containing some ed2k and sip URIs. Auto-parse URL option must be on.


Preview of posting with recognized URLs.
Note the formatting of ed2k file urls with the human readable size.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 01-05-2006, 10:18 AM
Symen_4ab's Avatar
Symen_4ab Symen_4ab is offline
 
Join Date: Jun 2002
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #13  
Old 01-05-2006, 10:33 AM
MRGTB MRGTB is offline
 
Join Date: Dec 2004
Posts: 548
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #14  
Old 01-05-2006, 11:38 AM
Symen_4ab's Avatar
Symen_4ab Symen_4ab is offline
 
Join Date: Jun 2002
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #15  
Old 01-05-2006, 12:08 PM
MRGTB MRGTB is offline
 
Join Date: Dec 2004
Posts: 548
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #16  
Old 01-14-2006, 05:37 PM
Symen_4ab's Avatar
Symen_4ab Symen_4ab is offline
 
Join Date: Jun 2002
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #17  
Old 01-14-2006, 05:55 PM
MRGTB MRGTB is offline
 
Join Date: Dec 2004
Posts: 548
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Reply With Quote
  #18  
Old 01-14-2006, 06:53 PM
Symen_4ab's Avatar
Symen_4ab Symen_4ab is offline
 
Join Date: Jun 2002
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #19  
Old 01-14-2006, 07:29 PM
MRGTB MRGTB is offline
 
Join Date: Dec 2004
Posts: 548
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #20  
Old 01-14-2006, 07:58 PM
Symen_4ab's Avatar
Symen_4ab Symen_4ab is offline
 
Join Date: Jun 2002
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #21  
Old 01-14-2006, 08:14 PM
MRGTB MRGTB is offline
 
Join Date: Dec 2004
Posts: 548
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:18 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05453 seconds
  • Memory Usage 2,316KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_code
  • (1)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete