vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Miscellaneous Hacks - eD2K Links Hack (https://vborg.vbsupport.ru/showthread.php?t=126481)

MRGTB 09-12-2006 10:00 PM

eD2K Links Hack
 
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.

https://vborg.vbsupport.ru/external/2010/10/30.jpg https://vborg.vbsupport.ru/external/2010/01/137.jpg


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.

bollie 09-13-2006 05:52 AM

Thankx instal ;)

Zia 09-13-2006 05:54 AM

what is its function?

Barakat 09-13-2006 06:11 AM

thanx

Snake 09-13-2006 10:05 AM

Very nice!

Mr_Devlin 09-13-2006 12:21 PM

For Servers with older PHP suppport (PHP 4) you have to change operators in your includes/adminfunctions_options.php

Find this code located in row 362:

PHP Code:

$value += 0

and change it to

PHP Code:

$value >= 0

Without this change you will get an error message in ACP when changing the option "number of characters before wrapping text".

dirtycrow 09-13-2006 01:10 PM

wait. .. what does this do? if it's what i think it is. . perfect!

m0nde 09-13-2006 01:24 PM

Quote:

Originally Posted by Zia
what is its function?

LOL, from the pictures, it looks like the purpose is to help spread warez by hosting eMule index files a la Sharereactor.

;)

dirtycrow 09-13-2006 01:27 PM

Quote:

Originally Posted by m0nde
LOL, from the pictures, it looks like the purpose is to help spread warez by hosting eMule index files a la Sharereactor.

;)

so is it just a private p2p for your forums? or does it connect to another p2p network?

MRGTB 09-13-2006 02:13 PM

The hack lets you add "ed2k links" to your board, that when clicked get added to emule or edonkey for download. Or any other ed2k link client program that can take the links.

soletrader 09-13-2006 02:33 PM

Sorry for this newbie question... what is a ed2k link?

MRGTB 09-13-2006 03:11 PM

Quote:

Originally Posted by Mr_Devlin
For Servers with older PHP suppport (PHP 4) you have to change operators in your includes/adminfunctions_options.php

Find this code located in row 362:

PHP Code:

$value += 0

and change it to

PHP Code:

$value >= 0

Without this change you will get an error message in ACP when changing the option "number of characters before wrapping text".

Thanks for that update.

lolo? 09-13-2006 04:22 PM

at this moment i see two bug
Uncached templates: ed2k (1)
Uncached templates: ed2kbit (1)
and with Fire fox the link are not copy
thanks for this mod

MRGTB 09-13-2006 04:43 PM

Quote:

Originally Posted by lolo?
at this moment i see two bug
Uncached templates: ed2k (1)
Uncached templates: ed2kbit (1)
and with Fire fox the link are not copy
thanks for this mod

Yes that right, I wasn't sure how to add the code to "cache the templates" in the plug-in, which is why I said in the installation file to add the template names to global.php instead to cache them that way instead. If a person knows how to add the cache code to the plug-in instead, to avoid having to edit the global.php file. I will alter the upload to not add the template names to the global.php file, and update the plug-in also for download. You will have to post the complete new plug-in code though for me to update it.

Yes, I'm aware that with Firefox the "copy links" is a problem. Hopefully we shall see a fix for that posted here, so again I can update the download. But the option is always there to completely remove that feature if you wish from the hack code.

I would also like to have integrated the option to "Add your own TAG" in the ed2k links posted. There is another hack here that does this. If a person can take that option from that hack and integrate it into this (maybe the author of that hack). And post the updated code here. Again I will update the download to reflect the changes. The "TAG" option a good feature to include because it means you can advertise your own site address or name in the TAG's that gets added automatically at the end of every ed2k link posted on your board (very good way to advertise your site in emule). Here is the link to the other hack that I would like to see that TAG feature taken from, and integrated into this version: https://vborg.vbsupport.ru/showthrea...highlight=ed2k

concordancer 09-13-2006 04:47 PM

Hasn't edonkey just gone belly up?
http://news.google.com/news?hl=en&ne...nG=Search+News

...looks like eMule is still around, though :)

lasto 09-13-2006 07:38 PM

suppose this could be altered for other stuff besides edonkey am i right ?
How about one for nzbs or is that a no go ?

MRGTB 09-13-2006 08:06 PM

I've just updated the download, I noticed in the installations details, the bit were you have to add some code to your global.php file was missing to cache the templates, that will sort the cached template problem out. Also updated the plug-in to 3.6.1 version from 3.6.0.

I've also completly removed the option to "COPY LINKS" seeing as that didn't work right in Firefox and only did in IE. It was not really needed as a feature (it would only give other users an easy way to take ed2k links and post them on there own site fast). So you now just have a download button only, and no copy links button. (all the code for that was removed from the hack).

m0nde 09-13-2006 08:17 PM

Quote:

Originally Posted by concordancer
Hasn't edonkey just gone belly up?
http://news.google.com/news?hl=en&ne...nG=Search+News

...looks like eMule is still around, though :)

eDonkey is the name of the file sharing protocol, but you're right, the original client is not very popular.
The eDonkey network hasn't gone belly up, but is not as popular as the Bit Torrent protocol at the moment.
Quote:

Originally Posted by dirtycrow
so is it just a private p2p for your forums? or does it connect to another p2p network?

There are several clients like eMule and eMule Plus and the indexing sites like sharereactor, which were shut down earlier, are coming back.

eDonkey is a file sharing protocol that works over various p2p networks

Take a look at this to find out what eDonkey is:
http://en.wikipedia.org/wiki/EDonkey_network

MRGTB 09-13-2006 08:56 PM

Shareaza is one, eMule Plus is another :)

MRGTB 09-13-2006 09:12 PM

Quote:

Originally Posted by m0nde
eDonkey hasn't gone belly up, but is not as popular as Bit Torrent at the moment.

There are several clients like eMule and eMule Plus and the indexing sites like sharereactor, which were shut down earlier, are coming back.

eDonkey is a file sharing protocol that works over various p2p networks

Take a look at this to find out what eDonkey is:
http://en.wikipedia.org/wiki/EDonkey_network

Read the full story here: http://www.slyck.com/news.php?story=1288

Paul M 09-13-2006 09:36 PM

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

PHP Code:

$globaltemplates[] = 'ed2k' ;
$globaltemplates[] = 'ed2kbit' 


MRGTB 09-13-2006 09:52 PM

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.

aveon 09-13-2006 10:28 PM

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

MRGTB 09-13-2006 10:35 PM

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

concordancer 09-13-2006 10:37 PM

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

MRGTB 09-13-2006 11:18 PM

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.

asj 09-14-2006 12:26 AM

Thanks

Paul M 09-14-2006 03:37 AM

So why, after i gave you the code have you created two cache_template plugins, and used array_merge .......

MRGTB 09-14-2006 03:42 AM

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

Paul M 09-14-2006 03:50 AM

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.

MRGTB 09-14-2006 04:29 AM

Sorted and updated

Der Sauger1 09-14-2006 10:38 AM

hello

Nice Hack but ERROR in Produkt is only for 3.6.1 not 0 ?

Edit:Ok,Edit the XML in 3.6.0 and ist gone :) ;)

MRGTB 09-14-2006 04:39 PM

will change that now, done, re-uploaded to show 3.6.0 minimum version.

Watched 09-20-2006 08:42 AM

wish there was something like this for torrents.

MRGTB 09-20-2006 12:15 PM

torrents is a lot more complicated when it comes to hacks for them. But there is a thread somewhere were I guy is selling it for vB6. He lists his email to contact him. VBT I think it called, but it's not a free hack.

Der Sauger1 10-10-2006 06:25 PM

.... not work in 3.6.2

Error when will add a Link

Code:

Fatal error: Call to undefined function: handle_ed2k_links() in /www/htdocs/w0075632/includes/class_bbcode.php on line 1071

In this Line:
PHP Code:

// call a callback function
                                    
$pending_text $this->$tag_info['callback']($open['data'], $open['option']);
                                }
                            } 

any Idea???

Ok is Gone,sorry ;)

MRGTB 10-10-2006 07:32 PM

is everything fine now, my guess is you added the code after the second "}" and not the first one.

Brandon Sheley 10-10-2006 08:10 PM

nice work Gary,

didn't know you had it in ya :p

KOKS@LN 11-12-2006 04:30 PM

I installed this hack on my board. It works with most of the links that I post but for some of them the hack doesn't calculate right size of the link and when I click on it, emule says
Quote:

could not add link- Ill formed hash
.. When I look at the link, I see many gaps in it..

Can anyone tell me how I can remove these gaps from the link?

thanks

s0b 11-21-2006 09:54 AM

Great hack!

But I have a problem... is possible to limit max. characters in the table of elinks??? I need to do that.

Thanks!!


All times are GMT. The time now is 05:50 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.01693 seconds
  • Memory Usage 1,848KB
  • 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
  • (5)bbcode_code_printable
  • (7)bbcode_php_printable
  • (10)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
  • (40)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