diff --git a/facebook.tgz b/facebook.tgz index 497015b7..6ec94f3a 100644 Binary files a/facebook.tgz and b/facebook.tgz differ diff --git a/facebook/facebook.php b/facebook/facebook.php index b9f42859..6786febb 100644 --- a/facebook/facebook.php +++ b/facebook/facebook.php @@ -3,7 +3,8 @@ * Name: Facebook Connector * Version: 1.3 * Author: Mike Macgirvin - * Tobias Hößl + * Author: Tobias Hößl + * */ /** @@ -162,10 +163,11 @@ function facebook_init(&$a) { } } - if($a->argc != 2) return; + $nick = $a->argv[1]; + if(strlen($nick)) $r = q("SELECT `uid` FROM `user` WHERE `nickname` = '%s' LIMIT 1", dbesc($nick) @@ -758,7 +760,7 @@ function facebook_plugin_admin(&$a, &$o){ elseif (is_array($subs)) { $o .= t('The given API Key seems to work correctly.') . '
'; $working_connection = true; - } else $o .= t('The correctness of the API Key could not be detected. Somthing strange\'s going on.') . '
'; + } else $o .= t('The correctness of the API Key could not be detected. Something strange\'s going on.') . '
'; } $o .= '
'; diff --git a/jappixmini.tgz b/jappixmini.tgz index a49c0b4e..212bb25e 100644 Binary files a/jappixmini.tgz and b/jappixmini.tgz differ diff --git a/jappixmini/jappixmini.php b/jappixmini/jappixmini.php index d5330633..5d6f8446 100644 --- a/jappixmini/jappixmini.php +++ b/jappixmini/jappixmini.php @@ -435,7 +435,7 @@ function jappixmini_script(&$a,&$s) { $key = $row['k']; $pos = strpos($key, ":"); $dfrn_id = substr($key, $pos+1); - $r = q("SELECT `name` FROM `contact` WHERE `uid`=$uid AND `dfrn-id`='%s' OR `issued-id`='%s'", + $r = q("SELECT `name` FROM `contact` WHERE `uid`=$uid AND (`dfrn-id`='%s' OR `issued-id`='%s')", dbesc($dfrn_id), dbesc($dfrn_id) ); diff --git a/libertree.tgz b/libertree.tgz index 92840aa9..f467bc00 100644 Binary files a/libertree.tgz and b/libertree.tgz differ diff --git a/libertree/libertree.php b/libertree/libertree.php index 4b55a5e7..fcd0fa5c 100755 --- a/libertree/libertree.php +++ b/libertree/libertree.php @@ -153,8 +153,8 @@ function libertree_send(&$a,&$b) { $ltree_api_token = get_pconfig($b['uid'],'libertree','libertree_api_token'); $ltree_url = get_pconfig($b['uid'],'libertree','libertree_url'); $ltree_blog = "$ltree_url/api/v1/posts/create/?token=$ltree_api_token"; - - if($ltree_url && $ltree_api_token && $ltree_blog) { + $ltree_source = "Friendica"; + if($ltree_url && $ltree_api_token && $ltree_blog && $ltree_source) { require_once('include/bb2diaspora.php'); $tag_arr = array(); @@ -171,7 +171,6 @@ function libertree_send(&$a,&$b) { $title = $b['title']; $body = $b['body']; - // Insert a newline before and after a quote $body = str_ireplace("[quote", "\n\n[quote", $body); $body = str_ireplace("[/quote]", "[/quote]\n\n", $body); @@ -195,9 +194,10 @@ function libertree_send(&$a,&$b) { if(strlen($title)) $body = "## ".html_entity_decode($title)."\n\n".$body; + $params = array( 'text' => $body, - 'source' => "friendica" + 'source' => $ltree_source // 'token' => $ltree_api_token ); diff --git a/page.tgz b/page.tgz index f77dcf23..7e95737f 100644 Binary files a/page.tgz and b/page.tgz differ diff --git a/page/page.css b/page/page.css index b8d84fef..0c0fe3cd 100644 --- a/page/page.css +++ b/page/page.css @@ -1,14 +1,13 @@ -#page-settings-label, #page-random-label { +#page-settings-label, #page-random-label, #page-profile-label { float: left; width: 200px; margin-bottom: 25px; } -#page-max-pages, #page-random { +#page-max-pages, #page-random, #page-profile { float: left; } - diff --git a/page/page.php b/page/page.php index fd48b4ee..3f0f0419 100755 --- a/page/page.php +++ b/page/page.php @@ -13,6 +13,7 @@ function page_install() { register_hook('network_mod_init', 'addon/page/page.php', 'page_network_mod_init'); register_hook('plugin_settings', 'addon/page/page.php', 'page_plugin_settings'); register_hook('plugin_settings_post', 'addon/page/page.php', 'page_plugin_settings_post'); + register_hook('profile_advanced', 'addon/page/page.php', 'page_profile_advanced'); } @@ -20,20 +21,22 @@ function page_uninstall() { unregister_hook('network_mod_init', 'addon/page/page.php', 'page_network_mod_init'); unregister_hook('plugin_settings', 'addon/page/page.php', 'page_plugin_settings'); unregister_hook('plugin_settings_post', 'addon/page/page.php', 'page_plugin_settings_post'); + unregister_hook('profile_advanced', 'addon/page/page.php', 'page_profile_advanced'); // remove only - obsolete unregister_hook('page_end', 'addon/page/page.php', 'page_page_end'); } -function page_getpage($uid,$randomise = false) { +function page_getpage($uid,$showhidden = true,$randomise = false) { $pagelist = array(); - $order = (($randomise) ? ' order by rand() ' : ' order by name asc '); + $order = (($showhidden) ? '' : " and hidden = 0 "); + $order .= (($randomise) ? ' order by rand() ' : ' order by name asc '); - $contacts = q("SELECT `id`, `url`, `name`, `micro`FROM `contact` + $contacts = q("SELECT `id`, `url`, `name`, `micro` FROM `contact` WHERE `network`= 'dfrn' AND `forum` = 1 AND `uid` = %d $order ", intval($uid) @@ -93,7 +96,7 @@ function page_network_mod_init($a,$b) { $show_total = 6; $randomise = intval(get_pconfig(local_user(),'page','randomise')); - $contacts = page_getpage($a->user['uid'],$randomise); + $contacts = page_getpage($a->user['uid'],true,$randomise); $total_shown = 0; $more = false; @@ -115,12 +118,49 @@ function page_network_mod_init($a,$b) { $a->page['aside'] = $page . $a->page['aside']; } + +function page_profile_advanced($a,&$b) { + + $profile = intval(get_pconfig($a->profile['profile_uid'],'page','show_on_profile')); + if(! $profile) + return; + + $page = '
+
'.t("Forums:").'
+
'; + + // place holder in case somebody wants configurability + $show_total = 9999; + + $randomise = true; + + $contacts = page_getpage($a->user['uid'],false,$randomise); + + $total_shown = 0; + $more = false; + + foreach($contacts as $contact) { + $page .= micropro($contact,false,'page-profile-advanced'); + $total_shown ++; + if($total_shown == $show_total) + break; + } + $page .= '
'; + + if(count($contacts) > 0) + $b .= $page; + +} + + + function page_plugin_settings_post($a,$post) { if(! local_user() || (! x($_POST,'page-settings-submit'))) return; set_pconfig(local_user(),'page','max_pages',intval($_POST['page_max_pages'])); set_pconfig(local_user(),'page','randomise',intval($_POST['page_random'])); + set_pconfig(local_user(),'page','show_on_profile',intval($_POST['page_profile'])); info( t('Page settings updated.') . EOL); } @@ -144,6 +184,9 @@ function page_plugin_settings(&$a,&$s) { $randomise = intval(get_pconfig(local_user(),'page','randomise')); $randomise_checked = (($randomise) ? ' checked="checked" ' : ''); + $profile = intval(get_pconfig(local_user(),'page','show_on_profile')); + $profile_checked = (($profile) ? ' checked="checked" ' : ''); + /* Add some HTML to the existing form */ @@ -156,6 +199,9 @@ function page_plugin_settings(&$a,&$s) { $s .= ''; $s .= ''; $s .= '
'; + $s .= ''; + $s .= ''; + $s .= '
'; $s .= '';