From 5afe8e5aa116fb288b2ef87c7af3c7e74565d50b Mon Sep 17 00:00:00 2001 From: jeroenpraat Date: Thu, 12 Nov 2015 22:10:20 +0100 Subject: Small update to Bluegrid and generic-content-wrapper-styled to dreport --- mod/dreport.php | 5 +++-- view/theme/redbasic/schema/bluegrid.css | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mod/dreport.php b/mod/dreport.php index c320bf0e6..1ad1eca7c 100644 --- a/mod/dreport.php +++ b/mod/dreport.php @@ -56,7 +56,7 @@ function dreport_content(&$a) { return; } - + $o .= '
'; $o .= '

' . sprintf( t('Delivery report for %1$s'),substr($mid,0,32)) . '...' . '

'; $o .= ''; @@ -121,6 +121,7 @@ function dreport_content(&$a) { $o .= ''; } $o .= '
' . $rr['name'] . '' . escape_tags($rr['dreport_result']) . '' . escape_tags($rr['dreport_time']) . '
'; + $o .= '
'; return $o; @@ -135,4 +136,4 @@ function dreport_gravity_sort($a,$b) { return strcmp($a['name'],$b['name']); } return (($a['gravity'] > $b['gravity']) ? 1 : (-1)); -} \ No newline at end of file +} diff --git a/view/theme/redbasic/schema/bluegrid.css b/view/theme/redbasic/schema/bluegrid.css index 2c6f34558..3c856c5e2 100644 --- a/view/theme/redbasic/schema/bluegrid.css +++ b/view/theme/redbasic/schema/bluegrid.css @@ -299,7 +299,7 @@ input { border: 1px solid rgba(255,255,255,.5); } -.contact-entry-edit a:hover, .contact-entry-edit a:focus, .generic-content-wrapper-styled > p > span.btn.btn-default > a:hover,.generic-content-wrapper-styled > p > span.btn.btn-default > a:focus, div#profile-edit-links a:hover, div#profile-edit-links a:focus { +.contact-entry-edit:hover a, .contact-entry-edit:focus a, .generic-content-wrapper-styled > p > span.btn.btn-default > a:hover,.generic-content-wrapper-styled > p > span.btn.btn-default > a:focus, div#profile-edit-links a:hover, div#profile-edit-links a:focus { color: #43488A; } -- cgit v1.2.3 From 391807b46c3f54eb94b88c253d89d09bc7139989 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 12 Nov 2015 16:45:38 -0800 Subject: small fixes, removed old unused database row, and log more prominently a missing directory server URL --- install/schema_postgres.sql | 1 - mod/directory.php | 2 ++ version.inc | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql index d60e1bc69..95ed9acb7 100644 --- a/install/schema_postgres.sql +++ b/install/schema_postgres.sql @@ -44,7 +44,6 @@ CREATE TABLE "abook" ( create index "abook_profile" on abook ("abook_profile"); create index "abook_dob" on abook ("abook_dob"); create index "abook_connected" on abook ("abook_connected"); - create index "abook_rating" on abook ("abook_rating"); create index "abook_channel_closeness" on abook ("abook_channel", "abook_closeness"); CREATE TABLE "account" ( diff --git a/mod/directory.php b/mod/directory.php index 3c230e173..4ab118b17 100644 --- a/mod/directory.php +++ b/mod/directory.php @@ -121,6 +121,8 @@ function directory_content(&$a) { } if(! $url) { $directory = find_upstream_directory($dirmode); + if((! $directory) || (! array_key_exists('url',$directory)) || (! $directory['url'])) + logger('CRITICAL: No directory server URL'); $url = $directory['url'] . '/dirsearch'; } diff --git a/version.inc b/version.inc index 3b6ad6e9a..938250e5c 100644 --- a/version.inc +++ b/version.inc @@ -1 +1 @@ -2015-11-11.1213 +2015-11-12.1214 -- cgit v1.2.3 From 22a650ade8b6c4472f9ad70337b69ee54e2c7c32 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 12 Nov 2015 16:57:02 -0800 Subject: issue #154 --- include/photo/photo_driver.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php index 285cbc8fb..0de3b9c97 100644 --- a/include/photo/photo_driver.php +++ b/include/photo/photo_driver.php @@ -3,6 +3,17 @@ function photo_factory($data, $type = null) { $ph = null; + + $unsupported_types = array( + 'image/bmp', + 'image/vnd.microsoft.icon', + 'image/tiff', + 'image/svg+xml' + ); + + if($type && in_array(strtolower($type),$unsupported_types)) + return null; + $ignore_imagick = get_config('system', 'ignore_imagick'); if(class_exists('Imagick') && !$ignore_imagick) { -- cgit v1.2.3 From 888bf76e4b4c2d4285c0bb28334df6e9af884e16 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 12 Nov 2015 17:47:38 -0800 Subject: allow pdl content --- boot.php | 5 +++++ include/conversation.php | 5 +++++ include/text.php | 10 +++++++++- mod/page.php | 4 ++++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/boot.php b/boot.php index f9b826bb7..390560592 100755 --- a/boot.php +++ b/boot.php @@ -2056,6 +2056,10 @@ function construct_page(&$a) { $a->build_pagehead(); + if($a->page['pdl_content']) { + $a->page['content'] = comanche_region($a,$a->page['content']); + } + // Let's say we have a comanche declaration '[region=nav][/region][region=content]$nav $content[/region]'. // The text 'region=' identifies a section of the layout by that name. So what we want to do here is leave // $a->page['nav'] empty and put the default content from $a->page['nav'] and $a->page['section'] @@ -2070,6 +2074,7 @@ function construct_page(&$a) { call_hooks('construct_page', $arr); $a->layout = $arr['layout']; + foreach($a->layout as $k => $v) { if((strpos($k, 'region_') === 0) && strlen($v)) { if(strpos($v, '$region_') !== false) { diff --git a/include/conversation.php b/include/conversation.php index c278dcf12..a7d5f3fa5 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1089,6 +1089,11 @@ function format_like($cnt, $arr, $type, $id) { return $o; } +/** + * This is our general purpose content editor. + * It was once nicknamed "jot" and you may see references to "jot" littered throughout the code. + * They are referring to the content editor or components thereof. + */ function status_editor($a, $x, $popup = false) { diff --git a/include/text.php b/include/text.php index edaa8dcd3..ed0e21a71 100644 --- a/include/text.php +++ b/include/text.php @@ -94,6 +94,8 @@ function z_input_filter($channel_id,$s,$type = 'text/bbcode') { return escape_tags($s); if($type == 'text/plain') return escape_tags($s); + if($type == 'application/x-pdl') + return escape_tags($s); $a = get_app(); if($a->is_sys) { @@ -1517,6 +1519,11 @@ function prepare_text($text, $content_type = 'text/bbcode', $cache = false) { $s = Markdown($text); break; + + case 'application/x-pdl'; + $s = escape_tags($text); + break; + // No security checking is done here at display time - so we need to verify // that the author is allowed to use PHP before storing. We also cannot allow // importation of PHP text bodies from other sites. Therefore this content @@ -1681,7 +1688,8 @@ function mimetype_select($channel_id, $current = 'text/bbcode') { 'text/bbcode', 'text/html', 'text/markdown', - 'text/plain' + 'text/plain', + 'application/x-pdl' ); $a = get_app(); diff --git a/mod/page.php b/mod/page.php index b635a60f2..ae572ca1e 100644 --- a/mod/page.php +++ b/mod/page.php @@ -131,6 +131,10 @@ function page_content(&$a) { xchan_query($r); $r = fetch_post_tags($r,true); + + if($r[0]['mimetype'] === 'application/x-pdl') + $a->page['pdl_content'] = true; + $o .= prepare_page($r[0]); return $o; -- cgit v1.2.3 From f5fcdf1de46ac3513cdec85184505f5b54bbb05b Mon Sep 17 00:00:00 2001 From: ken restivo Date: Thu, 12 Nov 2015 17:53:26 -0800 Subject: Fix spelling of documentation. --- doc/develop.bb | 2 +- doc/faq_developers.bb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/develop.bb b/doc/develop.bb index 6694a839b..ad5b2288f 100644 --- a/doc/develop.bb +++ b/doc/develop.bb @@ -15,7 +15,7 @@ [zrl=[baseurl]/help/Translations]Translations[/zrl] [zrl=[baseurl]/help/developers]Developers[/zrl] [zrl=[baseurl]/help/intro_for_developers]Intro for Developers[/zrl] -[zrl=[baseurl]/help/database]Database schema documantation[/zrl] +[zrl=[baseurl]/help/database]Database schema documentation[/zrl] [zrl=[baseurl]/help/api_functions]API functions[/zrl] [zrl=[baseurl]/help/api_posting]Posting to the red# using the API[/zrl] [zrl=[baseurl]/help/developer_function_primer]Red Functions 101[/zrl] diff --git a/doc/faq_developers.bb b/doc/faq_developers.bb index c74ec3c56..dd7f4cda1 100644 --- a/doc/faq_developers.bb +++ b/doc/faq_developers.bb @@ -285,7 +285,7 @@ An example (large) &$a object showing some of its many members and structures-- "xchan_photo_l": "http://hubzilla/photo/profile/l/2" }, "page": { - "content": "<div id="help-content" class="generic-content-wrapper">\n\t<div class="section-title-wrapper">\n\t<h2>Hubzilla Documentation</h2>\n\t</div>\n\t<div class="section-content-wrapper">\n\t<h2>Documentation for Developers</h2><br /><br /><h3>Technical Documentation</h3><br /><a class="zrl" href="http://hubzilla/help/Zot---A-High-Level-Overview" target="_newwin" >A high level overview of Zot</a><br /><a class="zrl" href="http://hubzilla/help/zot" target="_newwin" >An introduction to Zot</a><br /><a class="zrl" href="http://hubzilla/help/zot_structures" target="_newwin" >Zot Stuctures</a><br /><a class="zrl" href="http://hubzilla/help/comanche" target="_newwin" >Comanche Page Descriptions</a><br /><a class="zrl" href="http://hubzilla/help/Creating-Templates" target="_newwin" >Creating Comanche Templates</a><br /><a class="zrl" href="http://hubzilla/help/Widgets" target="_newwin" >Widgets</a><br /><a class="zrl" href="http://hubzilla/help/plugins" target="_newwin" >Plugins</a><br /><a class="zrl" href="http://hubzilla/help/hooks" target="_newwin" >Hooks</a><br /><a class="zrl" href="http://hubzilla/help/doco" target="_newwin" >Contributing Documentation</a><br /><a class="zrl" href="http://hubzilla/help/DerivedTheme1" target="_newwin" >Creating Derivative Themes</a><br /><a class="zrl" href="http://hubzilla/help/schema_development" target="_newwin" >Schemas</a><br /><a class="zrl" href="http://hubzilla/help/Translations" target="_newwin" >Translations</a><br /><a class="zrl" href="http://hubzilla/help/developers" target="_newwin" >Developers</a><br /><a class="zrl" href="http://hubzilla/help/intro_for_developers" target="_newwin" >Intro for Developers</a><br /><a class="zrl" href="http://hubzilla/help/database" target="_newwin" >Database schema documantation</a><br /><a class="zrl" href="http://hubzilla/help/api_functions" target="_newwin" >API functions</a><br /><a class="zrl" href="http://hubzilla/help/api_posting" target="_newwin" >Posting to the red# using the API</a><br /><a class="zrl" href="http://hubzilla/help/developer_function_primer" target="_newwin" >Red Functions 101</a><br /><a class="zrl" href="http://hubzilla/doc/html/" target="_newwin" >Code Reference (Doxygen generated - sets cookies)</a><br /><a class="zrl" href="http://hubzilla/help/to_do_doco" target="_newwin" >To-Do list for the Red Documentation Project</a><br /><a class="zrl" href="http://hubzilla/help/to_do_code" target="_newwin" >To-Do list for Developers</a><br /><a class="zrl" href="http://hubzilla/help/roadmap" target="_newwin" >Version 3 roadmap</a><br /><a class="zrl" href="http://hubzilla/help/git_for_non_developers" target="_newwin" >Git for Non-Developers</a><br /><a class="zrl" href="http://hubzilla/help/dev_beginner" target="_newwin" >Step-for-step manual for beginning developers</a><br /><br /><h3>Frequently Asked Questions For Developers</h3><br /><a class="zrl" href="http://hubzilla/help/faq_developers" target="_newwin" >FAQ For Developers</a><br /><br /><h3>External Resources</h3><br /><br /><a href="https://zothub.com/channel/one" target="_newwin" >Development Channel</a><br /><a href="https://federated.social/channel/postgres" target="_newwin" >Postgres-specific Hubzilla Admin Support Channel</a><br />\n\t</div>\n</div>\n<script>var homebase = "http://hubzilla/channel/testes";</script>", + "content": "<div id="help-content" class="generic-content-wrapper">\n\t<div class="section-title-wrapper">\n\t<h2>Hubzilla Documentation</h2>\n\t</div>\n\t<div class="section-content-wrapper">\n\t<h2>Documentation for Developers</h2><br /><br /><h3>Technical Documentation</h3><br /><a class="zrl" href="http://hubzilla/help/Zot---A-High-Level-Overview" target="_newwin" >A high level overview of Zot</a><br /><a class="zrl" href="http://hubzilla/help/zot" target="_newwin" >An introduction to Zot</a><br /><a class="zrl" href="http://hubzilla/help/zot_structures" target="_newwin" >Zot Stuctures</a><br /><a class="zrl" href="http://hubzilla/help/comanche" target="_newwin" >Comanche Page Descriptions</a><br /><a class="zrl" href="http://hubzilla/help/Creating-Templates" target="_newwin" >Creating Comanche Templates</a><br /><a class="zrl" href="http://hubzilla/help/Widgets" target="_newwin" >Widgets</a><br /><a class="zrl" href="http://hubzilla/help/plugins" target="_newwin" >Plugins</a><br /><a class="zrl" href="http://hubzilla/help/hooks" target="_newwin" >Hooks</a><br /><a class="zrl" href="http://hubzilla/help/doco" target="_newwin" >Contributing Documentation</a><br /><a class="zrl" href="http://hubzilla/help/DerivedTheme1" target="_newwin" >Creating Derivative Themes</a><br /><a class="zrl" href="http://hubzilla/help/schema_development" target="_newwin" >Schemas</a><br /><a class="zrl" href="http://hubzilla/help/Translations" target="_newwin" >Translations</a><br /><a class="zrl" href="http://hubzilla/help/developers" target="_newwin" >Developers</a><br /><a class="zrl" href="http://hubzilla/help/intro_for_developers" target="_newwin" >Intro for Developers</a><br /><a class="zrl" href="http://hubzilla/help/database" target="_newwin" >Database schema documentation</a><br /><a class="zrl" href="http://hubzilla/help/api_functions" target="_newwin" >API functions</a><br /><a class="zrl" href="http://hubzilla/help/api_posting" target="_newwin" >Posting to the red# using the API</a><br /><a class="zrl" href="http://hubzilla/help/developer_function_primer" target="_newwin" >Red Functions 101</a><br /><a class="zrl" href="http://hubzilla/doc/html/" target="_newwin" >Code Reference (Doxygen generated - sets cookies)</a><br /><a class="zrl" href="http://hubzilla/help/to_do_doco" target="_newwin" >To-Do list for the Red Documentation Project</a><br /><a class="zrl" href="http://hubzilla/help/to_do_code" target="_newwin" >To-Do list for Developers</a><br /><a class="zrl" href="http://hubzilla/help/roadmap" target="_newwin" >Version 3 roadmap</a><br /><a class="zrl" href="http://hubzilla/help/git_for_non_developers" target="_newwin" >Git for Non-Developers</a><br /><a class="zrl" href="http://hubzilla/help/dev_beginner" target="_newwin" >Step-for-step manual for beginning developers</a><br /><br /><h3>Frequently Asked Questions For Developers</h3><br /><a class="zrl" href="http://hubzilla/help/faq_developers" target="_newwin" >FAQ For Developers</a><br /><br /><h3>External Resources</h3><br /><br /><a href="https://zothub.com/channel/one" target="_newwin" >Development Channel</a><br /><a href="https://federated.social/channel/postgres" target="_newwin" >Postgres-specific Hubzilla Admin Support Channel</a><br />\n\t</div>\n</div>\n<script>var homebase = "http://hubzilla/channel/testes";</script>", "page_title": "help", "title": "Help: Develop", "nav": "\t<div class="container-fluid">\n\t\t<div class="navbar-header">\n\t\t\t<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse-1">\n\t\t\t\t<span class="icon-bar"></span>\n\t\t\t\t<span class="icon-bar"></span>\n\t\t\t\t<span class="icon-bar"></span>\n\t\t\t</button>\n\t\t\t<button id="expand-tabs" type="button" class="navbar-toggle" data-toggle="collapse" data-target="#tabs-collapse-1">\n\t\t\t\t<i class="icon-circle-arrow-down" id="expand-tabs-icon"></i>\n\t\t\t</button>\n\t\t\t<button id="expand-aside" type="button" class="navbar-toggle" data-toggle="offcanvas" data-target="#region_1">\n\t\t\t\t<i class="icon-circle-arrow-right" id="expand-aside-icon"></i>\n\t\t\t</button>\n\t\t\t\t\t\t\t<img class="dropdown-toggle fakelink" data-toggle="dropdown" id="avatar" src="http://hubzilla/photo/profile/m/2" alt="testes@hubzilla"><span class="caret" id="usermenu-caret"></span>\n\t\t\t\t\t\t\t\t\t<ul class="dropdown-menu" role="menu" aria-labelledby="avatar">\n\t\t\t\t\t\t\t\t\t\t\t\t<li role="presentation"><a href="channel/testes" title="Your posts and conversations" role="menuitem" id="channel_nav_btn">Home</a></li>\n\t\t\t\t\t\t\t\t\t\t\t\t<li role="presentation"><a href="profile/testes" title="Your profile page" role="menuitem" id="profile_nav_btn">View Profile</a></li>\n\t\t\t\t\t\t\t\t\t\t\t\t<li role="presentation"><a href="profiles/2" title="Edit your profile" role="menuitem" id="profiles_nav_btn">Edit Profile</a></li>\n\t\t\t\t\t\t\t\t\t\t\t\t<li role="presentation"><a href="photos/testes" title="Your photos" role="menuitem" id="photos_nav_btn">Photos</a></li>\n\t\t\t\t\t\t\t\t\t\t\t\t<li role="presentation"><a href="cloud/testes" title="Your files" role="menuitem" id="cloud_nav_btn">Files</a></li>\n\t\t\t\t\t\t\t\t\t\t\t\t<li role="presentation"><a href="chat/testes/new" title="Your chatrooms" role="menuitem" id="chat_nav_btn">Chat</a></li>\n\t\t\t\t\t\t\t\t\t\t\t\t<li role="presentation" class="divider"></li>\n\t\t\t\t\t\t\t\t\t\t\t\t<li role="presentation"><a href="settings" title="Account/Channel Settings" role="menuitem" id="settings_nav_btn">Settings</a></li>\t\t\t\t\t\t<li role="presentation"><a href="manage" title="Manage Your Channels" role="menuitem" id="manage_nav_btn">Channel Manager</a></li>\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<li role="presentation" class="divider"></li>\n\t\t\t\t\t\t<li role="presentation"><a href="admin/" title="Site Setup and Configuration" role="menuitem" id="admin_nav_btn">Admin</a></li>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<li role="presentation" class="divider"></li>\n\t\t\t\t\t\t<li role="presentation"><a href="logout" title="End this session" role="menuitem" id="logout_nav_btn">Logout</a></li>\n\t\t\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t<div class="collapse navbar-collapse" id="navbar-collapse-1">\n\t\t\t<ul class="nav navbar-nav navbar-left">\n\t\t\t\t\t\t\n\t\t\t\n\t\t\t\t\t\t\t<li class=" hidden-xs">\n\t\t\t\t\t<a href="network" title="Your grid" id="network_nav_btn"><i class="icon-th"></i></a>\n\t\t\t\t\t<span class="net-update badge dropdown-toggle" data-toggle="dropdown" rel="#nav-network-menu"></span>\n\t\t\t\t\t<ul id="nav-network-menu" role="menu" class="dropdown-menu" rel="network">\n\t\t\t\t\t\t\n\t\t\t\t\t\t<li id="nav-network-mark-all"><a href="#" onclick="markRead('network'); return false;">Mark all grid notifications seen</a></li>\n\t\t\t\t\t\t<li class="empty">Loading...</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</li>\n\t\t\t\t<li class=" visible-xs">\n\t\t\t\t\t<a href="network" title="Your grid" ><i class="icon-th"></i></a>\n\t\t\t\t\t<span class="net-update badge" rel="#nav-network-menu"></span>\n\t\t\t\t</li>\n\t\t\t\n\t\t\t\t\t\t\t<li class=" hidden-xs">\n\t\t\t\t\t<a class="" href="channel/testes" title="Channel home" id="home_nav_btn"><i class="icon-home"></i></a>\n\t\t\t\t\t<span class="home-update badge dropdown-toggle" data-toggle="dropdown" rel="#nav-home-menu"></span>\n\t\t\t\t\t<ul id="nav-home-menu" class="dropdown-menu" rel="home">\n\t\t\t\t\t\t\n\t\t\t\t\t\t<li id="nav-home-mark-all"><a href="#" onclick="markRead('home'); return false;">Mark all channel notifications seen</a></li>\n\t\t\t\t\t\t<li class="empty">Loading...</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</li>\n\t\t\t\t<li class=" visible-xs">\n\t\t\t\t\t<a class="" href="channel/testes" title="Channel home" ><i class="icon-home"></i></a>\n\t\t\t\t\t<span class="home-update badge" rel="#nav-home-menu"></span>\n\t\t\t\t</li>\n\t\t\t\n\n\t\t\t\t\t\t\t<li class=" hidden-xs">\n\t\t\t\t\t<a class="" href="mail/combined" title="Private mail" id="mail_nav_btn"><i class="icon-envelope"></i></a>\n\t\t\t\t\t<span class="mail-update badge dropdown-toggle" data-toggle="dropdown" rel="#nav-messages-menu"></span>\n\t\t\t\t\t<ul id="nav-messages-menu" class="dropdown-menu" rel="messages">\n\t\t\t\t\t\t<li id="nav-messages-see-all"><a href="mail/combined">See all private messages</a></li>\n\t\t\t\t\t\t<li id="nav-messages-mark-all"><a href="#" onclick="markRead('messages'); return false;">Mark all private messages seen</a></li>\n\t\t\t\t\t\t<li class="empty">Loading...</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</li>\n\t\t\t\t<li class=" visible-xs">\n\t\t\t\t\t<a class="" href="mail/combined" title="Private mail" ><i class="icon-envelope"></i></a>\n\t\t\t\t\t<span class="mail-update badge" rel="#nav-messages-menu"></span>\n\t\t\t\t</li>\n\t\t\t\n\t\t\t\t\t\t\t<li class=" hidden-xs">\n\t\t\t\t\t<a class="" href="events" title="Event Calendar" id='events_nav_btn'><i class="icon-calendar"></i></a>\n\t\t\t\t\t<span class="all_events-update badge dropdown-toggle" data-toggle="dropdown" rel="#nav-all_events-menu"></span>\n\t\t\t\t\t<ul id="nav-all_events-menu" class="dropdown-menu" rel="all_events">\n\t\t\t\t\t\t<li id="nav-all_events-see-all"><a href="events">See all events</a></li>\n\t\t\t\t\t\t<li id="nav-all_events-mark-all"><a href="#" onclick="markRead('all_events'); return false;">Mark all events seen</a></li>\n\t\t\t\t\t\t<li class="empty">Loading...</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</li>\n\t\t\t\t<li class=" visible-xs">\n\t\t\t\t\t<a class="" href="events" title="Event Calendar" ><i class="icon-calendar"></i></a>\n\t\t\t\t\t<span class="all_events-update badge" rel="#nav-all_events-menu"></span>\n\t\t\t\t</li>\n\t\t\t\n\t\t\t\t\t\t\t<li class=" hidden-xs">\n\t\t\t\t\t<a class="" href="connections/ifpending" title="Connections" id="connections_nav_btn"><i class="icon-user"></i></a>\n\t\t\t\t\t<span class="intro-update badge dropdown-toggle" data-toggle="dropdown" rel="#nav-intros-menu"></span>\n\t\t\t\t\t<ul id="nav-intros-menu" class="dropdown-menu" rel="intros">\n\t\t\t\t\t\t<li id="nav-intros-see-all"><a href=""></a></li>\n\t\t\t\t\t\t<li class="empty">Loading...</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</li>\n\t\t\t\t<li class=" visible-xs">\n\t\t\t\t\t<a class="" href="connections/ifpending" title="Connections" ><i class="icon-user"></i></a>\n\t\t\t\t\t<span class="intro-update badge" rel="#nav-intros-menu"></span>\n\t\t\t\t</li>\n\t\t\t\t\t\n\t\t\t\t\t\t\t<li class=" hidden-xs">\n\t\t\t\t\t<a href="notifications/system" title="Notices" id="notifications_nav_btn"><i class="icon-exclamation"></i></a>\n\t\t\t\t\t<span class="notify-update badge dropdown-toggle" data-toggle="dropdown" rel="#nav-notify-menu"></span>\n\t\t\t\t\t<ul id="nav-notify-menu" class="dropdown-menu" rel="notify">\n\t\t\t\t\t\t<li id="nav-notify-see-all"><a href="notifications/system">See all notifications</a></li>\n\t\t\t\t\t\t<li id="nav-notify-mark-all"><a href="#" onclick="markRead('notify'); return false;">Mark all system notifications seen</a></li>\n\t\t\t\t\t\t<li class="empty">Loading...</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</li>\n\t\t\t\t<li class=" visible-xs">\n\t\t\t\t\t<a href="notifications/system" title="Notices"><i class="icon-exclamation"></i></a>\n\t\t\t\t\t<span class="notify-update badge" rel="#nav-notify-menu"></span>\n\t\t\t\t</li>\n\t\t\t\t\t\t</ul>\n\t\t\t<ul class="nav navbar-nav navbar-right">\n\t\t\t\t<li class="hidden-xs">\n\t\t\t\t\t<form method="get" action="search" role="search">\n\t\t\t\t\t\t<div id="nav-search-spinner"></div><input class="icon-search" id="nav-search-text" type="text" value="" placeholder="&#xf002; @name, #tag, ?doc, content" name="search" title="Search site @name, #tag, ?docs, content" onclick="this.submit();"/>\n\t\t\t\t\t</form>\n\t\t\t\t</li>\n\t\t\t\t<li class="visible-xs">\n\t\t\t\t\t<a href="/search" title="Search site @name, #tag, ?docs, content"><i class="icon-search"></i></a>\n\t\t\t\t</li>\n\n\t\t\t\t\t\t\t\t\t\t<li class="">\n\t\t\t\t\t<a class="" href="directory" title="Channel Directory" id="directory_nav_btn"><i class="icon-sitemap"></i></a>\n\t\t\t\t</li>\n\t\t\t\n\t\t\t\t\t\t\t<li class="">\n\t\t\t\t\t<a class="" href="apps" title="Applications, utilities, links, games" id="apps_nav_btn"><i class="icon-cogs"></i></a>\n\t\t\t\t</li>\n\t\t\t\n\t\t\t\t\t\t\t<li class="active">\n\t\t\t\t\t<a class="" target="hubzilla-help" href="http://hubzilla/help?f=&cmd=help/develop" title="Help and documentation" id="help_nav_btn"><i class="icon-question"></i></a>\n\t\t\t\t</li>\n\t\t\t\t\t\t</ul>\n\t\t</div>\n\t</div>\n", -- cgit v1.2.3 From 4872a30e2bab4c7751bbf6549c207ae74f898597 Mon Sep 17 00:00:00 2001 From: ken restivo Date: Thu, 12 Nov 2015 18:02:20 -0800 Subject: Add note about base64 and urlencode. --- doc/database/db_channel.bb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/database/db_channel.bb b/doc/database/db_channel.bb index 70887298d..6f53517d8 100644 --- a/doc/database/db_channel.bb +++ b/doc/database/db_channel.bb @@ -15,7 +15,7 @@ [/td][/tr] [tr][td]channel_guid_sig[/td][td]channel.gui signed with channel.prvkey and base64url_encoded[/td][td]text[/td][td]NO[/td][td][/td][td]NULL[/td][td] [/td][/tr] -[tr][td]channel_hash[/td][td]whirlpool hash of channel.guid and channel_guid_sig concatenated, synonymous with xchan_hash[/td][td]char(255)[/td][td]NO[/td][td]MUL[/td][td][/td][td] +[tr][td]channel_hash[/td][td]base64url_encode of a 64-char whirlpool hash of channel.guid and channel_guid_sig concatenated, synonymous with xchan_hash.[/td][td]char(255)[/td][td]NO[/td][td]MUL[/td][td][/td][td] [/td][/tr] [tr][td]channel_timezone[/td][td]PHP-legal timezone[/td][td]char(128)[/td][td]NO[/td][td]MUL[/td][td]UTC[/td][td] [/td][/tr] @@ -97,4 +97,4 @@ [/td][/tr] [/table] -Return to [zrl=[baseurl]/help/database]database documentation[/zrl] \ No newline at end of file +Return to [zrl=[baseurl]/help/database]database documentation[/zrl] -- cgit v1.2.3 From 93e5449c0843494c49ae799fa044299ca5cdeb6d Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 12 Nov 2015 20:22:36 -0800 Subject: really basic photo album widget for content regions --- doc/Widgets.md | 7 +++++ include/widgets.php | 78 ++++++++++++++++++++++++++++++++++++++++++++++++ view/tpl/photo_album.tpl | 2 ++ 3 files changed, 87 insertions(+) diff --git a/doc/Widgets.md b/doc/Widgets.md index 7acd9241b..7c506dea7 100644 --- a/doc/Widgets.md +++ b/doc/Widgets.md @@ -108,6 +108,13 @@ Some/many of these widgets have restrictions which may restrict the type of page
 
+* album - provides a widget containing a complete photo album from albums belonging to the page owner; this may be too large to present in a sidebar region as is best implemented as a content region widget. + * args: + * album - album name + * title - optional title, album name is used if not present +
 
+ + Creating New Widgets ==================== diff --git a/include/widgets.php b/include/widgets.php index 0f61a04a0..5a135ae52 100644 --- a/include/widgets.php +++ b/include/widgets.php @@ -1221,3 +1221,81 @@ function widget_admin($arr) { return $o; } + + + +function widget_album($args) { + + $owner_uid = get_app()->profile_uid; + $sql_extra = permissions_sql($owner_uid); + + if($args['album']) + $album = $args['album']; + if($args['title']) + $title = $args['title']; + + $order = 'DESC'; + + $r = q("SELECT p.resource_id, p.id, p.filename, p.type, p.scale, p.description, p.created FROM photo p INNER JOIN + (SELECT resource_id, max(scale) scale FROM photo WHERE uid = %d AND album = '%s' AND scale <= 4 AND photo_usage IN ( %d, %d ) $sql_extra GROUP BY resource_id) ph + ON (p.resource_id = ph.resource_id AND p.scale = ph.scale) + ORDER BY created $order ", + intval($owner_uid), + dbesc($album), + intval(PHOTO_NORMAL), + intval(PHOTO_PROFILE) + ); + + //edit album name + $album_edit = null; + + + $photos = array(); + if($r) { + $twist = 'rotright'; + foreach($r as $rr) { + + if($twist == 'rotright') + $twist = 'rotleft'; + else + $twist = 'rotright'; + + $ext = $phototypes[$rr['type']]; + + $imgalt_e = $rr['filename']; + $desc_e = $rr['description']; + + $imagelink = (z_root() . '/photos/' . get_app()->profile['channel_address'] . '/image/' . $rr['resource_id']); + + + $photos[] = array( + 'id' => $rr['id'], + 'twist' => ' ' . $twist . rand(2,4), + 'link' => $imagelink, + 'title' => t('View Photo'), + 'src' => z_root() . '/photo/' . $rr['resource_id'] . '-' . $rr['scale'] . '.' .$ext, + 'alt' => $imgalt_e, + 'desc'=> $desc_e, + 'ext' => $ext, + 'hash'=> $rr['resource_id'], + 'unknown' => t('Unknown') + ); + } + } + + + $tpl = get_markup_template('photo_album.tpl'); + $o .= replace_macros($tpl, array( + '$photos' => $photos, + '$album' => (($title) ? $title : $album), + '$album_edit' => array(t('Edit Album'), $album_edit), + '$can_post' => false, + '$upload' => array(t('Upload'), z_root() . '/photos/' . get_app()->profile['channel_address'] . '/upload/' . bin2hex($album)), + '$order' => false, + '$upload_form' => $upload_form, + '$usage' => $usage_message + )); + + return $o; +} + diff --git a/view/tpl/photo_album.tpl b/view/tpl/photo_album.tpl index d22f82f8e..bbcdcefc1 100755 --- a/view/tpl/photo_album.tpl +++ b/view/tpl/photo_album.tpl @@ -1,7 +1,9 @@
+ {{if $order}} + {{/if}}
{{if $album_edit.1}} -- cgit v1.2.3