Parse error: syntax error, unexpected end of file - Zeile 59
Dieser Fehler wird angezeigt, wenn die Aktivierung eines modifizierten theme in WordPress:
Parse error: syntax error, unexpected end of file in C:\xampp\htdocs\wp-content\themes\manifest_v1.1\functions.php on line 59
Den functions.php die Datei wurde geändert, sodass "Betreff" - Zeilen werden ausgewählt, wenn Sie einen Kommentar abgeben.
Hier ist der code:
<?php
$cats=array(
1=>'Category 1',
2=>'Category 2',
3=>'Category 3'
);
function showCats($cats){
?>
<select name="commentCats">
<?php
foreach($cats as $key=>$cat){
?>
<option value="<?php print $key; ?>"><?php print $cat; ?></option>
<?
}
?>
</select>
<?php
}
add_action ('comment_post', 'add_comment_fields', 1);
function add_comment_fields($comment_id) {
add_comment_meta($comment_id, 'commentCats', $_POST['commentCats'], true);
}
function manifest_comment($comment, $args, $depth){
print $depth;
global $cats;
$catID = get_comment_meta(get_comment_ID(),"commentCats", true);
$GLOBALS['comment'] = $comment; ?>
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>">
<div id="comment-<?php comment_ID(); ?>">
<div class="comment-author vcard">
<?php echo get_avatar($comment,$size='48',$default='<path_to_url>' ); ?>
<?php printf(__('<cite class="fn">%s</cite> <span class="says">says:</span>'), get_comment_author_link()) ?>
</div>
<?php if ($comment->comment_approved == '0') : ?>
<em><?php _e('Your comment is awaiting moderation.') ?></em>
<br />
<?php endif; ?>
<div class="comment-meta commentmetadata"><a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>"><?php printf(__('%1$s at %2$s'), get_comment_date(), get_comment_time()) ?></a><?php edit_comment_link(__('(Edit)'),' ','') ?></div>
<?php if($catID){ ?>
<h3><?php
print $cats[$catID]; ?></h3>
<?php } ?>
<?php comment_text() ?>
<div class="reply">
<?php comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
</div>
</div>
<?php
}
?>
Ich kann nicht herausfinden, was das problem ist, ich habe gesagt, es war an einem weiteren test-Maschine. Ich bin derzeit auf der Prüfung das Thema auf einem lokalen Rechner. Ich Teste mit XAMPP (http://www.apachefriends.org/en/xampp-windows.html), die umfasst Apache, MySQL, PHP und PHPmyAdmin. Ich benutze eine frische installation von WordPress-version 3.4.1.
Dank!
- Ich fügte hinzu, in der alle fehlenden Semikolons nach allen Aussagen und ich bin noch immer dieser Fehler.
- Möglich, Duplikat der Parse error: Syntax error, unexpected end of file in meinem PHP-code.
Du musst angemeldet sein, um einen Kommentar abzugeben.
Zeile 36 - Sie vergessen eines
;
nach dem Aufruf:Edit: als ich sah, wie aus den Kommentaren und weiter Blick auf den code in eclipse, Sie fehlen schon ein paar
;
nach Aussagen:echo()
Anrufe oder diecomment_reply_link()
Anrufe.comment_text()
.comment_reply_link()
.