Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-27-2008, 08:13 AM
Sworm Sworm is offline
 
Join Date: Feb 2008
Posts: 422
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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:
Reply With Quote
  #2  
Old 04-27-2008, 09:16 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
<img src="http://img229.imageshack.us/img229/3470/ed2kiconrz4.gif" border="0" /><a href="ed2k://{option}">{param}</a>
Reply With Quote
  #3  
Old 04-27-2008, 01:58 PM
Sworm Sworm is offline
 
Join Date: Feb 2008
Posts: 422
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dismounted View Post
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.
Reply With Quote
  #4  
Old 02-26-2009, 03:51 PM
Sworm Sworm is offline
 
Join Date: Feb 2008
Posts: 422
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dismounted View Post
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
Reply With Quote
  #5  
Old 02-27-2009, 08:10 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It should be the same, the upgrade should not affect this.
Reply With Quote
  #6  
Old 02-28-2009, 06:28 AM
iyama iyama is offline
 
Join Date: Sep 2008
Posts: 327
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #7  
Old 02-28-2009, 12:20 PM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you have used a modification - post in that modification's release thread.
Reply With Quote
  #8  
Old 03-01-2009, 06:11 PM
iyama iyama is offline
 
Join Date: Sep 2008
Posts: 327
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #9  
Old 03-01-2009, 06:16 PM
Brandon Sheley's Avatar
Brandon Sheley Brandon Sheley is offline
 
Join Date: Mar 2005
Location: Google Kansas
Posts: 4,678
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Thnx to my chinees warez peopel:
wtf?.. crazy people on this forum
Reply With Quote
  #10  
Old 03-02-2009, 11:45 AM
vbplusme vbplusme is offline
 
Join Date: Sep 2008
Location: CyberSpace
Posts: 332
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Loco.M View Post
wtf?.. crazy people on this forum
I guess I must be a little slow but I don' t "get" your meaning...
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 02:11 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.04374 seconds
  • Memory Usage 2,272KB
  • Queries Executed 13 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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_postinfo_query
  • fetch_postinfo
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete