Bienvenido, invitado ( Identificarse | Registrarse )
![]() ![]() |
Feb 17 2007, 07:24 AM
Publicado:
#1
|
|
|
Webmaster Grupo: Webmaster Mensajes: 4,972 Registrado: 13-February 06 Desde: Tarragona - España Miembro No.: 1 |
Post original de raffa
Hello Back Dragon, reading yours post on invisionize board, they are recorded to me also here. I have tried to insert the code for edk links in classes_bbcode.php, but it does not work, it's my classes_bbcode.php after modify: CÓDIGO //----------------------------------------- // Custom BB code //----------------------------------------- if ( strstr( $t, '[/' ) ) { $t = $this->post_db_parse_bbcode($t); } //-------------------------------------- // Ed2k links //-------------------------------------- preg_match_all("#ed2k://\|(.*?)\|(.*?)\|([0-9]+)\|(.*?)\|/#", $t, $matches); foreach($matches[0] as $key=>$val) { $size_string = ($matches[3][$key] > 512)?( ($matches[3][$key]/1024 > 512) ?sprintf("%.02f Mb",($matches[3][$key]/1024)/1024) :sprintf("%.02f Kb",$matches[3][$key]/1024)) :sprintf("%d b",$matches[3][$key]); $pos = strpos($matches[4][$key], "|"); if($pos > 0) { $matches[4][$key] = substr($matches[4][$key], 0, $pos); } $matches[2][$key] = str_replace("%20", " ", $matches[2][$key]); $t = str_replace($val, "<a href='http://www.emugle.com/details.php?f=".$matches[4][$key]."' target='_blank'><img src='style_images/1/folder_mime_types/ed2k.gif' border='0' alt='Ed2k Details' title='Ed2k Details'></a> <a href='$val'>".$matches[2][$key]."</a> <b>(". $size_string . ")</b>", $t); } $t = preg_replace_callback( "#(<a href=[\"'])(.+?)([\"'])#is", array( $this, '_clean_long_url' ), $t ); return $t; } Where mistake? Thank Black Dragon |
|
|
|
Feb 17 2007, 07:36 AM
Publicado:
#2
|
|
|
Webmaster Grupo: Webmaster Mensajes: 4,972 Registrado: 13-February 06 Desde: Tarragona - España Miembro No.: 1 |
Hi raffa
CITA //----------------------------------------- // Custom BB code //----------------------------------------- if ( strstr( $t, '[/' ) ) { $t = $this->post_db_parse_bbcode($t); } return $t; } //-------------------------------------- // Ed2k links //-------------------------------------- preg_match_all("#ed2k://\|(.*?)\|(.*?)\|([0-9]+)\|(.*?)\|/#", $t, $matches); foreach($matches[0] as $key=>$val) { $size_string = ($matches[3][$key] > 512)?( ($matches[3][$key]/1024 > 512) ?sprintf("%.02f Mb",($matches[3][$key]/1024)/1024) :sprintf("%.02f Kb",$matches[3][$key]/1024)) :sprintf("%d b",$matches[3][$key]); $pos = strpos($matches[4][$key], "|"); if($pos > 0) { $matches[4][$key] = substr($matches[4][$key], 0, $pos); } $matches[2][$key] = str_replace("%20", " ", $matches[2][$key]); $t = str_replace($val, "http://www.emugle.com/details.php?f= ".$matches[2][$key]." (". $size_string . ")", $t); } $t = preg_replace_callback( "#( the red bit is missing so the function can't work. Bye |
|
|
|
Feb 17 2007, 10:14 AM
Publicado:
#3
|
|
|
Newbie ![]() Grupo: Miembro Mensajes: 3 Registrado: 14-February 07 Miembro No.: 1,273 |
Hi Black Dragon truly thanks, I have resolved. It works very well!!!! Not there would be successful without your aid! Thanks still! |
|
|
|
Feb 17 2007, 10:18 AM
Publicado:
#4
|
|
|
Webmaster Grupo: Webmaster Mensajes: 4,972 Registrado: 13-February 06 Desde: Tarragona - España Miembro No.: 1 |
Anything you need
Bye |
|
|
|
![]() ![]() |