WordPress Theme - Leere Warnungsbox erscheint ... warum?

Hey, ich habe ein Theme für WordPress installiert, das läuft wunderbar bis auf die Tatsache, dass nur IE Nutzer Kommentare abgeben können. Bei anderen Browsern erscheint nach dem Buttonklick eine leere Warnungsmeldung (wieso leer und wodurch kann das passieren?) und der Kommentar wird nicht veröffentlicht. Ich weiß leider nicht genau, wo der Fehler liegt.

Das ist der Inhalt der comments.php

PHP:
<?php
 if ( !empty($post->post_password) && $_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) : ?>
<div class="errorbox">
<?php _e('Enter your password to view comments.', 'philna'); ?>
</div>
<?php return; endif; ?>

<?php
$options = get_option('philna_options');
$trackbacks = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved = '1' AND (comment_type = 'pingback' OR comment_type = 'trackback') ORDER BY comment_date", $post->ID));
$count = 0;
?>
<script type="text/javascript">
/* <![CDATA[ */
ajaxCommentsURL = "<?php bloginfo('template_url'); ?>/comments-ajax.php";
/* ]]> */
</script>
<?php if ($comments || comments_open()):?>
<div id="comments">
<div id="cmtswitcher">

<a id="commenttab" class="curtab" href="javascript:void(0);">
<?php _e('Comments', 'philna');echo ' (';?><span id="allcmnub"><?php echo count($comments)-count($trackbacks);?></span>)</a>
<a id="trackbacktab" class="tab" href="javascript:void(0);">
<?php _e('Trackbacks', 'philna'); echo (' (' . count($trackbacks) . ')'); ?>
</a>

	<?php if(comments_open()) : ?>
		<span class="addcomment"><a href="#respond"><?php _e('Leave a comment', 'philna'); ?></a></span>
	<?php endif; ?>
	<?php if(pings_open()) : ?>
		<span class="addtrackback"><a href="<?php trackback_url(); ?>"><?php _e('Trackback', 'philna'); ?></a></span>
	<?php endif; ?>
	
	<div class="fixed"></div>

</div>
<div id="commentlist">

	<!-- comments START -->
	<ol id="thecomments" class="display">
	<?php
		if ($comments && count($comments) - count($trackbacks) > 0) {
			foreach ($comments as $comment) {
				if(!$comment->comment_type == 'pingback' && !$comment->comment_type == 'trackback') {
	?>

<li class="comment <?php if($comment->comment_author_email == get_the_author_email()) {echo 'admincomment';} else {echo 'regularcomment';} ?>" id="comment-<?php comment_ID() ?>">

				<div class="comment-meta">
					<? printf( __('%1$s at %2$s', 'philna'), get_comment_time(__('F jS, Y', 'philna')), get_comment_time(__('H:i', 'philna')) ); ?>
					 | #<span class="cmnub"><?php printf('%1$s', ++$count); ?></span>
					 
					 <?php edit_comment_link(__('Edit', 'philna'), ' | ', ''); ?>
				</div>

			<div class="comment-author">
				
					<?php if (function_exists('get_avatar') && get_option('show_avatars')) { echo get_avatar($comment, 32); } ?>				
				
					<?php if (get_comment_author_url()) : ?>
						<span class="fn"><a id="commentauthor-<?php comment_ID() ?>" href="<?php comment_author_url() ?>"><?php comment_author(); ?></a><?php if($options['xing_show']) get_xing(get_comment_author_email());?></span>
						<span class="reply" style="visibility:hidden;"><a href="#commentform" title="Notify this pumpkin." onclick="document.getElementById('comment').value += '&lt;a href=&quot;#comment-<?php comment_ID() ?>&quot;&gt;@<?php comment_author();?> &lt;/a&gt;\n'"><img src="<?php bloginfo('template_url'); ?>/img/reply.gif" alt="Notify"/></a></span>
					<?php else : ?>
						<span class="fn" id="commentauthor-<?php comment_ID() ?>"><?php comment_author(); ?><?php if($options['xing_show'])get_xing(get_comment_author_email());?></span>
						<span class="reply" style="display:none;"><a href="#commentform" title="Notify this pumpkin." onclick="document.getElementById('comment').value += '&lt;a href=&quot;#comment-<?php comment_ID() ?>&quot;&gt;@<?php comment_author();?> &lt;/a&gt;\n'"><img src="<?php bloginfo('template_url'); ?>/img/reply.gif" alt="Notify"/></a></span>
						
					<?php endif; ?>

			</div>
			<?php if ($comment->comment_approved == '0') : ?>
			<p><small class="waiting">Your comment is awaiting moderation.</small></p>
			<?php endif; ?>
			<?php comment_text(); ?>
		</li>
	<?php
				} // if pingback/trackback
			} // foreach
		} else {
	?>
	
		<li class="messagebox">
			<?php _e('No comments yet.Be the first ?', 'philna'); ?>
		</li>
	<?php
		}
	?>

	</ol>
	<!-- comments END -->

	<!-- trackbacks START -->
	<ol id="thetrackbacks" class="nodisplay">
		<?php if ($trackbacks) : $count = 0; ?>
			<?php foreach ($trackbacks as $comment) : ?>
				<li class="trackback">
				<div class="act">
						 | <?php edit_comment_link(__('Edit', 'philna'), '', ''); ?>
					</div>
					<div class="date">
						<? printf( __('%1$s at %2$s', 'philna'), get_comment_time(__('F jS, Y', 'philna')), get_comment_time(__('H:i', 'philna')) ); ?>
						 | <a href="#comment-<?php comment_ID() ?>"><?php printf('#%1$s', ++$count); ?></a>
					</div>					
					<div class="fixed"></div>
					<div class="title">
						<a href="<?php comment_author_url() ?>">
							<?php comment_author(); ?>
						</a>
					</div>
					<span class="trackbacks-content"><?php comment_text(); ?></span>
				</li>
			<?php endforeach; ?>

		<?php else : ?>
			<li class="messagebox">
				<?php _e('No trackbacks yet.', 'philna'); ?>
			</li>

		<?php endif; ?>
	</ol>
	<!-- trackbacks END -->
</div>
</div><!-- #comments -->
<?php endif; ?>


<?php if (!comments_open()) : // If comments are closed. ?>
	<div class="messagebox">
		<?php _e('Comments are closed.', 'philna'); ?>
	</div>
<?php elseif ( get_option('comment_registration') && !$user_ID ) : // If registration required and not logged in. ?>
	<div class="messagebox">
		<?php if (function_exists('wp_login_url')) {$login_link = wp_login_url();} else { $login_link = site_url('wp-login.php', 'login'); } ?>
		<?php printf(__('You must be <a href="%s">logged in</a> to post a comment.', 'philna'), $login_link); ?>
	</div>

<?php else : ?>
<div id="respond">
	<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
	

		<?php if ($user_ID) : ?>
			<?php if (function_exists('wp_logout_url')) {$logout_link = wp_logout_url();} else { $logout_link = site_url('wp-login.php?action=logout', 'login'); } ?>
			<div class="row"><?php _e('Logged in as', 'philna'); ?> <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><strong><?php echo $user_identity; ?></strong></a>. <a href="<?php echo $logout_link; ?>" title="<?php _e('Log out of this account', 'philna'); ?>"><?php _e('Logout &raquo;', 'philna'); ?></a></div>

		<?php else : ?>
			<?php if ( $comment_author != "" ) : ?>
				<script type="text/javascript" charset="utf-8">
				//<![CDATA[
					var changeMsg = "<?php _e('Change &raquo;','philna'); ?>";
					var closeMsg = "<?php _e('Close &raquo;','philna'); ?>";
				//]]>
				</script>
				<div class="row welcome">
					<?php echo get_avatar($comment_author_email, 32); printf(__('Welcome back <strong>%s</strong>.', 'philna'), $comment_author) ?>
					<span id="show_author_info"><a href="javascript:void(0);"><?php _e('Change &raquo;','philna'); ?></a></span>
					</div>
			<?php endif; ?>

			<div id="author_info"<?php if ( $comment_author != "" ) echo 'style="display:none"';?>>
				<span class="row">
					<input type="text" name="author" id="author" class="textfield" value="<?php echo $comment_author; ?>" size="24" tabindex="1" />
					<label for="author" class="small"><?php _e('Name', 'philna'); ?> <?php if ($req) _e('(required)', 'philna'); ?></label>
				</span>
				<span class="row">
					<input type="text" name="email" id="email" class="textfield" value="<?php echo $comment_author_email; ?>" size="24" tabindex="2" />
					<label for="email" class="small"><?php _e('E-Mail (will not be published)', 'philna');?> <?php if ($req) _e('(required)', 'philna'); ?></label>
				</span>
				<span class="row">
					<input type="text" name="url" id="url" class="textfield" value="<?php echo $comment_author_url; ?>" size="24" tabindex="3" />
					<label for="url" class="small"><?php _e('Website', 'philna'); ?></label>
				</span>
			</div>
		<?php endif; ?>

	<!-- comment input //-->
		<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/edit_button.js"></script>
<script type="text/javascript">edToolbar('comment');</script>
	<div class="row cmarea">

		<textarea name="comment" id="comment" tabindex="4" rows="8" cols="50"></textarea>
		<div id="commentload" class="center" style="display:none;">
		<img src="<?php bloginfo('template_url'); ?>/img/ajaxload.gif" alt="loading" /> <?php _e('Submitting Comment, please wait a second...','philna')?>
		</div>
	</div>
<div id="submitbox">
			<a class="feed" href="<?php bloginfo('comments_rss2_url'); ?>"><?php _e('Comments feed', 'philna'); ?></a>
<script type="text/javascript">
/* <![CDATA[ */
//ctrl+enter
document.getElementById("comment").onkeydown = function (moz_ev){
var ev = null;
	if (window.event){
	ev = window.event;
	}else{
	ev = moz_ev;
	}
	if (ev != null && ev.ctrlKey && ev.keyCode == 13)
	{
	document.getElementById("submit").click();
	}
}
/* ]]> */
</script>	
			<input name="submit" type="submit" id="submit" class="button" tabindex="5" value="<?php _e('Submit Comment', 'philna'); ?>" />
		<?php if (function_exists('highslide_emoticons')) : ?>
			<div id="emoticon"><?php highslide_emoticons(); ?></div>
		<?php endif; ?>
		<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
	<?php do_action('comment_form', $post->ID); ?>
<div class="fixed"></div>
</div>
</form>
</div>
<?php endif; ?>

Ich poste einmal die Datei, die dafür zuständig ist, den Kommentar auf Gültigkeit zu prüfen, allerdings kommts glaub gar nicht so weit, weil die Warnung auch aufpoppt, wenn man keinen Namen oder Mailadresse eingetragen hat, also evtl unnötig, hier zu lesen ;)

PHP:
<?php
if ($_SERVER["REQUEST_METHOD"] != "POST") {
    header('Allow: POST');
    header("HTTP/1.1 405 Method Not Allowed");
    header("Content-type: text/plain");
    exit;
}
$db_check = true;
function kill_data() {
    return '';
}
function check_db() {
    global $wpdb, $db_check;
    if($db_check) {
        // Check DB
        if(!$wpdb->dbh) {
            echo('Our database has issues. Try again later.');
        } else {
            echo('We\'re currently having site problems. Try again later.');
        }
        die();
    }
}
ob_start('kill_data');
register_shutdown_function('check_db');
require_once(dirname(__FILE__)."/../../../wp-config.php");
$db_check = false;
ob_end_clean();
nocache_headers();
function fail($s) {
    header('HTTP/1.0 500 Internal Server Error');
    echo $s;
    exit;
}
$comment_post_ID = (int) $_POST['comment_post_ID'];
$status = $wpdb->get_row("SELECT post_status, comment_status FROM $wpdb->posts WHERE ID = '$comment_post_ID'");
if ( empty($status->comment_status) ) {
    do_action('comment_id_not_found', $comment_post_ID);
    fail('The post you are trying to comment on does not currently exist in the database.');
} elseif ( 'closed' ==  $status->comment_status ) {
    do_action('comment_closed', $comment_post_ID);
    fail('Sorry, comments are closed for this item.');
} elseif ( in_array($status->post_status, array('draft', 'pending') ) ) {
    do_action('comment_on_draft', $comment_post_ID);
    fail('The post you are trying to comment on has not been published.');
}
$comment_author       = trim(strip_tags($_POST['author']));
$comment_author_email = trim($_POST['email']);
$comment_author_url   = trim($_POST['url']);
$comment_content      = trim($_POST['comment']);
// If the user is logged in
$user = wp_get_current_user();
if ( $user->ID ) {
    $comment_author       = $wpdb->escape($user->display_name);
    $comment_author_email = $wpdb->escape($user->user_email);
    $comment_author_url   = $wpdb->escape($user->user_url);
    if ( current_user_can('unfiltered_html') ) {
        if ( wp_create_nonce('unfiltered-html-comment_' . $comment_post_ID) != $_POST['_wp_unfiltered_html_comment'] ) {
            kses_remove_filters(); // start with a clean slate
            kses_init_filters(); // set up the filters
        }
    }
} else {
    if ( get_option('comment_registration') )
        fail('Sorry, you must be logged in to post a comment.');
}
$comment_type = '';
if ( get_option('require_name_email') && !$user->ID ) {
    if ( 6> strlen($comment_author_email) || '' == $comment_author )
        fail('Sorry: please fill the required fields (name, email).');
    elseif ( !is_email($comment_author_email))
        fail('Sorry: please enter a valid email address.');
}
if ( '' == $comment_content )
    fail('Sorry: please type a comment.');
// Simple duplicate check
$dupe = "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = '$comment_post_ID' AND ( comment_author = '$comment_author' ";
if ( $comment_author_email ) $dupe .= "OR comment_author_email = '$comment_author_email' ";
$dupe .= ") AND comment_content = '$comment_content' LIMIT 1";
if ( $wpdb->get_var($dupe) ) {
    fail('Duplicate comment detected; it looks as though you\'ve already said that!');
}
$commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'user_ID');
$comment_id = wp_new_comment( $commentdata );
$comment = get_comment($comment_id);
if ( !$user->ID ) {
    setcookie('comment_author_' . COOKIEHASH, $comment->comment_author, time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);
    setcookie('comment_author_email_' . COOKIEHASH, $comment->comment_author_email, time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);
    setcookie('comment_author_url_' . COOKIEHASH, clean_url($comment->comment_author_url), time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);
}
@header('Content-type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
?>


<li class="comment <?php if($comment->comment_author_email == get_the_author_email()) {echo 'admincomment';} else {echo 'regularcomment';} ?>" id="comment-<?php comment_ID() ?>">
<div class="comment-meta">
<? printf( __('%1$s at %2$s', 'philna'), get_comment_time(__('F jS, Y', 'philna')), get_comment_time(__('H:i', 'philna')) ); ?>| 
#<span class="nub"></span>
<?php edit_comment_link(__('Edit', 'philna'), ' | ', ''); ?></div>
<div class="comment-author">
<?php if (function_exists('get_avatar') && get_option('show_avatars')) { echo get_avatar($comment, 32); } ?>				

<?php if (get_comment_author_url()) : ?>
<span class="fn"><a id="commentauthor-<?php comment_ID() ?>" href="<?php comment_author_url() ?>"><?php comment_author(); ?></a></span>
<?php else : ?>
<span class="fn" id="commentauthor-<?php comment_ID() ?>"><?php comment_author(); ?></span>
<?php endif; ?>
</div>
<?php if ($comment->comment_approved == '0') : ?>
<p><small class="waiting">Your comment is awaiting moderation.</small></p>
<?php endif; ?>
<?php comment_text();?>
</li>

Wie gesagt, es erscheint eine leere Warnungsbox bei Abgabe eines Kommentars.Tritt auf bei Firefox und SRWare Iron (Chromium), Internet Explorer funktioniert. Versionen sind überall aktuell. Wenn jemand testen möchte, http://www.izza-me.de, nur zu ;) Theme heißt philna, vllt kennt es jemand zufällig.

Bin etwas "verzweifelt", sonst würde ich euch nicht mit so einem Haufen Quelltext nerven. Schonmal danke an alle, die überhaupt etwas versuchen ;)
 
Dein Problem ist nicht das Theme sondern das verwendete Java-Script. Siehe Attachment. Wenn du das übrigens selbst sehen willst, müsstest du im Firefox die Extension "Web Developer" installieren.
 

Anhänge

  • error.console.png
    error.console.png
    44,2 KB · Aufrufe: 42
Danke ;)

Habe das Skript jetzt einfach auskommentiert, nun funktioniert das Kommentieren. Ich nehme mal nicht an, dass mir irgendjemand die Konsequenzen aufzählen kann, die das Auskommentieren dieses Skriptes mit sich bringt? Animationen gehen jetzt auf jeden Fall nicht mehr, so viel weiß ich von jQuery :D
 
Zurück