From 77f71303f21e7690f75c33f54dc84033921102aa Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 13 Jul 2017 21:46:21 -0700 Subject: update some addon docs and ensure we only generate statistics once a day --- Zotlabs/Daemon/Cron_daily.php | 1 + doc/addons.bb | 12 ++++++++++-- doc/admin/administrator_guide.md | 2 +- include/statistics_fns.php | 20 ++++++++++++++------ include/zot.php | 2 +- 5 files changed, 27 insertions(+), 10 deletions(-) diff --git a/Zotlabs/Daemon/Cron_daily.php b/Zotlabs/Daemon/Cron_daily.php index 038790572..10e0e1d88 100644 --- a/Zotlabs/Daemon/Cron_daily.php +++ b/Zotlabs/Daemon/Cron_daily.php @@ -51,6 +51,7 @@ class Cron_daily { update_channels_active_halfyear_stat(); update_channels_active_monthly_stat(); update_local_posts_stat(); + update_local_comments_stat(); // expire old delivery reports diff --git a/doc/addons.bb b/doc/addons.bb index d49694030..85bb2dca3 100644 --- a/doc/addons.bb +++ b/doc/addons.bb @@ -2,12 +2,12 @@ [list=1] [*] abcjsplugin - Create musical scores in your posts [*] adultphotoflag - prevents nsfw photos from being displayed in public albums +[*] authchoose - only send identity assertions to sites of friends [*] b2tbtn - provide button to go directly to top of page if you are scrolled a long way down [*] bbmath - use complex math expressions in your posts [*] bookmarker - replace #^ with bookmark link in posts [*] buglink - provide a bug reporting icon in the lower-left corner of every page [*] calc - a scientific calculator -[*] cdav - CalDAV/CardDAV server [*] chess - cross domain identity aware interactive chess games [*] chords - generate fingering charts and alternatives for every known guitar chord [*] custom_home - set a custom page as the hub start page @@ -15,8 +15,11 @@ [*] dirstats - show some interesting statistics generated by the directory server [*] docs - alternate documentation pages [*] donate - provides a project donation page +[*] dreamhost - provide a more reliable service on Dreamhost shared hosting [*] dwpost - crosspost to Dreamwidth +[*] emojione - allow emojis as emoticons [*] extcron - use an external cron service to run your hub's scheduled tasks +[*] firefox - provide a link to install the Firefox Sharing API [*] flattrwidget - provides a "Flattr Us" button [*] flip - create upside down text [*] fortunate - displays random quote (fortune cookie). Requires setting up a fortune server. @@ -24,6 +27,7 @@ [*] frphotos - import photo albums from Friendica [*] gnusoc - GNU-Social (OStatus) protocol. Under development. [*] hexit - hexadecimal conversion tool +[*] hilite - allow language-specific highlighted code blocks in posts [*] hubwall - send an admin email to all hub accounts [*] ijpost - crosspost to Insanejournal [*] irc - connect to IRC chatrooms @@ -50,6 +54,7 @@ [*] nsfw - Highly recommended plugin to collpase posts with inappropriate content [*] openclipatar - choose a profile photo from hundreds of royalty free images [*] openid - OpenID authentication and OpenID server. Your OpenID URL is [observer.baseurl]/id/[observer.webname] +[*] opensearch - allow your site to become a browser search provider [*] openstreetmap - render locations and maps using OpenStreetMap [*] pageheader - display text at the top of every page on the site [*] phpmailer - alternate mail delivery system with more configurability @@ -71,7 +76,7 @@ [*] smiley_pack - extend the built-in smilie (emoticon) support [*] smileybutton - provides a smiley selector on the post window [*] startpage - set a personal preferred page to redirect after logging in. -[*] statistics_json - Diaspora statistics generator +[*] statistics - Diaspora statistics generator [*] statusnet - GNU-social and StatusNet crosspost [zrl=[baseurl]/help/addons_gnusocial]Posting To Gnu Social[/zrl] [*] std_embeds - allow unfiltered embeds for popular providers like youtube, vimeo and soundcloud [*] superblock - Highly recommended - completely block an offensive channel from your stream @@ -79,9 +84,12 @@ [*] tictac - 3D tic-tac-toe [*] torch - flashlight app [*] tour - feature tour for new members +[*] tripleaes - demo plugin for providing custom encryption algorithms [*] twitter - crosspost to Twitter +[*] twitter_api - Twitter/Statusnet compatible API [*] upload_limits - discover what server setting (there are a few) may be causing large photo uploads to fail [*] visage - show visitors to your channel +[*] webmention - process webmentions [*] wholikesme - provides a page to display what connections have 'liked' your posts the most [*] webRTC - use an external server (mayfirst.org) to negotiate webRTC hookups [*] wppost - crosspost to WordPress (or other wordpress XMLRPC service) diff --git a/doc/admin/administrator_guide.md b/doc/admin/administrator_guide.md index de64d5e8b..9e0ee3c59 100644 --- a/doc/admin/administrator_guide.md +++ b/doc/admin/administrator_guide.md @@ -207,7 +207,7 @@ We recommend the following addons be installed on all public sites: Several web communities have begun to converge using common protocols. The protocols involved are somewhat limited in their abilities. The GNU-Social protocol for instance offers no privacy modes, and the Diaspora protocol is somewhat restrictive in what kinds of communications are allowed. All comments must be signed in a very unique manner by the original author. The ActivityPub protocol is also being considered and may be supported at a future date. No other existing protocol supports nomadic location as used by this project. This presents some support challenges as some features work with some networks and don't work with others. Nevertheless the federation protocols allow connections to be made to a much larger community of people worldwide. They are provided as addons. -> diaspora - The Diaspora Protocol used by Diaspora and Friendica. You should enable 'Diaspora Statistics' (statistics_json) first to enable all the available features. +> diaspora - The Diaspora Protocol used by Diaspora and Friendica. You should enable 'Diaspora Statistics' (statistics) first to enable all the available features. > gnusoc - The GNU-Social Protocol, used by GNU-Social, Mastodon and several other communities. This addon requires you first install the 'pubsubhubbub' service (also an addon). diff --git a/include/statistics_fns.php b/include/statistics_fns.php index cbff3b0b7..d213485bf 100644 --- a/include/statistics_fns.php +++ b/include/statistics_fns.php @@ -7,7 +7,7 @@ function update_channels_total_stat() { $channels_total_stat = intval($r[0]['channels_total']); set_config('system','channels_total_stat',$channels_total_stat); } else { - set_config('system','channels_total_stat',null); + set_config('system','channels_total_stat',0); } } @@ -30,10 +30,10 @@ function update_channels_active_halfyear_stat() { $channels_active_halfyear_stat = count($x); set_config('system','channels_active_halfyear_stat',$channels_active_halfyear_stat); } else { - set_config('system','channels_active_halfyear_stat',null); + set_config('system','channels_active_halfyear_stat',0); } } else { - set_config('system','channels_active_halfyear_stat',null); + set_config('system','channels_active_halfyear_stat',0); } } @@ -56,10 +56,10 @@ function update_channels_active_monthly_stat() { $channels_active_monthly_stat = count($x); set_config('system','channels_active_monthly_stat',$channels_active_monthly_stat); } else { - set_config('system','channels_active_monthly_stat',null); + set_config('system','channels_active_monthly_stat',0); } } else { - set_config('system','channels_active_monthly_stat',null); + set_config('system','channels_active_monthly_stat',0); } } @@ -69,8 +69,16 @@ function update_local_posts_stat() { $local_posts_stat = intval($posts[0]["local_posts"]); set_config('system','local_posts_stat',$local_posts_stat); } else { - set_config('system','local_posts_stat',null); + set_config('system','local_posts_stat',0); } } +function update_local_comments_stat() { + $posts = q("SELECT COUNT(*) AS local_posts FROM item WHERE item_wall = 1 and id != parent"); + if (!is_array($posts)) + $local_posts = 0; + else + $local_posts = $posts[0]["local_posts"]; + set_config('system','local_comments_stat', $local_posts); +} \ No newline at end of file diff --git a/include/zot.php b/include/zot.php index 05475d051..677fdf6b7 100644 --- a/include/zot.php +++ b/include/zot.php @@ -2831,7 +2831,7 @@ function import_site($arr, $pubkey) { $access_policy = ACCESS_PRIVATE; if($access_policy != ACCESS_PRIVATE) { - $x = z_fetch_url($arr['url'] . '/siteinfo/json'); + $x = z_fetch_url($arr['url'] . '/siteinfo.json'); if(! $x['success']) $access_policy = ACCESS_PRIVATE; } -- cgit v1.2.3