Pcultimate.net

Bienvenido, invitado ( Identificarse | Registrarse )

 
Closed TopicStart new topic
> Edk Links In Classes_bbcode.php, from raffa
Black Dragon
mensaje Feb 17 2007, 07:24 AM
Publicado: #1


Webmaster
Ícono de Grupo

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
Go to the top of the page
 
+Quote Post
Black Dragon
mensaje Feb 17 2007, 07:36 AM
Publicado: #2


Webmaster
Ícono de Grupo

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
Go to the top of the page
 
+Quote Post
raffa
mensaje Feb 17 2007, 10:14 AM
Publicado: #3


Newbie
*

Grupo: Miembro
Mensajes: 3
Registrado: 14-February 07
Miembro No.: 1,273



100.gif 100.gif

Hi Black Dragon truly thanks, I have resolved. It works very well!!!!
Not there would be successful without your aid! Thanks still!

22.gif 22.gif 22.gif
Go to the top of the page
 
+Quote Post
Black Dragon
mensaje Feb 17 2007, 10:18 AM
Publicado: #4


Webmaster
Ícono de Grupo

Grupo: Webmaster
Mensajes: 4,972
Registrado: 13-February 06
Desde: Tarragona - España
Miembro No.: 1



Anything you need 100.gif 100.gif

Bye
Go to the top of the page
 
+Quote Post

Closed TopicStart new topic

 



AFILIATE - ENLAZANOS- VER AFILIADOS
RSS LoFi Fecha y Hora actual: 12th May 2008 - 02:51 AM