]> git.mxchange.org Git - friendica-addons.git/commitdiff
add numfriends plugin, update a couple of tgz's
authorfriendica <info@friendica.com>
Sun, 12 Feb 2012 07:44:20 +0000 (23:44 -0800)
committerfriendica <info@friendica.com>
Sun, 12 Feb 2012 07:44:20 +0000 (23:44 -0800)
12 files changed:
buildtgz
editplain.tgz
editplain/editplain.php
numfriends.tgz [new file with mode: 0644]
numfriends/numfriends.css [new file with mode: 0755]
numfriends/numfriends.php [new file with mode: 0755]
oembed.tgz [deleted file]
oembed/oembed.js [deleted file]
oembed/oembed.php [deleted file]
oembed/oembed.png [deleted file]
oembed/settings.tpl [deleted file]
openstreetmap.tgz

index dec535dd6192dd51d56d901cbb2933bff9653cdc..61dd5d71cd88d2b44f2b2483ca2769a4f5f88c1f 100755 (executable)
--- a/buildtgz
+++ b/buildtgz
@@ -3,7 +3,7 @@
 # without providing a Makefile in each one.
 # So we will just manually find any source
 # directories which contain any files that 
-# are newer than are .tgz file and rebuild
+# are newer than our .tgz file and rebuild
 # it if any are found
 
 SUBDIRS=`ls -d [a-z]*/ | tr -d /`
@@ -11,11 +11,13 @@ for a in $SUBDIRS; do
        TGZ=$a.tgz
        if [[ ! -f $TGZ ]]; then
                echo "Building: " $TGZ
+#              git log $a > $a/$a.log
                tar zcvf $TGZ $a
        else
                TOUCHED=`find $a -cnewer $TGZ`
                if [[ -n $TOUCHED ]]; then
                        echo "Building: " $TGZ
+#                      git log $a > $a/$a.log
                        tar zcvf $TGZ $a
                fi
        fi
index 51b57d0d1c57089cbc6c47af6a49063397726fa4..c99c7f63bab8821fe0d1df4cdbd74d75e14f5d25 100644 (file)
Binary files a/editplain.tgz and b/editplain.tgz differ
index 61273edf2579ad404807ec8874928367456af8aa..7d91c29526bfe498096638725107ed0598e7da38 100755 (executable)
@@ -20,7 +20,6 @@ function editplain_install() {
 
 function editplain_uninstall() {
 
-       unregister_hook('post_local',    'addon/editplain/editplain.php', 'editplain_post_hook');
        unregister_hook('plugin_settings', 'addon/editplain/editplain.php', 'editplain_settings');
        unregister_hook('plugin_settings_post', 'addon/editplain/editplain.php', 'editplain_settings_post');
 
diff --git a/numfriends.tgz b/numfriends.tgz
new file mode 100644 (file)
index 0000000..df47258
Binary files /dev/null and b/numfriends.tgz differ
diff --git a/numfriends/numfriends.css b/numfriends/numfriends.css
new file mode 100755 (executable)
index 0000000..c92ef8d
--- /dev/null
@@ -0,0 +1,14 @@
+
+
+
+#numfriends-label {
+       float: left;
+       width: 200px;
+       margin-bottom: 25px;
+}
+
+#numfriends {
+       float: left;
+}
+
+
diff --git a/numfriends/numfriends.php b/numfriends/numfriends.php
new file mode 100755 (executable)
index 0000000..6ca7b39
--- /dev/null
@@ -0,0 +1,87 @@
+<?php
+/**
+ * Name: Numfriends
+ * Description: Change number of contacts shown of profile sidebar
+ * Version: 1.0
+ * Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
+ * 
+ *
+ */
+
+
+function numfriends_install() {
+
+       register_hook('plugin_settings', 'addon/numfriends/numfriends.php', 'numfriends_settings');
+       register_hook('plugin_settings_post', 'addon/numfriends/numfriends.php', 'numfriends_settings_post');
+
+       logger("installed numfriends");
+}
+
+
+function numfriends_uninstall() {
+
+       unregister_hook('plugin_settings', 'addon/numfriends/numfriends.php', 'numfriends_settings');
+       unregister_hook('plugin_settings_post', 'addon/numfriends/numfriends.php', 'numfriends_settings_post');
+
+
+       logger("removed numfriends");
+}
+
+
+
+/**
+ *
+ * Callback from the settings post function.
+ * $post contains the $_POST array.
+ * We will make sure we've got a valid user account
+ * and if so set our configuration setting for this person.
+ *
+ */
+
+function numfriends_settings_post($a,$post) {
+       if(! local_user() || (! x($_POST,'numfriends-submit')))
+               return;
+
+       set_pconfig(local_user(),'system','display_friend_count',intval($_POST['numfriends']));
+       info( t('Numfriends settings updated.') . EOL);
+}
+
+
+/**
+ *
+ * Called from the Plugin Setting form. 
+ * Add our own settings info to the page.
+ *
+ */
+
+
+
+function numfriends_settings(&$a,&$s) {
+
+       if(! local_user())
+               return;
+
+       /* Add our stylesheet to the page so we can make our settings look nice */
+
+       $a->page['htmlhead'] .= '<link rel="stylesheet"  type="text/css" href="' . $a->get_baseurl() . '/addon/numfriends/numfriends.css' . '" media="all" />' . "\r\n";
+
+       /* Get the current state of our config variable */
+
+       $numfriends = get_pconfig(local_user(),'system','display_friend_count');
+       if($numfriends === false)
+               $numfriends = 24;
+       
+       /* Add some HTML to the existing form */
+
+       $s .= '<div class="settings-block">';
+       $s .= '<h3>' . t('Numfriends Settings') . '</h3>';
+       $s .= '<div id="numfriends-wrapper">';
+       $s .= '<label id="numfriends-label" for="numfriends">' . t('How many contacts to display on profile sidebar') . '</label>';
+       $s .= '<input id="numfriends-input" type="text" name="numfriends" value="' . intval($numfriends) . '" ' . '/>';
+       $s .= '</div><div class="clear"></div>';
+
+       /* provide a submit button */
+
+       $s .= '<div class="settings-submit-wrapper" ><input type="submit" name="numfriends-submit" class="settings-submit" value="' . t('Submit') . '" /></div></div>';
+
+}
diff --git a/oembed.tgz b/oembed.tgz
deleted file mode 100755 (executable)
index 733588c..0000000
Binary files a/oembed.tgz and /dev/null differ
diff --git a/oembed/oembed.js b/oembed/oembed.js
deleted file mode 100755 (executable)
index f8e9574..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-function oembed(){
-       var reply = prompt("$oembed_message:");
-       if(reply && reply.length) { 
-                 tinyMCE.execCommand('mceInsertRawHTML',false, "[embed]"+reply+"[/embed]" );
-       }
-}
diff --git a/oembed/oembed.php b/oembed/oembed.php
deleted file mode 100755 (executable)
index 880e499..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-<?php
-/**
- * Name: OEmbed
- * Description: OEmbed is a format for allowing an embedded representation of a URL on third party sites http://www.oembed.com/
- * Version: 1.2
- * Author: Fabio Comuni <http://kirgroup.com/profile/fabrix>
- */
-
-require_once('include/oembed.php');
-
-function oembed_install() {
-       register_hook('jot_tool', 'addon/oembed/oembed.php', 'oembed_hook_jot_tool');
-       register_hook('page_header', 'addon/oembed/oembed.php', 'oembed_hook_page_header');
-       register_hook('plugin_settings', 'addon/oembed/oembed.php', 'oembed_settings'); 
-       register_hook('plugin_settings_post', 'addon/oembed/oembed.php', 'oembed_settings_post');
-}
-
-function oembed_uninstall() {
-       unregister_hook('jot_tool', 'addon/oembed/oembed.php', 'oembed_hook_jot_tool');
-       unregister_hook('page_header', 'addon/oembed/oembed.php', 'oembed_hook_page_header');
-       unregister_hook('plugin_settings', 'addon/oembed/oembed.php', 'oembed_settings'); 
-       unregister_hook('plugin_settings_post', 'addon/oembed/oembed.php', 'oembed_settings_post');
-}
-
-function oembed_settings_post($a,$b){
-    if(! local_user())
-               return;
-       if (x($_POST,'oembed-submit')){
-               set_pconfig(local_user(), 'oembed', 'use_for_youtube', (x($_POST,'oembed_use_for_youtube')? intval($_POST['oembed_use_for_youtube']):0));
-               info( t('OEmbed settings updated') . EOL);
-       }
-}
-
-function oembed_settings(&$a,&$o) {
-    if(! local_user())
-               return;
-       $uofy = intval(get_pconfig(local_user(), 'oembed', 'use_for_youtube' ));
-
-       $t = file_get_contents( dirname(__file__). "/settings.tpl" );
-       $o .= replace_macros($t, array(
-               '$submit' => t('Submit'),
-               '$title' => "OEmbed",
-               '$useoembed' => array('oembed_use_for_youtube', t('Use OEmbed for YouTube videos'), $uofy, ""),
-       ));
-       
-}
-
-
-function oembed_hook_page_header($a, &$b){
-       $a->page['htmlhead'] .= sprintf('<script src="%s/oembed/oembed.js"></script>', $a->get_baseurl());
-}
-
-
-function oembed_hook_jot_tool($a, &$b) {
-       $b .= '
-       <div class="tool-wrapper" style="display: $visitor;" >
-         <img class="tool-link" src="addon/oembed/oembed.png" alt="Embed" title="Embed" onclick="oembed();" />
-       </div> 
-       ';
-}
-
-
-function oembed_module() {
-       return;
-}
-
-function oembed_init(&$a) {
-       if ($a->argv[1]=='oembed.js'){
-               $tpl = file_get_contents('addon/oembed/oembed.js');
-               echo replace_macros($tpl, array(
-                       '$oembed_message' =>  t('URL to embed:'),
-               ));
-       }
-       
-       if ($a->argv[1]=='b2h'){
-               $url = array( "", trim(hex2bin($_GET['url'])));
-               echo oembed_replacecb($url);
-       }
-       
-       if ($a->argv[1]=='h2b'){
-               $text = trim(hex2bin($_GET['text']));
-               echo oembed_html2bbcode($text);
-       }
-       
-       killme();
-       
-}
-
-?>
diff --git a/oembed/oembed.png b/oembed/oembed.png
deleted file mode 100755 (executable)
index 6fc3794..0000000
Binary files a/oembed/oembed.png and /dev/null differ
diff --git a/oembed/settings.tpl b/oembed/settings.tpl
deleted file mode 100755 (executable)
index 5a65ef8..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<div class="settings-block">
-       <h3 class="settings-heading">$title</h3>
-       {{ inc field_checkbox.tpl with $field=$useoembed }}{{ endinc }}
-       <div class="settings-submit-wrapper">
-               <input type="submit" value="$submit" class="settings-submit" name="oembed-submit" />
-       </div>
-</div>
index 9796235269b1ce1a80b44a2d707c21730d57273b..93dc874b6296c6227aacee15444b9b8f959ca357 100644 (file)
Binary files a/openstreetmap.tgz and b/openstreetmap.tgz differ