Page 1 of 1

"nofollow" für homepage-Links in Kommentaren

Posted: Sun Jun 27, 2010 11:58 am
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

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

Posted: Sun Jun 27, 2010 1:48 pm
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ß

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

Posted: Sun Jun 27, 2010 2:18 pm
by kleinerChemiker
Oder aber dafür sorgen, daß Spam gar nicht erst in die Kommentare kommt ;)

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

Posted: Sun Jun 27, 2010 2:23 pm
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

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

Posted: Sun Jun 27, 2010 2:35 pm
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.

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

Posted: Fri Apr 27, 2012 4:00 pm
by milos27
Wo muss ich den code einfügen?

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

Posted: Fri Apr 27, 2012 6:58 pm
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

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

Posted: Mon Apr 30, 2012 1:08 am
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 ...

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

Posted: Mon Apr 30, 2012 1:21 am
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

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

Posted: Mon Apr 30, 2012 1:32 pm
by milos27
DANKE nun funzt es ;-)

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

Posted: Sat Jun 02, 2012 3:50 pm
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: