Foros del Web » Creando para Internet » Sistemas de gestión de contenidos » WordPress »

codigo defectuoso

Estas en el tema de codigo defectuoso en el foro de WordPress en Foros del Web. hola me estoy haciendo una web tube con wordpress 3.5 en host privado, y el tema que e puesto incluye en las entradas una manera ...
  #1 (permalink)  
Antiguo 06/03/2013, 16:59
 
Fecha de Ingreso: febrero-2013
Mensajes: 14
Antigüedad: 13 años, 7 meses
Puntos: 0
Busqueda codigo defectuoso

hola me estoy haciendo una web tube con wordpress 3.5 en host privado,
y el tema que e puesto incluye en las entradas una manera de subir videos y de colocar una imagen en movimiento en la pagina de inicio (añadiendo la url de la imagen de la pagina del video) pero desconosco porque no me enseña las imagenes(miniatura) en inicio (el video si lo enseña), ninguna ponga la que le ponga no me deja verla pork puede ser (estara mal el codigo php). la web es www.videospornfree.es

Código PHP:
<?php

    
// Uses resizurr to create thumbnails

    
function arixWP_thumbnail($w, $h, $m, $a, $q, $class) {
    
            
$ax_customThumb             = get_option( 'ax_customThumb' );
            
$ax_customVideoCode             = get_option( 'ax_customVideoCode' );
            
$ax_customVideoFLV             = get_option( 'ax_customVideoFLV' );
            
$ax_customPaysiteTitle         = get_option( 'ax_customPaysiteTitle' );
            
$ax_customPaysiteUrl        = get_option( 'ax_customPaysiteUrl' );
            
$ax_customPostViews            = get_option( 'ax_customPostViews' );

            if ( 
$ax_customThumb == '' ) { $ax_customThumb = 'thumb'; }
            if ( 
$ax_customVideoCode == '' ) { $ax_customVideoCode = 'video_code'; }
            if ( 
$ax_customVideoFLV == '' ) { $ax_customVideoFLV = 'video_flv'; }
            if ( 
$ax_customPaysiteTitle == '' ) { $ax_customPaysiteTitle = 'paysite_title'; }
            if ( 
$ax_customPaysiteUrl == '' ) { $ax_customPaysiteUrl = 'paysite_url'; }
            if ( 
$ax_customPostViews == '' ) { $ax_customPostViews = 'ax_post_views'; }
    
        global 
$post;
        
        
// If the post has a featured image use it first.
        
if ( has_post_thumbnail( $post->ID ) ) {
        
            
$src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), array( 300,300 ), false, '' ); 
                                                        
            if ( 
is_multisite() ) {
                                                            
                global 
$blog_id;
                                                            
                    
$string = '/files';
                    
$replace = '/wp-content/blogs.dir/' . $blog_id . '/files';
                    
$thumbnailSrc = str_replace( $string, $replace, $src[0] );
                                                            
            } else {
                
                
$thumbnailSrc = $src[0];
                                                        
            }
        
        
// If no featured image exists look for the custom field 'thumb' and try to use that image.
        
} else {
        
            if ( 
get_post_meta($post->ID, $ax_customThumb, true) ) {
                
                
// The Value of the custom field 'thumb'
                
$url = get_post_meta($post->ID, $ax_customThumb, true);
                
                
// If image has been stripped already just load the file
                
if ( get_post_meta($post->ID, 'ax_stripped', true) ) {
                
                    
$thumbnailSrc = $url;
                
                
// Strip the thumbnail so we can cache it locally
                
} else {
                
                    
$tmp = download_url( $url );
                    
                    
$file_array = array(
                        
'name' => basename( $url ),
                        
'tmp_name' => $tmp
                    
);

                    
// Check for download errors
                    
if ( is_wp_error( $tmp ) ) {
                        @
unlink( $file_array[ 'tmp_name' ] );
                        return 
$tmp;
                    }

                    
$id = media_handle_sideload( $file_array, 0 );
                    
// Check for handle sideload errors.
                    
if ( is_wp_error( $id ) ) {
                        @
unlink( $file_array['tmp_name'] );
                        return 
$id;
                    }

                    
$attachment_url = wp_get_attachment_url( $id );
                    
// Do whatever you have to here    

                    
if ( $attachment_url ) {
                        
add_post_meta( $post->ID, 'ax_stripped', true );
                        
update_post_meta($post->ID, $ax_customThumb, $attachment_url);
                    }
                    
                    
$thumbnailSrc = $attachment_url;
                    
                }

                
            }
        
        }

        
$realThumb = get_template_directory_uri() . '/libs/resizurr.php?m=' . $m . '&amp;w=' . $w . '&amp;h=' . $h . '&amp;a=' . $a . '&amp;q=' . $q . '&amp;src=' . $thumbnailSrc;
                                                    
        
$thumbnail = '<a href="' . get_permalink() . '" title="' . get_the_title() . '" rel="bookmark"><img src="' . $realThumb . '" class="' . $class . '" alt="" /></a>';
        
        echo 
$thumbnail;
    }
    
    
    
// Show Related Posts
    
        
function arixWp_Related($amt) {
        
        
// Get custom field values 
        
            
$ax_customThumb             = get_option( 'ax_customThumb' );
            
$ax_customVideoCode             = get_option( 'ax_customVideoCode' );
            
$ax_customVideoFLV             = get_option( 'ax_customVideoFLV' );
            
$ax_customPaysiteTitle         = get_option( 'ax_customPaysiteTitle' );
            
$ax_customPaysiteUrl        = get_option( 'ax_customPaysiteUrl' );
            
$ax_customPostViews            = get_option( 'ax_customPostViews' );

            if ( 
$ax_customThumb == '' ) { $ax_customThumb = 'thumb'; }
            if ( 
$ax_customVideoCode == '' ) { $ax_customVideoCode = 'video_code'; }
            if ( 
$ax_customVideoFLV == '' ) { $ax_customVideoFLV = 'video_flv'; }
            if ( 
$ax_customPaysiteTitle == '' ) { $ax_customPaysiteTitle = 'paysite_title'; }
            if ( 
$ax_customPaysiteUrl == '' ) { $ax_customPaysiteUrl = 'paysite_url'; }
            if ( 
$ax_customPostViews == '' ) { $ax_customPostViews = 'ax_post_views'; }        
        
            global 
$post;

                
$args = array(
                        
'category'            => array($post->post_category),
                        
'post__not_in'         => array($post->ID),
                        
'showposts'            =>    $amt,
                        
'post_status'        => 'publish',
                        
'caller_get_posts'    =>1,
                        
'orderby'            => 'rand'
                
);            

                
$my_query = new wp_query($args);
                    
                if( 
$my_query->have_posts() ) {

                    while ( 
$my_query->have_posts() ) {

                        
$my_query->the_post();
                        
                        if ( 
get_post_meta($post->ID, 'studio_name', true) ) {
                            
$paysite_title = get_post_meta($post->ID, 'studio_name', true); 
                        
                            if ( 
$paysite_title = '' ) {
                                
                                if ( 
get_post_meta($post->ID, $ax_customPaysiteTitle, true) ) { 
                                    
$paysite_title = get_post_meta($post->ID, $ax_customPaysiteTitle, true); 
                                } else { 
                                    
$paysite_title = ''; 
                                }
                            }
                        } else {
                        
                            if ( 
get_post_meta($post->ID, $ax_customPaysiteTitle, true) ) { 
                                
$paysite_title = get_post_meta($post->ID, $ax_customPaysiteTitle, true); 
                            } else { 
                                
$paysite_title = ''; 
                            }                        
                        }
                        if ( 
get_post_meta($post->ID, $ax_customPaysiteUrl, true) ) { $paysite_url = get_post_meta($post->ID, $ax_customPaysiteUrl, true); } else { $paysite_url = ''; }
                    
                        echo 
'<li>';
                        
arixWP_thumbnail(164, 110, 'cc', 'center', 100, 'archiveThumb'); // width, height, mode, anchor, quality
                        
?>
                        <p class="title"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php $title = substr( get_the_title( $before = '', $after = '', FALSE ), 0, 24 ) . '...'; echo $title; ?></a></p>
                        <p class="byline">by <a href="<?php echo $paysite_url; ?>" target="_blank"><?php echo $paysite_title; ?></a></p>
                        <?php
                        
echo '</li>';
                    }
                    
                }
                
                
wp_reset_query();                

        }    
    
    
    
    
    
?>

Etiquetas: php
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 09:55.