Zurück   WordPress Deutschland Forum > Support > Design

Antwort
 
Themen-Optionen Ansicht
Alt 20.08.2008, 10:23   #1 (permalink)
PostRank: 2
 
Benutzerbild von Urgixgax
 
Registriert seit: 27.08.2007
Beiträge: 94
Trackback und Pingback anders darstellen, ich bekomme es nicht hin, wer kann helfen?

Hallo!
Auf der Suche nach einer Lösung, habe ich hier im Forum und via Google so einiges gefunden, aber entweder, ist die Seite, für ein mögliches Plugin nicht mehr vorhanden, oder das tauschen von Codeschnipseln, bringt nur Fehler in der Ausgabe.

Mein Ziel ist, dass die "normalen" Kommentare so bleiben, wie sie sind, mit Gravatar usw. und bei den Trackbacks und Pingbacks, nur das Eintragsdatum, der Beitragsname und Blog-Name, zu sehen ist.

Als Beispiel, wie ich es meine, ist in Caschys blog zu sehen.

Portable WordPress 2.6 | Caschys Blog

Erst kommen die Kommentare, dann die Trackbackbacks

Caschy hat mir freundlicher Weise seine comments.php geschickt, aber ich kann die leider nicht einfach verwenden, oder Code tauschen, da mein Theme ein anderes ist.
Auch müsste sicher in der CSS-Datei etwas geändert werden, was aber sicher das kleiner Übel ist.

Vielleicht ist es am einfachsten, wenn jemand meine comments.php ändern könnte bzw. mir schreibt, was er bräuchte, um mir helfen zu können, denn im Moment bin ich mit meinem Latein am Ende.



Urgixgax
__________________
Avatar in GROSS? Guckst Du HIER! Blog:www.blog.urgixgax.de
Urgixgax ist offline   Mit Zitat antworten
Alt 20.08.2008, 11:13   #2 (permalink)
WPD-Team
 
Benutzerbild von Monika
 
Registriert seit: 04.06.2005
Ort: INET
Beiträge: 6.870
8 Quick Tipps zu den WordPress Kommentaren und Pings und Trackbacks

kommst du damit klar ?

wenn nicht, dann poste etwaige Fehlermeldungen oder was Du davon gemacht hast

lg
Monika ist offline   Mit Zitat antworten
Alt 20.08.2008, 12:04   #3 (permalink)
PostRank: 2
 
Benutzerbild von Urgixgax
 
Registriert seit: 27.08.2007
Beiträge: 94
Danke, für den Tipp, aber ich bin wohl zu doof dazu, denn hier ist die Fehlermeldung:

Parse error: syntax error, unexpected T_ELSE in /home/www/web1350/html/blog/wordpress/wp-content/themes/fresh-urgixgax/comments.php on line 132

und damit es nicht zu möglichen Verständigungsproblemen kommt, hier die geänderte comments.php, nach Tipp5:

PHP-Code:
<?php // Do not delete these lines
    
if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
        die (
'Please do not load this page directly. Thanks!');

        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><?php _e("This post is password protected. Enter the password to view comments."); ?><p>

                <?php
                
return;
            }
        }

        
/* This variable is for alternating comment background, thanks Kubrick */
        
$oddcomment 'alt';
?>

<!-- You can start editing here. -->

<?php if ($comments) : ?>
<div id="comments">
    <h2 class="comments-num">
        <?php comments_number(__('Comments'), __('1 Comment'), __('% Comments')); ?>
        <?php if ( comments_open() ) : ?>
            <?php _e(' bis jetzt '); ?><a href="#postcomment" title="<?php _e('Jump to the comments form'); ?>">&raquo;</a>
        <?php endif; ?>
    </h2>
</div>
<!--kommentare-->
    <ol id="commentlist">

    <?php foreach ($comments as $comment) : ?>
     <?php if (get_comment_type() == "comment"){ ?>
        <li <?php if( $comment->user_id == $post->post_author)
{echo 
'class="mine"';
} else { echo 
$oddcomment; } ?> id="comment-<?php comment_ID() ?>">

        <!-- Gravatar -->
        <div class="comment-gravatar">
            <?php echo get_avatar(get_comment_author_email(), '80'get_bloginfo('template_url')."/images/default_gravatar.gif" ); ?>
        </div>

        <h3 class="comment-title"><?php comment_author_link() ?> <?php _e('schrieb'); ?> einen Kommentar</h3>

        <p class="comment-meta">
            <?php _e('... am: '); ?>
            <a href="#comment-<?php comment_ID() ?>">
                <?php comment_date('j. F Y,'?>
                <?php _e('um '); ?><?php comment_time() ?> Uhr:
            </a>
            <?php edit_comment_link(__("Edit"), ' · '''); ?>
        </p>

        <div class="comment-text"><?php comment_text() ?></div>
        </li>

        <?php
            
if ('alt' == $oddcomment$oddcomment '';
            else 
$oddcomment 'alt';
        
?>
      <?php ?>
    <?php endforeach; /* end for each comment */ ?>

    </ol>

    <p class="small">
    <p id="comments-rss">
        <?php comments_rss_link(__('Kommentar <abbr title="RSS-Feed">RSS</abbr>')); ?> <span>dieses</span> Beitrages
        <p>
        <?php if ( pings_open() ) : ?>
        <?php endif; ?></p>

<?php else : // this is displayed if there are no comments so far ?>

    <?php if ('open' == $post-> comment_status) : ?>
        <?php /* No comments yet */ ?>

    <?php else : // comments are closed ?>
        <?php /* Comments are closed */ ?>
        <p><?php _e('Comments are closed.'); ?></p>

    <?php endif; ?>

<?php endif; ?>
<!--kommentare aus-->
<!--trackback-->
    <ol id="commentlist">

    <?php foreach ($comments as $comment) : ?>
     <?php if (get_comment_type() != "comment"){ ?>
        <li <?php if( $comment->user_id == $post->post_author)
{echo 
'class="mine"';
} else { echo 
$oddcomment; } ?> id="comment-<?php comment_ID() ?>">

        <!-- Gravatar -->
        <div class="comment-gravatar">
            <?php echo get_avatar(get_comment_author_email(), '80'get_bloginfo('template_url')."/images/default_gravatar.gif" ); ?>
        </div>

        <h3 class="comment-title"><?php comment_author_link() ?> <?php _e('schrieb'); ?> einen Kommentar</h3>

        <p class="comment-meta">
            <?php _e('... am: '); ?>
            <a href="#comment-<?php comment_ID() ?>">
                <?php comment_date('j. F Y,'?>
                <?php _e('um '); ?><?php comment_time() ?> Uhr:
            </a>
            <?php edit_comment_link(__("Edit"), ' · '''); ?>
        </p>

        <div class="comment-text"><?php comment_text() ?></div>
        </li>

        <?php
            
if ('alt' == $oddcomment$oddcomment '';
            else 
$oddcomment 'alt';
        
?>
     <?php ?>
    <?php endforeach; /* end for each comment */ ?>

    </ol>

    <p class="small">
    <p id="comments-rss">
        <?php comments_rss_link(__('Kommentar <abbr title="RSS-Feed">RSS</abbr>')); ?> <span>dieses</span> Beitrages
        <p>
        <?php if ( pings_open() ) : ?>
        <?php endif; ?></p>

<?php else : // this is displayed if there are no comments so far ?>

    <?php if ('open' == $post-> comment_status) : ?>
        <?php /* No comments yet */ ?>

    <?php else : // comments are closed ?>
        <?php /* Comments are closed */ ?>
        <p><?php _e('Comments are closed.'); ?></p>

    <?php endif; ?>

<?php endif; ?>
<!--trackback aus-->
<?php if ('open' == $post-> comment_status) : ?>

    <h2 id="postcomment"><?php _e('Schreibe einen Kommentar'); ?></h2>
    <div class="postcomment">

    <?php if ( get_option('comment_registration') && !$user_ID ) : ?>

        <p><?php _e('You must be'); ?> <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?>"><?php _e('logged in'); ?></a> <?php _e('to post a comment.'); ?></p>

    <?php else : ?>

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

        <?php if ( $user_ID ) : ?>

            <p><?php _e('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="<?php _e('Log out of this account'?>"><?php _e('Abmelden'); ?> &raquo;</a></p>

        <?php else : ?>

            <p>
                <strong><?php _e('Name:'); ?> <?php if ($req_e('(Pflichtfeld)'); ?></strong><br/>
                <input type="text" name="author" id="author" value="<?php echo $comment_author?>" tabindex="1" />
            </p>

            <p>
                <strong><?php _e('E-mail:'); ?> <?php if ($req_e('(Pflichtfeld)'); ?></strong><br/>
                <input type="text" name="email" id="email" value="<?php echo $comment_author_email?>" tabindex="2" />
            </p>

            <p>
                <strong><?php _e('Website:'); ?></strong><br/>
                <input type="text" name="url" id="url" value="<?php echo $comment_author_url?>" tabindex="3" />
            </p>

        <?php endif; ?>

            <p>
                <strong><?php _e('Kommentar:'); ?> <?php if ($req_e('(Pflichtfeld)'); ?></strong><br/>
                <textarea name="comment" id="comment" rows="" cols="" tabindex="4"></textarea>
            </p>
            
            <p>
            <?php 
/****** Math Comment Spam Protection Plugin ******/
if ( function_exists('math_comment_spam_protection') ) { 
    
$mcsp_info math_comment_spam_protection();
?>     <p><input type="text" name="mcspvalue" id="mcspvalue" value="" size="22" tabindex="4" />
    <label for="mcspvalue"><small>Spamschutz: Summe von: <?php echo $mcsp_info['operand1'] . ' + ' $mcsp_info['operand2'] . ' ?' ?></small></label>
    <input type="hidden" name="mcspinfo" value="<?php echo $mcsp_info['result']; ?>" />
</p>
<?php // if function_exists... ?>
</p> <div class="send">
            <p>
                <input type="submit" name="submit" class="send" tabindex="5" value="<?php _e('Senden'); ?>" />
                <input type="hidden" name="comment_post_ID" value="<?php echo $id?>" />
            </p>
   </div>
        <?php do_action('comment_form'$post->ID); ?>

        </form>

    <?php endif; // If registration required and not logged in ?>
    </div>

<?php endif; // if you delete this the sky will fall on your head ?>

... weiter im Nächsten Eintrag ...
__________________
Avatar in GROSS? Guckst Du HIER! Blog:www.blog.urgixgax.de
Urgixgax ist offline   Mit Zitat antworten
Alt 20.08.2008, 12:04   #4 (permalink)
PostRank: 2
 
Benutzerbild von Urgixgax
 
Registriert seit: 27.08.2007
Beiträge: 94
... und hier die original comments.php:



PHP-Code:
<?php // Do not delete these lines
    
if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
        die (
'Please do not load this page directly. Thanks!');

        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><?php _e("This post is password protected. Enter the password to view comments."); ?><p>

                <?php
                
return;
            }
        }

        
/* This variable is for alternating comment background, thanks Kubrick */
        
$oddcomment 'alt';
?>

<!-- You can start editing here. -->

<?php if ($comments) : ?>
<div id="comments">
    <h2 class="comments-num">
        <?php comments_number(__('Comments'), __('1 Comment'), __('% Comments')); ?>
        <?php if ( comments_open() ) : ?>
            <?php _e(' bis jetzt '); ?><a href="#postcomment" title="<?php _e('Jump to the comments form'); ?>">&raquo;</a>
        <?php endif; ?>
    </h2>
</div>
    <ol id="commentlist">

    <?php foreach ($comments as $comment) : ?>

        <li <?php if( $comment->user_id == $post->post_author)
{echo 
'class="mine"';
} else { echo 
$oddcomment; } ?> id="comment-<?php comment_ID() ?>">

        <!-- Gravatar -->
        <div class="comment-gravatar">
            <?php echo get_avatar(get_comment_author_email(), '80'get_bloginfo('template_url')."/images/default_gravatar.gif" ); ?>
        </div>

        <h3 class="comment-title"><?php comment_author_link() ?> <?php _e('schrieb'); ?> einen Kommentar</h3>

        <p class="comment-meta">
            <?php _e('... am: '); ?>
            <a href="#comment-<?php comment_ID() ?>">
                <?php comment_date('j. F Y,'?>
                <?php _e('um '); ?><?php comment_time() ?> Uhr:
            </a>
            <?php edit_comment_link(__("Edit"), ' · '''); ?>
        </p>

        <div class="comment-text"><?php comment_text() ?></div>
        </li>

        <?php
            
if ('alt' == $oddcomment$oddcomment '';
            else 
$oddcomment 'alt';
        
?>

    <?php endforeach; /* end for each comment */ ?>

    </ol>

    <p class="small">
    <p id="comments-rss">
        <?php comments_rss_link(__('Kommentar <abbr title="RSS-Feed">RSS</abbr>')); ?> <span>dieses</span> Beitrages
        <p>
        <?php if ( pings_open() ) : ?>
        <?php endif; ?></p>

<?php else : // this is displayed if there are no comments so far ?>

    <?php if ('open' == $post-> comment_status) : ?>
        <?php /* No comments yet */ ?>

    <?php else : // comments are closed ?>
        <?php /* Comments are closed */ ?>
        <p><?php _e('Comments are closed.'); ?></p>

    <?php endif; ?>

<?php endif; ?>

<?php if ('open' == $post-> comment_status) : ?>

    <h2 id="postcomment"><?php _e('Schreibe einen Kommentar'); ?></h2>
    <div class="postcomment">

    <?php if ( get_option('comment_registration') && !$user_ID ) : ?>

        <p><?php _e('You must be'); ?> <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?>"><?php _e('logged in'); ?></a> <?php _e('to post a comment.'); ?></p>

    <?php else : ?>

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

        <?php if ( $user_ID ) : ?>

            <p><?php _e('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="<?php _e('Log out of this account'?>"><?php _e('Abmelden'); ?> &raquo;</a></p>

        <?php else : ?>

            <p>
                <strong><?php _e('Name:'); ?> <?php if ($req_e('(Pflichtfeld)'); ?></strong><br/>
                <input type="text" name="author" id="author" value="<?php echo $comment_author?>" tabindex="1" />
            </p>

            <p>
                <strong><?php _e('E-mail:'); ?> <?php if ($req_e('(Pflichtfeld)'); ?></strong><br/>
                <input type="text" name="email" id="email" value="<?php echo $comment_author_email?>" tabindex="2" />
            </p>

            <p>
                <strong><?php _e('Website:'); ?></strong><br/>
                <input type="text" name="url" id="url" value="<?php echo $comment_author_url?>" tabindex="3" />
            </p>

        <?php endif; ?>

            <p>
                <strong><?php _e('Kommentar:'); ?> <?php if ($req_e('(Pflichtfeld)'); ?></strong><br/>
                <textarea name="comment" id="comment" rows="" cols="" tabindex="4"></textarea>
            </p>
            
            <p>
            <?php 
/****** Math Comment Spam Protection Plugin ******/
if ( function_exists('math_comment_spam_protection') ) { 
    
$mcsp_info math_comment_spam_protection();
?>     <p><input type="text" name="mcspvalue" id="mcspvalue" value="" size="22" tabindex="4" />
    <label for="mcspvalue"><small>Spamschutz: Summe von: <?php echo $mcsp_info['operand1'] . ' + ' $mcsp_info['operand2'] . ' ?' ?></small></label>
    <input type="hidden" name="mcspinfo" value="<?php echo $mcsp_info['result']; ?>" />
</p>
<?php // if function_exists... ?>
</p> <div class="send">
            <p>
                <input type="submit" name="submit" class="send" tabindex="5" value="<?php _e('Senden'); ?>" />
                <input type="hidden" name="comment_post_ID" value="<?php echo $id?>" />
            </p>
   </div>
        <?php do_action('comment_form'$post->ID); ?>

        </form>

    <?php endif; // If registration required and not logged in ?>
    </div>

<?php endif; // if you delete this the sky will fall on your head ?>
Ich wollte mit der Änderung erreichen, das die Trackbacks separat, unter den Kommentaren stehen.

Urgixgax.
__________________
Avatar in GROSS? Guckst Du HIER! Blog:www.blog.urgixgax.de
Urgixgax ist offline   Mit Zitat antworten
Alt 20.08.2008, 12:07   #5 (permalink)
WPD-Moderator
 
Benutzerbild von Alphawolf
 
Registriert seit: 31.05.2005
Ort: Gera Ghetto
Beiträge: 2.389
Ja, die Fehlermeldung ist eineindeutig.

In Zeile 132 ist ein else zu viel, also in Zeile 132 diese entfernen:
PHP-Code:
<?php else : // this is displayed if there are no comments so far ?>
__________________
FAQ // Doku // Erbreiterungen
Alphawolf ist offline   Mit Zitat antworten
Alt 20.08.2008, 14:09   #6 (permalink)
PostRank: 2
 
Benutzerbild von Urgixgax
 
Registriert seit: 27.08.2007
Beiträge: 94
Habe ich gelöscht und es kam eine andere Fehlermeldung. Das habe ich aber auch noch in bekommen.
Im Groben und Ganzen ist es nun ok, aber ob noch diverse Schönheitsfehler im Code sein, weiß ich nicht:

PHP-Code:
  <?php // Do not delete these lines
    
if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
        die (
'Please do not load this page directly. Thanks!');

        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><?php _e("This post is password protected. Enter the password to view comments."); ?><p>

                <?php
                
return;
            }
        }

        
/* This variable is for alternating comment background, thanks Kubrick */
        
$oddcomment 'alt';
?>

<!-- You can start editing here. -->

<?php if ($comments) : ?>
<div id="comments">
    <h2 class="comments-num">
        <?php comments_number(__('Comments'), __('1 Comment'), __('% Comments')); ?>
        <?php if ( comments_open() ) : ?>
            <?php _e(' bis jetzt '); ?><a href="#postcomment" title="<?php _e('Jump to the comments form'); ?>">&raquo;</a>
        <?php endif; ?>
    </h2>
</div>
<!--kommentare-->
    <ol id="commentlist">

    <?php foreach ($comments as $comment) : ?>
     <?php if (get_comment_type() == "comment"){ ?>
        <li <?php if( $comment->user_id == $post->post_author)
{echo 
'class="mine"';
} else { echo 
$oddcomment; } ?> id="comment-<?php comment_ID() ?>">

        <!-- Gravatar -->
        <div class="comment-gravatar">
            <?php echo get_avatar(get_comment_author_email(), '80'get_bloginfo('template_url')."/images/default_gravatar.gif" ); ?>
        </div>

        <h3 class="comment-title"><?php comment_author_link() ?> <?php _e('schrieb'); ?> einen Kommentar</h3>

        <p class="comment-meta">
            <?php _e('... am: '); ?>
            <a href="#comment-<?php comment_ID() ?>">
                <?php comment_date('j. F Y,'?>
                <?php _e('um '); ?><?php comment_time() ?> Uhr:
            </a>
            <?php edit_comment_link(__("Edit"), ' · '''); ?>
        </p>

        <div class="comment-text"><?php comment_text() ?></div>
        </li>

        <?php
            
if ('alt' == $oddcomment$oddcomment '';
            else 
$oddcomment 'alt';
        
?>
      <?php ?>
    <?php endforeach; /* end for each comment */ ?>

    </ol>

    <p id="trackback-h">
    Trackbacks<span> bis jetzt!</span>
        <p>
        <?php if ( pings_open() ) : ?>
        <?php endif; ?></p>

<?php else : // this is displayed if there are no comments so far ?>

    <?php if ('open' == $post-> comment_status) : ?>
        <?php /* No comments yet */ ?>

    <?php else : // comments are closed ?>
        <?php /* Comments are closed */ ?>
        <p><?php _e('Comments are closed.'); ?></p>

    <?php endif; ?>

<?php endif; ?>
<!--kommentare aus-->
<!--trackback-->
    <ol id="commentlist">

    <?php foreach ($comments as $comment) : ?>
     <?php if (get_comment_type() != "comment"){ ?>
        <li <?php if( $comment->user_id == $post->post_author)
{echo 
'class="mine"';
} else { echo 
$oddcomment; } ?> id="comment-<?php comment_ID() ?>">


        <p class="comment-trackbackmeta">
            Von <?php comment_author_link() ?> <?php _e('kommt'); ?> ein Trackback,<br />
                <?php _e(' erstellt am: '); ?>
                <?php comment_date('j. F Y,'?>
                <?php _e('um '); ?><?php comment_time() ?> Uhr!
            <?php edit_comment_link(__("Edit"), ' · '''); ?>
        </p>

        </li>

        <?php
            
if ('alt' == $oddcomment$oddcomment '';
            else 
$oddcomment 'alt';
        
?>
     <?php ?>
    <?php endforeach; /* end for each comment */ ?>

    </ol>

    <p class="small">
    <p id="comments-rss">
        <?php comments_rss_link(__