Foros del Web » Programando para Internet » PHP »

Funcion utils_kexplode(), que hace?

Estas en el tema de Funcion utils_kexplode(), que hace? en el foro de PHP en Foros del Web. Hola gente, estoy tratando de implementar una funcion para embeber videos y al ejecutar el siguiente script, me tira el siguiente error: Fatal error: Call ...
  #1 (permalink)  
Antiguo 17/03/2009, 22:02
 
Fecha de Ingreso: junio-2008
Mensajes: 119
Antigüedad: 15 años, 10 meses
Puntos: 1
Funcion utils_kexplode(), que hace?

Hola gente, estoy tratando de implementar una funcion para embeber videos y al ejecutar el siguiente script, me tira el siguiente error:

Fatal error: Call to undefined function utils_kexplode() in ....php on line 188

si alguien sabe que hace esta funcion o como implementarla les agradeceria, les dejo el codigo para que lo vean a la funcion la llama dos veces a la mitad y una por el final...

Código PHP:
                    // Function for embedding videos
                    
function do_bbcode_video($action$attr$content$params$node_object) {

                        if (
$action=='validate') {
                            return 
true;
                        }


                        
$vurl parse_url($attr['default']);

                        if (isset(
$attr['type'])) {
                            
$type $attr['type'];
                        } else {

                            
// is it http://www.MYSITE.com  or http://MYSITE.com ?
                            
$web explode('.'$vurl['host']);
                            
array_pop($web);
                            
$type = isset($web[1])? $web[1] : $web[0];

                        }

                        
$query utils_kexplode($vurl['query'], '=&');

                        
$the_url null;
                        
$others '';
                        switch (
$type) {
                            case 
'google':
                                
$the_url "http://video.google.com/googleplayer.swf?docid={$query['docid']}";
                                
$others '<param name="FlashVars" value="playerMode=embedded" />';
                                break;
                            case 
'youtube':
                                
$the_url "http://youtube.com/v/{$query['v']}";
                                break;
                            case 
'default':
                                
$the_url null;
                        }

                        if (
$the_url) {

                            
$width = isset($attr['width'])? $attr['width'] : '400';
                            
$height = isset($attr['height'])? $attr['height'] : '326';
                            
$float = isset($attr['float'])? "float: {$attr['float']}" '';


                            return
                                
'<center><object type="application/x-shockwave-flash" '.
                                
"height=\"$height\" width=\"$width\"".
                                
'style="' $float.    '" data="' .
                                
$the_url '"><param name="movie" value="' $the_url '" />'
                                
$others '</object><center>';
                        }

                        return 
'[Video no soportado]';

                    } 
Gracias
  #2 (permalink)  
Antiguo 17/03/2009, 22:24
Avatar de pateketrueke
Modernizr
 
Fecha de Ingreso: abril-2008
Ubicación: Mexihco-Tenochtitlan
Mensajes: 26.399
Antigüedad: 16 años
Puntos: 2534
Respuesta: Funcion utils_kexplode(), que hace?

pues utils_kexplode() no es una función estándar de PHP ...

¿¿como piensas que nosotros sabemos que hace o que no???

debes revisas tus scripts, de donde empezaste a copiar tu funcion..... ya que si la hubieras hecho tu, pues obvio, sabrías que es esta función...


en fin, suerte!
__________________
Y U NO RTFM? щ(ºдºщ)

No atiendo por MP nada que no sea personal.
  #3 (permalink)  
Antiguo 18/03/2009, 18:20
 
Fecha de Ingreso: junio-2008
Mensajes: 119
Antigüedad: 15 años, 10 meses
Puntos: 1
Respuesta: Funcion utils_kexplode(), que hace?

Bueno me contesto a mi mismo, hay que modificar la linea de esta funcion por esta para poder embeber los videos de youtube y el codigo quedaria mas o menos asi...

utils_kexplode() --> $query=$vurl['query'];

Código PHP:
 function do_bbcode_video($action$attr$content$params$node_object) {

                        if (
$action=='validate') {
                            return 
true;
                        }


                        
$vurl parse_url($attr['default']);

                        if (isset(
$attr['type'])) {
                            
$type $attr['type'];
                        } else {

                            
// is it http://www.MYSITE.com  or http://MYSITE.com ?
                            
$web explode('.'$vurl['host']);
                            
array_pop($web);
                            
$type = isset($web[1])? $web[1] : $web[0];

                        }

//                        $query = utils_kexplode($vurl['query'], '=&');
                        
                        
$query=$vurl['query'];
                        
                        
$the_url null;
                        
$others '';
                        switch (
$type) {
                            case 
'google':
                                
$the_url "http://video.google.com/googleplayer.swf?docid={$query['docid']}";
                                
$others '<param name="FlashVars" value="playerMode=embedded" />';
                                break;
                            case 
'youtube':
                                
//$the_url = "http://youtube.com/v/{$query['v']}";
                                
$youtube_url=substr($query2);
                                
$the_url "http://youtube.com/v/{$youtube_url}";
                                break;
                            case 
'default':
                                
$the_url null;
                        }

                        if (
$the_url) {

                            
$width = isset($attr['width'])? $attr['width'] : '400';
                            
$height = isset($attr['height'])? $attr['height'] : '326';
                            
$float = isset($attr['float'])? "float: {$attr['float']}" '';


                            return
                                
'<center><object type="application/x-shockwave-flash" '.
                                
"height=\"$height\" width=\"$width\"".
                                
'style="' $float.    '" data="' .
                                
$the_url '"><param name="movie" value="' $the_url '" />'
                                
$others '</object></center>';
                        }

                        return 
'<center>[Video no soportado]</center>';

                    } 
Espero que le sirva a alguien, Saludos...
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 21:34.