mirror of
https://framagit.org/hubzilla/core.git
synced 2026-06-25 02:29:11 -04:00
Compare commits
41 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
90fd323ac5 | ||
|
|
b6c384a0f7 | ||
|
|
cda8a7be38 | ||
|
|
ddbc35181c | ||
|
|
57dde3e980 | ||
|
|
3eba0c2297 | ||
|
|
414b7e28d3 | ||
|
|
fca464071f | ||
|
|
4f08f4b84c | ||
|
|
1b5175d018 | ||
|
|
0bfda6d4c8 | ||
|
|
880b22604b | ||
|
|
04a2dc075f | ||
|
|
01448c152c | ||
|
|
a09beb3833 | ||
|
|
feda1e6d84 | ||
|
|
4256bea418 | ||
|
|
4d47b098e5 | ||
|
|
163754a46c | ||
|
|
66b56416b6 | ||
|
|
c855346358 | ||
|
|
0e32c86c3d | ||
|
|
19952264c8 | ||
|
|
5ec1e97cae | ||
|
|
5f5746a2f6 | ||
|
|
d0ee6d1ad2 | ||
|
|
06c71eec65 | ||
|
|
aabc6c2825 | ||
|
|
8323458da9 | ||
|
|
d7c7ff1c12 | ||
|
|
d77c7d51e3 | ||
|
|
d51d0160d3 | ||
|
|
c2ad9d4996 | ||
|
|
79f828125d | ||
|
|
ad4b18cbbe | ||
|
|
1bd49671b7 | ||
|
|
9896057549 | ||
|
|
44832bbacb | ||
|
|
f20a923dd7 | ||
|
|
30403da326 | ||
|
|
6b68a76bbe |
30
CHANGELOG
30
CHANGELOG
@@ -1,3 +1,33 @@
|
||||
Hubzilla 3.8.8 (2018-12-22)
|
||||
- Fix issue with linkinfo
|
||||
- Fix cURL with HTTP/2
|
||||
- Remove scale_external_images()
|
||||
- Style highlight bbcode via css
|
||||
- Make mod channel deal with b64 encoded mid's
|
||||
- Fix email retrieval in OAuth2Storage
|
||||
- Add reinstall option to util/addons
|
||||
- Remove deprecated caching protection from mod photo
|
||||
- Add missing check for observer in mod like
|
||||
- Articles: default to logged in channel if channel name is not passed
|
||||
- Wiki: fix preview issue with hyperlinks
|
||||
- Cart: backport fixes from osada
|
||||
- Gallery: provide file extensions for better compatibility
|
||||
- Hsse: fix issue when linkinfo data was inserted
|
||||
- Diaspora: remove deprecated scale_external_images()
|
||||
|
||||
|
||||
Hubzilla 3.8.7 (2018-12-14)
|
||||
- Fix issue with linkdropper in comment area
|
||||
- Fix regression wit app ordering
|
||||
- Fix return if readImnageBlob() throws an exception
|
||||
- Introduce photo_view_filter hook
|
||||
- Fix home notifications not expanding in certain situations
|
||||
- Fix for dark schema
|
||||
- Fix total identities restriction
|
||||
- Fix article page title not updating if article has no title
|
||||
- Gallery: the gallery app will now act as the full-size photo viewer in /photos if installed
|
||||
|
||||
|
||||
Hubzilla 3.8.6 (2018-12-03)
|
||||
- Prevent incompatible export files (osada/zap) from being imported
|
||||
- Catch exception if readImageBlob() receives bogus data
|
||||
|
||||
@@ -64,7 +64,7 @@ class OAuth2Storage extends \OAuth2\Storage\Pdo {
|
||||
return( [
|
||||
'webfinger' => channel_reddress($x),
|
||||
'portable_id' => $x['channel_hash'],
|
||||
'email' => $a['account_email'],
|
||||
'email' => $a[0]['account_email'],
|
||||
'username' => $x['channel_address'],
|
||||
'user_id' => $x['channel_id'],
|
||||
'name' => $x['channel_name'],
|
||||
|
||||
@@ -808,12 +808,14 @@ class Apps {
|
||||
return($r);
|
||||
}
|
||||
|
||||
static public function app_order($uid,$apps) {
|
||||
static public function app_order($uid,$apps,$menu) {
|
||||
|
||||
if(! $apps)
|
||||
return $apps;
|
||||
|
||||
$x = (($uid) ? get_pconfig($uid,'system','app_order') : get_config('system','app_order'));
|
||||
$conf = (($menu === 'nav_featured_app') ? 'app_order' : 'app_pin_order');
|
||||
|
||||
$x = (($uid) ? get_pconfig($uid,'system',$conf) : get_config('system',$conf));
|
||||
if(($x) && (! is_array($x))) {
|
||||
$y = explode(',',$x);
|
||||
$y = array_map('trim',$y);
|
||||
@@ -850,19 +852,25 @@ class Apps {
|
||||
return false;
|
||||
}
|
||||
|
||||
static function moveup($uid,$guid) {
|
||||
static function moveup($uid,$guid,$menu) {
|
||||
$syslist = array();
|
||||
$list = self::app_list($uid, false, ['nav_featured_app', 'nav_pinned_app']);
|
||||
|
||||
$conf = (($menu === 'nav_featured_app') ? 'app_order' : 'app_pin_order');
|
||||
|
||||
$list = self::app_list($uid, false, [ $menu ]);
|
||||
if($list) {
|
||||
foreach($list as $li) {
|
||||
$syslist[] = self::app_encode($li);
|
||||
$papp = self::app_encode($li);
|
||||
if($menu !== 'nav_pinned_app' && strpos($papp['categories'],'nav_pinned_app') !== false)
|
||||
continue;
|
||||
$syslist[] = $papp;
|
||||
}
|
||||
}
|
||||
self::translate_system_apps($syslist);
|
||||
|
||||
usort($syslist,'self::app_name_compare');
|
||||
|
||||
$syslist = self::app_order($uid,$syslist);
|
||||
$syslist = self::app_order($uid,$syslist,$menu);
|
||||
|
||||
if(! $syslist)
|
||||
return;
|
||||
@@ -887,23 +895,29 @@ class Apps {
|
||||
$narr[] = $x['name'];
|
||||
}
|
||||
|
||||
set_pconfig($uid,'system','app_order',implode(',',$narr));
|
||||
set_pconfig($uid,'system',$conf,implode(',',$narr));
|
||||
|
||||
}
|
||||
|
||||
static function movedown($uid,$guid) {
|
||||
static function movedown($uid,$guid,$menu) {
|
||||
$syslist = array();
|
||||
$list = self::app_list($uid, false, ['nav_featured_app', 'nav_pinned_app']);
|
||||
|
||||
$conf = (($menu === 'nav_featured_app') ? 'app_order' : 'app_pin_order');
|
||||
|
||||
$list = self::app_list($uid, false, [ $menu ]);
|
||||
if($list) {
|
||||
foreach($list as $li) {
|
||||
$syslist[] = self::app_encode($li);
|
||||
$papp = self::app_encode($li);
|
||||
if($menu !== 'nav_pinned_app' && strpos($papp['categories'],'nav_pinned_app') !== false)
|
||||
continue;
|
||||
$syslist[] = $papp;
|
||||
}
|
||||
}
|
||||
self::translate_system_apps($syslist);
|
||||
|
||||
usort($syslist,'self::app_name_compare');
|
||||
|
||||
$syslist = self::app_order($uid,$syslist);
|
||||
$syslist = self::app_order($uid,$syslist,$menu);
|
||||
|
||||
if(! $syslist)
|
||||
return;
|
||||
@@ -928,7 +942,7 @@ class Apps {
|
||||
$narr[] = $x['name'];
|
||||
}
|
||||
|
||||
set_pconfig($uid,'system','app_order',implode(',',$narr));
|
||||
set_pconfig($uid,'system',$conf,implode(',',$narr));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -90,12 +90,12 @@ class Appman extends \Zotlabs\Web\Controller {
|
||||
|
||||
$channel = \App::get_channel();
|
||||
|
||||
if(argc() > 2) {
|
||||
if(argc() > 3) {
|
||||
if(argv(2) === 'moveup') {
|
||||
Zlib\Apps::moveup(local_channel(),argv(1));
|
||||
Zlib\Apps::moveup(local_channel(),argv(1),argv(3));
|
||||
}
|
||||
if(argv(2) === 'movedown') {
|
||||
Zlib\Apps::movedown(local_channel(),argv(1));
|
||||
Zlib\Apps::movedown(local_channel(),argv(1),argv(3));
|
||||
}
|
||||
goaway(z_root() . '/apporder');
|
||||
}
|
||||
|
||||
@@ -17,25 +17,28 @@ class Apporder extends \Zotlabs\Web\Controller {
|
||||
|
||||
nav_set_selected('Order Apps');
|
||||
|
||||
$syslist = array();
|
||||
$list = Zlib\Apps::app_list(local_channel(), false, ['nav_featured_app', 'nav_pinned_app']);
|
||||
if($list) {
|
||||
foreach($list as $li) {
|
||||
$syslist[] = Zlib\Apps::app_encode($li);
|
||||
foreach( [ 'nav_featured_app', 'nav_pinned_app' ] as $l ) {
|
||||
$syslist = [];
|
||||
$list = Zlib\Apps::app_list(local_channel(), false, [ $l ]);
|
||||
if($list) {
|
||||
foreach($list as $li) {
|
||||
$syslist[] = Zlib\Apps::app_encode($li);
|
||||
}
|
||||
}
|
||||
}
|
||||
Zlib\Apps::translate_system_apps($syslist);
|
||||
|
||||
Zlib\Apps::translate_system_apps($syslist);
|
||||
|
||||
usort($syslist,'Zotlabs\\Lib\\Apps::app_name_compare');
|
||||
usort($syslist,'Zotlabs\\Lib\\Apps::app_name_compare');
|
||||
|
||||
$syslist = Zlib\Apps::app_order(local_channel(),$syslist);
|
||||
$syslist = Zlib\Apps::app_order(local_channel(),$syslist, $l);
|
||||
|
||||
foreach($syslist as $app) {
|
||||
if(strpos($app['categories'],'nav_pinned_app') !== false) {
|
||||
$navbar_apps[] = Zlib\Apps::app_render($app,'nav-order');
|
||||
}
|
||||
else {
|
||||
$nav_apps[] = Zlib\Apps::app_render($app,'nav-order');
|
||||
foreach($syslist as $app) {
|
||||
if($l === 'nav_pinned_app') {
|
||||
$navbar_apps[] = Zlib\Apps::app_render($app,'nav-order');
|
||||
}
|
||||
elseif(strpos($app['categories'],'nav_pinned_app') === false) {
|
||||
$nav_apps[] = Zlib\Apps::app_render($app,'nav-order');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,8 +17,16 @@ class Articles extends Controller {
|
||||
|
||||
if(argc() > 1)
|
||||
$which = argv(1);
|
||||
else
|
||||
return;
|
||||
|
||||
if(! $which) {
|
||||
if(local_channel()) {
|
||||
$channel = App::get_channel();
|
||||
if($channel && $channel['channel_address'])
|
||||
$which = $channel['channel_address'];
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
profile_load($which);
|
||||
|
||||
|
||||
@@ -80,6 +80,11 @@ class Channel extends Controller {
|
||||
|
||||
$mid = ((x($_REQUEST,'mid')) ? $_REQUEST['mid'] : '');
|
||||
|
||||
if(strpos($mid,'b64.') === 0)
|
||||
$decoded = @base64url_decode(substr($mid,4));
|
||||
if($decoded)
|
||||
$mid = $decoded;
|
||||
|
||||
$datequery = ((x($_GET,'dend') && is_a_date_arg($_GET['dend'])) ? notags($_GET['dend']) : '');
|
||||
$datequery2 = ((x($_GET,'dbegin') && is_a_date_arg($_GET['dbegin'])) ? notags($_GET['dbegin']) : '');
|
||||
|
||||
@@ -331,6 +336,9 @@ class Channel extends Controller {
|
||||
|
||||
if((! $update) && (! $load)) {
|
||||
|
||||
if($decoded)
|
||||
$mid = 'b64.' . base64url_encode($mid);
|
||||
|
||||
// This is ugly, but we can't pass the profile_uid through the session to the ajax updater,
|
||||
// because browser prefetching might change it on us. We have to deliver it with the page.
|
||||
|
||||
|
||||
@@ -375,8 +375,7 @@ class Display extends \Zotlabs\Web\Controller {
|
||||
}
|
||||
$o .= '</noscript>';
|
||||
|
||||
if ($items[0]['title'])
|
||||
\App::$page['title'] = $items[0]['title'] . " - " . \App::$page['title'];
|
||||
\App::$page['title'] = (($items[0]['title']) ? $items[0]['title'] . " - " . \App::$page['title'] : \App::$page['title']);
|
||||
|
||||
$o .= conversation($items, 'display', $update, 'client');
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ class Like extends \Zotlabs\Web\Controller {
|
||||
|
||||
$observer = \App::get_observer();
|
||||
$interactive = $_REQUEST['interactive'];
|
||||
if($interactive) {
|
||||
if((! $observer) || ($interactive)) {
|
||||
$o .= '<h1>' . t('Like/Dislike') . '</h1>';
|
||||
$o .= EOL . EOL;
|
||||
|
||||
@@ -249,6 +249,9 @@ class Like extends \Zotlabs\Web\Controller {
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
if(! $observer)
|
||||
killme();
|
||||
|
||||
// this is used to like an item or comment
|
||||
|
||||
|
||||
@@ -138,8 +138,8 @@ class Linkinfo extends \Zotlabs\Web\Controller {
|
||||
}
|
||||
|
||||
$image = "";
|
||||
|
||||
if(sizeof($siteinfo["images"]) > 0){
|
||||
|
||||
if(is_array($siteinfo["images"]) && count($siteinfo["images"])){
|
||||
/* Execute below code only if image is present in siteinfo */
|
||||
|
||||
$total_images = 0;
|
||||
@@ -161,7 +161,7 @@ class Linkinfo extends \Zotlabs\Web\Controller {
|
||||
$total_images ++;
|
||||
if($max_images && $max_images >= $total_images)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(strlen($text)) {
|
||||
|
||||
@@ -134,7 +134,7 @@ class New_channel extends \Zotlabs\Web\Controller {
|
||||
$default_role = '';
|
||||
$aid = get_account_id();
|
||||
if($aid) {
|
||||
$r = q("select count(channel_id) as total from channel where channel_account_id = %d",
|
||||
$r = q("select count(channel_id) as total from channel where channel_account_id = %d and channel_removed = 0",
|
||||
intval($aid)
|
||||
);
|
||||
if($r && (! intval($r[0]['total']))) {
|
||||
@@ -145,7 +145,7 @@ class New_channel extends \Zotlabs\Web\Controller {
|
||||
$canadd = true;
|
||||
if($r && ($limit !== false)) {
|
||||
$channel_usage_message = sprintf( t("You have created %1$.0f of %2$.0f allowed channels."), $r[0]['total'], $limit);
|
||||
if ($r[0]['total'] >= $limit) {
|
||||
if ($r[0]['total'] > $limit) {
|
||||
$canadd = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ class Oep extends \Zotlabs\Web\Controller {
|
||||
dbesc($res)
|
||||
);
|
||||
if($r) {
|
||||
$sql_extra = "and item.id = " . intval($r[0]['iid']) . " ";
|
||||
$sql_extra .= " and item.id = " . intval($r[0]['iid']) . " ";
|
||||
}
|
||||
else {
|
||||
return $ret;
|
||||
@@ -194,6 +194,9 @@ class Oep extends \Zotlabs\Web\Controller {
|
||||
intval(ITEM_TYPE_CARD)
|
||||
);
|
||||
|
||||
if(! $r)
|
||||
return;
|
||||
|
||||
$item_normal = " and item.item_hidden = 0 and item.item_type in (0,6) and item.item_deleted = 0
|
||||
and item.item_unpublished = 0 and item.item_delayed = 0 and item.item_pending_remove = 0
|
||||
and item.item_blocked = 0 ";
|
||||
@@ -255,7 +258,6 @@ class Oep extends \Zotlabs\Web\Controller {
|
||||
if(! $channel)
|
||||
return $ret;
|
||||
|
||||
|
||||
if(! perm_is_allowed($channel['channel_id'],get_observer_hash(),'view_pages'))
|
||||
return $ret;
|
||||
|
||||
@@ -265,7 +267,7 @@ class Oep extends \Zotlabs\Web\Controller {
|
||||
dbesc($res)
|
||||
);
|
||||
if($r) {
|
||||
$sql_extra = "and item.id = " . intval($r[0]['iid']) . " ";
|
||||
$sql_extra .= " and item.id = " . intval($r[0]['iid']) . " ";
|
||||
}
|
||||
else {
|
||||
return $ret;
|
||||
@@ -278,6 +280,9 @@ class Oep extends \Zotlabs\Web\Controller {
|
||||
intval(ITEM_TYPE_ARTICLE)
|
||||
);
|
||||
|
||||
if(! $r)
|
||||
return;
|
||||
|
||||
$item_normal = " and item.item_hidden = 0 and item.item_type in (0,7) and item.item_deleted = 0
|
||||
and item.item_unpublished = 0 and item.item_delayed = 0 and item.item_pending_remove = 0
|
||||
and item.item_blocked = 0 ";
|
||||
|
||||
@@ -988,7 +988,7 @@ class Photos extends \Zotlabs\Web\Controller {
|
||||
$photo = array(
|
||||
'href' => z_root() . '/photo/' . $hires['resource_id'] . '-' . $hires['imgscale'] . '.' . $phototypes[$hires['mimetype']],
|
||||
'title'=> t('View Full Size'),
|
||||
'src' => z_root() . '/photo/' . $lores['resource_id'] . '-' . $lores['imgscale'] . '.' . $phototypes[$lores['mimetype']] . '?f=&_u=' . datetime_convert('','','','ymdhis')
|
||||
'src' => z_root() . '/photo/' . $lores['resource_id'] . '-' . $lores['imgscale'] . '.' . $phototypes[$lores['mimetype']]
|
||||
);
|
||||
|
||||
if($nextlink)
|
||||
@@ -1122,6 +1122,7 @@ class Photos extends \Zotlabs\Web\Controller {
|
||||
$comments = '';
|
||||
if(! $r) {
|
||||
if($observer && ($can_post || $can_comment)) {
|
||||
$feature_auto_save_draft = ((feature_enabled($owner_uid, 'auto_save_draft')) ? "true" : "false");
|
||||
$commentbox = replace_macros($cmnt_tpl,array(
|
||||
'$return_path' => '',
|
||||
'$mode' => 'photos',
|
||||
@@ -1137,7 +1138,8 @@ class Photos extends \Zotlabs\Web\Controller {
|
||||
'$submit' => t('Submit'),
|
||||
'$preview' => t('Preview'),
|
||||
'$ww' => '',
|
||||
'$feature_encrypt' => false
|
||||
'$feature_encrypt' => false,
|
||||
'$auto_save_draft' => $feature_auto_save_draft
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -1270,8 +1272,14 @@ class Photos extends \Zotlabs\Web\Controller {
|
||||
if(feature_enabled($owner_uid,'dislike'))
|
||||
$response_verbs[] = 'dislike';
|
||||
|
||||
|
||||
$responses = get_responses($conv_responses,$response_verbs,'',$link_item);
|
||||
|
||||
$hookdata = [
|
||||
'onclick' => '$.colorbox({href: \'' . $photo['href'] . '\'}); return false;',
|
||||
'raw_photo' => $ph[0],
|
||||
'nickname' => \App::$data['channel']['channel_address']
|
||||
];
|
||||
call_hooks('photo_view_filter', $hookdata);
|
||||
|
||||
$photo_tpl = get_markup_template('photo_view.tpl');
|
||||
$o .= replace_macros($photo_tpl, array(
|
||||
@@ -1309,6 +1317,7 @@ class Photos extends \Zotlabs\Web\Controller {
|
||||
'$comments' => $comments,
|
||||
'$commentbox' => $commentbox,
|
||||
'$paginate' => $paginate,
|
||||
'$onclick' => $hookdata['onclick']
|
||||
));
|
||||
|
||||
\App::$data['photo_html'] = $o;
|
||||
|
||||
@@ -347,6 +347,10 @@ class Ping extends \Zotlabs\Web\Controller {
|
||||
if(argc() > 1 && (argv(1) === 'network' || argv(1) === 'home')) {
|
||||
$result = array();
|
||||
|
||||
if(argv(1) === 'home') {
|
||||
$sql_extra .= ' and item_wall = 1 ';
|
||||
}
|
||||
|
||||
$r = q("SELECT * FROM item
|
||||
WHERE uid = %d
|
||||
AND item_unseen = 1
|
||||
@@ -362,8 +366,6 @@ class Ping extends \Zotlabs\Web\Controller {
|
||||
if($r) {
|
||||
xchan_query($r);
|
||||
foreach($r as $item) {
|
||||
if((argv(1) === 'home') && (! intval($item['item_wall'])))
|
||||
continue;
|
||||
$result[] = \Zotlabs\Lib\Enotify::format($item);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -442,8 +442,8 @@ class Wiki extends Controller {
|
||||
$mimeType = $_POST['mimetype'];
|
||||
|
||||
if($mimeType === 'text/bbcode') {
|
||||
$linkconverted = NativeWikiPage::convert_links($content,$wikiURL);
|
||||
$html = zidify_links(smilies(bbcode($linkconverted)));
|
||||
$html = zidify_links(smilies(bbcode($content)));
|
||||
$html = NativeWikiPage::convert_links($html,$wikiURL);
|
||||
}
|
||||
elseif($mimeType === 'text/markdown') {
|
||||
$linkconverted = NativeWikiPage::convert_links($content,$wikiURL);
|
||||
|
||||
2
boot.php
2
boot.php
@@ -50,7 +50,7 @@ require_once('include/attach.php');
|
||||
require_once('include/bbcode.php');
|
||||
|
||||
define ( 'PLATFORM_NAME', 'hubzilla' );
|
||||
define ( 'STD_VERSION', '3.8.6' );
|
||||
define ( 'STD_VERSION', '3.8.9' );
|
||||
define ( 'ZOT_REVISION', '6.0a' );
|
||||
|
||||
define ( 'DB_UPDATE_VERSION', 1225 );
|
||||
|
||||
1
doc/hook/photo_view_filter.bb
Normal file
1
doc/hook/photo_view_filter.bb
Normal file
@@ -0,0 +1 @@
|
||||
[h2]photo_view_filter[/h2]
|
||||
@@ -502,6 +502,9 @@ Hooks allow plugins/addons to "hook into" the code at many points and alter the
|
||||
[zrl=[baseurl]/help/hook/photo_upload_form]photo_upload_form[/zrl]
|
||||
Called when generating a photo upload form
|
||||
|
||||
[zrl=[baseurl]/help/hook/photo_view_filter]photo_view_filter[/zrl]
|
||||
Called before the data is handed over to the photo_view template
|
||||
|
||||
[zrl=[baseurl]/help/hook/poke_verbs]poke_verbs[/zrl]
|
||||
Called when generating the list of actions for "poke" module
|
||||
|
||||
|
||||
@@ -1021,7 +1021,7 @@ function bbcode($Text, $options = []) {
|
||||
}
|
||||
// Check for colored text
|
||||
if (strpos($Text,'[/hl]') !== false) {
|
||||
$Text = preg_replace("(\[hl\](.*?)\[\/hl\])ism", "<span style=\"background-color: yellow;\">$1</span>", $Text);
|
||||
$Text = preg_replace("(\[hl\](.*?)\[\/hl\])ism", "<span class=\"default-highlight\">$1</span>", $Text);
|
||||
$Text = preg_replace("(\[hl=(.*?)\](.*?)\[\/hl\])ism", "<span style=\"background-color: $1;\">$2</span>", $Text);
|
||||
}
|
||||
|
||||
|
||||
@@ -1035,8 +1035,9 @@ function import_mail($channel, $mails, $sync = false) {
|
||||
if(! $m)
|
||||
continue;
|
||||
|
||||
$m['aid'] = $channel['channel_account_id'];
|
||||
$m['uid'] = $channel['channel_id'];
|
||||
$m['account_id'] = $channel['channel_account_id'];
|
||||
$m['channel_id'] = $channel['channel_id'];
|
||||
|
||||
$mail_id = mail_store($m);
|
||||
if($sync && $mail_id) {
|
||||
Zotlabs\Daemon\Master::Summon(array('Notifier','single_mail',$mail_id));
|
||||
|
||||
@@ -91,8 +91,6 @@ function markdown_to_bb($s, $use_zrl = false, $options = []) {
|
||||
// remove duplicate adjacent code tags
|
||||
$s = preg_replace("/(\[code\])+(.*?)(\[\/code\])+/ism","[code]$2[/code]", $s);
|
||||
|
||||
// Don't show link to full picture (until it is fixed)
|
||||
$s = scale_external_images($s, false);
|
||||
|
||||
/**
|
||||
* @hooks markdown_to_bb
|
||||
|
||||
@@ -222,6 +222,9 @@ function nav($template = 'default') {
|
||||
if(! $settings_url && isset(App::$nav_sel['settings_url']))
|
||||
$settings_url = App::$nav_sel['settings_url'];
|
||||
|
||||
$pinned_list = [];
|
||||
$syslist = [];
|
||||
|
||||
//app bin
|
||||
if($is_owner) {
|
||||
if(get_pconfig(local_channel(), 'system','import_system_apps') !== datetime_convert('UTC','UTC','now','Y-m-d')) {
|
||||
@@ -234,14 +237,29 @@ function nav($template = 'default') {
|
||||
set_pconfig(local_channel(), 'system','force_import_system_apps', STD_VERSION);
|
||||
}
|
||||
|
||||
$syslist = array();
|
||||
$list = Apps::app_list(local_channel(), false, ['nav_featured_app', 'nav_pinned_app']);
|
||||
$list = Apps::app_list(local_channel(), false, [ 'nav_pinned_app' ]);
|
||||
if($list) {
|
||||
foreach($list as $li) {
|
||||
$pinned_list[] = Apps::app_encode($li);
|
||||
}
|
||||
}
|
||||
Apps::translate_system_apps($pinned_list);
|
||||
|
||||
usort($pinned_list,'Zotlabs\\Lib\\Apps::app_name_compare');
|
||||
|
||||
$pinned_list = Apps::app_order(local_channel(),$pinned_list, 'nav_pinned_app');
|
||||
|
||||
|
||||
$syslist = [];
|
||||
$list = Apps::app_list(local_channel(), false, [ 'nav_featured_app' ]);
|
||||
|
||||
if($list) {
|
||||
foreach($list as $li) {
|
||||
$syslist[] = Apps::app_encode($li);
|
||||
}
|
||||
}
|
||||
Apps::translate_system_apps($syslist);
|
||||
|
||||
}
|
||||
else {
|
||||
$syslist = Apps::get_system_apps(true);
|
||||
@@ -249,26 +267,38 @@ function nav($template = 'default') {
|
||||
|
||||
usort($syslist,'Zotlabs\\Lib\\Apps::app_name_compare');
|
||||
|
||||
$syslist = Apps::app_order(local_channel(),$syslist);
|
||||
$syslist = Apps::app_order(local_channel(),$syslist, 'nav_featured_app');
|
||||
|
||||
foreach($syslist as $app) {
|
||||
if(\App::$nav_sel['name'] == $app['name'])
|
||||
$app['active'] = true;
|
||||
|
||||
if($is_owner) {
|
||||
if(strpos($app['categories'],'nav_pinned_app') !== false) {
|
||||
if($pinned_list) {
|
||||
foreach($pinned_list as $app) {
|
||||
if(\App::$nav_sel['name'] == $app['name'])
|
||||
$app['active'] = true;
|
||||
|
||||
if($is_owner) {
|
||||
$navbar_apps[] = Apps::app_render($app,'navbar');
|
||||
}
|
||||
else {
|
||||
$nav_apps[] = Apps::app_render($app,'nav');
|
||||
elseif(! $is_owner && strpos($app['requires'], 'local_channel') === false) {
|
||||
$navbar_apps[] = Apps::app_render($app,'navbar');
|
||||
}
|
||||
}
|
||||
elseif(! $is_owner && strpos($app['requires'], 'local_channel') === false) {
|
||||
if(strpos($app['categories'],'nav_pinned_app') !== false) {
|
||||
$navbar_apps[] = Apps::app_render($app,'navbar');
|
||||
}
|
||||
|
||||
|
||||
if($syslist) {
|
||||
foreach($syslist as $app) {
|
||||
if(\App::$nav_sel['name'] == $app['name'])
|
||||
$app['active'] = true;
|
||||
|
||||
if($is_owner) {
|
||||
if(strpos($app['categories'],'nav_pinned_app') === false) {
|
||||
$nav_apps[] = Apps::app_render($app,'nav');
|
||||
}
|
||||
}
|
||||
else {
|
||||
$nav_apps[] = Apps::app_render($app,'nav');
|
||||
elseif(! $is_owner && strpos($app['requires'], 'local_channel') === false) {
|
||||
if(strpos($app['categories'],'nav_pinned_app') === false) {
|
||||
$nav_apps[] = Apps::app_render($app,'nav');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,6 +116,9 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) {
|
||||
@curl_setopt($ch, CURLOPT_USERPWD, $opts['http_auth']);
|
||||
}
|
||||
|
||||
if(array_key_exists('http_version',$opts))
|
||||
@curl_setopt($ch,CURLOPT_HTTP_VERSION,$opts['http_version']);
|
||||
|
||||
if(x($opts,'cookiejar'))
|
||||
@curl_setopt($ch, CURLOPT_COOKIEJAR, $opts['cookiejar']);
|
||||
if(x($opts,'cookiefile'))
|
||||
@@ -153,7 +156,7 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) {
|
||||
// Pull out multiple headers, e.g. proxy and continuation headers
|
||||
// allow for HTTP/2.x without fixing code
|
||||
|
||||
while(preg_match('/^HTTP\/[1-2].+? [1-5][0-9][0-9]/',$base)) {
|
||||
while(preg_match('/^HTTP\/[1-3](\.\d)? [1-5][0-9][0-9]/',$base)) {
|
||||
$chunk = substr($base,0,strpos($base,"\r\n\r\n")+4);
|
||||
$header .= $chunk;
|
||||
$base = substr($base,strlen($chunk));
|
||||
@@ -286,6 +289,9 @@ function z_post_url($url, $params, $redirects = 0, $opts = array()) {
|
||||
@curl_setopt($ch, CURLOPT_USERPWD, $opts['http_auth']);
|
||||
}
|
||||
|
||||
if(array_key_exists('http_version',$opts))
|
||||
@curl_setopt($ch,CURLOPT_HTTP_VERSION,$opts['http_version']);
|
||||
|
||||
if(x($opts,'cookiejar'))
|
||||
@curl_setopt($ch, CURLOPT_COOKIEJAR, $opts['cookiejar']);
|
||||
if(x($opts,'cookiefile'))
|
||||
@@ -318,8 +324,7 @@ function z_post_url($url, $params, $redirects = 0, $opts = array()) {
|
||||
|
||||
// Pull out multiple headers, e.g. proxy and continuation headers
|
||||
// allow for HTTP/2.x without fixing code
|
||||
|
||||
while(preg_match('/^HTTP\/[1-2].+? [1-5][0-9][0-9]/',$base)) {
|
||||
while(preg_match('/^HTTP\/[1-3](\.\d)? [1-5][0-9][0-9]/',$base)) {
|
||||
$chunk = substr($base,0,strpos($base,"\r\n\r\n")+4);
|
||||
$header .= $chunk;
|
||||
$base = substr($base,strlen($chunk));
|
||||
@@ -690,99 +695,6 @@ function sxml2array ( $xmlObject, $out = array () )
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Scales an external image.
|
||||
*
|
||||
* @param string $s
|
||||
* @param string $include_link default true
|
||||
* @param string $scale_replace default false
|
||||
* @return string
|
||||
*/
|
||||
function scale_external_images($s, $include_link = true, $scale_replace = false) {
|
||||
|
||||
// Picture addresses can contain special characters
|
||||
$s = htmlspecialchars_decode($s, ENT_COMPAT);
|
||||
|
||||
$matches = null;
|
||||
$c = preg_match_all('/\[([zi])mg(.*?)\](.*?)\[\/[zi]mg\]/ism', $s, $matches, PREG_SET_ORDER);
|
||||
if($c) {
|
||||
require_once('include/photo/photo_driver.php');
|
||||
|
||||
foreach($matches as $mtch) {
|
||||
logger('data: ' . $mtch[2] . ' ' . $mtch[3]);
|
||||
|
||||
if(substr($mtch[2],0,1) == '=') {
|
||||
$owidth = intval(substr($mtch[2],1));
|
||||
if($owidth > 0 && $owidth < 1024)
|
||||
continue;
|
||||
}
|
||||
|
||||
$hostname = str_replace('www.','',substr(z_root(),strpos(z_root(),'://')+3));
|
||||
if(stristr($mtch[3],$hostname))
|
||||
continue;
|
||||
|
||||
// $scale_replace, if passed, is an array of two elements. The
|
||||
// first is the name of the full-size image. The second is the
|
||||
// name of a remote, scaled-down version of the full size image.
|
||||
// This allows Friendica to display the smaller remote image if
|
||||
// one exists, while still linking to the full-size image
|
||||
if($scale_replace)
|
||||
$scaled = str_replace($scale_replace[0], $scale_replace[1], $mtch[3]);
|
||||
else
|
||||
$scaled = $mtch[3];
|
||||
|
||||
if(! strpbrk(substr($scaled, 0, 1), 'zhfmt'))
|
||||
continue;
|
||||
|
||||
$i = z_fetch_url($scaled, true);
|
||||
|
||||
$cache = get_config('system', 'itemcache');
|
||||
if (($cache != '') and is_dir($cache)) {
|
||||
$cachefile = $cache . '/' . hash('md5', $scaled);
|
||||
file_put_contents($cachefile, $i['body']);
|
||||
}
|
||||
|
||||
// guess mimetype from headers or filename
|
||||
|
||||
$type = guess_image_type($mtch[3], $i['header']);
|
||||
if(strpos($type, 'image') === false)
|
||||
continue;
|
||||
|
||||
if($i['success']) {
|
||||
$ph = photo_factory($i['body'], $type);
|
||||
|
||||
if(! is_object($ph))
|
||||
continue;
|
||||
|
||||
if($ph->is_valid()) {
|
||||
$orig_width = $ph->getWidth();
|
||||
$orig_height = $ph->getHeight();
|
||||
|
||||
if($orig_width > 1024 || $orig_height > 1024) {
|
||||
$tag = (($match[1] == 'z') ? 'zmg' : 'img');
|
||||
$linktag = (($match[1] == 'z') ? 'zrl' : 'url');
|
||||
$ph->scaleImage(1024);
|
||||
$new_width = $ph->getWidth();
|
||||
$new_height = $ph->getHeight();
|
||||
logger('data: ' . $orig_width . '->' . $new_width . 'w ' . $orig_height . '->' . $new_height . 'h' . ' match: ' . $mtch[0], LOGGER_DEBUG);
|
||||
$s = str_replace($mtch[0],'[' . $tag . '=' . $new_width . 'x' . $new_height. ']' . $scaled . '[/' . $tag . ']'
|
||||
. "\n" . (($include_link)
|
||||
? '[' . $linktag . '=' . $mtch[3] . ']' . t('view full size') . '[/' . $linktag . ']' . "\n"
|
||||
: ''),$s);
|
||||
logger('new string: ' . $s, LOGGER_DEBUG);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// replace the special char encoding
|
||||
|
||||
$s = htmlspecialchars($s, ENT_COMPAT, 'UTF-8');
|
||||
|
||||
return $s;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief xml2array() will convert the given XML text to an array in the XML structure.
|
||||
*
|
||||
|
||||
@@ -36,6 +36,7 @@ class photo_imagick extends photo_driver {
|
||||
}
|
||||
catch (Exception $e) {
|
||||
logger('imagick readImageBlob() exception:' . print_r($e,true));
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -3331,8 +3331,6 @@ function cleanup_bbcode($body) {
|
||||
|
||||
$body = preg_replace('/\[\/code\]\s*\[code\]/ism',"\n",$body);
|
||||
|
||||
$body = scale_external_images($body,false);
|
||||
|
||||
return $body;
|
||||
}
|
||||
|
||||
|
||||
15
util/addons
15
util/addons
@@ -10,6 +10,7 @@ echo <<< EOT
|
||||
util/addons list all # list all addons (*)= installed, (!)= disabled due to version compatibility
|
||||
util/addons install foo # install addon named 'foo'
|
||||
util/addons uninstall foo # uninstall addon named 'foo'
|
||||
util/addons reinstall # reinstall all plugins
|
||||
|
||||
EOT;
|
||||
}
|
||||
@@ -68,6 +69,20 @@ if($argc == 2 && $argv[1] === 'list') {
|
||||
killme();
|
||||
}
|
||||
|
||||
if($argc == 2 && $argv[1] === 'reinstall') {
|
||||
require_once("include/plugin.php");
|
||||
if($plugins) {
|
||||
foreach($plugins as $p) {
|
||||
if($p[1]) {
|
||||
echo "Reinstall: ". $p[0] . "\n";
|
||||
uninstall_plugin($p[0]);
|
||||
install_plugin($p[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
killme();
|
||||
}
|
||||
|
||||
if($argc == 3 && $argv[1] === 'list' && $argv[2] === 'all') {
|
||||
|
||||
if($plugins) {
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
if(! function_exists("string_plural_select_es_es")) {
|
||||
function string_plural_select_es_es($n){
|
||||
return ($n != 1 ? 1 : 0);;
|
||||
return ($n != 1 ? 1 : 0);
|
||||
}}
|
||||
App::$rtl = 0;
|
||||
App::$strings["plural_function_code"] = "(n != 1 ? 1 : 0);";
|
||||
App::$strings["plural_function_code"] = "(n != 1 ? 1 : 0)";
|
||||
App::$strings["Can view my channel stream and posts"] = "Pueden verse la actividad y publicaciones de mi canal";
|
||||
App::$strings["Can send me their channel stream and posts"] = "Se me pueden enviar entradas y contenido de un canal";
|
||||
App::$strings["Can view my default channel profile"] = "Puede verse mi perfil de canal predeterminado.";
|
||||
|
||||
@@ -832,10 +832,10 @@ function collapseHeight() {
|
||||
});
|
||||
|
||||
var collapsedContentHeight = Math.ceil($("#region_2").height());
|
||||
contentHeightDiff = origContentHeight - collapsedContentHeight;
|
||||
contentHeightDiff = liking ? 0 : origContentHeight - collapsedContentHeight;
|
||||
console.log('collapseHeight() - contentHeightDiff: ' + contentHeightDiff + 'px');
|
||||
|
||||
if(i){
|
||||
if(i && !liking){
|
||||
var sval = position - cDiff + ($(".divgrow-showmore").outerHeight() * i);
|
||||
console.log('collapsed above viewport count: ' + i);
|
||||
$(window).scrollTop(sval);
|
||||
|
||||
@@ -1803,3 +1803,8 @@ dl.bb-dl > dd > li {
|
||||
.hover-fx-show:hover .hover-fx-hide {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/* default highlighted text if not specified by schema: */
|
||||
span.default-highlight {
|
||||
background-color: yellow;
|
||||
}
|
||||
|
||||
@@ -322,9 +322,6 @@ a, a:visited, a:link, .fakelink, .fakelink:visited, .fakelink:link {
|
||||
.text-dark {
|
||||
color: #aaa !important;
|
||||
}
|
||||
a.text-dark:focus, a.text-dark:hover {
|
||||
color: #ddd !important;
|
||||
}
|
||||
|
||||
.group-selected, .fileas-selected, .categories-selected, .search-selected, a.active {
|
||||
color: #fff !important;
|
||||
@@ -480,3 +477,26 @@ pre {
|
||||
.widget-nav-pills-checkbox:hover + a {
|
||||
background-color: #222;
|
||||
}
|
||||
|
||||
|
||||
/* category badge fix: */
|
||||
a.text-dark:focus, a.text-dark:hover {
|
||||
color: #ddd !important;
|
||||
}
|
||||
|
||||
.badge-warning {
|
||||
/* background-color: #ffc927; */
|
||||
}
|
||||
.badge-warning a.text-dark {
|
||||
color: #333 !important;
|
||||
}
|
||||
.badge-warning a.text-dark:focus, .badge-warning a.text-dark:hover {
|
||||
color: red !important;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/* fix color for highlithed text */
|
||||
span.default-highlight {
|
||||
color: #333;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
<a class="dropdown-item{{if $app.active}} active{{/if}}" href="{{$app.url}}">{{if $icon}}<i class="generic-icons-nav fa fa-fw fa-{{$icon}}"></i>{{else}}<img src="{{$app.photo}}" width="16" height="16" style="margin-right:9px;"/>{{/if}}{{$app.name}}</a>
|
||||
{{/if}}
|
||||
{{if $order}}
|
||||
<a href="{{$hosturl}}appman/{{$app.guid}}/moveup" class="btn btn-outline-secondary btn-sm" style="margin-bottom: 5px;"><i class="generic-icons-nav fa fa-fw fa-arrow-up"></i></a>
|
||||
<a href="{{$hosturl}}appman/{{$app.guid}}/movedown" class="btn btn-outline-secondary btn-sm" style="margin-bottom: 5px;"><i class="generic-icons-nav fa fa-fw fa-arrow-down"></i></a>
|
||||
<a href="{{$hosturl}}appman/{{$app.guid}}/moveup{{if $pinned}}/nav_pinned_app{{else}}/nav_featured_app{{/if}}" class="btn btn-outline-secondary btn-sm" style="margin-bottom: 5px;"><i class="generic-icons-nav fa fa-fw fa-arrow-up"></i></a>
|
||||
<a href="{{$hosturl}}appman/{{$app.guid}}/movedown{{if $pinned}}/nav_pinned_app{{else}}/nav_featured_app{{/if}}" class="btn btn-outline-secondary btn-sm" style="margin-bottom: 5px;"><i class="generic-icons-nav fa fa-fw fa-arrow-down"></i></a>
|
||||
{{if $icon}}<i class="generic-icons-nav fa fa-fw fa-{{$icon}}"></i>{{else}}<img src="{{$app.photo}}" width="16" height="16" style="margin-right:9px;"/>{{/if}}{{$app.name}}<br>
|
||||
{{/if}}
|
||||
|
||||
|
||||
@@ -219,7 +219,7 @@ var activeCommentText = '';
|
||||
}
|
||||
|
||||
function linkdropper(event) {
|
||||
var linkFound = event.dataTransfer.types.contains("text/uri-list");
|
||||
var linkFound = ((event.dataTransfer.types.indexOf("text/uri-list") > -1) ? true : false);
|
||||
if(linkFound) {
|
||||
event.preventDefault();
|
||||
var editwin = '#' + event.target.id;
|
||||
@@ -256,7 +256,7 @@ var activeCommentText = '';
|
||||
commentwin = ((editwin.indexOf('comment') >= 0) ? true : false);
|
||||
if(commentwin) {
|
||||
var commentid = editwin.substring(editwin.lastIndexOf('-') + 1);
|
||||
commentOpen(document.getElementById(event.target.id),commentid);
|
||||
$("#comment-edit-text-" + commentid).addClass("expanded");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
<div id="photo-edit-end" class="clear"></div>
|
||||
</div>
|
||||
<div id="photo-view-wrapper">
|
||||
<div id="photo-photo"><a href="{{$photo.href}}" title="{{$photo.title}}" onclick="$.colorbox({href: '{{$photo.href}}'}); return false;"><img style="width: 100%;" src="{{$photo.src}}"></a></div>
|
||||
<div id="photo-photo"><a href="{{$photo.href}}" title="{{$photo.title}}" onclick="{{$onclick}}"><img style="width: 100%;" src="{{$photo.src}}"></a></div>
|
||||
<div id="photo-photo-end" class="clear"></div>
|
||||
{{if $tags}}
|
||||
<div class="photo-item-tools-left" id="in-this-photo">
|
||||
|
||||
Reference in New Issue
Block a user