Kommentar Eingabe über Button
So, dank Jottlieb der Stand der Dinge:
-> Beispiel Eintrag
Die Eingabemaske für Kommentare öffnet sich (durch Javascript) erst nach
anklicken des Buttons "Infos hinzufügen".
Die bei Jottlieb aktivierte Funktion des Hintergrundwechsels bei Kommentaren (grau - weiß - grau - weiß...) habe ich deaktiviert.
Hier meine Comments.php:
PHP
<?php // Do not delete these lines
if ('comments-topinput.php' == basename($_SERVER['SCRIPT_FILENAME']))
die ('Bitte diese Seite nicht direkt aufrufen. Danke!');
if (!empty($post->post_password)) { // if there's a password
if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) { // and it doesn't match the cookie
?>
<p class="nocomments">Dieser Beitrag ist passwortgeschützt. Bitte gebe das Passwort an um die Kommentare zu sehen.<p>
<?php
return;
}
}
/* This variable is for alternating comment background */
$oddcomment = 'alt';
?>
<!-- Ab hier EDITIEREN -->
<!-- Die gelisteten Einträge -->
<ol class="commentlist">
<?php if ($comments) : ?>
<!-- erscheint nur falls Kommentare vorhanden -->
<img src="http://funkygog.de/images/Ordner_Fotos/Scheren_Abschnitt.gif"<br>
<p>weiter Infos: <font color="#999999">(Links zu Videos, Discographien, Homepage)</font></p>
<?php endif; ?>
<?php foreach ($comments as $comment) : ?>
<li class="
<?php echo ; ?>" id="comment-
<?php comment_ID() ?>"></a>
<?php comment_text() ?>
</li>
<?php /* Wechselt bei jedem Kommentar die different class (deaktiviert) */
if ('alt' == $oddcomment) $oddcomment = '';
else $oddcomment = 'alt';
?>
<?php endforeach; /* end for each comment */ ?>
</ol>
<!-- Die gelisteten Einträge (Ende) -->
<!-- Kommentar ausklappen Anfang (Script start)-->
<div class="entrytext">
<script type="text/javascript" language="javascript">
function showForm(obj)
{
obj.style.display = 'none';
var ele = document.getElementById('rumwallform');
if (ele)
{
ele.style.display = 'block';
}
}
</script>
<br>
<div id="rumwallbtn">
<input type="button" onclick="showForm(this);" value="
<?php _e('Infos hinzufügen'); ?>" class="styled"/>
</div>
<div id="rumwallform" style="display: none;">
<?php if ('open' == $post->comment_status) : ?>
<h4 id="respond"><font color="#999999">Weitere Infos, Links u.a. eintragen</font></h4>
<!-- Kommentar ausklappen Ende-->
<?php if ( get_option('comment_registration') && !$user_ID ) : ?>
<p>
Du musst <a href="
<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=
<?php the_permalink(); ?>">angemeldet</a> sein um einen Kommentar zu schreiben.</p>
<?php else : ?>
<form action="
<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
<?php if ( $user_ID ) : ?>
<p>Angemeldet als <a href="
<?php echo get_option('siteurl'); ?>/wp-admin/profile.php">
<?php echo $user_identity; ?></a>. <a href="
<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="Log out of this account">Abmelden »</a></p>
<?php else : ?>
<p>
<input type="text" name="author" id="author" value="
<?php echo $comment_author; ?>" size="22" tabindex="1" />
<label for="author"><small>Name*</small></label>
</p>
<p>
<input type="text" name="email" id="email" value="
<?php echo $comment_author_email; ?>" size="22" tabindex="2" />
<label for="email"><small>E-Mail* (wird nicht angezeigt)</small></label>
</p>
<p>
<input type="text" name="url" id="url" value="
<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
<label for="url"><small>Website</small></label>
</p>
<?php endif; ?>
<!--<p><small><strong>XHTML:</strong> Du kannst die Stichworte benutzen:
<?php echo allowed_tags(); ?></small></p>-->
<p>
<textarea name="comment" id="comment" cols="100%" rows="5" tabindex="4"></textarea>
</p>
<small>*=erforderliche Eingaben</small>
<p>
<input name="submit" type="submit" id="submit" tabindex="5" value="Eintrag absenden" />
<input type="hidden" name="comment_post_ID" value="
<?php echo $id; ?>" />
</p>
<?php do_action('comment_form', $post->ID); ?>
</form>
</div>
</div>
<?php endif; // If registration required and not logged in ?>
<?php if ($comments) : ?>
<?php else : // this is displayed if there are no comments so far ?>
<?php if ('open' == $post->comment_status) : ?>
<!-- If comments are open, but there are no comments. -->
<?php else : // comments are closed ?>
<!-- If comments are closed. -->
<p class="nocomments">Comments are closed.</p>
<?php endif; ?>
<?php endif; ?>
<?php endif; // if you delete this the sky will fall on your head ?>
Alles anzeigen