Go Back   vb.org Archive > vBulletin Modifications > Archive > Modification Graveyard

Reply
 
Thread Tools
eD2K Links Hack Details »»
eD2K Links Hack
Version: 1.00, by MRGTB MRGTB is offline
Developer Last Online: Dec 2014 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 3.6.0 Rating:
Released: 09-12-2006 Last Update: 09-16-2006 Installs: 52
Uses Plugins Template Edits
Code Changes  
No support by the author.

This will let you add ed2k links to your site. The hack does require ONE manual edit to a PHP file, but no vBulletin code is altered, just some code added to the file. Please follow the instructions in the download carefully.

Check the images out below as to what it looks like once installed. The hack "counts file size", can add "multiple ed2k links" in one go. All ed2k links opened in the "same browser window" (no more blank browser windows left open) when clicking ed2k links posted on your board. It also shows the proper "ed2k file" link file name. I've also validated the code so it's W3C and CSS valid.




What are ed2k links?

eD2k links are downloads that are advertised in file sharing programs like eMule:www.emule.net.

To download the ed2k links, you "must" have an ed2k link client program installed like the above. What this hack does is it lets you search programs like eMule for files being shared over the ed2k network. Giving you the option to copy and paste the ed2k link on your forum. When clicked by a person visiting your board, who has an ed2k link client program installed like eMule. The link will be added to his download list in emule, it will also start the program automatically for him if he has it configured to take ed2k links while the program is not running.


Features & Notes:

[1] W3C & CSS Valid
[2] All templates are cached in the plug-in
[3] Only one PHP file edit is required, (No vBulletin code is changed)
[4] ed2k links can be added singly or multiply
[5] All ed2k links open in the same browser window (no more blank pages to close)
[6] File sizes are shown and calculated
[7] ed2k link names are displayed correctly
[8] Uses a box to contain all the ed2k links in neat
[9] Links also get displayed and work correctly in Printthread

Feature Plans
"CUSTOM TAG" feature planned, were all ed2k links posted will contain a custom tag of your choice. Like adding your site address for example to the ed2k file name. Which would mean your site would be advertised for free in every ed2k link added to eMule.

PLEASE CLICK: INSTALL
if you use the hack.

Supporters / CoAuthors

Show Your Support

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

Comments
  #22  
Old 09-13-2006, 09:36 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

To cache templates in a plugin use the cache_templates hook and this code ;

PHP Code:
$globaltemplates[] = 'ed2k' ;
$globaltemplates[] = 'ed2kbit' 
Reply With Quote
  #23  
Old 09-13-2006, 09:52 PM
MRGTB MRGTB is offline
 
Join Date: Dec 2004
Posts: 548
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Paul M
To cache templates in a plugin use the cache_templates hook and this code ;

PHP Code:
$globaltemplates[] = 'ed2k' ;
$globaltemplates[] = 'ed2kbit' 
Paul can you just copy the code from the plug-in and show me were that goes, if you will please.
Reply With Quote
  #24  
Old 09-13-2006, 10:28 PM
aveon's Avatar
aveon aveon is offline
 
Join Date: May 2006
Posts: 410
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hey gary when i try to add a link i get this error

Fatal error: Call to undefined function: handle_ed2k_links() in /kunden/137092_81737/www.e-paylas.de/forum/includes/class_bbcode.php on line 1071
Reply With Quote
  #25  
Old 09-13-2006, 10:35 PM
MRGTB MRGTB is offline
 
Join Date: Dec 2004
Posts: 548
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

check that you put the code in the class_bbcode.php file after this.

Code:
	* Returns whether this parser is a WYSIWYG parser. Useful to change
	* behavior slightly for a WYSIWYG parser without rewriting code.
	*
	* @return	bool	True if it is; false otherwise
	*/
	function is_wysiwyg()
	{
		return false;
	}
An not after this marked in red:

Code:
	* Returns whether this parser is a WYSIWYG parser. Useful to change
	* behavior slightly for a WYSIWYG parser without rewriting code.
	*
	* @return	bool	True if it is; false otherwise
	*/
	function is_wysiwyg()
	{
		return false;
	}
        }
So it should look like this:

Code:
Code:
	* Returns whether this parser is a WYSIWYG parser. Useful to change
	* behavior slightly for a WYSIWYG parser without rewriting code.
	*
	* @return	bool	True if it is; false otherwise
	*/
	function is_wysiwyg()
	{
		return false;
	}
/**
* ed2k link start.
*/
	function handle_ed2k_links($text)
{
if(!$this->is_wysiwyg())
{
$text=preg_replace ("/(<\/?)(\w+)([^>]*>)/e","", $text);
$list=explode("ed2k://",$text);
$rand=rand(100, 999);
foreach ( $list as $key => $ed2k )
{ 
if (!empty($ed2k))
{
$ed2k = "ed2k://".$ed2k;
$ed2k_array=explode("|",$ed2k);
$total+=$ed2k_array[3];
$totalper=$ed2k_array[3];
if($totalper>(1024*1024*1024*1024)){
$totalper=round($totalper/1024/1024/1024/1024,2); 
if(!$totalper){continue; }
$totalper.="TB";
}elseif($totalper>(1024*1024*1024)){
$totalper=round($totalper/1024/1024/1024,2); 
if(!$totalper){continue; }
$totalper.="GB";
}elseif($totalper>(1024*1024)){
$totalper=round($totalper/1024/1024,2); 
if(!$totalper){continue; }
$totalper.="MB";
}else{
$totalper=round($totalper/1024,2); 
if(!$totalper){continue; }
$totalper.="KB";
}
++$i;
$key1=iif($i%2, 1, 2);
$ed2k_array[2]=rawurldecode($ed2k_array[2]);
eval('$ed2kbit .= "' . fetch_template('ed2kbit') . '";');
}
}
if($total>(1024*1024*1024*1024)){
$total=round($total/1024/1024/1024/1024,2);
$total.="TB";
}elseif($total>(1024*1024*1024)){
$total=round($total/1024/1024/1024,2);
$total.="GB";
}elseif($total>(1024*1024)){
$total=round($total/1024/1024,2);
$total.="MB";
}else{
$total=round($total/1024,2);
$total.="KB";
}
$key2=iif($key%2, 1, 2);
eval('$text = "' . fetch_template('ed2k') . '";');
}
else
{
$text ="[ed2k]".$text."[/ed2k]" ;
}
return $text;
}
/**
* ed2k link end.
*/
        }
There are two of these "}" in the code you search for at the end of it. Put the hack code before the very last one
Reply With Quote
  #26  
Old 09-13-2006, 10:37 PM
concordancer concordancer is offline
 
Join Date: Apr 2005
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by m0nde
eDonkey hasn't gone belly up, but is not as popular as Bit Torrent at the moment.
Yeah, sure... See http://yro.slashdot.org/yro/06/09/12/1932225.shtml
Reply With Quote
  #27  
Old 09-13-2006, 11:18 PM
MRGTB MRGTB is offline
 
Join Date: Dec 2004
Posts: 548
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The hack has now been updated again.

All templates are "cached" now in the "plug-in", no need to edit the global.php file, instuctions have been updated in download to reflect this change.

Please re-download and install the hack via the plug-in (remove the other version first). And remove all edits to your global.php file if you made any to cache templates.
Reply With Quote
  #28  
Old 09-14-2006, 12:26 AM
asj's Avatar
asj asj is offline
 
Join Date: Jul 2006
Posts: 117
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks
Reply With Quote
  #29  
Old 09-14-2006, 03:37 AM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So why, after i gave you the code have you created two cache_template plugins, and used array_merge .......
Reply With Quote
  #30  
Old 09-14-2006, 03:42 AM
MRGTB MRGTB is offline
 
Join Date: Dec 2004
Posts: 548
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Paul, not sure what you mean. You know a lot more than me and I had to look at another hack to see how they had cached the templates and followed there way. If you can do it a better way. Please feel to post the full plug-in code here with your cache template code added to do it a better way. And I will update the plug-in with your code posted.

Pretty new to this plug-in coding
Reply With Quote
  #31  
Old 09-14-2006, 03:50 AM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's not the way its done.

You create/edit plugins in your ACP and then export the product as an XML file afterwards, not try and add them directly to the XML file.

If you look in your plugins for this product, you will find you now have two associated with the cache_templates hook. Delete one, edit the other to contain the two lines of code I gave you, and then re-export it.
Reply With Quote
Reply

Thread Tools

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 11:55 PM.


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.11311 seconds
  • Memory Usage 2,312KB
  • Queries Executed 26 (?)
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
  • (2)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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