]> git.mxchange.org Git - friendica.git/blobdiff - static/dbview.config.php
First draft for using a image grid to display attached images.
[friendica.git] / static / dbview.config.php
index 875273cb021c74023e5eba6aa0e8f9a3e08ef106..66f3de3b63f556ee2e3f81a5064b156c70d1ca22 100644 (file)
@@ -72,6 +72,8 @@
                        "thr-parent-id" => ["post-user", "thr-parent-id"],
                        "conversation" => ["conversation-item-uri", "uri"],
                        "conversation-id" => ["post-thread-user", "conversation-id"],
+                       "quote-uri" => ["quote-item-uri", "uri"],
+                       "quote-uri-id" => ["post-content", "quote-uri-id"],
                        "guid" => ["item-uri", "guid"],
                        "wall" => ["post-user", "wall"],
                        "gravity" => ["post-user", "gravity"],
                        "parent-author-name" => ["parent-post-author", "name"],
                        "parent-author-nick" => ["parent-post-author", "nick"],
                        "parent-author-network" => ["parent-post-author", "network"],
-                       "parent-author-blocked" => ["parent-post-author", "blocked"],
-                       "parent-author-hidden" => ["parent-post-author", "hidden"],
                ],
                "query" => "FROM `post-user`
                        STRAIGHT_JOIN `post-thread-user` ON `post-thread-user`.`uri-id` = `post-user`.`parent-uri-id` AND `post-thread-user`.`uid` = `post-user`.`uid`
                        LEFT JOIN `event` ON `event`.`id` = `post-user`.`event-id`
                        LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post-user`.`uri-id`
                        LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post-user`.`uri-id`
+                       LEFT JOIN `item-uri` AS `quote-item-uri` ON `quote-item-uri`.`id` = `post-content`.`quote-uri-id`
                        LEFT JOIN `post-delivery-data` ON `post-delivery-data`.`uri-id` = `post-user`.`uri-id` AND `post-user`.`origin`
                        LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post-user`.`uri-id`
                        LEFT JOIN `permissionset` ON `permissionset`.`id` = `post-user`.`psid`
                        "thr-parent-id" => ["post-user", "thr-parent-id"],
                        "conversation" => ["conversation-item-uri", "uri"],
                        "conversation-id" => ["post-thread-user", "conversation-id"],
+                       "quote-uri" => ["quote-item-uri", "uri"],
+                       "quote-uri-id" => ["post-content", "quote-uri-id"],
                        "guid" => ["item-uri", "guid"],
                        "wall" => ["post-thread-user", "wall"],
                        "gravity" => ["post-user", "gravity"],
                        "parent-author-link" => ["parent-post-author", "url"],
                        "parent-author-name" => ["parent-post-author", "name"],
                        "parent-author-network" => ["parent-post-author", "network"],
-                       "parent-author-blocked" => ["parent-post-author", "blocked"],
-                       "parent-author-hidden" => ["parent-post-author", "hidden"],
                ],
                "query" => "FROM `post-thread-user`
                        INNER JOIN `post-user` ON `post-user`.`id` = `post-thread-user`.`post-user-id`
                        LEFT JOIN `event` ON `event`.`id` = `post-user`.`event-id`
                        LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post-thread-user`.`uri-id`
                        LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post-thread-user`.`uri-id`
+                       LEFT JOIN `item-uri` AS `quote-item-uri` ON `quote-item-uri`.`id` = `post-content`.`quote-uri-id`
                        LEFT JOIN `post-delivery-data` ON `post-delivery-data`.`uri-id` = `post-thread-user`.`uri-id` AND `post-thread-user`.`origin`
                        LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post-thread-user`.`uri-id`
                        LEFT JOIN `permissionset` ON `permissionset`.`id` = `post-thread-user`.`psid`
                        "thr-parent-id" => ["post", "thr-parent-id"],
                        "conversation" => ["conversation-item-uri", "uri"],
                        "conversation-id" => ["post-thread", "conversation-id"],
+                       "quote-uri" => ["quote-item-uri", "uri"],
+                       "quote-uri-id" => ["post-content", "quote-uri-id"],
                        "guid" => ["item-uri", "guid"],
                        "gravity" => ["post", "gravity"],
                        "extid" => ["external-item-uri", "uri"],
                        "parent-author-link" => ["parent-post-author", "url"],
                        "parent-author-name" => ["parent-post-author", "name"],
                        "parent-author-network" => ["parent-post-author", "network"],
-                       "parent-author-blocked" => ["parent-post-author", "blocked"],
-                       "parent-author-hidden" => ["parent-post-author", "hidden"],
                ],
                "query" => "FROM `post`
                        STRAIGHT_JOIN `post-thread` ON `post-thread`.`uri-id` = `post`.`parent-uri-id`
                        LEFT JOIN `verb` ON `verb`.`id` = `post`.`vid`
                        LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post`.`uri-id`
                        LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post`.`uri-id`
+                       LEFT JOIN `item-uri` AS `quote-item-uri` ON `quote-item-uri`.`id` = `post-content`.`quote-uri-id`
                        LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post`.`uri-id`
                        LEFT JOIN `post` AS `parent-post` ON `parent-post`.`uri-id` = `post`.`parent-uri-id`
                        LEFT JOIN `contact` AS `parent-post-author` ON `parent-post-author`.`id` = `parent-post`.`author-id`"
                        "thr-parent-id" => ["post", "thr-parent-id"],
                        "conversation" => ["conversation-item-uri", "uri"],
                        "conversation-id" => ["post-thread", "conversation-id"],
+                       "quote-uri" => ["quote-item-uri", "uri"],
+                       "quote-uri-id" => ["post-content", "quote-uri-id"],
                        "guid" => ["item-uri", "guid"],
                        "gravity" => ["post", "gravity"],
                        "extid" => ["external-item-uri", "uri"],
                        "question-end-time" => ["post-question", "end-time"],
                        "has-categories" => "0",
                        "has-media" => "EXISTS(SELECT `id` FROM `post-media` WHERE `post-media`.`uri-id` = `post-thread`.`uri-id`)",
+                       "total-comments" => "(SELECT COUNT(*) FROM `post` WHERE `parent-uri-id` = `post-thread`.`uri-id` AND `gravity` = 6)",
+                       "total-actors" => "(SELECT COUNT(DISTINCT(`author-id`)) FROM `post` WHERE `parent-uri-id` = `post-thread`.`uri-id` AND `gravity` = 6)",
                        "signed_text" => ["diaspora-interaction", "interaction"],
                        "parent-guid" => ["parent-item-uri", "guid"],
                        "parent-network" => ["parent-post", "network"],
                        "parent-author-link" => ["parent-post-author", "url"],
                        "parent-author-name" => ["parent-post-author", "name"],
                        "parent-author-network" => ["parent-post-author", "network"],
-                       "parent-author-blocked" => ["parent-post-author", "blocked"],
-                       "parent-author-hidden" => ["parent-post-author", "hidden"],
                ],
                "query" => "FROM `post-thread`
                        INNER JOIN `post` ON `post`.`uri-id` = `post-thread`.`uri-id`
                        LEFT JOIN `verb` ON `verb`.`id` = `post`.`vid`
                        LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post-thread`.`uri-id`
                        LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post-thread`.`uri-id`
+                       LEFT JOIN `item-uri` AS `quote-item-uri` ON `quote-item-uri`.`id` = `post-content`.`quote-uri-id`
                        LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post-thread`.`uri-id`
                        LEFT JOIN `post` AS `parent-post` ON `parent-post`.`uri-id` = `post`.`parent-uri-id`
                        LEFT JOIN `contact` AS `parent-post-author` ON `parent-post-author`.`id` = `parent-post`.`author-id`"
                "fields" => [
                        "uri-id" => ["post-collection", "uri-id"],
                        "type" => ["post-collection", "type"],
-                       "cid" => ["post", "author-id"],
+                       "cid" => ["post-collection", "author-id"],
                        "received" => ["post", "received"],
                        "created" => ["post", "created"],
                        "commented" => ["post-thread", "commented"],
                        "visible" => ["post", "visible"],
                        "deleted" => ["post", "deleted"],
                        "thr-parent-id" => ["post", "thr-parent-id"],
-                       "author-id" => ["post", "author-id"],
+                       "author-id" => ["post-collection", "author-id"],
                        "gravity" => ["post", "gravity"],
                ],
                "query" => "FROM `post-collection`
                        INNER JOIN `post` ON `post-collection`.`uri-id` = `post`.`uri-id`
                        INNER JOIN `post-thread` ON `post-thread`.`uri-id` = `post`.`parent-uri-id`"
        ],
+       "media-view" => [
+               "fields" => [
+                       "uri-id" => ["post-media", "uri-id"],
+                       "type" => ["post-media", "type"],
+                       "received" => ["post", "received"],
+                       "created" => ["post", "created"],
+                       "private" => ["post", "private"],
+                       "visible" => ["post", "visible"],
+                       "deleted" => ["post", "deleted"],
+                       "thr-parent-id" => ["post", "thr-parent-id"],
+                       "author-id" => ["post", "author-id"],
+                       "gravity" => ["post", "gravity"],
+               ],
+               "query" => "FROM `post-media`
+                       INNER JOIN `post` ON `post-media`.`uri-id` = `post`.`uri-id`"
+       ],
        "tag-view" => [
                "fields" => [
                        "uri-id" => ["post-tag", "uri-id"],
                        "language" => ["user", "language"],
                        "register_date" => ["user", "register_date"],
                        "login_date" => ["user", "login_date"],
+                       "last-activity" => ["user", "last-activity"],
                        "default-location" => ["user", "default-location"],
                        "allow_location" => ["user", "allow_location"],
                        "theme" => ["user", "theme"],
                        "postal-code" => ["profile", "postal-code"],
                        "country-name" => ["profile", "country-name"],
                        "homepage" => ["profile", "homepage"],
+                       "homepage_verified" => ["profile", "homepage_verified"],
                        "dob" => ["profile", "dob"],
                ],
                "query" => "FROM `user`