"nofollow" für homepage-Links in Kommentaren

Hier können Probleme und alles andere in Deutscher Sprache gelöst werden.
Post Reply
thh
Regular
Posts: 419
Joined: Thu Oct 26, 2006 2:38 pm
Location: Stuttgart, Germany
Contact:

"nofollow" für homepage-Links in Kommentaren

Post by thh »

Serendipity setzt an einigen Stellen bereits das "nofollow"-Attribut für externe Links, bspw. im Kommentar-Plugin, das die aktuellsten x Kommentare anzeigt.

Bei der Anzeige der Kommentare selbst ist das aber für den Homepage-Link, den der Kommentator angeben kann, offensichtlich nicht der Fall! Gerade dort wird aber natürlich von Spammern gerne eine entsprechende URL abgekippt. Daher fände ich es - optional oder standardisiert - sinnvoll, auch dort "nofollow" zu setzen oder setzen zu können, etwa so:

Code: Select all

--- default/comments.tpl        2007-02-26 08:51:04.000000000 +0100
+++ thh/comments.tpl    2010-06-27 11:53:18.168402816 +0200
@@ -18,7 +18,7 @@
             {/if}
             </span>
             {if $comment.url}
-                (<a class="comment_source_url" href="{$comment.url}" title="{$comment.url|@escape}">{$CONST.HOMEPAGE}</a>)
+                (<a rel="nofollow" class="comment_source_url" href="{$comment.url}" title="{$comment.url|@escape}">{$CONST.HOMEPAGE}</a>)
             {/if}
             {$CONST.ON}
             <span class="comment_source_date">{$comment.timestamp|@formatTime:$CONST.DATE_FORMAT_SHORT}</span>
Sorry, wenn das schonmal Thema war - meine Suche hat nichts passendes zutage gefördert.

-thh
onli
Regular
Posts: 2828
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: "nofollow" für homepage-Links in Kommentaren

Post by onli »

Du hast ja genau erkannt, wie man das umstellen kann. Als feste Option wäre das auch noch ok, nur Standard sollte es meiner Meinung nach keinesfalls werden.
Gruß
kleinerChemiker
Regular
Posts: 765
Joined: Tue Oct 17, 2006 2:36 pm
Location: Vienna/Austria
Contact:

Re: "nofollow" für homepage-Links in Kommentaren

Post by kleinerChemiker »

Oder aber dafür sorgen, daß Spam gar nicht erst in die Kommentare kommt ;)
thh
Regular
Posts: 419
Joined: Thu Oct 26, 2006 2:38 pm
Location: Stuttgart, Germany
Contact:

Re: "nofollow" für homepage-Links in Kommentaren

Post by thh »

kleinerChemiker wrote:Oder aber dafür sorgen, daß Spam gar nicht erst in die Kommentare kommt ;)
Ich habe jetzt neuerdings mindestens einen Kommentar, der inhaltlich durchaus sinnvoll ist und zu dem Beitrag paßt, ihn auch direkt in Bezug nimmt, aber einen "Homepage"-Eintrag hat, der auf eine kommerzielle Seite verweist. Und Google-Recherche hat eine ganze Reihe Kommentare in anderen Blogs zutage gefördert, die gleichfalls sinnvoll Bezug auf den jeweiligen Beitrag nehmen und in denen die Namen wechseln, aber die URL immer die gleiche ist. Ich würde vermuten, daß das "manueller" Spam ist. Das läßt sich m.E. nicht sinnvoll filtern, weil - mit Ausnahme der "beworbenen" URL - nicht von normalen Kommentaren zu unterscheiden.

Der übliche Spam fliegt natürlich vorher raus.

-thh
kleinerChemiker
Regular
Posts: 765
Joined: Tue Oct 17, 2006 2:36 pm
Location: Vienna/Austria
Contact:

Re: "nofollow" für homepage-Links in Kommentaren

Post by kleinerChemiker »

Falls es immer die selbe Adresse ist, könntest du die ins Spamplugin aufnehmen. Sind es verschiedene, dann ists natürlich dumm. Allerdings ist auch die Frage, ob ein nofollow den manuellen Spam abhalten würde.
milos27
Regular
Posts: 154
Joined: Sun Jul 06, 2008 8:31 pm
Contact:

Re: "nofollow" für homepage-Links in Kommentaren

Post by milos27 »

Wo muss ich den code einfügen?
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: "nofollow" für homepage-Links in Kommentaren

Post by yellowled »

milos27 wrote:Wo muss ich den code einfügen?
comments.tpl – allerdings bitte nicht den gesamten obigen Code einfügen, sondern nur das rel="nofollow" bei den Links, bei denen das Attribut gewünscht ist.

(Und bitte keine deutschsprachigen Threads in englische Foren verschieben.)

YL
milos27
Regular
Posts: 154
Joined: Sun Jul 06, 2008 8:31 pm
Contact:

Re: "nofollow" für homepage-Links in Kommentaren

Post by milos27 »

So schaut meine comments.tpl aus:

Code: Select all

{foreach from=$comments item=comment name="comments"}
    <a id="c{$comment.id}"></a>
    <div id="serendipity_comment_{$comment.id}" class="serendipity_comment serendipity_comment_author_{$comment.author|@makeFilename} {if ($entry.author == $comment.author) && ($entry.email == $commentform_entry.email)}serendipity_comment_author_self{/if} {cycle values="comment_oddbox, comment_evenbox"}" style="margin-left: {$comment.depth*10}px">
        <div class="serendipity_comment_source">
            <a class="comment_source_trace" href="#c{$comment.id}">#{$comment.trace}</a>

            <span class="comment_source_author">
                {if $comment.url}
                    <a class="comment_source_url" href="{$comment.url}" title="{$comment.url|@escape}">{$comment.author|@default:$CONST.ANONYMOUS}</a>
                {else}
                    {$comment.author|@default:$CONST.ANONYMOUS}
                {/if}
            </span>

            {$CONST.ON}

            <span class="comment_source_date">{$comment.timestamp|@formatTime:'%m/%d/%y'} {$CONST.AT} {$comment.timestamp|@formatTime:'%I:%M %p'}</span>

            {if $entry.is_entry_owner}
                [<a class="comment_source_ownerlink" href="{$comment.link_delete}" onclick="return confirm('{$CONST.COMMENT_DELETE_CONFIRM|@sprintf:$comment.id:$comment.author}');">{$CONST.DELETE}</a>]
            {/if}

            {if $entry.allow_comments AND $comment.body != 'COMMENT_DELETED'}
                [<a class="comment_reply" href="#serendipity_CommentForm" id="serendipity_reply_{$comment.id}" onclick="document.getElementById('serendipity_replyTo').value='{$comment.id}'; {$comment_onchange}">{$CONST.REPLY}</a>]
                <div id="serendipity_replyform_{$comment.id}"></div>
            {/if}
        </div>

        <div class="serendipity_commentBody">
            {if $comment.body == 'COMMENT_DELETED'}
                {$CONST.COMMENT_IS_DELETED}
            {else}
                {if $comment.avatar}
                    {$comment.avatar}
                {/if}
                {$comment.body}
            {/if}
        </div>

    </div>
{foreachelse}
    <div class="serendipity_center nocomments">{$CONST.NO_COMMENTS}</div>
{/foreach}
Ich weiß nicht an welche Stelle ich nun die Änderungen einfügen muss damit die URL`s der Kommentare auf no follow geändert werden ...
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: "nofollow" für homepage-Links in Kommentaren

Post by yellowled »

Code: Select all

                {if $comment.url}
                    <a rel="nofollow" class="comment_source_url" href="{$comment.url}" title="{$comment.url|@escape}">{$comment.author|@default:$CONST.ANONYMOUS}</a>
                {else}
                    {$comment.author|@default:$CONST.ANONYMOUS}
                {/if}
Das ist die einzige externe URL, die im Kommentarfomular existiert. Bei internen URLs ist rel="nofollow" sinnfrei.

YL
milos27
Regular
Posts: 154
Joined: Sun Jul 06, 2008 8:31 pm
Contact:

Re: "nofollow" für homepage-Links in Kommentaren

Post by milos27 »

DANKE nun funzt es ;-)
blog.brockha.us
Regular
Posts: 695
Joined: Tue Jul 03, 2007 3:34 am
Location: Berlin, Germany
Contact:

Re: "nofollow" für homepage-Links in Kommentaren

Post by blog.brockha.us »

Nebenbei kann man das in meinem Plugin, an dem ich immer noch so nebenbei rum werkele (CommentSpice) auch einstellen: Kommentatoren mit X Kommentaren bekommen das nofollow ausgeschaltet, alle anderen (die "neuen") behaben es.

Hmm.. Ich sollte es vielleicht wirklich mal releasen.. :mrgreen:
- Grischa Brockhaus - http://blog.brockha.us
- Want to make me happy? http://wishes.brockha.us/
Post Reply