From 5ec96c72c178ca6f03cea98b821923a726e4ba2b Mon Sep 17 00:00:00 2001 From: Grischa Brockhaus Date: Fri, 20 Jan 2012 12:03:23 +0100 Subject: [PATCH] commentspice: nofollow link options. --- .../UTF-8/lang_de.inc.php | 8 ++++---- .../lang_de.inc.php | 2 +- .../lang_en.inc.php | 6 +++++- .../serendipity_event_commentspice.php | 20 ++++++++++++++++--- 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/serendipity_event_commentspice/UTF-8/lang_de.inc.php b/serendipity_event_commentspice/UTF-8/lang_de.inc.php index 521916d0..1394fd2b 100644 --- a/serendipity_event_commentspice/UTF-8/lang_de.inc.php +++ b/serendipity_event_commentspice/UTF-8/lang_de.inc.php @@ -1,12 +1,12 @@ Twitter Namen eingibst wird Deine Timeline in Deinem Kommentar verlinkt.'); @define('PLUGIN_EVENT_COMMENTSPICE_PROMOTE_ARTICLE_CHOOSE', '- Bewirb einen Deiner letzten Artikel -'); -@define('PLUGIN_EVENT_COMMENTSPICE_PROMOTE_ARTICLE_RESCENT', 'Letzter Artikel'); -@define('PLUGIN_EVENT_COMMENTSPICE_PROMOTE_ARTICLE_FOOTER', 'Bewirb einen Deiner letzten Artikel
Dieses Blog erlaubt Dir mit Deinem Kommentar einen Deiner letzten Artikel zu bewerben. Bitte gib Deine Blog URL als Homepage ein, dann wird eine Auswahl erscheinen, in der Du einen Artikel auswählen kannst.'); -@define('PLUGIN_EVENT_COMMENTSPICE_PROMOTE_ARTICLE_CORRUPTED', 'Entschuldigung, bei der Übergabe "Deines letzten Artikels" ist etwas schief gegangen.'); +@define('PLUGIN_EVENT_COMMENTSPICE_PROMOTE_ARTICLE_RESCENT', '%s schrieb auch'); +@define('PLUGIN_EVENT_COMMENTSPICE_PROMOTE_ARTICLE_FOOTER', 'Bewirb einen Deiner letzten Artikel
Dieses Blog erlaubt Dir mit Deinem Kommentar einen Deiner letzten Artikel zu bewerben. Bitte gib Deine Blog URL als Homepage ein, dann wird eine Auswahl erscheinen, in der Du einen Artikel auswählen kannst.'); +@define('PLUGIN_EVENT_COMMENTSPICE_PROMOTE_ARTICLE_CORRUPTED', 'Entschuldigung, bei der Übergabe "Deines letzten Artikels" ist etwas schief gegangen.'); diff --git a/serendipity_event_commentspice/lang_de.inc.php b/serendipity_event_commentspice/lang_de.inc.php index af732a34..1394fd2b 100644 --- a/serendipity_event_commentspice/lang_de.inc.php +++ b/serendipity_event_commentspice/lang_de.inc.php @@ -7,6 +7,6 @@ @define('PLUGIN_EVENT_COMMENTSPICE_PROMOTE_TWITTER_FOOTER', 'Wenn Du Deinen Twitter Namen eingibst wird Deine Timeline in Deinem Kommentar verlinkt.'); @define('PLUGIN_EVENT_COMMENTSPICE_PROMOTE_ARTICLE_CHOOSE', '- Bewirb einen Deiner letzten Artikel -'); -@define('PLUGIN_EVENT_COMMENTSPICE_PROMOTE_ARTICLE_RESCENT', 'Letzter Artikel'); +@define('PLUGIN_EVENT_COMMENTSPICE_PROMOTE_ARTICLE_RESCENT', '%s schrieb auch'); @define('PLUGIN_EVENT_COMMENTSPICE_PROMOTE_ARTICLE_FOOTER', 'Bewirb einen Deiner letzten Artikel
Dieses Blog erlaubt Dir mit Deinem Kommentar einen Deiner letzten Artikel zu bewerben. Bitte gib Deine Blog URL als Homepage ein, dann wird eine Auswahl erscheinen, in der Du einen Artikel auswählen kannst.'); @define('PLUGIN_EVENT_COMMENTSPICE_PROMOTE_ARTICLE_CORRUPTED', 'Entschuldigung, bei der Übergabe "Deines letzten Artikels" ist etwas schief gegangen.'); diff --git a/serendipity_event_commentspice/lang_en.inc.php b/serendipity_event_commentspice/lang_en.inc.php index 9a00ae2a..93308934 100644 --- a/serendipity_event_commentspice/lang_en.inc.php +++ b/serendipity_event_commentspice/lang_en.inc.php @@ -5,8 +5,12 @@ @define('PLUGIN_EVENT_COMMENTSPICE_TWITTERINPUT', 'Allow commentors to add their twitter name'); @define('PLUGIN_EVENT_COMMENTSPICE_TWITTERINPUT_DESC', 'If you enable this, commenters are allowed to enter their twitter names and their twitter timeline will be linked to the comment.'); +@define('PLUGIN_EVENT_COMMENTSPICE_TWITTERINPUT_NOFOLLOW', 'Set twitter link nofollow'); +@define('PLUGIN_EVENT_COMMENTSPICE_TWITTERINPUT_NOFOLLOW_DESC', 'If set to nofollow search engines will ignore the twitter timeline link. It will make it less interesting for manual comment spammers but won\'t give search engine kudos to the real commenter.'); @define('PLUGIN_EVENT_COMMENTSPICE_ANNOUNCE_RSS', 'Allow commentors to announce recent posts'); @define('PLUGIN_EVENT_COMMENTSPICE_ANNOUNCE_RSS_DESC', 'When the commentor adds a homepage, comment spice will check for a RSS feed on that page. If so, the commentor can choose one of his rescents posts to be announced with his comment.'); +@define('PLUGIN_EVENT_COMMENTSPICE_ANNOUNCE_RSS_NOFOLLOW', 'Set recent post link nofollow'); +@define('PLUGIN_EVENT_COMMENTSPICE_ANNOUNCE_RSS_NOFOLLOW_DESC', 'If set to nofollow search engines will ignore the recent post link. It will make it less interesting for manual comment spammers but won\'t give search engine kudos to the real commenter.'); @define('PLUGIN_EVENT_COMMENTSPICE_ANNOUNCE_RSS_MAXSELECT', 'Maximum article count for announcing'); @define('PLUGIN_EVENT_COMMENTSPICE_ANNOUNCE_RSS_MAXSELECT_DESC', 'How many rescent posts should be loaded at maximum the user can announce?'); @define('PLUGIN_EVENT_COMMENTSPICE_PATH', 'Plugins path'); @@ -16,6 +20,6 @@ @define('PLUGIN_EVENT_COMMENTSPICE_PROMOTE_TWITTER_FOOTER', 'If you enter your twitter name, your timeline will get linked to your comment.'); @define('PLUGIN_EVENT_COMMENTSPICE_PROMOTE_ARTICLE_CHOOSE', '- Promote one of your rescent articles -'); -@define('PLUGIN_EVENT_COMMENTSPICE_PROMOTE_ARTICLE_RESCENT', 'Recent post'); +@define('PLUGIN_EVENT_COMMENTSPICE_PROMOTE_ARTICLE_RESCENT', '%s wrote about'); @define('PLUGIN_EVENT_COMMENTSPICE_PROMOTE_ARTICLE_FOOTER', 'Promote one of your rescent articles
This blog allows you to announce one of your recent blog articles with your comment. Please enter your the corresponding URL as homepage and a selection box will pop up letting you choose an article.'); @define('PLUGIN_EVENT_COMMENTSPICE_PROMOTE_ARTICLE_CORRUPTED', 'Sorry, unable to verify your "recent post" datas..'); diff --git a/serendipity_event_commentspice/serendipity_event_commentspice.php b/serendipity_event_commentspice/serendipity_event_commentspice.php index 10cdaed2..70e52f2c 100644 --- a/serendipity_event_commentspice/serendipity_event_commentspice.php +++ b/serendipity_event_commentspice/serendipity_event_commentspice.php @@ -45,7 +45,7 @@ class serendipity_event_commentspice extends serendipity_event 'external_plugin' => true, )); $propbag->add('groups', array('FRONTEND_VIEWS')); - $propbag->add('configuration', array('twitterinput','announcerss','plugin_path')); + $propbag->add('configuration', array('twitterinput','twitterinput_nofollow', 'announcerss', 'announcerss_nofollow','plugin_path')); } function generate_content(&$title) { @@ -63,6 +63,13 @@ class serendipity_event_commentspice extends serendipity_event $propbag->add('default', true); return true; break; + case 'twitterinput_nofollow': + $propbag->add('type', 'boolean'); + $propbag->add('name', PLUGIN_EVENT_COMMENTSPICE_TWITTERINPUT_NOFOLLOW); + $propbag->add('description', PLUGIN_EVENT_COMMENTSPICE_TWITTERINPUT_NOFOLLOW_DESC); + $propbag->add('default', true); + return true; + break; case 'announcerss': $propbag->add('type', 'boolean'); $propbag->add('name', PLUGIN_EVENT_COMMENTSPICE_ANNOUNCE_RSS); @@ -70,6 +77,13 @@ class serendipity_event_commentspice extends serendipity_event $propbag->add('default', false); return true; break; + case 'announcerss_nofollow': + $propbag->add('type', 'boolean'); + $propbag->add('name', PLUGIN_EVENT_COMMENTSPICE_ANNOUNCE_RSS_NOFOLLOW); + $propbag->add('description', PLUGIN_EVENT_COMMENTSPICE_ANNOUNCE_RSS_NOFOLLOW_DESC); + $propbag->add('default', false); + return true; + break; case 'announcerssmax': $propbag->add('type', 'string'); $propbag->add('name', PLUGIN_EVENT_COMMENTSPICE_ANNOUNCE_RSS_MAXSELECT); @@ -303,9 +317,9 @@ class serendipity_event_commentspice extends serendipity_event return true; } $twittername = $spice['twittername']; - $eventData['comment'] = '' . PLUGIN_EVENT_COMMENTSPICE_PROMOTE_TWITTER . ': ' . $twittername . '
' . $eventData['comment']; + $eventData['comment'] = 'get_config('twitterinput_nofollow', true)?' rel="nofollow"':'') . '>' . PLUGIN_EVENT_COMMENTSPICE_PROMOTE_TWITTER . ': ' . $twittername . '
' . $eventData['comment']; if ($spice['promo_name'] && $spice['promo_url']) { - $eventData['comment'] .= "

" . PLUGIN_EVENT_COMMENTSPICE_PROMOTE_ARTICLE_RESCENT . ": {$spice['promo_name']}

"; + $eventData['comment'] .= "

" . sprintf(PLUGIN_EVENT_COMMENTSPICE_PROMOTE_ARTICLE_RESCENT, $eventData['author']) . ": get_config('announcerss_nofollow', false)?' rel="nofollow"':'') . ">{$spice['promo_name']}

"; } }