X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=page%2Fpage.php;h=21a83e16d48126d96e061d40136b0c55f3e357c1;hb=6728d714cbdb1552ccb2684dbc123a5dd3cda5a8;hp=c79b6bea4ae8f8f121400a339c41d109e16f7f6c;hpb=4c2a40ece8731ab4f4a1232c356b83b67e0259d6;p=friendica-addons.git diff --git a/page/page.php b/page/page.php index c79b6bea..21a83e16 100755 --- a/page/page.php +++ b/page/page.php @@ -1,7 +1,7 @@ * based on pages plugin by @@ -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,22 +21,25 @@ 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(); - $random = (($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 by name asc ", + and blocked = 0 and hidden = 0 and pending = 0 and archive = 0 + $order ", intval($uid) ); @@ -65,7 +69,7 @@ function page_page_end($a,&$b) { $more = false; foreach($contacts as $contact) { - $page .= '