diff --git a/fromgplus/fromgplus.php b/fromgplus/fromgplus.php
index 9fc13c5e..94b12af3 100644
--- a/fromgplus/fromgplus.php
+++ b/fromgplus/fromgplus.php
@@ -218,14 +218,6 @@ function fromgplus_cleanupgoogleproxy($fullImage, $image) {
return($cleaned);
}
-function fromgplus_cleantext($text) {
- $text = strip_tags($text);
- $text = html_entity_decode($text);
- $text = trim($text);
- $text = str_replace(array("\n", "\r", " "), array("", "", ""), $text);
- return($text);
-}
-
function fromgplus_handleattachments($item, $displaytext) {
$post = "";
$quote = "";
@@ -247,11 +239,9 @@ function fromgplus_handleattachments($item, $displaytext) {
$post .= "\n\n[bookmark=".$attachment->url."]".fromgplus_html2bbcode($attachment->displayName)."[/bookmark]\n";
$images = fromgplus_cleanupgoogleproxy($attachment->fullImage, $attachment->image);
- //if ($images["preview"] != "")
- // $post .= "\n[url=".$images["full"]."][img]".$images["preview"]."[/img][/url]\n";
- //elseif ($images["full"] != "")
- // $post .= "\n[img]".$images["full"]."[/img]\n";
- if ($images["full"] != "")
+ if ($images["preview"] != "")
+ $post .= "\n[url=".$images["full"]."][img]".$images["preview"]."[/img][/url]\n";
+ elseif ($images["full"] != "")
$post .= "\n[img]".$images["full"]."[/img]\n";
//$post .= "[quote]".trim(fromgplus_html2bbcode($attachment->content))."[/quote]";
@@ -267,7 +257,7 @@ function fromgplus_handleattachments($item, $displaytext) {
elseif ($images["full"] != "")
$post .= "\n[img]".$images["full"]."[/img]\n";
- if (($attachment->displayName != "") AND (fromgplus_cleantext($attachment->displayName) != fromgplus_cleantext($displaytext)))
+ if (($attachment->displayName != "") AND ($attachment->displayName != $displaytext))
$post .= fromgplus_html2bbcode($attachment->displayName)."\n";
break;
diff --git a/smileybutton/icon.gif b/smileybutton/icon.gif
new file mode 100644
index 00000000..6ce09471
Binary files /dev/null and b/smileybutton/icon.gif differ
diff --git a/smileybutton/smileybutton.css b/smileybutton/smileybutton.css
new file mode 100755
index 00000000..916e0416
--- /dev/null
+++ b/smileybutton/smileybutton.css
@@ -0,0 +1,21 @@
+
+img.smiley_preview {
+ max-height: 25px;
+ max-width: 25px;
+}
+
+table.smiley-preview {
+ border: 1px solid #AAAAAA;
+}
+
+#smileybutton-enable-label {
+ float: left;
+ width: 200px;
+ margin-bottom: 25px;
+}
+
+#smileybutton-checkbox {
+ float: left;
+}
+
+
diff --git a/smileybutton/smileybutton.php b/smileybutton/smileybutton.php
new file mode 100755
index 00000000..87db098b
--- /dev/null
+++ b/smileybutton/smileybutton.php
@@ -0,0 +1,283 @@
+
+ */
+
+
+function smileybutton_install() {
+
+ /**
+ *
+ * Register hooks for jot_tool and plugin_settings
+ *
+ */
+
+ register_hook('jot_tool', 'addon/smileybutton/smileybutton.php', 'show_button');
+ register_hook('plugin_settings', 'addon/smileybutton/smileybutton.php', 'smileybutton_settings');
+ register_hook('plugin_settings_post', 'addon/smileybutton/smileybutton.php', 'smileybutton_settings_post');
+
+ logger("installed smileybutton");
+}
+
+
+function smileybutton_uninstall() {
+
+ /**
+ *
+ * Delet registered hooks
+ *
+ */
+
+ unregister_hook('jot_tool', 'addon/smileybutton/smileybutton.php', 'show_button');
+ unregister_hook('plugin_settings', 'addon/smileybutton/smileybutton.php', 'smileybutton_settings');
+ unregister_hook('plugin_settings_post', 'addon/smileybutton/smileybutton.php', 'smileybutton_settings_post');
+
+ logger("removed smileybutton");
+}
+
+
+
+function show_button($a, &$b) {
+
+ /**
+ *
+ * Check if it is a local user and he has enabled smileybutton
+ *
+ */
+
+ if(! local_user()) {
+ $nobutton = false;
+ } else {
+ $nobutton = get_pconfig(local_user(), 'smileybutton', 'nobutton');
+ }
+
+ /**
+ *
+ * Prepare the Smilie-Arrays
+ *
+ */
+
+ /**
+ *
+ * I have copied this from /include/text.php, removed dobles
+ * and some escapes.
+ *
+ */
+
+ $texts = array(
+ '<3',
+ '</3',
+ ':-)',
+ ';-)',
+ ':-(',
+ ':-P',
+ ':-X',
+ ':-D',
+ ':-O',
+ '\\\\o/',
+ 'O_o',
+ ":\'(",
+ ":-!",
+ ":-/",
+ ":-[",
+ "8-)",
+ ':beer',
+ ':coffee',
+ ':facepalm',
+ ':like',
+ ':dislike',
+ '~friendica',
+ 'red#'
+
+ );
+
+ $icons = array(
+ '',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
'
+ );
+
+ /**
+ *
+ * Call hooks to get aditional smileies from other addons
+ *
+ */
+
+ $params = array('texts' => $texts, 'icons' => $icons, 'string' => ""); //changed
+ call_hooks('smilie', $params);
+
+ /**
+ *
+ * Generate html for smileylist
+ *
+ */
+
+ $s = "\t
" . $icon . " | "; + if (($x+1) % (sqrt(count($params['texts']))+1) == 0) { + $s .= "