aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG2
-rw-r--r--Zotlabs/Lib/Img_filesize.php122
-rw-r--r--Zotlabs/Module/Admin/Site.php10
-rw-r--r--Zotlabs/Module/Api.php10
-rw-r--r--Zotlabs/Module/Apps.php5
-rw-r--r--Zotlabs/Module/Dirsearch.php2
-rw-r--r--Zotlabs/Module/Feed.php9
-rw-r--r--Zotlabs/Module/Hq.php33
-rw-r--r--Zotlabs/Module/Ofeed.php9
-rw-r--r--Zotlabs/Module/Owa.php22
-rw-r--r--Zotlabs/Thumbs/Video.php1
-rw-r--r--Zotlabs/Widget/Forums.php4
-rw-r--r--Zotlabs/Widget/Notifications.php1
-rw-r--r--app/articles.apd2
-rw-r--r--app/cards.apd2
-rw-r--r--app/webpages.apd2
-rw-r--r--app/wiki.apd2
-rwxr-xr-xboot.php1
-rw-r--r--include/event.php6
-rw-r--r--include/feedutils.php9
-rw-r--r--include/import.php2
-rwxr-xr-xinclude/items.php7
-rw-r--r--include/socgraph.php3
-rw-r--r--include/taxonomy.php19
-rw-r--r--include/zid.php4
-rw-r--r--view/css/widgets.css3
l---------view/de1
-rw-r--r--view/de-de/hmessages.po (renamed from view/de/hmessages.po)0
-rw-r--r--view/de-de/hstrings.php (renamed from view/de/hstrings.php)0
-rw-r--r--view/de-de/htconfig.tpl (renamed from view/de/htconfig.tpl)0
-rw-r--r--view/de-de/lostpass_eml.tpl (renamed from view/de/lostpass_eml.tpl)0
-rw-r--r--view/de-de/messages.po (renamed from view/de/messages.po)0
-rw-r--r--view/de-de/passchanged_eml.tpl (renamed from view/de/passchanged_eml.tpl)0
-rw-r--r--view/de-de/register_open_eml.tpl (renamed from view/de/register_open_eml.tpl)0
-rw-r--r--view/de-de/register_verify_eml.tpl (renamed from view/de/register_verify_eml.tpl)0
-rw-r--r--view/de-de/strings.php (renamed from view/de/strings.php)0
-rw-r--r--view/de-de/update_fail_eml.tpl (renamed from view/de/update_fail_eml.tpl)0
-rw-r--r--view/js/acl.js6
-rw-r--r--view/js/main.js9
-rwxr-xr-xview/tpl/admin_site.tpl3
-rwxr-xr-xview/tpl/hq.tpl7
-rwxr-xr-xview/tpl/myapps.tpl4
-rw-r--r--view/tpl/notifications_widget.tpl5
43 files changed, 250 insertions, 77 deletions
diff --git a/CHANGELOG b/CHANGELOG
index d84b8fe4a..6e540a04d 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,4 @@
-Hubzilla 3.0 (????-??-??)
+Hubzilla 3.0 (2018-01-09)
- Updated homeinstall script
- Sort cloud directory by 1. is_dir and 2. name
- Document that imagick calls/execs ffmpeg for mp4 video thumbnails
diff --git a/Zotlabs/Lib/Img_filesize.php b/Zotlabs/Lib/Img_filesize.php
new file mode 100644
index 000000000..196697733
--- /dev/null
+++ b/Zotlabs/Lib/Img_filesize.php
@@ -0,0 +1,122 @@
+<?php
+
+namespace Zotlabs\Lib;
+
+class Img_filesize {
+
+ private $url;
+
+ function __construct($url) {
+ $this->url = $url;
+ }
+
+ function getSize() {
+ $size = null;
+
+ if(stripos($this->url,z_root() . '/photo') !== false) {
+ $size = self::getLocalFileSize($this->url);
+ }
+ if(! $size) {
+ $size = getRemoteFileSize($this->url);
+ }
+
+ return $size;
+ }
+
+
+ static function getLocalFileSize($url) {
+
+ $fname = basename($url);
+ $resolution = 0;
+
+ if(strpos($fname,'.') !== false)
+ $fname = substr($fname,0,strpos($fname,'.'));
+
+ if(substr($fname,-2,1) == '-') {
+ $resolution = intval(substr($fname,-1,1));
+ $fname = substr($fname,0,-2);
+ }
+
+ $r = q("SELECT filesize FROM photo WHERE resource_id = '%s' AND imgscale = %d LIMIT 1",
+ dbesc($fname),
+ intval($resolution)
+ );
+ if($r) {
+ return $r[0]['filesize'];
+ }
+ return null;
+ }
+
+}
+
+/**
+ * Try to determine the size of a remote file by making an HTTP request for
+ * a byte range, or look for the content-length header in the response.
+ * The function aborts the transfer as soon as the size is found, or if no
+ * length headers are returned, it aborts the transfer.
+ *
+ * @return int|null null if size could not be determined, or length of content
+ */
+function getRemoteFileSize($url)
+{
+ $ch = curl_init($url);
+
+ $headers = array(
+ 'Range: bytes=0-1',
+ 'Connection: close',
+ );
+
+ $in_headers = true;
+ $size = null;
+
+ curl_setopt($ch, CURLOPT_HEADER, 1);
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+ curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2450.0 Iron/46.0.2450.0');
+ curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
+ curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
+ curl_setopt($ch, CURLOPT_VERBOSE, 0); // set to 1 to debug
+ curl_setopt($ch, CURLOPT_STDERR, fopen('php://output', 'r'));
+
+ curl_setopt($ch, CURLOPT_HEADERFUNCTION, function($curl, $line) use (&$in_headers, &$size) {
+ $length = strlen($line);
+
+ if (trim($line) == '') {
+ $in_headers = false;
+ }
+
+ list($header, $content) = explode(':', $line, 2);
+ $header = strtolower(trim($header));
+
+ if ($header == 'content-range') {
+ // found a content-range header
+ list($rng, $s) = explode('/', $content, 2);
+ $size = (int)$s;
+ return 0; // aborts transfer
+ } else if ($header == 'content-length' && 206 != curl_getinfo($curl, CURLINFO_HTTP_CODE)) {
+ // found content-length header and this is not a 206 Partial Content response (range response)
+ $size = (int)$content;
+ return 0;
+ } else {
+ // continue
+ return $length;
+ }
+ });
+
+ curl_setopt($ch, CURLOPT_WRITEFUNCTION, function($curl, $data) use ($in_headers) {
+ if (!$in_headers) {
+ // shouldn't be here unless we couldn't determine file size
+ // abort transfer
+ return 0;
+ }
+
+ // write function is also called when reading headers
+ return strlen($data);
+ });
+
+ curl_exec($ch);
+ curl_getinfo($ch);
+ curl_close($ch);
+
+ return $size;
+} \ No newline at end of file
diff --git a/Zotlabs/Module/Admin/Site.php b/Zotlabs/Module/Admin/Site.php
index a9db1ad55..50756c654 100644
--- a/Zotlabs/Module/Admin/Site.php
+++ b/Zotlabs/Module/Admin/Site.php
@@ -35,6 +35,8 @@ class Site {
$abandon_days = ((x($_POST,'abandon_days')) ? intval(trim($_POST['abandon_days'])) : 0);
$register_text = ((x($_POST,'register_text')) ? notags(trim($_POST['register_text'])) : '');
+ $site_sellpage = ((x($_POST,'site_sellpage')) ? notags(trim($_POST['site_sellpage'])) : '');
+ $site_location = ((x($_POST,'site_location')) ? notags(trim($_POST['site_location'])) : '');
$frontpage = ((x($_POST,'frontpage')) ? notags(trim($_POST['frontpage'])) : '');
$mirror_frontpage = ((x($_POST,'mirror_frontpage')) ? intval(trim($_POST['mirror_frontpage'])) : 0);
$directory_server = ((x($_POST,'directory_server')) ? trim($_POST['directory_server']) : '');
@@ -76,6 +78,8 @@ class Site {
set_config('system', 'poll_interval', $poll_interval);
set_config('system', 'maxloadavg', $maxloadavg);
set_config('system', 'frontpage', $frontpage);
+ set_config('system', 'sellpage', $site_sellpage);
+ set_config('system', 'site_location', $site_location);
set_config('system', 'mirror_frontpage', $mirror_frontpage);
set_config('system', 'sitename', $sitename);
set_config('system', 'login_on_homepage', $login_on_homepage);
@@ -328,6 +332,12 @@ class Site {
'$thumbnail_security' => array('thumbnail_security', t("Allow SVG thumbnails in file browser"), get_config('system','thumbnail_security',0), t("WARNING: SVG images may contain malicious code.")),
'$maxloadavg' => array('maxloadavg', t("Maximum Load Average"), ((intval(get_config('system','maxloadavg')) > 0)?get_config('system','maxloadavg'):50), t("Maximum system load before delivery and poll processes are deferred - default 50.")),
'$default_expire_days' => array('default_expire_days', t('Expiration period in days for imported (grid/network) content'), intval(get_config('system','default_expire_days')), t('0 for no expiration of imported content')),
+
+ '$sellpage' => array('site_sellpage', t('Public servers: Optional landing (marketing) webpage for new registrants'), get_config('system','sellpage',''), sprintf( t('Create this page first. Default is %s/register'),z_root())),
+
+ '$location' => array('site_location', t('Optional: site location'), get_config('system','site_location',''), t('Region or country')),
+
+
'$form_security_token' => get_form_security_token("admin_site"),
));
}
diff --git a/Zotlabs/Module/Api.php b/Zotlabs/Module/Api.php
index a2a1aac1d..aa0fca54d 100644
--- a/Zotlabs/Module/Api.php
+++ b/Zotlabs/Module/Api.php
@@ -39,10 +39,12 @@ class Api extends \Zotlabs\Web\Controller {
// get consumer/client from request token
try {
- $request = OAuth1Request::from_request();
+ $request = \OAuth1Request::from_request();
}
catch(\Exception $e) {
- echo "<pre>"; var_dump($e); killme();
+ logger('OAuth exception: ' . print_r($e,true));
+ // echo "<pre>"; var_dump($e);
+ killme();
}
@@ -52,7 +54,7 @@ class Api extends \Zotlabs\Web\Controller {
if (is_null($app))
return "Invalid request. Unknown token.";
- $consumer = new OAuth1Consumer($app['client_id'], $app['pw'], $app['redirect_uri']);
+ $consumer = new \OAuth1Consumer($app['client_id'], $app['pw'], $app['redirect_uri']);
$verifier = md5($app['secret'] . local_channel());
set_config('oauth', $verifier, local_channel());
@@ -63,7 +65,7 @@ class Api extends \Zotlabs\Web\Controller {
$glue = '?';
if(strstr($consumer->callback_url,$glue))
$glue = '?';
- goaway($consumer->callback_url . $glue . "oauth_token=" . OAuth1Util::urlencode_rfc3986($params['oauth_token']) . "&oauth_verifier=" . OAuth1Util::urlencode_rfc3986($verifier));
+ goaway($consumer->callback_url . $glue . "oauth_token=" . \OAuth1Util::urlencode_rfc3986($params['oauth_token']) . "&oauth_verifier=" . \OAuth1Util::urlencode_rfc3986($verifier));
killme();
}
diff --git a/Zotlabs/Module/Apps.php b/Zotlabs/Module/Apps.php
index 2f61f2932..c672ea467 100644
--- a/Zotlabs/Module/Apps.php
+++ b/Zotlabs/Module/Apps.php
@@ -22,7 +22,8 @@ class Apps extends \Zotlabs\Web\Controller {
if(local_channel()) {
Zlib\Apps::import_system_apps();
$syslist = array();
- $list = Zlib\Apps::app_list(local_channel(), (($mode == 'edit') ? true : false), $_GET['cat']);
+ $cat = ((array_key_exists('cat',$_GET) && $_GET['cat']) ? [ escape_tags($_GET['cat']) ] : '');
+ $list = Zlib\Apps::app_list(local_channel(), (($mode == 'edit') ? true : false), $cat);
if($list) {
foreach($list as $x) {
$syslist[] = Zlib\Apps::app_encode($x);
@@ -43,7 +44,7 @@ class Apps extends \Zotlabs\Web\Controller {
return replace_macros(get_markup_template('myapps.tpl'), array(
'$sitename' => get_config('system','sitename'),
- '$cat' => ((array_key_exists('cat',$_GET) && $_GET['cat']) ? escape_tags($_GET['cat']) : ''),
+ '$cat' => $cat,
'$title' => t('Apps'),
'$apps' => $apps,
'$authed' => ((local_channel()) ? true : false),
diff --git a/Zotlabs/Module/Dirsearch.php b/Zotlabs/Module/Dirsearch.php
index e6cf5449a..53ec1a850 100644
--- a/Zotlabs/Module/Dirsearch.php
+++ b/Zotlabs/Module/Dirsearch.php
@@ -313,7 +313,7 @@ class Dirsearch extends \Zotlabs\Web\Controller {
$ret['results'] = $entries;
if($kw) {
- $k = dir_tagadelic($kw);
+ $k = dir_tagadelic($kw, $hub);
if($k) {
$ret['keywords'] = array();
foreach($k as $kv) {
diff --git a/Zotlabs/Module/Feed.php b/Zotlabs/Module/Feed.php
index 06637b6d2..36869abbe 100644
--- a/Zotlabs/Module/Feed.php
+++ b/Zotlabs/Module/Feed.php
@@ -16,12 +16,15 @@ class Feed extends \Zotlabs\Web\Controller {
$params['type'] = ((stristr(argv(0),'json')) ? 'json' : 'xml');
$params['pages'] = ((x($_REQUEST,'pages')) ? intval($_REQUEST['pages']) : 0);
$params['top'] = ((x($_REQUEST,'top')) ? intval($_REQUEST['top']) : 0);
- $params['start'] = ((x($params,'start')) ? intval($params['start']) : 0);
- $params['records'] = ((x($params,'records')) ? intval($params['records']) : 40);
- $params['direction'] = ((x($params,'direction')) ? dbesc($params['direction']) : 'desc');
+ $params['start'] = ((x($_REQUEST,'start')) ? intval($_REQUEST['start']) : 0);
+ $params['records'] = ((x($_REQUEST,'records')) ? intval($_REQUEST['records']) : 40);
+ $params['direction'] = ((x($_REQUEST,'direction')) ? dbesc($_REQUEST['direction']) : 'desc');
$params['cat'] = ((x($_REQUEST,'cat')) ? escape_tags($_REQUEST['cat']) : '');
$params['compat'] = ((x($_REQUEST,'compat')) ? intval($_REQUEST['compat']) : 0);
+ if(! in_array($params['direction'],['asc','desc'])) {
+ $params['direction'] = 'desc';
+ }
if(argc() > 1) {
diff --git a/Zotlabs/Module/Hq.php b/Zotlabs/Module/Hq.php
index 1e46a6353..ec3858471 100644
--- a/Zotlabs/Module/Hq.php
+++ b/Zotlabs/Module/Hq.php
@@ -51,8 +51,8 @@ class Hq extends \Zotlabs\Web\Controller {
if(! $item_hash) {
$r = q("SELECT mid FROM item
- WHERE uid = %d
- AND mid = parent_mid
+ WHERE uid = %d $item_normal
+ AND item_unseen = 1
ORDER BY created DESC LIMIT 1",
intval(local_channel())
);
@@ -135,13 +135,11 @@ class Hq extends \Zotlabs\Web\Controller {
$o = replace_macros(get_markup_template("hq.tpl"),
[
'$no_messages' => (($target_item) ? false : true),
- '$no_messages_label' => t('Welcome to hubzilla!')
+ '$no_messages_label' => [ t('Welcome to Hubzilla!'), t('You have got no unseen activity...') ],
+ '$editor' => status_editor($a,$x)
]
);
-
- $o = '<div id="jot-popup">';
- $o .= status_editor($a,$x);
- $o .= '</div>';
+
}
if(! $update && ! $load) {
@@ -266,23 +264,20 @@ class Hq extends \Zotlabs\Web\Controller {
}
if($r) {
- $parents_str = ids_to_querystr($r,'item_id');
- if($parents_str) {
- $items = q("SELECT item.*, item.id AS item_id
- FROM item
- WHERE parent IN ( %s ) $item_normal ",
- dbesc($parents_str)
- );
+ $items = q("SELECT item.*, item.id AS item_id
+ FROM item
+ WHERE parent = '%s' $item_normal ",
+ dbesc($r[0]['item_id'])
+ );
- xchan_query($items,true,(($sys_item) ? local_channel() : 0));
- $items = fetch_post_tags($items,true);
- $items = conv_sort($items,'created');
- }
+ xchan_query($items,true,(($sys_item) ? local_channel() : 0));
+ $items = fetch_post_tags($items,true);
+ $items = conv_sort($items,'created');
}
else {
$items = [];
}
-
+
$o .= conversation($items, 'hq', $update, 'client');
if($updateable) {
diff --git a/Zotlabs/Module/Ofeed.php b/Zotlabs/Module/Ofeed.php
index 58488d4af..d18a43ae5 100644
--- a/Zotlabs/Module/Ofeed.php
+++ b/Zotlabs/Module/Ofeed.php
@@ -17,12 +17,15 @@ class Ofeed extends \Zotlabs\Web\Controller {
$params['type'] = ((stristr(argv(0),'json')) ? 'json' : 'xml');
$params['pages'] = ((x($_REQUEST,'pages')) ? intval($_REQUEST['pages']) : 0);
$params['top'] = ((x($_REQUEST,'top')) ? intval($_REQUEST['top']) : 0);
- $params['start'] = ((x($params,'start')) ? intval($params['start']) : 0);
- $params['records'] = ((x($params,'records')) ? intval($params['records']) : 10);
- $params['direction'] = ((x($params,'direction')) ? dbesc($params['direction']) : 'desc');
+ $params['start'] = ((x($_REQUEST,'start')) ? intval($_REQUEST['start']) : 0);
+ $params['records'] = ((x($_REQUEST,'records')) ? intval($_REQUEST['records']) : 10);
+ $params['direction'] = ((x($_REQUEST,'direction')) ? dbesc($_REQUEST['direction']) : 'desc');
$params['cat'] = ((x($_REQUEST,'cat')) ? escape_tags($_REQUEST['cat']) : '');
$params['compat'] = ((x($_REQUEST,'compat')) ? intval($_REQUEST['compat']) : 1);
+ if(! in_array($params['direction'],['asc','desc'])) {
+ $params['direction'] = 'desc';
+ }
if(argc() > 1) {
diff --git a/Zotlabs/Module/Owa.php b/Zotlabs/Module/Owa.php
index d58fd7a41..9a39fe4c0 100644
--- a/Zotlabs/Module/Owa.php
+++ b/Zotlabs/Module/Owa.php
@@ -31,19 +31,21 @@ class Owa extends \Zotlabs\Web\Controller {
if($keyId) {
$r = q("select * from hubloc left join xchan on hubloc_hash = xchan_hash
- where hubloc_addr = '%s' limit 1",
+ where hubloc_addr = '%s' ",
dbesc(str_replace('acct:','',$keyId))
);
if($r) {
- $hubloc = $r[0];
- $verified = \Zotlabs\Web\HTTPSig::verify('',$hubloc['xchan_pubkey']);
- if($verified && $verified['header_signed'] && $verified['header_valid']) {
- $ret['success'] = true;
- $token = random_string(32);
- \Zotlabs\Zot\Verify::create('owt',0,$token,$r[0]['hubloc_addr']);
- $result = '';
- openssl_public_encrypt($token,$result,$hubloc['xchan_pubkey']);
- $ret['encrypted_token'] = base64url_encode($result);
+ foreach($r as $hubloc) {
+ $verified = \Zotlabs\Web\HTTPSig::verify('',$hubloc['xchan_pubkey']);
+ if($verified && $verified['header_signed'] && $verified['header_valid']) {
+ $ret['success'] = true;
+ $token = random_string(32);
+ \Zotlabs\Zot\Verify::create('owt',0,$token,$r[0]['hubloc_addr']);
+ $result = '';
+ openssl_public_encrypt($token,$result,$hubloc['xchan_pubkey']);
+ $ret['encrypted_token'] = base64url_encode($result);
+ break;
+ }
}
}
}
diff --git a/Zotlabs/Thumbs/Video.php b/Zotlabs/Thumbs/Video.php
index 05127355e..ff4d10a36 100644
--- a/Zotlabs/Thumbs/Video.php
+++ b/Zotlabs/Thumbs/Video.php
@@ -49,6 +49,7 @@ class Video {
$cmd = $imagick_path . ' ' . escapeshellarg(PROJECT_BASE . '/' . $tmpfile . '[0]') . ' -thumbnail ' . $width . 'x' . $height . ' ' . escapeshellarg(PROJECT_BASE . '/' . $outfile);
// logger('imagick thumbnail command: ' . $cmd);
+ /** @scrutinizer ignore-unhandled */
@exec($cmd);
if(! file_exists($outfile)) {
diff --git a/Zotlabs/Widget/Forums.php b/Zotlabs/Widget/Forums.php
index 91b987746..0b90b9740 100644
--- a/Zotlabs/Widget/Forums.php
+++ b/Zotlabs/Widget/Forums.php
@@ -11,8 +11,8 @@ class Forums {
$o = '';
- if(is_array($arr) && array_key_exists('limit',$arr))
- $limit = " limit " . intval($limit) . " ";
+ if(is_array($arr) && array_key_exists('limit',$arr) && intval($arr['limit']) >= 0)
+ $limit = " limit " . intval($arr['limit']) . " ";
else
$limit = '';
diff --git a/Zotlabs/Widget/Notifications.php b/Zotlabs/Widget/Notifications.php
index a677d84c9..5a0c1f3d5 100644
--- a/Zotlabs/Widget/Notifications.php
+++ b/Zotlabs/Widget/Notifications.php
@@ -144,6 +144,7 @@ class Notifications {
$o = replace_macros(get_markup_template('notifications_widget.tpl'), array(
'$module' => \App::$module,
'$notifications' => $notifications,
+ '$no_notifications' => t('Sorry, you have got no notifications at the moment'),
'$loading' => t('Loading')
));
diff --git a/app/articles.apd b/app/articles.apd
index eec9cda0a..74e86415b 100644
--- a/app/articles.apd
+++ b/app/articles.apd
@@ -3,4 +3,4 @@ url: $baseurl/articles/$nick
name: Articles
requires: local_channel, articles
photo: icon:file-text-o
-categories: Productivity
+categories: nav_featured_app, Productivity
diff --git a/app/cards.apd b/app/cards.apd
index 047aaeac9..8e2762ff8 100644
--- a/app/cards.apd
+++ b/app/cards.apd
@@ -3,4 +3,4 @@ url: $baseurl/cards/$nick
name: Cards
requires: local_channel, cards
photo: icon:list
-categories: Productivity
+categories: nav_featured_app, Productivity
diff --git a/app/webpages.apd b/app/webpages.apd
index b00e55cc4..46c6cdb5d 100644
--- a/app/webpages.apd
+++ b/app/webpages.apd
@@ -3,4 +3,4 @@ url: $baseurl/webpages/$nick
requires: local_channel, webpages
name: Webpages
photo: icon:newspaper-o
-categories: Productivity
+categories: nav_featured_app, Productivity
diff --git a/app/wiki.apd b/app/wiki.apd
index 1110f0cc4..48fcbe0c1 100644
--- a/app/wiki.apd
+++ b/app/wiki.apd
@@ -3,4 +3,4 @@ url: $baseurl/wiki/$nick
requires: local_channel, wiki
name: Wiki
photo: icon:pencil-square-o
-categories: Productivity
+categories: nav_featured_app, Productivity
diff --git a/boot.php b/boot.php
index 99274019c..bfe86f767 100755
--- a/boot.php
+++ b/boot.php
@@ -48,6 +48,7 @@ require_once('include/zid.php');
require_once('include/xchan.php');
require_once('include/hubloc.php');
require_once('include/attach.php');
+require_once('include/bbcode.php');
define ( 'PLATFORM_NAME', 'hubzilla' );
define ( 'STD_VERSION', '3.1.1' );
diff --git a/include/event.php b/include/event.php
index 282c1a9d7..c1cf59425 100644
--- a/include/event.php
+++ b/include/event.php
@@ -6,6 +6,8 @@
use Sabre\VObject;
+require_once('include/bbcode.php');
+
/**
* @brief Returns an event as HTML.
*
@@ -14,7 +16,6 @@ use Sabre\VObject;
*/
function format_event_html($ev) {
- require_once('include/bbcode.php');
if(! ((is_array($ev)) && count($ev)))
return '';
@@ -192,7 +193,7 @@ function format_todo_ical($ev) {
function format_ical_text($s) {
- require_once('include/bbcode.php');
+
require_once('include/html2plain.php');
$s = html2plain(bbcode($s));
@@ -983,7 +984,6 @@ function event_store_item($arr, $event) {
require_once('include/datetime.php');
require_once('include/items.php');
- require_once('include/bbcode.php');
$item = null;
diff --git a/include/feedutils.php b/include/feedutils.php
index 4638ef66a..5e48cb1ee 100644
--- a/include/feedutils.php
+++ b/include/feedutils.php
@@ -1801,12 +1801,17 @@ function compat_photos_list($s) {
if($found) {
foreach($matches as $match) {
- $ret[] = [
+ $entry = [
'href' => $match[2],
- 'length' => 0,
'type' => guess_image_type($match[2])
];
+ $sizer = new \Zotlabs\Lib\Img_filesize($match[2]);
+ $size = $sizer->getSize();
+ if(intval($size)) {
+ $entry['length'] = intval($size);
+ }
+ $ret[] = $entry;
}
}
diff --git a/include/import.php b/include/import.php
index 5a655ce4c..51791347a 100644
--- a/include/import.php
+++ b/include/import.php
@@ -184,7 +184,7 @@ function import_profiles($channel, $profiles) {
*
* @param array $channel
* @param array $hublocs
- * @param unknown $seize
+ * @param boolean $seize
* @param boolean $moving (optional) default false
*/
function import_hublocs($channel, $hublocs, $seize, $moving = false) {
diff --git a/include/items.php b/include/items.php
index 722757f87..d0b9cffc9 100755
--- a/include/items.php
+++ b/include/items.php
@@ -4063,8 +4063,9 @@ function items_fetch($arr,$channel = null,$observer_hash = null,$client_mode = C
$item_uids = ' true ';
$item_normal = item_normal();
-
- if ($arr['uid']) $uid= $arr['uid'];
+ if($arr['uid']) {
+ $uid = $arr['uid'];
+ }
if($channel) {
$uid = $channel['channel_id'];
@@ -4226,7 +4227,7 @@ function items_fetch($arr,$channel = null,$observer_hash = null,$client_mode = C
$items = q("SELECT item.*, item.id AS item_id FROM item
WHERE $item_uids $item_restrict
$simple_update
- $sql_extra $sql_nets
+ $sql_extra $sql_nets $sql_extra3
ORDER BY item.received DESC $pager_sql"
);
diff --git a/include/socgraph.php b/include/socgraph.php
index 26446d9c7..87a880202 100644
--- a/include/socgraph.php
+++ b/include/socgraph.php
@@ -178,11 +178,12 @@ function poco_load($xchan = '', $url = null) {
);
if(! $r) {
- q("insert into xlink ( xlink_xchan, xlink_link, xlink_rating, xlink_rating_text, xlink_updated, xlink_static ) values ( '%s', '%s', %d, '%s', '%s', 0 ) ",
+ q("insert into xlink ( xlink_xchan, xlink_link, xlink_rating, xlink_rating_text, xlink_sig, xlink_updated, xlink_static ) values ( '%s', '%s', %d, '%s', '%s', '%s', 0 ) ",
dbesc($xchan),
dbesc($hash),
intval(0),
dbesc(''),
+ dbesc(''),
dbesc(datetime_convert())
);
}
diff --git a/include/taxonomy.php b/include/taxonomy.php
index a646df28c..278925391 100644
--- a/include/taxonomy.php
+++ b/include/taxonomy.php
@@ -309,19 +309,27 @@ function article_tagadelic($uid, $count = 0, $authors = '', $owner = '', $flags
-function dir_tagadelic($count = 0) {
+function dir_tagadelic($count = 0, $hub = '') {
$count = intval($count);
$dirmode = get_config('system','directory_mode');
- if($dirmode == DIRECTORY_MODE_STANDALONE) {
+ if(($dirmode == DIRECTORY_MODE_STANDALONE) && (! $hub)) {
+ $hub = \App::get_hostname();
+ }
+
+ if($hub)
+ $hub_query = " and xtag_hash in (select hubloc_hash from hubloc where hubloc_host = '" . protect_sprintf(dbesc($hub)) . "') ";
+ else
+ $hub_query = '';
+
+ if($hub_query) {
// Fetch tags
$r = q("select xtag_term as term, count(xtag_term) as total from xtag
left join hubloc on xtag_hash = hubloc_hash
- where xtag_flags = 0 and hubloc_url = '%s'
+ where xtag_flags = 0 $hub_query
group by xtag_term order by total desc %s",
- dbesc(z_root()),
((intval($count)) ? "limit $count" : '')
);
}
@@ -485,9 +493,6 @@ function dir_tagblock($link,$r) {
$o = '';
$observer = get_observer_hash();
- if(! get_directory_setting($observer, 'globaldir'))
- return $o;
-
if(! $r)
$r = App::$data['directory_keywords'];
diff --git a/include/zid.php b/include/zid.php
index d1a0fa88a..6ebc9a6ab 100644
--- a/include/zid.php
+++ b/include/zid.php
@@ -105,8 +105,8 @@ function strip_zats($s) {
-function clean_query_string() {
- $x = strip_zids(\App::$query_string);
+function clean_query_string($s = '') {
+ $x = strip_zids(($s) ? $s : \App::$query_string);
$x = strip_owt($x);
$x = strip_zats($x);
diff --git a/view/css/widgets.css b/view/css/widgets.css
index 5b1273e25..76e829b04 100644
--- a/view/css/widgets.css
+++ b/view/css/widgets.css
@@ -170,6 +170,9 @@ a.wikilist {
}
/* notifications */
+.notifications-btn {
+ opacity: .5;
+}
.notification-content {
max-height: 70vh;
diff --git a/view/de b/view/de
new file mode 120000
index 000000000..47f12ca72
--- /dev/null
+++ b/view/de
@@ -0,0 +1 @@
+de-de \ No newline at end of file
diff --git a/view/de/hmessages.po b/view/de-de/hmessages.po
index e7c962bbd..e7c962bbd 100644
--- a/view/de/hmessages.po
+++ b/view/de-de/hmessages.po
diff --git a/view/de/hstrings.php b/view/de-de/hstrings.php
index 61db3fb5d..61db3fb5d 100644
--- a/view/de/hstrings.php
+++ b/view/de-de/hstrings.php
diff --git a/view/de/htconfig.tpl b/view/de-de/htconfig.tpl
index 46bf0de14..46bf0de14 100644
--- a/view/de/htconfig.tpl
+++ b/view/de-de/htconfig.tpl
diff --git a/view/de/lostpass_eml.tpl b/view/de-de/lostpass_eml.tpl
index 02a71b77a..02a71b77a 100644
--- a/view/de/lostpass_eml.tpl
+++ b/view/de-de/lostpass_eml.tpl
diff --git a/view/de/messages.po b/view/de-de/messages.po
index 460fd764b..460fd764b 100644
--- a/view/de/messages.po
+++ b/view/de-de/messages.po
diff --git a/view/de/passchanged_eml.tpl b/view/de-de/passchanged_eml.tpl
index 95805f677..95805f677 100644
--- a/view/de/passchanged_eml.tpl
+++ b/view/de-de/passchanged_eml.tpl
diff --git a/view/de/register_open_eml.tpl b/view/de-de/register_open_eml.tpl
index ce96d2ec6..ce96d2ec6 100644
--- a/view/de/register_open_eml.tpl
+++ b/view/de-de/register_open_eml.tpl
diff --git a/view/de/register_verify_eml.tpl b/view/de-de/register_verify_eml.tpl
index 4da21265d..4da21265d 100644
--- a/view/de/register_verify_eml.tpl
+++ b/view/de-de/register_verify_eml.tpl
diff --git a/view/de/strings.php b/view/de-de/strings.php
index 85bff2451..85bff2451 100644
--- a/view/de/strings.php
+++ b/view/de-de/strings.php
diff --git a/view/de/update_fail_eml.tpl b/view/de-de/update_fail_eml.tpl
index d28bed717..d28bed717 100644
--- a/view/de/update_fail_eml.tpl
+++ b/view/de-de/update_fail_eml.tpl
diff --git a/view/js/acl.js b/view/js/acl.js
index 6042b43ca..c8f7c7180 100644
--- a/view/js/acl.js
+++ b/view/js/acl.js
@@ -173,11 +173,7 @@ ACL.prototype.on_custom = function(event) {
that.deny_cid = [];
that.deny_gid = [];
- $("#acl-list-content .acl-list-item img[data-src]").each(function(i, el) {
- //Replace data-src attribute with src attribute for every image
- $(el).attr('src', $(el).data("src"));
- $(el).removeAttr("data-src");
- });
+ datasrc2src('#acl-list-content .acl-list-item img[data-src]');
that.update_view('custom');
that.on_submit();
diff --git a/view/js/main.js b/view/js/main.js
index 11a09b647..77b8e91e7 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -92,6 +92,13 @@ $(document).ready(function() {
});
+function datasrc2src(selector) {
+ $(selector).each(function(i, el) {
+ $(el).attr("src", $(el).data("src"));
+ $(el).removeAttr("data-src");
+ });
+}
+
function confirmDelete() {
return confirm(aStr.delitem);
}
@@ -373,10 +380,12 @@ function notificationsUpdate() {
if(data.network || data.home || data.intros || data.register || data.mail || data.all_events || data.notify || data.files || data.pubs) {
$('.notifications-btn').css('opacity', 1);
+ $('#no_notifications').hide();
}
else {
$('.notifications-btn').css('opacity', 0.5);
$('#navbar-collapse-1').removeClass('show');
+ $('#no_notifications').show();
}
if(data.home || data.intros || data.register || data.mail || data.notify || data.files) {
diff --git a/view/tpl/admin_site.tpl b/view/tpl/admin_site.tpl
index a2a9f3f27..2b4e8c9f9 100755
--- a/view/tpl/admin_site.tpl
+++ b/view/tpl/admin_site.tpl
@@ -71,6 +71,9 @@
{{include file="field_select.tpl" field=$register_policy}}
{{include file="field_checkbox.tpl" field=$invite_only}}
{{include file="field_select.tpl" field=$access_policy}}
+ {{include file="field_input.tpl" field=$location}}
+ {{include file="field_input.tpl" field=$sellpage}}
+
<div class="submit"><input type="submit" name="page_site" value="{{$submit}}" /></div>
<h3>{{$corporate}}</h3>
diff --git a/view/tpl/hq.tpl b/view/tpl/hq.tpl
index bd27250e6..fce11ff83 100755
--- a/view/tpl/hq.tpl
+++ b/view/tpl/hq.tpl
@@ -1,9 +1,14 @@
{{if $no_messages}}
<div class="alert alert-warning alert-dismissible fade show" role="alert">
- {{$no_messages_label}}
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
+ <h3>{{$no_messages_label.0}}</h3>
+ <br>
+ {{$no_messages_label.1}}
</div>
{{/if}}
+<div id="jot-popup">
+{{$editor}}
+</div>
diff --git a/view/tpl/myapps.tpl b/view/tpl/myapps.tpl
index dd2a67a63..0ac836b38 100755
--- a/view/tpl/myapps.tpl
+++ b/view/tpl/myapps.tpl
@@ -4,10 +4,10 @@
{{if $create}}
<a href="appman" class="pull-right btn btn-success btn-sm"><i class="fa fa-pencil-square-o"></i>&nbsp;{{$create}}</a>
{{else}}
- <a href="apps/edit{{if $cat}}/?f=&cat={{$cat}}{{/if}}" class="pull-right btn btn-primary btn-sm">{{$manage}}</a>
+ <a href="apps/edit{{if $cat.0}}/?f=&cat={{$cat.0}}{{/if}}" class="pull-right btn btn-primary btn-sm">{{$manage}}</a>
{{/if}}
{{/if}}
- <h2>{{$title}}{{if $cat}} - {{$cat}}{{/if}}</h2>
+ <h2>{{$title}}{{if $cat.0}} - {{$cat.0}}{{/if}}</h2>
</div>
<div class="clearfix section-content-wrapper">
{{foreach $apps as $ap}}
diff --git a/view/tpl/notifications_widget.tpl b/view/tpl/notifications_widget.tpl
index 299c07592..9d2e08c41 100644
--- a/view/tpl/notifications_widget.tpl
+++ b/view/tpl/notifications_widget.tpl
@@ -63,7 +63,7 @@
$(document).on('click', '#tt-{{$notification.type}}-only', function(e) {
e.preventDefault();
$('#nav-{{$notification.type}}-menu [data-thread_top=false]').toggle();
- $(this).toggleClass('active');
+ $(this).toggleClass('active sticky-top');
});
{{/if}}
{{/foreach}}
@@ -85,6 +85,9 @@
{{if $notifications}}
<div id="notifications_wrapper">
+ <div id="no_notifications" class="d-xl-none">
+ {{$no_notifications}}<span class="jumping-dots"><span class="dot-1">.</span><span class="dot-2">.</span><span class="dot-3">.</span></span>
+ </div>
<div id="notifications" class="navbar-nav" data-children=".nav-item">
<div id="nav-notifications-template" rel="template">
<a class="list-group-item clearfix notification {5}" href="{0}" title="{2} {3}" data-b64mid="{6}" data-notify_id="{7}" data-thread_top="{8}">