CiberMorph
Portal    Foro    Buscar    FAQ    Medallas    Registrarse    Conectarse
Normas de este Foro  
Antes de nada, lee las Normas de Project Morph.
Si es sobre cómo Crear una Consulta SQL ya lo tienes explicado en el enlace.
En general, se pide Buscar antes de preguntar para no repetir preguntas y dudas resueltas.
Solo tendras algo de Ayuda si respetas el Copyright de phpBB.
NOTA: No preguntéis por MP ni E-Mail. No se dará respuesta a las posibles dudas que mandéis. Poner en el Foro, vuestras dudas
si podemos las intentaremos solucionar. Asi quedara constancia por si alguien más, pudiera necesitarlo.

Recordar que esto no es un foro de soporte, solo se intenta ayudar. Saludos a todos .^-^.
© Morph -
Project Morph

Publicar Nuevo Tema  El tema está bloqueado: no pueden editarse ni agregar mensajes. Página 1 de 1
 
ed2k all links V1.2.0
Autor Mensaje
Responder Citando
Mensaje Idea ed2k all links V1.2.0 
 
ed2k all links V1.2.0 Enlaces directos ED2K Gracias por la info zankyw

Código: [Descargar] [Ocultar]
  1. ##############################################################  
  2. ## MOD Title: eD2k Links add all Feature  
  3. ## MOD Author: Simon Moon <simon@gomp.net> (Christian Riesen) http://www.blackpearltech.com/  
  4. ## MOD Authors: [ Oki/Mozes/Meithar/ppw ]  
  5. ##  
  6. ## MOD Description: Makes ed2k links for files and servers clickable and adds a link for adding all files in a post at once.  
  7. ## MOD Version: 1.2.0  
  8. ##  
  9. ## Installation Level: moderate  
  10. ## Installation Time: 6 Minutes  
  11. ## Files To Edit: 2  
  12. ##               includes/bbcode.php  
  13. ##               viewtopic.php  
  14. ## Included Files: images/mule_icon.gif (http://www.ed2k-it.com/forum/images/mule_icon.gif)  
  15. ##                              images/ed2k-info.gif (http://www.ed2k-it.com/forum/images/ed2k-info.gif)  
  16. ##  
  17. ## Tested with phpBB Version 2.0.11 to 2.0.15  
  18. ## Forum Link: http://www.phpbb.com/phpBB/viewtopic.php?t=206016  
  19. ##############################################################  
  20. ## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the  
  21. ## latest version of this MOD. Downloading this MOD from other sites could cause malicious code  
  22. ## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered  
  23. ## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/  
  24. ##############################################################  
  25. ## Author Notes:  
  26. ## If you have already installed a ed2k hack (which you mostlikely will have)  
  27. ## check the files mentioned below anyways and change it to this version of  
  28. ## the hack. This is very important to ensure it will work properly, otherwise  
  29. ## you might have weird problems.  
  30. ## Change the line below that looks like this to have a different text:  
  31. ## $t_ed2kinsert .= "<a href='javascript:addall()'>Add ".$t_ed2k_confirmed." links to ed2k client</a> ";  
  32. ## You can for example leave away the number of files.  
  33. ##############################################################  
  34. ## MOD History:  
  35. ##    2005-05-07 - Version 1.2.0  
  36. ##       - compatible with latest ed2k link formats  
  37. ##      - friendly readable names, kB, MB  
  38. ##      - added icons  
  39. ##  
  40. ##   2004-06-27 - Version 1.1.1  
  41. ##      - Error with ' sign in filenames  
  42. ##  
  43. ##   2004-06-27 - Version 1.1.0  
  44. ##      - Javascript bug in add all, predefining of filearray  
  45. ##  
  46. ##   2004-06-27 - Version 1.0.0  
  47. ##      - First release, works fine, could use some different look  
  48. ##  
  49. ##############################################################  
  50. ## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD  
  51. ##############################################################  
  52. #  
  53. #-----[ OPEN ]-----------------------------------------------  
  54. #  
  55.  
  56. includes/bbcode.php  
  57.  
  58. #  
  59. #-----[ FIND ]-----  
  60. #  
  61.  
  62. $bbcode_tpl['url4'] = str_replace('{DESCRIPTION}', '\\3', $bbcode_tpl['url4']);  
  63.  
  64. #  
  65. #-----[ AFTER, ADD ]-----------------------------------------------  
  66. #  
  67.  
  68. // ed2k links  
  69. $bbcode_tpl['url5'] = str_replace('{URL}', '\\1', $bbcode_tpl['url']);  
  70. $bbcode_tpl['url5'] = str_replace('{DESCRIPTION}', '\\2', $bbcode_tpl['url5']);  
  71.  
  72. // ed2k links with description  
  73. $bbcode_tpl['url6'] = str_replace('{URL}', '\\1', $bbcode_tpl['url']);  
  74. $bbcode_tpl['url6'] = str_replace('{DESCRIPTION}', '\\3', $bbcode_tpl['url6']);  
  75. // end ed2k links  
  76.  
  77. #  
  78. #-----[ FIND ]-----------------------------------------------  
  79. #  
  80.  
  81. // [url=www.phpbb.com]phpBB[/url] code.. (no xxxx:// prefix).  
  82. $patterns[] = "#\[url=((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*?)\]([^?\n\r\t].*?)\[/url\]#is";  
  83. $replacements[] = $bbcode_tpl['url4'];  
  84.  
  85. #  
  86. #-----[ AFTER, ADD ]-----------------------------------------------  
  87. #  
  88.  
  89. // url-ed2k, name code  
  90. $patterns[] = "#\[url=(ed2k://\|file\|.*\|\d+\|\w+\|/?)\](.*?)\[/url\]#si";  
  91. $replacements[] = $bbcode_tpl['url5'];  
  92.  
  93. // name code  
  94. $patterns[] = "#\[url=(ed2k:(//)?\|server\|[\d\.]+\|\d+\|/?)\](.*?)\[/url\]#si";  
  95. $replacements[] = $bbcode_tpl['url6'];  
  96. // end url-ed2k  
  97.  
  98. #  
  99. #-----[ FIND ]-----------------------------------------------  
  100. #  
  101.  
  102. /**  
  103. * Rewritten by Nathan Codding - Feb 6, 2001.  
  104. * - Goes through the given string, and replaces xxxx://yyyy with an HTML <a> tag linking  
  105. *    to that URL  
  106.  
  107. #  
  108. #-----[ BEFORE, ADD ]-----------------------------------------------  
  109. #  
  110.  
  111. // ed2k links  
  112. // Returns a file size formatted in a more human-friendly format, rounded  
  113. // to the nearest Gb, Mb, Kb, or byte.  
  114.  
  115. function ed2k_humanize_size ($size, $rounder = 0, $min = '')  
  116. {  
  117.   $sizes   = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');  
  118.   $rounders = array(0,   0,    0,    2,    2,    3,    3,    3,    3);  
  119.   $ext = $sizes[0];  
  120.   $rnd = $rounders[0];  
  121.  
  122.   if ($min == 'KB' && $size < 1024)  
  123.   {  
  124.      $size = $size / 1024;  
  125.      $ext = 'KB';  
  126.      $rounder = 1;  
  127.   }  
  128.   else  
  129.   {  
  130.      for ($i=1, $cnt=count($sizes); ($i < $cnt && $size >= 1024); $i++)  
  131.      {  
  132.         $size = $size / 1024;  
  133.         $ext  = $sizes[$i];  
  134.         $rnd  = $rounders[$i];  
  135.      }  
  136.   }  
  137.  
  138.   if (!$rounder)  
  139.   {  
  140.      $rounder = $rnd;  
  141.   }  
  142.  
  143.   return round($size, $rounder) . '&nbsp;' . $ext;  
  144. }  
  145.  
  146. function ed2k_link_callback ($m)  
  147. {  
  148.   $max_len = 120;  
  149.   $href = 'href="' . $m[2] . '" class="postlink"';  
  150.   $size = ed2k_humanize_size($m[4]);  
  151.   $fname = urldecode($m[3]);  
  152.  
  153.   if (strlen($fname) > $max_len)  
  154.   {  
  155.      $fname = substr($fname, 0, $max_len - 19) . '...' . substr($fname, -16);  
  156.   }  
  157.   if (preg_match('#[<>"]#', $fname))  
  158.   {  
  159.      $fname = htmlspecialchars($fname);  
  160.   }  
  161.   // added an icon in front of link (ppw)  
  162.   return "<img src='images/mule_icon.gif' border='0'>&nbsp;<a $href>$fname&nbsp;($size)</a>";  
  163. }  
  164. // ed2k links end  
  165.  
  166. #  
  167. #-----[ FIND ]-----------------------------------------------  
  168. #  
  169.  
  170. function make_clickable($text)  
  171. {  
  172. $text = preg_replace('#(script|about|applet|activex|chrome):#is', "\\1:", $text);  
  173.  
  174.  // pad it with a space so we can match things at the start of the 1st line.  
  175.  $ret = ' ' . $text;  
  176.  
  177. #  
  178. #-----[ AFTER, ADD ]------------------------------------------  
  179. #  
  180.  
  181. // ed2k file links (Meithar):  
  182. // ed2k://|file|fileName|fileSize|fileHash|(optional params)|(optional params)|etc|  
  183. $ret = preg_replace_callback("#(^|(?<=[^\w\"']))(ed2k://\|file\|([^\\/\|:<>\*\?\"]+?)\|(\d+?)\|([a-f0-9]{32})\|(.*?)/?)(?![\"'])(?=([,\.]*?[\s<\[])|[,\.]*?$)#i", "ed2k_link_callback", $ret);  
  184. // ed2k server links:  
  185. // ed2k://|server|serverIP|serverPort  
  186. $ret = preg_replace("#(^|(?<=[^\w\"']))(ed2k://\|server\|([\d\.]+?)\|(\d+?)\|/?)#i", "<a href=\"\\2\" class=\"postLink\">\\3:\\4</a>", $ret);  
  187. // ed2k file links end  
  188.  
  189. #  
  190. #-----[ FIND ]-----------------------------------------------  
  191. #  
  192.  
  193. // Note: Only the followed chars are valid; alphanums, "-", "_" and or ".".  
  194.   $ret = preg_replace("#(^|[\n ])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $ret);  
  195.  
  196.   // Remove our padding..  
  197.   $ret = substr($ret, 1);  
  198.  
  199.   return($ret);  
  200. }  
  201.  
  202. #  
  203. #-----[ AFTER, ADD ]-----------------------------------------------  
  204. #  
  205.  
  206. /**  
  207. * Christian Riesen - Jun 27, 2004  
  208. * Adds the "Add all links to ed2k client" link to the end of the post text  
  209. */  
  210. function make_addalled2k_link($text,$post_id)  
  211. {  
  212. // padding  
  213. $ret = ' ' . $text;  
  214.  
  215. // dig through the message for all ed2k links!  
  216. // split up by "ed2k:"  
  217. $t_ed2k_raw = explode("ed2k:",$text);  
  218.  
  219. // The first item is garbage  
  220. unset($t_ed2k_raw[0]);  
  221.  
  222. // no need to dig through it if there are not at least 2 links!  
  223. $t_ed2k_possibles = count($t_ed2k_raw);  
  224. if ($t_ed2k_possibles > 1)  
  225. {  
  226. unset($t_ed2k_reallinks);  
  227. foreach ($t_ed2k_raw as $t_ed2k_raw_line)  
  228. {  
  229. $t_ed2k_parts = explode("|",$t_ed2k_raw_line);  
  230. // This looks now like this (only important parts included  
  231. /*  
  232. [1]=>  
  233. string(4) "file"  
  234. [2]=>  
  235. string(46) "some-filename-here.txt"  
  236. [3]=>  
  237. string(9) "321456789"  
  238. [4]=>  
  239. string(32) "112233445566778899AABBCCDDEEFF11"  
  240. */  
  241.  
  242. // Check the obvious things  
  243. if (strlen($t_ed2k_parts[1]) == 4 AND $t_ed2k_parts[1] === "file" AND strlen($t_ed2k_parts[2]) > 0 AND strlen($t_ed2k_parts[4]) == 32 AND floatval($t_ed2k_parts[3]) > 0)  
  244. {  
  245. // This is a true link, lets paste it together and put it in an array  
  246. $t_ed2k_reallinks[] = "ed2k://|file|".str_replace("'","\'",$t_ed2k_parts[2])."|".$t_ed2k_parts[3]."|".$t_ed2k_parts[4]."|";  
  247. }  
  248. }  
  249.  
  250. // Now lets see if we have 2 or more links  
  251. // Only then, we do our little trick, because otherwise, it would be wasted for one link alone!  
  252. $t_ed2k_confirmed = count($t_ed2k_reallinks);  
  253. if ($t_ed2k_confirmed > 1)  
  254. {  
  255. $t_ed2kinsert = " \n";  
  256. $t_ed2kinsert .= "<SCRIPT> ";  
  257. $t_ed2kinsert .= "filearray".$post_id."=new Array; ";  
  258. $t_ed2kinsert .= "n=0; ";  
  259. $i = 0;  
  260. foreach($t_ed2k_reallinks as $t_ed2klink)  
  261. {  
  262. $t_ed2kinsert .= "filearray".$post_id."[".$i."]='".$t_ed2klink."'; ";  
  263. $i++;  
  264. }  
  265. $t_ed2kinsert .= "iv=false; ";  
  266. $t_ed2kinsert .= "function addfile".$post_id."(){ ";  
  267. $t_ed2kinsert .= " var s=filearray".$post_id."[n]; ";  
  268. $t_ed2kinsert .= " n++; ";  
  269. $t_ed2kinsert .= " if(n==filearray".$post_id.".length && iv){ ";  
  270. $t_ed2kinsert .= " top.clearInterval(iv); ";  
  271. $t_ed2kinsert .= " n=0; ";  
  272. $t_ed2kinsert .= " } ";  
  273. $t_ed2kinsert .= " top.document.location=s; ";  
  274. $t_ed2kinsert .= " return true; ";  
  275. $t_ed2kinsert .= "} ";  
  276. $t_ed2kinsert .= "function addall".$post_id."(){iv=top.setInterval('addfile".$post_id."()',250)} ";  
  277. $t_ed2kinsert .= "</SCRIPT> ";  
  278. //added an icon in front of link (ppw)  
  279. $t_ed2kinsert .= "<img src='images/ed2k-info.gif' border='0'>&nbsp;<a href='javascript:addall".$post_id."()'>Add ".$t_ed2k_confirmed." links to ed2k client</a> ";  
  280. $ret = $ret . $t_ed2kinsert;  
  281. }  
  282. }  
  283.  
  284. // remove padding  
  285. $ret = substr($ret, 1);  
  286.  
  287. return($ret);  
  288. }  
  289. // Add all links to ed2k client end  
  290.  
  291. #  
  292. #-----[ OPEN ]-----------------------------------------------  
  293. #  
  294.  
  295. viewtopic.php  
  296.  
  297. #  
  298. #-----[ FIND ]-----------------------------------------------  
  299. #  
  300. $message = make_clickable($message);  
  301.  
  302. #  
  303. #-----[ BEFORE, ADD ]-----------------------------------------------  
  304. #  
  305.  
  306. $message = make_addalled2k_link($message,$postrow[$i]['post_id']); // ed2k link and add all  
  307.  
  308. #-----[ SAVE/CLOSE ALL FILES ]----------------------------------------------- 


Eso es todo amigos: Hacer copias de seguridad de vuestros archivos antes de efectuar cambios





____________
En breve me pasare al lado oscuro.
Antes de nada, lee las Normas de CiberMorph.
Si es sobre cómo Crear una Consulta SQL ya lo tienes explicado en el enlace.
En general, se pide Buscar antes de preguntar para no repetir preguntas y dudas resueltas.
Solo tendras algo de Ayuda si respetas el Copyright de phpBB.
NOTA: No preguntéis por MP ni E-Mail. No se dará respuesta a las posibles dudas que mandéis. Poned en el Foro, vuestras dudas,
si podemos las intentaremos solucionar. Así quedará constancia por si alguien más pudiera necesitarlo

Recordad que esto no es un foro de soporte, sólo se intenta ayudar. Saludos a todos .^-^.
Morph


Image
Desconectado MSN Messenger Yahoo Messenger Ver perfil del usuario Enviar Mensaje Privado Visitar sitio Web del Usuario
Descargar Mensaje Volver arriba Página Inferior
Gracias por el tema tan útil, Morph:
SuperNovato (24 Julio), zankyw (24 Julio) 
Mostrar mensajes anteriores:   
Ocultar¿Este tema fue útil?

 

No está autorizado a valorar este Tema

Media de Valoración Valoración Mínima Valoración Máxima Número de Valoraciones
0.00 0 0 0
Compartir este tema
blinkslist.com blogmarks.net co.mments.com del.icio.us digg.com newsvine.com facebook.com fark.com feedmelinks.com furl.net google.com linkagogo.com ma.gnolia.com meneame.net netscape.com reddit.com shadows.com simpy.com slashdot.org smarking.com spurl.net stumbleupon.com technorati.com favorites.live.com yahoo.com DIGG ITA Fai Informazione KiPapa Ok Notizie Segnalo
OcultarTemas Parecidos
Tema Autor Foro Respuestas Último Mensaje
No hay nuevos mensajes Links Mod chrids Icy Phoenix 1 19 Feb 2008 01:23 Ver último mensaje
Mago Cloud
No hay nuevos mensajes simple links prosilver_1.0.0 Morph Phpbb-3 0 11 Aug 2007 21:52 Ver último mensaje
Morph
No hay nuevos mensajes Como Ocultar Links En El Foro?? Invitado Phpbb2-XS2 1 06 Mar 2007 22:15 Ver último mensaje
Morph
No hay nuevos mensajes [SOLUCIONADO] Links Con Vista Previa. poderfull Phpbb2-XS2 2 12 Mar 2007 17:30 Ver último mensaje
poderfull
No hay nuevos mensajes Mostrar Página HTML Con Estilo Icy Phoenix... chrids Icy Phoenix 3 13 Feb 2008 23:57 Ver último mensaje
jd_zuri

Publicar Nuevo Tema  El tema está bloqueado: no pueden editarse ni agregar mensajes.  Página 1 de 1
 

Usuarios navegando en este Tema: 0 Registrados, 0 Ocultos y 1 Invitado
Usuarios Registrados conectados: Ninguno


 
Lista de Permisos
No puede crear mensajes
No puede responder temas
No puede editar sus mensajes
No puede borrar sus mensajes
No puede votar en encuestas
No puede adjuntar archivos
No Puede descargar archivos
No Puede enviar eventos al Calendario



  
.:: MorpH 2003@2008. Afiliados y Enlaces de Interes ::.


 Páginas Web alojadas en Fenixer

 MuchoGrafico Paz y Justicia InForHosting Astrotecno JanuWeb Lphant  PhPBB-es
 eddb phpBBHacks.Es Buscar con Google Gmail Google Analytics Punto Warez Juegos Flash Gratis Tu Web Aqui



Valid Robots.txt

Webmasters, ganen dinero mostrando Avisos de contexto Oxado