News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

ed2k links support

Started by Mindstorm, February 12, 2005, 04:43:43 AM

Previous topic - Next topic

FragaCampos

Any chance of adding ed2k stats support from this page?
http://tothbenedek.hu/ed2kstats/

tckbm


tckbm

Heres the code for PHPBB

can anyone migrate to smf?

<?php

/*

phpBB script for getting ed2k file/url list

It scans the phpbb database for ed2k links and if it finds one in a topic which can be read by an anonymous user it displays it.

Install:
Make sure you run phpBB version 2.0 or later
Simply copy the file to the phpbb root directory and rename it to listed2k.php

If you want your database to be present at the RB2M ed2k stats' "backlinking" database, please contact me!

more info and updates can be found at http://tothbenedek.hu/ed2kstats/

(c)2006 Benedek Toth
Licensed under GPL which can be found at http://www.gnu.org/licenses/gpl.txt

THERE IS ABSOLUTELY NO WARRANTY FOR THIS SCRIPT 
(...altough I find it hard to believe it can damage anything... in the worst case it will simply not work)
*/




/*

If you want to define a password to not let anyone access your database, uncomment the next line and change yourpass to your password! Accessing the file will be available at the url listed2k.php?pass=yourpass

If your file is linked to the RB2M ed2k stats service don't forget to notify me before(!!!) doing so, or your files will disappear from the database.

*/

//if ($HTTP_GET_VARS[pass]!='yourpass') die();


set_time_limit(300);

function 
plog ($log) {
print "#COMMENT\t$log\n";
}

plog("running  <pre>"); // for better HTML VIEW
define('IN_PHPBB'true);
$phpbb_root_path './';
include(
$phpbb_root_path 'extension.inc');
include(
$phpbb_root_path 'common.'.$phpEx);
if (
$board_config[server_port])
plog("phpbb init done and okay");
$porta $board_config[server_port]==80?"":":"$board_config[server_port];

$rooturl "http://" $board_config[server_name] . $porta $board_config[script_path];


$sql "SELECT count(*) FROM " POSTS_TEXT_TABLE " c , " POSTS_TABLE " d, " FORUMS_TABLE " f WHERE c.post_id=d.post_id and f.forum_id=d.forum_id and f.auth_read=0 and instr(c.post_text, 'ed2k://|file|')>0;";
if (!(
$result $db->sql_query($sql))) die("#FATAL_ERROR\t SQL problem");
//plog("sql ok: ".$sql);

if ($row $db->sql_fetchrow($result)) {
$lcount $row[0];
plog("sum posts: ".$lcount);
}

for (
$i=0;$i<=$lcount;$i+=100) {
plog("starting circle ".$i/100);

$sql "SELECT c.post_id, c.post_text FROM " POSTS_TEXT_TABLE " c , " POSTS_TABLE " d, " FORUMS_TABLE " f
WHERE c.post_id=d.post_id and f.forum_id=d.forum_id and f.auth_read=0 and instr(c.post_text, 'ed2k://|file|')>0
ORDER BY c.post_id DESC LIMIT 
$i,100;";
if (!($result $db->sql_query($sql))) die("#FATAL_ERROR\t SQL problem");
$rows = array();
while ($row $db->sql_fetchrow($result)) {
$url $rooturl.'viewtopic.' $phpEx '?'  POST_POST_URL '=' $row[0] . '#' $row[0];
$pt "nuku".strtolower($row[1]);
$ptt explode('ed2k://|file|'$pt);
$elso true;
while (list($k$v) = each($ptt)) {
if (!$elso) {
$hasht explode('|'$v);
$hash strtoupper($hasht[2]);
$hash substr($hash032);
if (strlen($hash)==32 and strspn($hash"0123456789ABCDEF")==32)
print $hash "\t" $url "\n";
}
$elso false;
}
}
}
$db->sql_freeresult($result);

plog("done");

?>

Mindstorm

#63
Quote from: FragaCampos on October 14, 2007, 04:14:52 PM
There is a mode which hides images from guests. Would it be posible to edit the php file so that it hides ed2k tags instead of img?
It's certainly possible and probably not that hard. As I've previously said my free time is running dangerously low, so I probably won't be doing it anytime soon.

Quote from: Ahriman on November 14, 2007, 02:38:23 AM
My english is very bad, but i can say: THANKS  :D
You're welcome! :)

Quote from: allumius on December 13, 2007, 07:58:25 AM
I have this error

if Enable URL filters is not active, the ed2k mod work, but if the Enable URL filters is active, ed2k not work. look the examples

Hello. I suppose you're refering to the prettyurls mod, right? I'm not sure why it doesn't work... I'll try and look at it when I can find the time.

Mindstorm

Quote from: FragaCampos on December 20, 2007, 08:58:45 AM
Any chance of adding ed2k stats support from this page?
http://tothbenedek.hu/ed2kstats/ [nofollow]

Quote from: tckbm on March 31, 2008, 11:09:16 PM
Quote from: FragaCampos on December 20, 2007, 08:58:45 AM
Any chance of adding ed2k stats support from this page?
http://tothbenedek.hu/ed2kstats/ [nofollow]

Is my doubt too!

Quote from: tckbm on March 31, 2008, 11:15:22 PM
Heres the code for PHPBB

can anyone migrate to smf?

I think I'm missing the purpose... That code prints a list of all links on the forum, right? What's it good for?

In any case, I'll probably reply with the standard line: this is supposed to be a minimal extension, and I don't have the time to create and maintain any others. I'm sorry!

EkSeS

Think about update to SMF 2.x ? when ?

Mindstorm

I will update to 2.0 when it gets out of beta and I update my forums. I'm sorry, but I don't have the time to go look at it "just for fun".

Dukessa

I have SMF 1.1.6.
The mod works flawlessly, but Id need your help with something please!

The problem is that sometimes there are spaces in ed2k link names...

Example:

ed2k://|file|[some%20file%20with%20spaces.rar|101996469|FF7D18024C4C61716F2188568DECA73C|/

The result is:

some%20file%20with%20spaces.rar  >:(

So i would like to take off %20 from the name, cose its ugly, and put spaces there instead, but in the link %20 MUST stay (otherwise link doesnt work).

How I want it:

some file with spaces.rar   :)
(and the link is= ed2k://|file|[some%20file%20with%20spaces.rar|101996469|FF7D18024C4C61716F2188568DECA73C|/)

I tried to use:
$message=str_replace("%20"," ",$message);
It works with the name, %20 are gone...but the links are broken now because it put a space there too, so its not ok.
I was wondering if maybe there is an "if" to add to the function link_from_a_ed2k ($m)....?
Im not an expert at php...so Im just guessing...

Anyone?

EkSeS

Hi
Quote from: Mindstorm on October 11, 2008, 08:05:25 AM
I will update to 2.0 when it gets out of beta and I update my forums. I'm sorry, but I don't have the time to go look at it "just for fun".

SMF 2.0 RC1 is released ;)

I'm waiting for update ... thx ;)

FragaCampos

Is it doable to somehow show the number of hits of an edk2?

FragaCampos


davidhs

In attachment file I add support for SMF 2.0.* (code is equal to 1.1.*).

zorer

Hi! i installed the elink mod attached in smf 2.0.4 but i have problems displaying the emule gif.

I don't get problems in the preview, but after the post the url redirects to /forum/index.php/ed2k/emule.gif and the original file it's in /forum/ed2k/emule.gif

How i can fix it?

Thanks!

FragaCampos

I don't know why, but I had the same problem and fixed it this way:

In Subs.php search src="./ed2k/emule.gif" and substitute the link by an external link, from imageshack or imgur, for example.

davidhs

I use this MOD and works fine when I want see eLinks with icon-style but if I write more than one eLink on BBC code
Quote
ed2k://|file|file_name1.ext|123456789|123456789ABCDEFG123456789ABCDEFG|/
ed2k://|file|file_name2.ext|123456789|123456789ABCDEFG123456789ABCDEFG|/
<a href="ed2k://|file|file_name3.ext|123456789|123456789ABCDEFG123456789ABCDEFG|/">file_name3.ext</a>
I want see source code but this MOD converts the second and next elinks to icon-style.

I think this is an error. Can you correct this?

Asier

#75
I try this mod and works fine when I use editor in code mode, but when I use WYSIWYG the code changes and doesn't work any more.

For this code:


ed2k://|file|file_name1.ext|123456789|123456789ABCDEFG123456789ABCDEFG|/
ed2k://|file|file_name2.ext|123456789|123456789ABCDEFG123456789ABCDEFG|/
<a href="ed2k://|file|file_name3.ext|123456789|123456789ABCDEFG123456789ABCDEFG|/">file_name3.ext</a>


And I clik preview. The code changes to this other:

[img alt=ed2k:]http://foro.tusproyectos.net/./ed2kfile/donkey.gif[/img] [url=http://foro.tusproyectos.net/ed2k://|file|file_name1.ext|123456789|123456789ABCDEFG123456789ABCDEFG|/]file_name1.ext[/url] (117.74 MiB)
[img alt=ed2k:]http://foro.tusproyectos.net/./ed2kfile/donkey.gif[/img] [url=http://foro.tusproyectos.net/ed2k://|file|file_name2.ext|123456789|123456789ABCDEFG123456789ABCDEFG|/]file_name2.ext[/url] (117.74 MiB)
<a href="ed2k://|file|file_name3.ext|123456789|123456789ABCDEFG123456789ABCDEFG|/">file_name3.ext


Can you helpme?

Thanks ;)
Dicen que la fe mueve montañas, apuesto que la ciencia lo consigue en menos tiempo.
[nofollow]

Advertisement: