vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   ed2k (https://vborg.vbsupport.ru/showthread.php?t=177295)

Sworm 04-27-2008 08:13 AM

ed2k
 
hi,
where is the html replacement of this bbcode?

e.g.
Quote:

[eD2k]

The sintax is: [ed2k=option]value[/ed2k]

Esempio:
[ed2k=ed2k://|file|copyleft%20-%20david%20bravo%20en%20TV%20(creative%20commons,% 20anti%20SGAE,%20SGAE).avi
|85654080|554921F4F0E1F9D12E5B3FDC957A665B|/]Vbulletin[/ed2k]:
ed2k: vBulletin (but it is a link)
Anyone?

Edit:
This vbCode show this image before the "URLED" link:
http://img229.imageshack.us/img229/3470/ed2kiconrz4.gif

Dismounted 04-27-2008 09:16 AM

Code:

<img src="http://img229.imageshack.us/img229/3470/ed2kiconrz4.gif" border="0" /><a href="ed2k://{option}">{param}</a>

Sworm 04-27-2008 01:58 PM

Quote:

Originally Posted by Dismounted (Post 1500563)
Code:

<img src="http://img229.imageshack.us/img229/3470/ed2kiconrz4.gif" border="0" /><a href="ed2k://{option}">{param}</a>

thank for the reply,
but i have a problem,
when i go to add the ed2k link, the link don't showed in the posts..... why?

Where is the problem? :(

--------------- Added [DATE]1209310363[/DATE] at [TIME]1209310363[/TIME] ---------------

Edit

nothing problems, but the ed2k: in the href="ed2k: can cause problems in adding a full link..... i've removed it and this vBcode works ok.

Thank to the moderator. :)

Sworm 02-26-2009 03:51 PM

Quote:

Originally Posted by Dismounted (Post 1500563)
Code:

<img src="http://img229.imageshack.us/img229/3470/ed2kiconrz4.gif" border="0" /><a href="ed2k://{option}">{param}</a>

Hi,
i have upgraded to 3.81, but this code want work,
is possible an upgrade of this code for 3.81?

Thanks in advance

Dismounted 02-27-2009 08:10 AM

It should be the same, the upgrade should not affect this.

iyama 02-28-2009 06:28 AM

I have also problems with the ed2k hack on 3.8.1. First it shows the link nice in a block. and the next day are al ed2k links gone. I must edit the post and click ok and the link is ok again. The next day the same.
I have used this hack: https://vborg.vbsupport.ru/showthrea...highlight=ed2k

Already have send a pm to the coder buth no response :(
And ad a request for this mod working on 3.8.1.

Ore must i ad the code [ED2K] and [/ED2K] in the bb code manager? So yes how must i fill it there in?

maybe anyone?

iiyama

Dismounted 02-28-2009 12:20 PM

If you have used a modification - post in that modification's release thread.

iyama 03-01-2009 06:11 PM

Thnx to my chinees warez peopel:

*open: includes/class_bbcode.php

*find:
/**
* 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;
}

*add below:
/**
*
* @param string URLs of ed2k
*
* @return string table with download list
*
* @by explon
*/
function handle_ed2k_links($text)
{
global $vbulletin;

if (!$this->is_wysiwyg())
{
if (strpos($text, "<br>") OR strpos($text, "<br />"))
{
$text = str_replace("<br>", "<br />", $text);
$text = str_replace("<br />", "\n", $text);
$ed2klist = explode("\n", $text);
}
else
{
$ed2klist = explode("\n", $text);
}

$ed2k_rand = rand(0, 1000);
$text = "<br /><table class=\"tborder\" cellpadding=\"5\" cellspacing=\"1\" border=\"0\" width=\"100%\" align=\"center\"><thead><tr><td class=\"tcat\" colspan=\"2\">eMule download</td></tr></thead><tbody>";

foreach ($ed2klist AS $key => $ed2k)
{
$ed2klen = strlen($ed2k);
if ($ed2k AND $ed2klen > 7)
{
$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);
$totalper .= "TB";
}
else if ($totalper > (1024*1024*1024))
{
$totalper = round($totalper/1024/1024/1024,2);
$totalper .= "GB";
}
else if($totalper > (1024*1024))
{
$totalper = round($totalper/1024/1024,2);
$totalper .= "MB";
}
else
{
$totalper = round($totalper/1024,2);
$totalper .= "KB";
}

$ed2k_array[2] = urldecode($ed2k_array[2]);

$text .= "<tr align=\"left\" class=\"alt" . iif($key%2, 1, 2) . "\"><td width=\"80%\" align=\"left\"><input type=\"checkbox\" class=\"button\" name=\"ed2k" . $ed2k_rand . "\" value=\"" . $ed2k . "\" onclick=\"Ed2KFileSize('ed2k" . $ed2k_rand . "');\" checked=\"checked\" /> <a href=\"" . $ed2k . "\">" . $ed2k_array[2] . "</a></td><td align=\"center\">" . $totalper . "</td></tr>";
}
}

if ($total > (1024*1024*1024*1024))
{
$total = round($total/1024/1024/1024/1024,2);
$total .= "TB";
}
else if($total > (1024*1024*1024))
{
$total = round($total/1024/1024/1024,2);
$total .= "GB";
}
else if ($total > (1024*1024))
{
$total = round($total/1024/1024,2);
$total .= "MB";
}
else
{
$total = round($total/1024,2);
$total .= "KB";
}
$text .= "<tr align=\"left\" class=\"alt" . iif($key%2, 1, 2) . "\"><td width=\"80%\" align=\"left\"><input type=\"checkbox\" class=\"button\" id=\"CheckAll_ed2k".$ed2k_rand."\" onclick=\"Ed2KCheckAll('ed2k" . $ed2k_rand . "', this.checked)\" checked=\"checked\" /> <label for=\"CheckAll_ed2k" . $ed2k_rand . "\" style=\"margin-right:6px\">all</label> <input type=\"button\" class=\"button\" value=\"download selected\" onclick=\"Ed2KDownLoad('ed2k" . $ed2k_rand . "', 0, 1)\" /> <input type=\"button\" class=\"button\" value=\"copy selected\" onclick=\"Ed2KCopyLink('ed2k" . $ed2k_rand . "')\" /><div id=\"Ed2KLink_ed2k" . $ed2k_rand . "\" style=\"position:absolute; height:0px; width:0px; overflow:hidden;\"></div> </td><td align=\"center\" id=\"FileSize_ed2k" . $ed2k_rand . "\">" . $total . "</td></tr></tbody></table>";
}
else
{
$text = "[ed2k]" . $text . "[/ed2k]" ;
}
return $text;
}

*find:
if ($vbulletin->options['allowedbbcodes'] & ALLOW_BBCODE_HTML)
{
// [HTML]
$tag_list['no_option']['html'] = array(
'callback' => 'handle_bbcode_html',
'strip_empty' => true,
'stop_parse' => true,
'disable_smilies' => true,
'disable_wordwrap' => true,
'strip_space_after' => 1
);
}

*add below:
if (($vbulletin->options['allowedbbcodes']) OR $force_all)
{
// [ED2K]
$tag_list['no_option']['ed2k'] = array(
'callback' => 'handle_ed2k_links',
'strip_empty' => true,
'stop_parse' => true,
'disable_smilies' => true,
'disable_wordwrap' => true,
'strip_space_after' => 1
);
}

*open: clientscript/vbulletin_global.js

*add at the end:
function Ed2KCheckAll(str, checked)
{
var a = document.getElementsByName(str);
var n = a.length;

for (var i = 0; i < n; i++)
{
a[i].checked = checked;
}

Ed2KFileSize(str);
}

function Ed2KDownLoad(str, i, first)
{
var a = document.getElementsByName(str);
var n = a.length;

for (var i = i; i < n; i++)
{
if(a[i].checked)
{
window.location = a[i].value;

if (first)
{
timeout = 6000;
}
else
{
timeout = 500;
}

i++;
window.setTimeout("Ed2KDownLoad('"+str+"', "+i+", 0)", timeout);
break;
}
}
}

function Ed2KCopyLink(str)
{
var a = document.getElementsByName(str);
var n = a.length;
var CopyLink = document.getElementById("Ed2KLink_" + str)
CopyLink.innerHTML = ""

for (var i = 0; i < n; i++)
{
if(a[i].checked)
{
CopyLink.innerHTML += a[i].value;
CopyLink.innerHTML += "<br />";
}
}

var rng = document.body.createTextRange();
rng.moveToElementText(CopyLink)
rng.scrollIntoView();
rng.select();
rng.execCommand("Copy");
rng.collapse(false);
}

function Ed2KFileSize(str)
{
var a = document.getElementsByName(str);
var n = a.length;

try
{
var Input_CheckAll = document.getElementById("CheckAll_"+str);
var FileSize = 0;
Input_CheckAll.checked = true ;

for (var i=0; i < n; i++)
{
if (a[i].checked)
{
var piecesArray = a[i].value.split("|");
FileSize += piecesArray[3]*1;
}
else
{
Input_CheckAll.checked = false;
}
}

OutPut = document.getElementById("FileSize_" + str);
OutPut.innerHTML = Ed2KGetSize(FileSize, 3, 2);
}

catch (e)
{
// Nothing
}
}

function Ed2KGetSize(val, li, sepa)
{
sep = Math.pow(10, sepa);
li = Math.pow(10, li);
retval = val;
unit = 'Bytes';
if (val >= li*1000000000)
{
val = Math.round(val / (1099511627776/sep)) / sep;
unit = 'TB';
}
else if (val >= li*1000000)
{
val = Math.round(val / (1073741824/sep)) / sep;
unit = 'GB';
}
else if (val >= li*1000)
{
val = Math.round(val / (1048576/sep)) / sep;
unit = 'MB';
}
else if (val >= li)
{
val = Math.round(val / (1024/sep)) / sep;
unit = 'KB';
}

return val + unit;
}


*edit temple: editor_toolbar_on

*find:
$vBeditTemplate[extrabuttons]

*add above:
<!-- ED2K --><td><div class="imagebutton" id="{$editorid}_cmd_wrap0_ed2k"><img src="$stylevar[imgdir_editor]/ed2k.gif" width="21" height="20" alt="Wrap eD2k tag" /></div></td><!-- /ED2K -->

======================
Make your own ed2k.gif ;)

Brandon Sheley 03-01-2009 06:16 PM

Quote:

Thnx to my chinees warez peopel:
wtf?.. crazy people on this forum :D

vbplusme 03-02-2009 11:45 AM

Quote:

Originally Posted by Loco.M (Post 1757753)
wtf?.. crazy people on this forum :D

I guess I must be a little slow but I don' t "get" your meaning...


All times are GMT. The time now is 05:11 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.01263 seconds
  • Memory Usage 1,759KB
  • 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
  • (3)bbcode_code_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete