Skip to content

Commit

Permalink
commentSpice: Supports audioboo comments (optionaly of course)
Browse files Browse the repository at this point in the history
  • Loading branch information
brockhaus committed Jun 29, 2012
1 parent dd021e4 commit 80b925a
Show file tree
Hide file tree
Showing 8 changed files with 150 additions and 19 deletions.
25 changes: 15 additions & 10 deletions serendipity_event_commentspice/DbSpice.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ function install(&$obj) {
serendipity_db_query($q); // if it already exists, it won't be created
$obj->set_config(PLUGIN_EVENT_COMMENTSPICE_CNAME_DBCONFIG, 3);
}
// Version 4 updates
if ($obj->get_config((PLUGIN_EVENT_COMMENTSPICE_CNAME_DBCONFIG)<4)) {
$q = "alter table {$serendipity['dbPrefix']}commentspice" .
" add column boo nvarchar(250);";
serendipity_db_query($q);
$obj->set_config(PLUGIN_EVENT_COMMENTSPICE_CNAME_DBCONFIG, 4);
}
}

function countComments($email) {
Expand All @@ -61,19 +68,17 @@ function countComments($email) {
return $row['commentcount'];
}

function saveCommentSpice($commentid, $twittername, $promo_name, $promo_url) {
function saveCommentSpice($commentid, $twittername, $promo_name, $promo_url, $boo_url) {
global $serendipity;
if (empty($commentid) || !is_numeric($commentid) || (empty($twittername) && empty($promo_name)) ) return true;
if (empty($commentid) || !is_numeric($commentid) || (empty($twittername) && empty($promo_name) && empty($boo_url)) ) return true;

$db_twittername = (empty($twittername)?'':serendipity_db_escape_string($twittername));
$db_promo_name = (empty($promo_name)?'':serendipity_db_escape_string($promo_name));
$db_promo_url = (empty($promo_url)?'':serendipity_db_escape_string($promo_url));
$spice = array('commentid' => $commentid);
if (!empty($twittername)) $spice['twittername'] = $twittername;
if (!empty($promo_name)) $spice['promo_name'] = $promo_name;
if (!empty($promo_url)) $spice['promo_url'] = $promo_url;
if (!empty($boo_url)) $spice['boo'] = $boo_url;

$sql = "INSERT INTO {$serendipity['dbPrefix']}commentspice (commentid, twittername, promo_name, promo_url) ";
if (empty($promo_name)) $sql .= " VALUES ($commentid, '$db_twittername', NULL, NULL)";
elseif (empty($twittername)) $sql .= " VALUES ($commentid, NULL, '$db_promo_name', '$db_promo_url')";
else $sql .= " VALUES ($commentid, '$db_twittername', '$db_promo_name', '$db_promo_url')";
return serendipity_db_query($sql);
return serendipity_db_insert('commentspice', $spice);
}

function loadCommentSpice($commentid) {
Expand Down
11 changes: 11 additions & 0 deletions serendipity_event_commentspice/UTF-8/lang_de.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,17 @@
@define('PLUGIN_EVENT_COMMENTSPICE_PROMOTE_ARTICLE_FOOTER', '<b>Bewirb einen Deiner letzten Artikel</b><br/>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_CONFIG_BOO','Audio Kommentare mittels audioboo.fm');
@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_BOO_DESC','Wenn Du z.B. ein Podcasting Blog hast, möchtest Du vielleicht Deinen Hörern erlauben, per Boo Audio (Mini Podcasts) zu kommentieren, die auf <a href="http://audioboo.fm" target="_blank">audioboo.fm</a> gehostet werden.');
@define('PLUGIN_EVENT_COMMENTSPICE_BOO_ALLOW','Erlaube Boo Kommentare');
@define('PLUGIN_EVENT_COMMENTSPICE_BOO_ALLOW_DESC','Schalte dies ein, wenn Du Deinen Lesern/Hörern Boo Audio Kommentare erlauben möchtest. Unterhalb des Kommentar Editors wird ein Feld erscheinen, in dem ein Boo eingetragen und (beta!) aufgenommen werden kann.');
@define('PLUGIN_EVENT_COMMENTSPICE_BOO_MODERATE','Moderiere Boo Kommentare');
@define('PLUGIN_EVENT_COMMENTSPICE_BOO_MODERATE_DESC','Schalte dies ein, wenn Audio Boos moderiert werden sollen.');
@define('PLUGIN_EVENT_COMMENTSPICE_BOO_FOOTER','Dieses Blog erlaubt Dir, Audio Kommentare über <a href="http://audioboo.fm/profile" target="_blank">audioboo.fm</a> hinzuzufügen. <a href="http://audioboo.fm/boos/new" target="_blank">Erstelle einen neuen Boo</a> und gib hier den Link auf die Seite Deines Boos ein.');
@define('PLUGIN_EVENT_COMMENTSPICE_BOO_PLACEHOLDER', 'http://audioboo.fm/boos/123456-title');
@define('PLUGIN_EVENT_COMMENTSPICE_BOO_WRONG', 'Tut mir leid, das scheint keine boo URL zu sein (http://audioboo.fm/boos/12345-title)');
@define('PLUGIN_EVENT_COMMENTSPICE_BOO_MODERATED', 'Boo Audio Kommentare werden vorerst moderiert, bitte habe etwas Geduld.');

@define('PLUGIN_EVENT_COMMENTSPICE_REQUIREMENTS', 'Bedingung');
@define('PLUGIN_EVENT_COMMENTSPICE_REQUIREMENTS_COMMENTCOUNT', '%s Kommentare geschrieben');
@define('PLUGIN_EVENT_COMMENTSPICE_REQUIREMENTS_COMMENTLEN', '%s Buchstaben in diesem Kommentar');
Binary file added serendipity_event_commentspice/img/audioboo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified serendipity_event_commentspice/img/commentspice.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added serendipity_event_commentspice/img/microphone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions serendipity_event_commentspice/lang_de.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,17 @@
@define('PLUGIN_EVENT_COMMENTSPICE_PROMOTE_ARTICLE_FOOTER', '<b>Bewirb einen Deiner letzten Artikel</b><br/>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_CONFIG_BOO','Audio Kommentare mittels audioboo.fm');
@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_BOO_DESC','Wenn Du z.B. ein Podcasting Blog hast, möchtest Du vielleicht Deinen Hörern erlauben, per Boo Audio (Mini Podcasts) zu kommentieren, die auf <a href="http://audioboo.fm" target="_blank">audioboo.fm</a> gehostet werden.');
@define('PLUGIN_EVENT_COMMENTSPICE_BOO_ALLOW','Erlaube Boo Kommentare');
@define('PLUGIN_EVENT_COMMENTSPICE_BOO_ALLOW_DESC','Schalte dies ein, wenn Du Deinen Lesern/Hörern Boo Audio Kommentare erlauben möchtest. Unterhalb des Kommentar Editors wird ein Feld erscheinen, in dem ein Boo eingetragen und (beta!) aufgenommen werden kann.');
@define('PLUGIN_EVENT_COMMENTSPICE_BOO_MODERATE','Moderiere Boo Kommentare');
@define('PLUGIN_EVENT_COMMENTSPICE_BOO_MODERATE_DESC','Schalte dies ein, wenn Audio Boos moderiert werden sollen.');
@define('PLUGIN_EVENT_COMMENTSPICE_BOO_FOOTER','Dieses Blog erlaubt Dir, Audio Kommentare über <a href="http://audioboo.fm/profile" target="_blank">audioboo.fm</a> hinzuzufügen. <a href="http://audioboo.fm/boos/new" target="_blank">Erstelle einen neuen Boo</a> und gib hier den Link auf die Seite Deines Boos ein.');
@define('PLUGIN_EVENT_COMMENTSPICE_BOO_PLACEHOLDER', 'http://audioboo.fm/boos/123456-title');
@define('PLUGIN_EVENT_COMMENTSPICE_BOO_WRONG', 'Tut mir leid, das scheint keine boo URL zu sein (http://audioboo.fm/boos/12345-title)');
@define('PLUGIN_EVENT_COMMENTSPICE_BOO_MODERATED', 'Boo Audio Kommentare werden vorerst moderiert, bitte habe etwas Geduld.');

@define('PLUGIN_EVENT_COMMENTSPICE_REQUIREMENTS', 'Bedingung');
@define('PLUGIN_EVENT_COMMENTSPICE_REQUIREMENTS_COMMENTCOUNT', '%s Kommentare geschrieben');
@define('PLUGIN_EVENT_COMMENTSPICE_REQUIREMENTS_COMMENTLEN', '%s Buchstaben in diesem Kommentar');
11 changes: 11 additions & 0 deletions serendipity_event_commentspice/lang_en.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,17 @@
@define('PLUGIN_EVENT_COMMENTSPICE_PROMOTE_ARTICLE_FOOTER', '<b>Promote one of your rescent articles</b><br/>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..');

@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_BOO','Audio comments using audioboo.fm');
@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_BOO_DESC','If you have a podcasting blog you may allow your listeners to comment your podcasts using boo audios (mini podcasts) hosted on <a href="http://audioboo.fm" target="_blank">audioboo.fm</a>.');
@define('PLUGIN_EVENT_COMMENTSPICE_BOO_ALLOW','Allow boo comments');
@define('PLUGIN_EVENT_COMMENTSPICE_BOO_ALLOW_DESC','Switch it on, if you want to allow boo audio comments. There will be a field below the comment editor for adding and recording (beta!) boo comments.');
@define('PLUGIN_EVENT_COMMENTSPICE_BOO_MODERATE','Moderate boo comments');
@define('PLUGIN_EVENT_COMMENTSPICE_BOO_MODERATE_DESC','Switch this on, if you want boo audio comments to be moderated');
@define('PLUGIN_EVENT_COMMENTSPICE_BOO_FOOTER','This blog allows you to add audio comments using <a href="http://audioboo.fm/profile" target="_blank">audioboo.fm</a>. <a href="http://audioboo.fm/boos/new" target="_blank">Create a new boo</a> and enter the link to the page into the boo field.');
@define('PLUGIN_EVENT_COMMENTSPICE_BOO_PLACEHOLDER', 'http://audioboo.fm/boos/123456-title');
@define('PLUGIN_EVENT_COMMENTSPICE_BOO_WRONG', 'Sorry, this does not seem to bee a boo URL (http://audioboo.fm/boos/12345-title)');
@define('PLUGIN_EVENT_COMMENTSPICE_BOO_MODERATED', 'Boo comments are moderated first, please be patient');

@define('PLUGIN_EVENT_COMMENTSPICE_REQUIREMENTS', 'Requirements');
@define('PLUGIN_EVENT_COMMENTSPICE_REQUIREMENTS_COMMENTCOUNT', '%s comments written');
@define('PLUGIN_EVENT_COMMENTSPICE_REQUIREMENTS_COMMENTLEN', 'this comment %s letters at least');
Loading

0 comments on commit 80b925a

Please sign in to comment.