Foros del Web » Programando para Internet » PHP »

AYUDAA POR FAVOOR Parse error: syntax error, unexpected '}'

Estas en el tema de AYUDAA POR FAVOOR Parse error: syntax error, unexpected '}' en el foro de PHP en Foros del Web. Hola! necesito ayuda urgente con mi codigo de functions.php el error que me sale es Parse error: syntax error, unexpected '}' in /home/kittenby/public_html/blog/wp-content/themes/codium-extend/functions.php on line ...
  #1 (permalink)  
Antiguo 14/04/2011, 10:22
 
Fecha de Ingreso: abril-2011
Mensajes: 5
Antigüedad: 13 años, 7 meses
Puntos: 0
Exclamación AYUDAA POR FAVOOR Parse error: syntax error, unexpected '}'

Hola! necesito ayuda urgente con mi codigo de functions.php

el error que me sale es
Parse error: syntax error, unexpected '}' in /home/kittenby/public_html/blog/wp-content/themes/codium-extend/functions.php on line 257


les agradeceria mucho si me pueden ayudar
este es el codigo:

$c[] = 'untagged';
} else {
foreach ( (array) get_the_tags() as $tag )
$c[] = 'tag-' . $tag->slug;
}

// For password-protected posts
if ( $post->post_password )
$c[] = 'protected';

// Applies the time- and date-based classes (below) to post DIV
codium_extend_date_classes( mysql2date( 'U', $post->post_date ), $c );

// If it's the other to the every, then add 'alt' class
if ( ++$codium_extend_post_alt % 2 )
$c[] = 'alt';

// Separates classes with a single space, collates classes for post DIV
$c = join( ' ', apply_filters( 'post_class', $c ) ); // Available filter: post_class

// And tada!
return $print ? print($c) : $c;
}

// Define the num val for 'alt' classes (in post DIV and comment LI)
$codium_extend_post_alt = 1;
//$codium_extend_comment_alt = 1;

// Generates semantic classes for each comment LI element
function codium_extend_comment_class( $print = true ) {
global $comment, $post, $codium_extend_comment_alt;

// Collects the comment type (comment, trackback),
$c = array( get_comment_type() );

// Counts trackbacks (t[n]) or comments (c[n])
if ( $comment->comment_type == 'comment' ) {
$c[] = "c$codium_extend_comment_alt";
} else {
$c[] = "t$codium_extend_comment_alt";
}

// If the comment author has an id (registered), then print the log in name
if ( $comment->user_id > 0 ) {
$user = get_userdata($comment->user_id);
// For all registered users, 'byuser'; to specificy the registered user, 'commentauthor+[log in name]'
$c[] = 'byuser comment-author-' . sanitize_title_with_dashes(strtolower( $user->user_login ));
// For comment authors who are the author of the post
if ( $comment->user_id === $post->post_author )
$c[] = 'bypostauthor';
}

// If it's the other to the every, then add 'alt' class; collects time- and date-based classes
codium_extend_date_classes( mysql2date( 'U', $comment->comment_date ), $c, 'c-' );
if ( ++$codium_extend_comment_alt % 2 )
$c[] = 'alt';

// Separates classes with a single space, collates classes for comment LI
$c = join( ' ', apply_filters( 'comment_class', $c ) ); // Available filter: comment_class

// Tada again!
return $print ? print($c) : $c;
}

// count comment
function codium_extend_comment_count( $print = true ) {
global $comment, $post, $codium_extend_comment_alt;

// Counts trackbacks and comments
if ( $comment->comment_type == 'comment' ) {
$count[] = "$codium_extend_comment_alt";
} else {
$count[] = "$codium_extend_comment_alt";
}

$count = join( ' ', $count ); // Available filter: comment_class

// Tada again!
echo $count;
//return $print ? print($count) : $count;
}


// Generates time- and date-based classes for BODY, post DIVs, and comment LIs; relative to GMT (UTC)
function codium_extend_date_classes( $t, &$c, $p = '' ) {
$t = $t + ( get_option('gmt_offset') * 3600 );
$c[] = $p . 'y' . gmdate( 'Y', $t ); // Year
$c[] = $p . 'm' . gmdate( 'm', $t ); // Month
$c[] = $p . 'd' . gmdate( 'd', $t ); // Day
$c[] = $p . 'h' . gmdate( 'H', $t ); // Hour
}

// For category lists on category archives: Returns other categories except the current one (redundant)
function codium_extend_cats_meow($glue) {
$current_cat = single_cat_title( '', false );
$separator = "\n";
$cats = explode( $separator, get_the_category_list($separator) );
foreach ( $cats as $i => $str ) {
if ( strstr( $str, ">$current_cat<" ) ) {
unset($cats[$i]);
break;
}
}
if ( empty($cats) )
return false;

return trim(join( $glue, $cats ));
}

// For tag lists on tag archives: Returns other tags except the current one (redundant)
function codium_extend_tag_ur_it($glue) {
$current_tag = single_tag_title( '', '', false );
$separator = "\n";
$tags = explode( $separator, get_the_tag_list( "", "$separator", "" ) );
foreach ( $tags as $i => $str ) {
if ( strstr( $str, ">$current_tag<" ) ) {
unset($tags[$i]);
break;
}
}
if ( empty($tags) )
return false;

return trim(join( $glue, $tags ));
}

if ( ! function_exists( 'codium_extend_posted_on' ) ) :
// data before post
function codium_extend_posted_on() {
printf( __( '<span class="%1$s">Posted on</span> %2$s <span class="meta-sep">by</span> %3$s.', 'codium_extend' ),
'meta-prep meta-prep-author',
sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><span class="entry-date">%3$s</span></a>',
get_permalink(),
esc_attr( get_the_time() ),
get_the_date()
),
sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>',
get_author_posts_url( get_the_author_meta( 'ID' ) ),
sprintf( esc_attr__( 'View all posts by %s', 'codium_extend' ), get_the_author() ),
get_the_author()
)
);
}
endif;

if ( ! function_exists( 'codium_extend_posted_in' ) ) :
// data after post
function codium_extend_posted_in() {
// Retrieves tag list of current post, separated by commas.
$tag_list = get_the_tag_list( '', ', ' );
if ( $tag_list ) {
$posted_in = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'codium_extend' );
} elseif ( is_object_in_taxonomy( get_post_type(), 'category' ) ) {
$posted_in = __( 'This entry was posted in %1$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'codium_extend' );
} else {
$posted_in = __( 'Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'codium_extend' );
}
// Prints the string, replacing the placeholders.
printf(
$posted_in,
get_the_category_list( ', ' ),
$tag_list,
get_permalink(),
the_title_attribute( 'echo=0' )
);
}
endif;


// Widgets plugin: intializes the plugin after the widgets above have passed snuff
function codium_extend_widgets_init() {

register_sidebar(array(
'name' => 'SidebarTop',
'description' => 'Top sidebar',
'before_widget' => "\n\t\t\t" . '<li id="%1$s" class="widget %2$s"><div class="widgetblock">',
'after_widget' => "\n\t\t\t</div></li>\n",
'before_title' => "\n\t\t\t\t". '<div class="widgettitleb"><h3 class="widgettitle">',
'after_title' => "</h3></div>\n" .''
));

register_sidebar(array(
'name' => 'SidebarBottom',
'description' => 'Bottom sidebar',
'before_widget' => "\n\t\t\t" . '<li id="%1$s" class="widget %2$s"><div class="widgetblock">',
'after_widget' => "\n\t\t\t</div></li>\n",
'before_title' => "\n\t\t\t\t". '<div class="widgettitleb"><h3 class="widgettitle">',
'after_title' => "</h3></div>\n" .''
));

}



// Changes default [...] in excerpt to a real link
function codium_extend_excerpt_more($more) {
global $post;
$readmore = __(' read more <span class="meta-nav">&raquo;</span>', 'codium_extend' );
return ' <a href="'. get_permalink($post->ID) . '">' . $readmore . '</a>';
}
add_filter('excerpt_more', 'codium_extend_excerpt_more');


// Runs our code at the end to check that everything needed has loaded
add_action( 'init', 'codium_extend_widgets_init' );


// Adds filters for the description/meta content in archives.php
add_filter( 'archive_meta', 'wptexturize' );
add_filter( 'archive_meta', 'convert_smilies' );
add_filter( 'archive_meta', 'convert_chars' );
add_filter( 'archive_meta', 'wpautop' );

// Remember: the codium_extend is for play.



//Remove <p> in excerpt
function codium_extend_strip_para_tags ($content) {
if ( is_home() && ($paged < 2 )) {
$content = str_replace( '<p>', '', $content );
$content = str_replace( '</p>', '', $content );
return $content;
}
}

//Comment function
function codium_extend_comment($comment, $args, $depth) {
$GLOBALS['comment'] = $comment; ?>

<li id="comment-<?php comment_ID() ?>" class="<?php codium_extend_comment_class() ?>">
<span class="count"><?php echo codium_extend_comment_count();?></span>
<div class="comment-author vcard">
<?php echo get_avatar( $comment, 48 ); ?>
<?php printf(__('<div class="fn">%s</div> '), get_comment_author_link()) ?>
</div>

<?php if ($comment->comment_approved == '0') : ?>
<em><?php _e('Your comment is in moderation.') ?></em>
<br />
<?php endif; ?>

<div class="comment-meta"><?php printf(__('%1$s - %2$s <span class="meta-sep">|</span> <a href="%3$s" title="Permalink to this comment">Permalink</a>', 'codium_extend'),
get_comment_date(),
get_comment_time(),
'#comment-' . get_comment_ID() );
edit_comment_link(__('Edit', 'codium_extend'), ' <span class="meta-sep">|</span> <span class="edit-link">', '</span>'); ?></div>
<div class="clear"></div>

<?php comment_text() ?>

<div class="reply">
<?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
</div>
<?php

}

//custom menu support
add_action( 'init', 'codium_extend_register_my_menu' );

function codium_extend_register_my_menu() {
register_nav_menu( 'primary-menu', __( 'Primary Menu' ) );
}


?>

Última edición por carlossse; 14/04/2011 a las 10:34
  #2 (permalink)  
Antiguo 14/04/2011, 10:36
Avatar de bUllan9ebrio  
Fecha de Ingreso: enero-2011
Ubicación: Chile
Mensajes: 1.128
Antigüedad: 13 años, 9 meses
Puntos: 128
Respuesta: AYUDAA POR FAVOOR Parse error: syntax error, unexpected '}'

Probaste sacando la llave de la linea 257, ordena tu código y aparecerá la solución, cuando copiaste esa función de alguna web, salia algún consejo de que funciona?
__________________
Si no vivimos como pensamos, pronto empezaremos a pensar como vivimos.
Más vale un Gracias sincero, que un número que aumente "popularidad" ¬¬°

Universidad de chile, campeón
  #3 (permalink)  
Antiguo 14/04/2011, 10:40
Avatar de bioxido  
Fecha de Ingreso: diciembre-2008
Ubicación: $_SERVER['PHP_SELF']
Mensajes: 601
Antigüedad: 15 años, 11 meses
Puntos: 21
Respuesta: AYUDAA POR FAVOOR Parse error: syntax error, unexpected '}'

Primero que nada, usa highlight [ php] [ /php] porque sino la próxima ni me gasto en leer tu mensaje.

Viéndolo así nomas, te puedo decir que tiene 2 errores principales... En la linea 3 y la línea 24

Abri los ojos, lee el codigo, y te vas a dar cuenta de los errores chotos que tiene.

AUNQUE... sospecho que ese no es todo el script, asique talvez no sean errores, si no pones el script completo no podemos hacer nada...
(No significa que si subis un archivo de 800líneas lo valla a leer..)
  #4 (permalink)  
Antiguo 14/04/2011, 10:47
 
Fecha de Ingreso: abril-2011
Mensajes: 5
Antigüedad: 13 años, 7 meses
Puntos: 0
Respuesta: AYUDAA POR FAVOOR Parse error: syntax error, unexpected '}'

Disculpa! no se nada de esto! solo queria editar el tema de wp.
gracias por ayudar...

te envio el codigo nuevamente

el error que dice que hay es en en la linea 257

Parse error: syntax error, unexpected '}' in /home/kittenby/public_html/blog/wp-content/themes/codium-extend/functions.php on line 257


Código PHP:
Ver original
  1. $c[] = 'untagged';
  2.     } else {
  3.         foreach ( (array) get_the_tags() as $tag )
  4.             $c[] = 'tag-' . $tag->slug;
  5.     }
  6.  
  7.     // For password-protected posts
  8.     if ( $post->post_password )
  9.         $c[] = 'protected';
  10.  
  11.     // Applies the time- and date-based classes (below) to post DIV
  12.     codium_extend_date_classes( mysql2date( 'U', $post->post_date ), $c );
  13.  
  14.     // If it's the other to the every, then add 'alt' class
  15.     if ( ++$codium_extend_post_alt % 2 )
  16.         $c[] = 'alt';
  17.  
  18.     // Separates classes with a single space, collates classes for post DIV
  19.     $c = join( ' ', apply_filters( 'post_class', $c ) ); // Available filter: post_class
  20.  
  21.     // And tada!
  22.     return $print ? print($c) : $c;
  23. }
  24.  
  25. // Define the num val for 'alt' classes (in post DIV and comment LI)
  26. $codium_extend_post_alt = 1;
  27. //$codium_extend_comment_alt = 1;
  28.  
  29. // Generates semantic classes for each comment LI element
  30. function codium_extend_comment_class( $print = true ) {
  31.     global $comment, $post, $codium_extend_comment_alt;
  32.  
  33.     // Collects the comment type (comment, trackback),
  34.     $c = array( get_comment_type() );
  35.  
  36.     // Counts trackbacks (t[n]) or comments (c[n])
  37.     if ( $comment->comment_type == 'comment' ) {
  38.         $c[] = "c$codium_extend_comment_alt";
  39.     } else {
  40.         $c[] = "t$codium_extend_comment_alt";
  41.     }
  42.  
  43.     // If the comment author has an id (registered), then print the log in name
  44.     if ( $comment->user_id > 0 ) {
  45.         $user = get_userdata($comment->user_id);
  46.         // For all registered users, 'byuser'; to specificy the registered user, 'commentauthor+[log in name]'
  47.         $c[] = 'byuser comment-author-' . sanitize_title_with_dashes(strtolower( $user->user_login ));
  48.         // For comment authors who are the author of the post
  49.         if ( $comment->user_id === $post->post_author )
  50.             $c[] = 'bypostauthor';
  51.     }
  52.  
  53.     // If it's the other to the every, then add 'alt' class; collects time- and date-based classes
  54.     codium_extend_date_classes( mysql2date( 'U', $comment->comment_date ), $c, 'c-' );
  55.     if ( ++$codium_extend_comment_alt % 2 )
  56.         $c[] = 'alt';
  57.  
  58.     // Separates classes with a single space, collates classes for comment LI
  59.     $c = join( ' ', apply_filters( 'comment_class', $c ) ); // Available filter: comment_class
  60.    
  61.     // Tada again!
  62.     return $print ? print($c) : $c;
  63. }
  64.  
  65. // count comment
  66. function codium_extend_comment_count( $print = true ) {
  67.     global $comment, $post, $codium_extend_comment_alt;
  68.  
  69.     // Counts trackbacks and comments
  70.     if ( $comment->comment_type == 'comment' ) {
  71.         $count[] = "$codium_extend_comment_alt";
  72.     } else {
  73.         $count[] = "$codium_extend_comment_alt";
  74.     }
  75.  
  76.     $count = join( ' ', $count ); // Available filter: comment_class
  77.  
  78.     // Tada again!
  79.     echo $count;
  80.     //return $print ? print($count) : $count;
  81. }
  82.  
  83.  
  84. // Generates time- and date-based classes for BODY, post DIVs, and comment LIs; relative to GMT (UTC)
  85. function codium_extend_date_classes( $t, &$c, $p = '' ) {
  86.     $t = $t + ( get_option('gmt_offset') * 3600 );
  87.     $c[] = $p . 'y' . gmdate( 'Y', $t ); // Year
  88.     $c[] = $p . 'm' . gmdate( 'm', $t ); // Month
  89.     $c[] = $p . 'd' . gmdate( 'd', $t ); // Day
  90.     $c[] = $p . 'h' . gmdate( 'H', $t ); // Hour
  91. }
  92.  
  93. // For category lists on category archives: Returns other categories except the current one (redundant)
  94. function codium_extend_cats_meow($glue) {
  95.     $current_cat = single_cat_title( '', false );
  96.     $separator = "\n";
  97.     $cats = explode( $separator, get_the_category_list($separator) );
  98.     foreach ( $cats as $i => $str ) {
  99.         if ( strstr( $str, ">$current_cat<" ) ) {
  100.             unset($cats[$i]);
  101.             break;
  102.         }
  103.     }
  104.     if ( empty($cats) )
  105.         return false;
  106.  
  107.     return trim(join( $glue, $cats ));
  108. }
  109.  
  110. // For tag lists on tag archives: Returns other tags except the current one (redundant)
  111. function codium_extend_tag_ur_it($glue) {
  112.     $current_tag = single_tag_title( '', '',  false );
  113.     $separator = "\n";
  114.     $tags = explode( $separator, get_the_tag_list( "", "$separator", "" ) );
  115.     foreach ( $tags as $i => $str ) {
  116.         if ( strstr( $str, ">$current_tag<" ) ) {
  117.             unset($tags[$i]);
  118.             break;
  119.         }
  120.     }
  121.     if ( empty($tags) )
  122.         return false;
  123.  
  124.     return trim(join( $glue, $tags ));
  125. }
  126.  
  127. if ( ! function_exists( 'codium_extend_posted_on' ) ) :
  128. // data before post
  129. function codium_extend_posted_on() {
  130.     printf( __( '<span class="%1$s">Posted on</span> %2$s <span class="meta-sep">by</span> %3$s.', 'codium_extend' ),
  131.         'meta-prep meta-prep-author',
  132.         sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><span class="entry-date">%3$s</span></a>',
  133.             get_permalink(),
  134.             esc_attr( get_the_time() ),
  135.             get_the_date()
  136.         ),
  137.         sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>',
  138.             get_author_posts_url( get_the_author_meta( 'ID' ) ),
  139.             sprintf( esc_attr__( 'View all posts by %s', 'codium_extend' ), get_the_author() ),
  140.             get_the_author()
  141.         )
  142.     );
  143. }
  144. endif;
  145.  
  146. if ( ! function_exists( 'codium_extend_posted_in' ) ) :
  147. // data after post
  148. function codium_extend_posted_in() {
  149.     // Retrieves tag list of current post, separated by commas.
  150.     $tag_list = get_the_tag_list( '', ', ' );
  151.     if ( $tag_list ) {
  152.         $posted_in = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'codium_extend' );
  153.     } elseif ( is_object_in_taxonomy( get_post_type(), 'category' ) ) {
  154.         $posted_in = __( 'This entry was posted in %1$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'codium_extend' );
  155.     } else {
  156.         $posted_in = __( 'Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'codium_extend' );
  157.     }
  158.     // Prints the string, replacing the placeholders.
  159.     printf(
  160.         $posted_in,
  161.         get_the_category_list( ', ' ),
  162.         $tag_list,
  163.         get_permalink(),
  164.         the_title_attribute( 'echo=0' )
  165.     );
  166. }
  167. endif;
  168.  
  169.  
  170. // Widgets plugin: intializes the plugin after the widgets above have passed snuff
  171. function codium_extend_widgets_init() {
  172.  
  173.         register_sidebar(array(
  174.         'name' => 'SidebarTop',
  175.         'description' => 'Top sidebar',
  176.         'before_widget'  =>   "\n\t\t\t" . '<li id="%1$s" class="widget %2$s"><div class="widgetblock">',
  177.         'after_widget'   =>   "\n\t\t\t</div></li>\n",
  178.         'before_title'   =>   "\n\t\t\t\t". '<div class="widgettitleb"><h3 class="widgettitle">',
  179.         'after_title'    =>   "</h3></div>\n" .''
  180.         ));
  181.        
  182.         register_sidebar(array(
  183.         'name' => 'SidebarBottom',
  184.         'description' => 'Bottom sidebar',
  185.         'before_widget'  =>   "\n\t\t\t" . '<li id="%1$s" class="widget %2$s"><div class="widgetblock">',
  186.         'after_widget'   =>   "\n\t\t\t</div></li>\n",
  187.         'before_title'   =>   "\n\t\t\t\t". '<div class="widgettitleb"><h3 class="widgettitle">',
  188.         'after_title'    =>   "</h3></div>\n" .''
  189.         ));
  190.  
  191.     }
  192.  
  193.  
  194.  
  195. // Changes default [...] in excerpt to a real link
  196. function codium_extend_excerpt_more($more) {
  197.        global $post;
  198.        $readmore = __(' read more <span class="meta-nav">&raquo;</span>', 'codium_extend' );
  199.     return ' <a href="'. get_permalink($post->ID) . '">' . $readmore . '</a>';
  200. }
  201. add_filter('excerpt_more', 'codium_extend_excerpt_more');
  202.  
  203.  
  204. // Runs our code at the end to check that everything needed has loaded
  205. add_action( 'init', 'codium_extend_widgets_init' );
  206.  
  207.  
  208. // Adds filters for the description/meta content in archives.php
  209. add_filter( 'archive_meta', 'wptexturize' );
  210. add_filter( 'archive_meta', 'convert_smilies' );
  211. add_filter( 'archive_meta', 'convert_chars' );
  212. add_filter( 'archive_meta', 'wpautop' );
  213.  
  214. // Remember: the codium_extend is for play.
  215.  
  216.  
  217.  
  218. //Remove <p> in excerpt
  219. function codium_extend_strip_para_tags ($content) {
  220. if ( is_home() && ($paged < 2 )) {
  221.   $content = str_replace( '<p>', '', $content );
  222.   $content = str_replace( '</p>', '', $content );
  223.   return $content;
  224. }
  225. }
  226.  
  227. //Comment function
  228. function codium_extend_comment($comment, $args, $depth) {
  229.    $GLOBALS['comment'] = $comment; ?>
  230.    
  231.    <li id="comment-<?php comment_ID() ?>" class="<?php codium_extend_comment_class() ?>">
  232.       <span class="count"><?php echo codium_extend_comment_count();?></span>
  233.       <div class="comment-author vcard">
  234.         <?php echo get_avatar( $comment, 48 ); ?>
  235.         <?php printf(__('<div class="fn">%s</div> '), get_comment_author_link()) ?>
  236.       </div>
  237.        
  238.       <?php if ($comment->comment_approved == '0') : ?>
  239.          <em><?php _e('Your comment is in moderation.') ?></em>
  240.          <br />
  241.       <?php endif; ?>
  242.  
  243.       <div class="comment-meta"><?php printf(__('%1$s - %2$s <span class="meta-sep">|</span> <a href="%3$s" title="Permalink to this comment">Permalink</a>', 'codium_extend'),
  244.                                         get_comment_date(),
  245.                                         get_comment_time(),
  246.                                         '#comment-' . get_comment_ID() );
  247.                                         edit_comment_link(__('Edit', 'codium_extend'), ' <span class="meta-sep">|</span> <span class="edit-link">', '</span>'); ?></div>
  248.       <div class="clear"></div>
  249.            
  250.       <?php comment_text() ?>
  251.  
  252.       <div class="reply">
  253.          <?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
  254.       </div>
  255. <?php
  256.  
  257.         }
  258.        
  259. //custom menu support
  260. add_action( 'init', 'codium_extend_register_my_menu' );
  261.  
  262. function codium_extend_register_my_menu() {
  263.     register_nav_menu( 'primary-menu', __( 'Primary Menu' ) );
  264. }        
  265.  
  266.  
  267. ?>


GRACIAS
  #5 (permalink)  
Antiguo 14/04/2011, 10:49
 
Fecha de Ingreso: abril-2011
Mensajes: 5
Antigüedad: 13 años, 7 meses
Puntos: 0
Respuesta: AYUDAA POR FAVOOR Parse error: syntax error, unexpected '}'

Disculpa! no se nada de esto! solo queria editar el tema de wp.
gracias por ayudar...

te envio el codigo nuevamente

el error que dice que hay es en en la linea 257

Parse error: syntax error, unexpected '}' in /home/kittenby/public_html/blog/wp-content/themes/codium-extend/functions.php on line 257


Código PHP:
Ver original
  1. $c[] = 'untagged';
  2.     } else {
  3.         foreach ( (array) get_the_tags() as $tag )
  4.             $c[] = 'tag-' . $tag->slug;
  5.     }
  6.  
  7.     // For password-protected posts
  8.     if ( $post->post_password )
  9.         $c[] = 'protected';
  10.  
  11.     // Applies the time- and date-based classes (below) to post DIV
  12.     codium_extend_date_classes( mysql2date( 'U', $post->post_date ), $c );
  13.  
  14.     // If it's the other to the every, then add 'alt' class
  15.     if ( ++$codium_extend_post_alt % 2 )
  16.         $c[] = 'alt';
  17.  
  18.     // Separates classes with a single space, collates classes for post DIV
  19.     $c = join( ' ', apply_filters( 'post_class', $c ) ); // Available filter: post_class
  20.  
  21.     // And tada!
  22.     return $print ? print($c) : $c;
  23. }
  24.  
  25. // Define the num val for 'alt' classes (in post DIV and comment LI)
  26. $codium_extend_post_alt = 1;
  27. //$codium_extend_comment_alt = 1;
  28.  
  29. // Generates semantic classes for each comment LI element
  30. function codium_extend_comment_class( $print = true ) {
  31.     global $comment, $post, $codium_extend_comment_alt;
  32.  
  33.     // Collects the comment type (comment, trackback),
  34.     $c = array( get_comment_type() );
  35.  
  36.     // Counts trackbacks (t[n]) or comments (c[n])
  37.     if ( $comment->comment_type == 'comment' ) {
  38.         $c[] = "c$codium_extend_comment_alt";
  39.     } else {
  40.         $c[] = "t$codium_extend_comment_alt";
  41.     }
  42.  
  43.     // If the comment author has an id (registered), then print the log in name
  44.     if ( $comment->user_id > 0 ) {
  45.         $user = get_userdata($comment->user_id);
  46.         // For all registered users, 'byuser'; to specificy the registered user, 'commentauthor+[log in name]'
  47.         $c[] = 'byuser comment-author-' . sanitize_title_with_dashes(strtolower( $user->user_login ));
  48.         // For comment authors who are the author of the post
  49.         if ( $comment->user_id === $post->post_author )
  50.             $c[] = 'bypostauthor';
  51.     }
  52.  
  53.     // If it's the other to the every, then add 'alt' class; collects time- and date-based classes
  54.     codium_extend_date_classes( mysql2date( 'U', $comment->comment_date ), $c, 'c-' );
  55.     if ( ++$codium_extend_comment_alt % 2 )
  56.         $c[] = 'alt';
  57.  
  58.     // Separates classes with a single space, collates classes for comment LI
  59.     $c = join( ' ', apply_filters( 'comment_class', $c ) ); // Available filter: comment_class
  60.    
  61.     // Tada again!
  62.     return $print ? print($c) : $c;
  63. }
  64.  
  65. // count comment
  66. function codium_extend_comment_count( $print = true ) {
  67.     global $comment, $post, $codium_extend_comment_alt;
  68.  
  69.     // Counts trackbacks and comments
  70.     if ( $comment->comment_type == 'comment' ) {
  71.         $count[] = "$codium_extend_comment_alt";
  72.     } else {
  73.         $count[] = "$codium_extend_comment_alt";
  74.     }
  75.  
  76.     $count = join( ' ', $count ); // Available filter: comment_class
  77.  
  78.     // Tada again!
  79.     echo $count;
  80.     //return $print ? print($count) : $count;
  81. }
  82.  
  83.  
  84. // Generates time- and date-based classes for BODY, post DIVs, and comment LIs; relative to GMT (UTC)
  85. function codium_extend_date_classes( $t, &$c, $p = '' ) {
  86.     $t = $t + ( get_option('gmt_offset') * 3600 );
  87.     $c[] = $p . 'y' . gmdate( 'Y', $t ); // Year
  88.     $c[] = $p . 'm' . gmdate( 'm', $t ); // Month
  89.     $c[] = $p . 'd' . gmdate( 'd', $t ); // Day
  90.     $c[] = $p . 'h' . gmdate( 'H', $t ); // Hour
  91. }
  92.  
  93. // For category lists on category archives: Returns other categories except the current one (redundant)
  94. function codium_extend_cats_meow($glue) {
  95.     $current_cat = single_cat_title( '', false );
  96.     $separator = "\n";
  97.     $cats = explode( $separator, get_the_category_list($separator) );
  98.     foreach ( $cats as $i => $str ) {
  99.         if ( strstr( $str, ">$current_cat<" ) ) {
  100.             unset($cats[$i]);
  101.             break;
  102.         }
  103.     }
  104.     if ( empty($cats) )
  105.         return false;
  106.  
  107.     return trim(join( $glue, $cats ));
  108. }
  109.  
  110. // For tag lists on tag archives: Returns other tags except the current one (redundant)
  111. function codium_extend_tag_ur_it($glue) {
  112.     $current_tag = single_tag_title( '', '',  false );
  113.     $separator = "\n";
  114.     $tags = explode( $separator, get_the_tag_list( "", "$separator", "" ) );
  115.     foreach ( $tags as $i => $str ) {
  116.         if ( strstr( $str, ">$current_tag<" ) ) {
  117.             unset($tags[$i]);
  118.             break;
  119.         }
  120.     }
  121.     if ( empty($tags) )
  122.         return false;
  123.  
  124.     return trim(join( $glue, $tags ));
  125. }
  126.  
  127. if ( ! function_exists( 'codium_extend_posted_on' ) ) :
  128. // data before post
  129. function codium_extend_posted_on() {
  130.     printf( __( '<span class="%1$s">Posted on</span> %2$s <span class="meta-sep">by</span> %3$s.', 'codium_extend' ),
  131.         'meta-prep meta-prep-author',
  132.         sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><span class="entry-date">%3$s</span></a>',
  133.             get_permalink(),
  134.             esc_attr( get_the_time() ),
  135.             get_the_date()
  136.         ),
  137.         sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>',
  138.             get_author_posts_url( get_the_author_meta( 'ID' ) ),
  139.             sprintf( esc_attr__( 'View all posts by %s', 'codium_extend' ), get_the_author() ),
  140.             get_the_author()
  141.         )
  142.     );
  143. }
  144. endif;
  145.  
  146. if ( ! function_exists( 'codium_extend_posted_in' ) ) :
  147. // data after post
  148. function codium_extend_posted_in() {
  149.     // Retrieves tag list of current post, separated by commas.
  150.     $tag_list = get_the_tag_list( '', ', ' );
  151.     if ( $tag_list ) {
  152.         $posted_in = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'codium_extend' );
  153.     } elseif ( is_object_in_taxonomy( get_post_type(), 'category' ) ) {
  154.         $posted_in = __( 'This entry was posted in %1$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'codium_extend' );
  155.     } else {
  156.         $posted_in = __( 'Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'codium_extend' );
  157.     }
  158.     // Prints the string, replacing the placeholders.
  159.     printf(
  160.         $posted_in,
  161.         get_the_category_list( ', ' ),
  162.         $tag_list,
  163.         get_permalink(),
  164.         the_title_attribute( 'echo=0' )
  165.     );
  166. }
  167. endif;
  168.  
  169.  
  170. // Widgets plugin: intializes the plugin after the widgets above have passed snuff
  171. function codium_extend_widgets_init() {
  172.  
  173.         register_sidebar(array(
  174.         'name' => 'SidebarTop',
  175.         'description' => 'Top sidebar',
  176.         'before_widget'  =>   "\n\t\t\t" . '<li id="%1$s" class="widget %2$s"><div class="widgetblock">',
  177.         'after_widget'   =>   "\n\t\t\t</div></li>\n",
  178.         'before_title'   =>   "\n\t\t\t\t". '<div class="widgettitleb"><h3 class="widgettitle">',
  179.         'after_title'    =>   "</h3></div>\n" .''
  180.         ));
  181.        
  182.         register_sidebar(array(
  183.         'name' => 'SidebarBottom',
  184.         'description' => 'Bottom sidebar',
  185.         'before_widget'  =>   "\n\t\t\t" . '<li id="%1$s" class="widget %2$s"><div class="widgetblock">',
  186.         'after_widget'   =>   "\n\t\t\t</div></li>\n",
  187.         'before_title'   =>   "\n\t\t\t\t". '<div class="widgettitleb"><h3 class="widgettitle">',
  188.         'after_title'    =>   "</h3></div>\n" .''
  189.         ));
  190.  
  191.     }
  192.  
  193.  
  194.  
  195. // Changes default [...] in excerpt to a real link
  196. function codium_extend_excerpt_more($more) {
  197.        global $post;
  198.        $readmore = __(' read more <span class="meta-nav">&raquo;</span>', 'codium_extend' );
  199.     return ' <a href="'. get_permalink($post->ID) . '">' . $readmore . '</a>';
  200. }
  201. add_filter('excerpt_more', 'codium_extend_excerpt_more');
  202.  
  203.  
  204. // Runs our code at the end to check that everything needed has loaded
  205. add_action( 'init', 'codium_extend_widgets_init' );
  206.  
  207.  
  208. // Adds filters for the description/meta content in archives.php
  209. add_filter( 'archive_meta', 'wptexturize' );
  210. add_filter( 'archive_meta', 'convert_smilies' );
  211. add_filter( 'archive_meta', 'convert_chars' );
  212. add_filter( 'archive_meta', 'wpautop' );
  213.  
  214. // Remember: the codium_extend is for play.
  215.  
  216.  
  217.  
  218. //Remove <p> in excerpt
  219. function codium_extend_strip_para_tags ($content) {
  220. if ( is_home() && ($paged < 2 )) {
  221.   $content = str_replace( '<p>', '', $content );
  222.   $content = str_replace( '</p>', '', $content );
  223.   return $content;
  224. }
  225. }
  226.  
  227. //Comment function
  228. function codium_extend_comment($comment, $args, $depth) {
  229.    $GLOBALS['comment'] = $comment; ?>
  230.    
  231.    <li id="comment-<?php comment_ID() ?>" class="<?php codium_extend_comment_class() ?>">
  232.       <span class="count"><?php echo codium_extend_comment_count();?></span>
  233.       <div class="comment-author vcard">
  234.         <?php echo get_avatar( $comment, 48 ); ?>
  235.         <?php printf(__('<div class="fn">%s</div> '), get_comment_author_link()) ?>
  236.       </div>
  237.        
  238.       <?php if ($comment->comment_approved == '0') : ?>
  239.          <em><?php _e('Your comment is in moderation.') ?></em>
  240.          <br />
  241.       <?php endif; ?>
  242.  
  243.       <div class="comment-meta"><?php printf(__('%1$s - %2$s <span class="meta-sep">|</span> <a href="%3$s" title="Permalink to this comment">Permalink</a>', 'codium_extend'),
  244.                                         get_comment_date(),
  245.                                         get_comment_time(),
  246.                                         '#comment-' . get_comment_ID() );
  247.                                         edit_comment_link(__('Edit', 'codium_extend'), ' <span class="meta-sep">|</span> <span class="edit-link">', '</span>'); ?></div>
  248.       <div class="clear"></div>
  249.            
  250.       <?php comment_text() ?>
  251.  
  252.       <div class="reply">
  253.          <?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
  254.       </div>
  255. <?php
  256.  
  257.         }
  258.        
  259. //custom menu support
  260. add_action( 'init', 'codium_extend_register_my_menu' );
  261.  
  262. function codium_extend_register_my_menu() {
  263.     register_nav_menu( 'primary-menu', __( 'Primary Menu' ) );
  264. }        
  265.  
  266.  
  267. ?>


GRACIAS
  #6 (permalink)  
Antiguo 14/04/2011, 10:49
Avatar de bUllan9ebrio  
Fecha de Ingreso: enero-2011
Ubicación: Chile
Mensajes: 1.128
Antigüedad: 13 años, 9 meses
Puntos: 128
Respuesta: AYUDAA POR FAVOOR Parse error: syntax error, unexpected '}'

No está todo el código sino el primer Else de cuál If hace referencia
__________________
Si no vivimos como pensamos, pronto empezaremos a pensar como vivimos.
Más vale un Gracias sincero, que un número que aumente "popularidad" ¬¬°

Universidad de chile, campeón
  #7 (permalink)  
Antiguo 14/04/2011, 10:54
 
Fecha de Ingreso: abril-2011
Mensajes: 5
Antigüedad: 13 años, 7 meses
Puntos: 0
Respuesta: AYUDAA POR FAVOOR Parse error: syntax error, unexpected '}'

ese es el codigo que sale en functions.php


no se cual tengo que pasarte. estoy desde el cpanel de mi web.

ayudame! por favor!
  #8 (permalink)  
Antiguo 14/04/2011, 10:58
Avatar de bUllan9ebrio  
Fecha de Ingreso: enero-2011
Ubicación: Chile
Mensajes: 1.128
Antigüedad: 13 años, 9 meses
Puntos: 128
Respuesta: AYUDAA POR FAVOOR Parse error: syntax error, unexpected '}'

Código PHP:
Ver original
  1. $c[] = 'untagged';
  2. } else {
  3. foreach ( (array) get_the_tags() as $tag )
  4. $c[] = 'tag-' . $tag->slug;
  5. }

Si comienza de esta forma estamos mal Insisto Copia nuevamente el código de la página que sacaste, eso claramente fue copiado de internet y tal vez asi se soluciona tu error
__________________
Si no vivimos como pensamos, pronto empezaremos a pensar como vivimos.
Más vale un Gracias sincero, que un número que aumente "popularidad" ¬¬°

Universidad de chile, campeón
  #9 (permalink)  
Antiguo 14/04/2011, 11:26
 
Fecha de Ingreso: abril-2011
Mensajes: 5
Antigüedad: 13 años, 7 meses
Puntos: 0
Respuesta: AYUDAA POR FAVOOR Parse error: syntax error, unexpected '}'

ya restaure el codigo original de functions.php. pero ahora me sale esto!

Fatal error: Call to undefined function codium_extend_body_class() in /home/kittenby/public_html/blog/wp-content/themes/codium-extend/header.php on line 16


y este es el codigo de header.php:

Código PHP:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes() ?>>
  3. <head profile="http://gmpg.org/xfn/11">
  4. <meta http-equiv="content-type" content="<?php bloginfo('html_type') ?>; charset=<?php bloginfo('charset') ?>" />
  5. <meta name="viewport" content="width=device-width" />
  6. <title><?php bloginfo('name'); wp_title();?></title>
  7. <link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>" />
  8. <link href='http://fonts.googleapis.com/css?family=PT+Sans&subset=latin' rel='stylesheet' type='text/css'>
  9. <link rel="pingback" href="<?php bloginfo('pingback_url') ?>" />
  10. <link rel="shortcut icon" href="/favicon.ico" />
  11. <?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
  12. <?php wp_head() ?>
  13.  
  14. </head>
  15.  
  16. <body class="<?php codium_extend_body_class() ?>">
  17.  
  18. <div id="wrapperpub">
  19.     <div id="header">
  20.         <div class="dp100">
  21.             <h1 id="blog-title" class="blogtitle"><a href="<?php echo home_url( '/' ); ?>" title="<?php bloginfo('name') ?>"><?php bloginfo('name') ?></a></h1>
  22.             <div class="description"><?php bloginfo('description'); ?> </div>
  23.         </div><!-- dp100 -->       
  24.     </div><!--  #header -->
  25. </div><!--  #wrapperpub -->        
  26. <div class="clear"></div>
  27. <div id="wrapper"> 
  28.         <div id="access">
  29.             <div class="menu">
  30.                 <ul>
  31.                     <li>
  32.                         <a href="<?php echo home_url( '/' ); ?>" title="home" class="top_parent"><?php printf(__('HOME', 'codium_extend')) ?></a>
  33.                     </li>
  34.                 </ul>
  35.             </div>
  36.                     <?php wp_nav_menu(array( 'container_class' => 'menu-header', 'theme_location' => 'primary-menu',)); ?>         
  37.         </div><!--  #access -->
  38. <div class="clear"></div>
  #10 (permalink)  
Antiguo 15/04/2011, 02:50
 
Fecha de Ingreso: marzo-2011
Mensajes: 107
Antigüedad: 13 años, 7 meses
Puntos: 22
Respuesta: AYUDAA POR FAVOOR Parse error: syntax error, unexpected '}'

En la línea 16 no falta un ;?

Código PHP:
<body class="<?php codium_extend_body_class() ?>">
Código PHP:
<body class="<?php codium_extend_body_class() ; ?>">
Todas las lineas de código llevan un ';' al final aunque solo sean una linea, no?

Etiquetas: css, parse, syntax, web.config
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:55.