From b31c602e9b8fa580ee0e6a8afb9de1c761bf122c Mon Sep 17 00:00:00 2001 From: rabuzarus <> Date: Thu, 3 Dec 2015 00:06:11 +0100 Subject: [PATCH 1/8] added code reference to docs --- doc/Home.md | 1 + doc/de/Home.md | 1 + doc/html/index.php | 16 ++++++++++++++++ mod/help.php | 2 +- util/Doxyfile | 23 +++++++++++++++++++++++ util/Doxygen.footer | 4 ++++ 6 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 doc/html/index.php create mode 100644 util/Doxyfile create mode 100644 util/Doxygen.footer diff --git a/doc/Home.md b/doc/Home.md index cd8752c1ef..b37c76417c 100644 --- a/doc/Home.md +++ b/doc/Home.md @@ -46,6 +46,7 @@ Friendica Documentation and Resources * [Plugin Development](help/Plugins) * [Theme Development](help/themes) * [Smarty 3 Templates](help/smarty3-templates) +* [Code - Reference(Doxygen generated - sets cookies)](doc/html/) **External Resources** diff --git a/doc/de/Home.md b/doc/de/Home.md index 2a9ea091ed..44ebfc0285 100644 --- a/doc/de/Home.md +++ b/doc/de/Home.md @@ -50,6 +50,7 @@ Friendica - Dokumentation und Ressourcen * [Plugin Development](help/Plugins) * [Theme Development](help/themes) * [Smarty 3 Templates](help/smarty3-templates) +* [Code-Referenz (mit doxygen generiert - setzt Cookies)](doc/html/) **Externe Ressourcen** diff --git a/doc/html/index.php b/doc/html/index.php new file mode 100644 index 0000000000..2e1b4277cf --- /dev/null +++ b/doc/html/index.php @@ -0,0 +1,16 @@ + + + + $Projectname Doxygen API Documentation + + +

$Projectname Doxygen API Documentation not rendered

+ +To get the Doxygen API Documentation you must render it with the program Doxygen (included in most distributions). +
+$ doxygen util/Doxyfile
+
+
+back + + diff --git a/mod/help.php b/mod/help.php index 6d8fbb1842..6b8cb3821a 100644 --- a/mod/help.php +++ b/mod/help.php @@ -50,4 +50,4 @@ function help_content(&$a) { $html = "".$html; return $html; -} +} \ No newline at end of file diff --git a/util/Doxyfile b/util/Doxyfile new file mode 100644 index 0000000000..c009290312 --- /dev/null +++ b/util/Doxyfile @@ -0,0 +1,23 @@ +INPUT = README.md index.php boot.php testargs.php update.php mod/ object/ include/ js/ util/ view/ version.inc +RECURSIVE = YES +PROJECT_NAME = "Friendica" +PROJECT_LOGO = images/friendica-64.jpg +EXCLUDE = .htconfig.php library/ doc/ .git/ log/ util/zotsh/easywebdav/ +EXCLUDE_PATTERNS = *smarty3* *strings.php *.out *test* +OUTPUT_DIRECTORY = doc +GENERATE_HTML = YES +HTML_OUTPUT = html/ +HTML_FILE_EXTENSION = .html +GENERATE_LATEX = NO +EXTRACT_ALL = YES +EXTRACT_PRIVATE = YES +GENERATE_TODOLIST = YES +USE_MDFILE_AS_MAINPAGE = README.md +REFERENCED_BY_RELATION = YES +GENERATE_TREEVIEW = YES +HTML_FOOTER = util/Doxygen.footer +ALIASES += "license=@par License:\n" +ALIASES += "fixme=\xrefitem fixme \"Fixme\" \"Fixme List\"" +ALIASES += "FIXME=\fixme" +ALIASES += "TODO=\todo" +ALIASES += "BUG=\bug" diff --git a/util/Doxygen.footer b/util/Doxygen.footer new file mode 100644 index 0000000000..fd40910d9e --- /dev/null +++ b/util/Doxygen.footer @@ -0,0 +1,4 @@ + + + + From 8522446891d0f13c9606de084332820968fb3e16 Mon Sep 17 00:00:00 2001 From: rabuzarus <> Date: Thu, 3 Dec 2015 00:11:18 +0100 Subject: [PATCH 2/8] little cleanup: insert new line at the end --- mod/help.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/help.php b/mod/help.php index 6b8cb3821a..6d8fbb1842 100644 --- a/mod/help.php +++ b/mod/help.php @@ -50,4 +50,4 @@ function help_content(&$a) { $html = "".$html; return $html; -} \ No newline at end of file +} From 76bb3f66737df48f012531eeb01dd608128e9c4f Mon Sep 17 00:00:00 2001 From: rabuzarus <> Date: Thu, 3 Dec 2015 16:17:25 +0100 Subject: [PATCH 3/8] doxygen: exclude some more folders --- .gitignore | 9 +++++++++ util/Doxyfile | 4 ++-- view/theme/boheme | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) create mode 160000 view/theme/boheme diff --git a/.gitignore b/.gitignore index 3c0570c67d..0f644f4839 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,12 @@ nbproject #ignore local folder /local/ + +.directory + +/view/theme/Friendiboot +/view/theme/clean +/view/theme/Viereinhalb +/view/theme/suckerberg +/view/theme/blog +/view/theme/boehme diff --git a/util/Doxyfile b/util/Doxyfile index c009290312..4527c4ca67 100644 --- a/util/Doxyfile +++ b/util/Doxyfile @@ -2,8 +2,8 @@ INPUT = README.md index.php boot.php testargs.php update.php mod/ object/ includ RECURSIVE = YES PROJECT_NAME = "Friendica" PROJECT_LOGO = images/friendica-64.jpg -EXCLUDE = .htconfig.php library/ doc/ .git/ log/ util/zotsh/easywebdav/ -EXCLUDE_PATTERNS = *smarty3* *strings.php *.out *test* +EXCLUDE = .htconfig.php library/ doc/ .git/ log/ util/zotsh/easywebdav/ addon/ report/ privacy_image_cache/ photo/ proxy/ local/ +EXCLUDE_PATTERNS = *smarty3* *strings.php*.log *.out *test* OUTPUT_DIRECTORY = doc GENERATE_HTML = YES HTML_OUTPUT = html/ diff --git a/view/theme/boheme b/view/theme/boheme new file mode 160000 index 0000000000..3009bdd2c2 --- /dev/null +++ b/view/theme/boheme @@ -0,0 +1 @@ +Subproject commit 3009bdd2c2720d481028cb03671a5987160b8279 From c0406918ece1a48bb7ce3def21ce53f8b34c2307 Mon Sep 17 00:00:00 2001 From: rabuzarus <> Date: Thu, 3 Dec 2015 17:15:49 +0100 Subject: [PATCH 4/8] ping: cleanup --- include/group.php | 15 +++++++++++++++ mod/ping.php | 26 +++++++++----------------- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/include/group.php b/include/group.php index 862d06818d..7e417b0e65 100644 --- a/include/group.php +++ b/include/group.php @@ -340,3 +340,18 @@ function groups_containing($uid,$c) { return $ret; } + +function groups_count_unseen() { + + $r = q("SELECT `group`.`id`, `group`.`name`, COUNT(`item`.id`) AS `count` FROM `group`, `group_member`, `item` + WHERE `group`.`uid` = %d + AND `item`.`uid` = %d + AND `item`.`unseen` AND `item`.`visible` + AND NOT `item`.`deleted` + AND `item`.`contact-id` = `group_member`.`contact-id` + AND `group_member`.`gid` = `group`.`id` + GROUP BY `group.id` ", + intval(local_user()), + intval(local_user()) + ); +} \ No newline at end of file diff --git a/mod/ping.php b/mod/ping.php index 967555881c..f8faadff85 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -2,6 +2,7 @@ require_once("include/datetime.php"); require_once('include/bbcode.php'); require_once('include/forums.php'); +require_once('include/groupo.php'); require_once("mod/proxy.php"); function ping_init(&$a) { @@ -34,7 +35,7 @@ function ping_init(&$a) { $home = 0; $network = 0; - $network_group = array(); + $groups_unseen = array(); $forums_unseen = array(); $r = q("SELECT `item`.`id`,`item`.`parent`, `item`.`verb`, `item`.`wall`, `item`.`author-name`, @@ -88,20 +89,11 @@ function ping_init(&$a) { } } - if ( $network ) - { - # Find out how unseen network posts are spread across groups - $sql = "SELECT g.id, g.name, count(i.id) count " . - "FROM `group` g, group_member gm, item i " . - "WHERE g.uid = %d " . - "AND i.uid = %d " . - "AND i.unseen AND i.visible " . - "AND NOT i.deleted " . - "AND i.`contact-id` = gm.`contact-id` " . - "AND gm.gid = g.id GROUP BY g.id"; - #echo '' . $sql . ''; - $network_group = q($sql, intval(local_user()), intval(local_user())); - #echo ''; + if($network) { + if(intval(feature_enabled(local_user(),'groups'))) { + // Find out how unseen network posts are spread across groups + $groups_unseen = groups_count_unseen(); + } if(intval(feature_enabled(local_user(),'forumlist_widget'))) { $forums_unseen = forums_count_unseen(); @@ -227,9 +219,9 @@ function ping_init(&$a) { $home\r\n"; if ($register!=0) echo "$register"; - if ( count($network_group) ) { + if ( count($groups_unseen) ) { echo ''; - foreach ($network_group as $it) { + foreach ($groups_unseen as $it) { echo '' . $it['count'] . ""; } echo ""; From b4213d0e9e0a5b530c7e39cdb26071e76d52aca6 Mon Sep 17 00:00:00 2001 From: rabuzarus <> Date: Thu, 3 Dec 2015 17:30:34 +0100 Subject: [PATCH 5/8] doxygen: delete wrong commited file --- view/theme/boheme | 1 - 1 file changed, 1 deletion(-) delete mode 160000 view/theme/boheme diff --git a/view/theme/boheme b/view/theme/boheme deleted file mode 160000 index 3009bdd2c2..0000000000 --- a/view/theme/boheme +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3009bdd2c2720d481028cb03671a5987160b8279 From 5ff9fbb0139916c73a7aaf1d3320d425612f01c8 Mon Sep 17 00:00:00 2001 From: rabuzarus <> Date: Thu, 3 Dec 2015 21:22:13 +0100 Subject: [PATCH 6/8] doxygen: correct mistake - .gitignore shouldn't be submitted --- .gitignore | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.gitignore b/.gitignore index 0f644f4839..3c0570c67d 100644 --- a/.gitignore +++ b/.gitignore @@ -42,12 +42,3 @@ nbproject #ignore local folder /local/ - -.directory - -/view/theme/Friendiboot -/view/theme/clean -/view/theme/Viereinhalb -/view/theme/suckerberg -/view/theme/blog -/view/theme/boehme From 4b7f080c4647e5f0d6288b381169236a03791f19 Mon Sep 17 00:00:00 2001 From: rabuzarus <> Date: Thu, 3 Dec 2015 22:42:53 +0100 Subject: [PATCH 7/8] ping: further work --- include/group.php | 20 ++++++++++++++++---- mod/ping.php | 2 +- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/include/group.php b/include/group.php index 7e417b0e65..64c74ba2d1 100644 --- a/include/group.php +++ b/include/group.php @@ -340,18 +340,30 @@ function groups_containing($uid,$c) { return $ret; } - +/** + * @brief count unread group items + * + * Count unread items of each groups + * + * @return array + * 'id' => contact id + * 'name' => group name + * 'count' => counted unseen group items + * + */ function groups_count_unseen() { - - $r = q("SELECT `group`.`id`, `group`.`name`, COUNT(`item`.id`) AS `count` FROM `group`, `group_member`, `item` + + $r = q("SELECT `group`.`id`, `group`.`name`, COUNT(`item`.`id`) AS `count` FROM `group`, `group_member`, `item` WHERE `group`.`uid` = %d AND `item`.`uid` = %d AND `item`.`unseen` AND `item`.`visible` AND NOT `item`.`deleted` AND `item`.`contact-id` = `group_member`.`contact-id` AND `group_member`.`gid` = `group`.`id` - GROUP BY `group.id` ", + GROUP BY `group`.`id` ", intval(local_user()), intval(local_user()) ); + + return $r; } \ No newline at end of file diff --git a/mod/ping.php b/mod/ping.php index f8faadff85..57728d3294 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -2,7 +2,7 @@ require_once("include/datetime.php"); require_once('include/bbcode.php'); require_once('include/forums.php'); -require_once('include/groupo.php'); +require_once('include/group.php'); require_once("mod/proxy.php"); function ping_init(&$a) { From d94b96e54676a220e064dcfd1d12bdbc2a939a95 Mon Sep 17 00:00:00 2001 From: rabuzarus <> Date: Thu, 3 Dec 2015 22:51:00 +0100 Subject: [PATCH 8/8] ping: docu fix --- include/group.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/group.php b/include/group.php index 64c74ba2d1..fd1c97dfde 100644 --- a/include/group.php +++ b/include/group.php @@ -346,7 +346,7 @@ function groups_containing($uid,$c) { * Count unread items of each groups * * @return array - * 'id' => contact id + * 'id' => group id * 'name' => group name * 'count' => counted unseen group items *