Merge branch 'dev' of https://framagit.org/hubzilla/core into dev
This commit is contained in:
commit
1358a81c32
@ -448,11 +448,11 @@ function check_https {
|
||||
function install_hubzilla {
|
||||
print_info "installing addons..."
|
||||
cd /var/www/html/
|
||||
if git remote -v | grep -i "origin.*core.git"
|
||||
if git remote -v | grep -i "origin.*hubzilla.*core"
|
||||
then
|
||||
print_info "hubzilla"
|
||||
util/add_addon_repo https://framagit.org/hubzilla/addons hzaddons
|
||||
elif git remote -v | grep -i "origin.*zap.git"
|
||||
elif git remote -v | grep -i "origin.*zap.*core"
|
||||
then
|
||||
print_info "zap"
|
||||
util/add_addon_repo https://framagit.org/zot/zap-addons.git zaddons
|
||||
|
@ -97,13 +97,14 @@ class Cron {
|
||||
|
||||
// Clean expired photos from cache
|
||||
|
||||
$age = get_config('system','active_expire_days', '30');
|
||||
$r = q("SELECT DISTINCT xchan, content FROM photo WHERE photo_usage = %d AND expires < %s - INTERVAL %s",
|
||||
intval(PHOTO_CACHE),
|
||||
db_utcnow(),
|
||||
db_quoteinterval($age . ' DAY')
|
||||
$sql_interval = "'" . dbesc(datetime_convert()) . "' - INTERVAL " . db_quoteinterval(get_config('system','active_expire_days', '30') . ' DAY');
|
||||
$r = q("SELECT DISTINCT xchan, content FROM photo WHERE photo_usage = %d AND expires < $sql_interval",
|
||||
intval(PHOTO_CACHE)
|
||||
);
|
||||
if($r) {
|
||||
q("DELETE FROM photo WHERE photo_usage = %d AND expires < $sql_interval",
|
||||
intval(PHOTO_CACHE)
|
||||
);
|
||||
foreach($r as $rr) {
|
||||
$file = dbunescbin($rr['content']);
|
||||
if(is_file($file)) {
|
||||
@ -113,11 +114,6 @@ class Cron {
|
||||
}
|
||||
}
|
||||
}
|
||||
q("DELETE FROM photo WHERE photo_usage = %d AND expires < %s - INTERVAL %s",
|
||||
intval(PHOTO_CACHE),
|
||||
db_utcnow(),
|
||||
db_quoteinterval($age . ' DAY')
|
||||
);
|
||||
|
||||
// publish any applicable items that were set to be published in the future
|
||||
// (time travel posts). Restrict to items that have come of age in the last
|
||||
|
@ -1693,11 +1693,12 @@ class Activity {
|
||||
}
|
||||
|
||||
if($act->obj['type'] === 'Event') {
|
||||
|
||||
$s['obj'] = [];
|
||||
$s['obj']['asld'] = $act->obj;
|
||||
$s['obj']['type'] = ACTIVITY_OBJ_EVENT;
|
||||
$s['obj']['id'] = $act->obj['id'];
|
||||
$s['obj']['title'] = $act->obj['summary'];
|
||||
$s['obj']['title'] = $act->obj['name'];
|
||||
|
||||
if(strpos($act->obj['startTime'],'Z'))
|
||||
$s['obj']['adjust'] = true;
|
||||
|
@ -1764,7 +1764,7 @@ class Libzot {
|
||||
// if it's a sourced post, call the post_local hooks as if it were
|
||||
// posted locally so that crosspost connectors will be triggered.
|
||||
|
||||
if(check_item_source($arr['uid'], $arr)) {
|
||||
if(check_item_source($arr['uid'], $arr) || ($channel['xchan_pubforum'] == 1)) {
|
||||
/**
|
||||
* @hooks post_local
|
||||
* Called when an item has been posted on this machine via mod/item.php (also via API).
|
||||
|
@ -9,6 +9,7 @@ use Zotlabs\Lib\PermissionDescription;
|
||||
require_once('include/channel.php');
|
||||
require_once('include/conversation.php');
|
||||
require_once('include/acl_selectors.php');
|
||||
require_once('include/opengraph.php');
|
||||
|
||||
|
||||
class Articles extends Controller {
|
||||
@ -192,7 +193,7 @@ class Articles extends Controller {
|
||||
|
||||
$parents_str = ids_to_querystr($r,'id');
|
||||
|
||||
$items = q("SELECT item.*, item.id AS item_id
|
||||
$r = q("SELECT item.*, item.id AS item_id
|
||||
FROM item
|
||||
WHERE item.uid = %d $item_normal
|
||||
AND item.parent IN ( %s )
|
||||
@ -200,15 +201,18 @@ class Articles extends Controller {
|
||||
intval(App::$profile['profile_uid']),
|
||||
dbesc($parents_str)
|
||||
);
|
||||
if($items) {
|
||||
xchan_query($items);
|
||||
$items = fetch_post_tags($items, true);
|
||||
if($r) {
|
||||
xchan_query($r);
|
||||
$items = fetch_post_tags($r, true);
|
||||
$items = conv_sort($items,'updated');
|
||||
}
|
||||
else
|
||||
$items = [];
|
||||
}
|
||||
|
||||
// Add Opengraph markup
|
||||
opengraph_add_meta(((! empty($items)) ? $r[0] : array()), App::$profile);
|
||||
|
||||
$mode = 'articles';
|
||||
|
||||
if(get_pconfig(local_channel(),'system','articles_list_mode') && (! $selected_card))
|
||||
|
@ -13,6 +13,7 @@ require_once('include/items.php');
|
||||
require_once('include/security.php');
|
||||
require_once('include/conversation.php');
|
||||
require_once('include/acl_selectors.php');
|
||||
require_once('include/opengraph.php');
|
||||
|
||||
|
||||
/**
|
||||
@ -111,17 +112,6 @@ class Channel extends Controller {
|
||||
// we start loading content
|
||||
|
||||
profile_load($which,$profile);
|
||||
|
||||
App::$page['htmlhead'] .= '<meta property="og:title" content="' . htmlspecialchars($channel['channel_name']) . '">' . "\r\n";
|
||||
App::$page['htmlhead'] .= '<meta property="og:image" content="' . $channel['xchan_photo_l'] . '">' . "\r\n";
|
||||
|
||||
if(App::$profile['about'] && perm_is_allowed($channel['channel_id'],get_observer_hash(),'view_profile')) {
|
||||
App::$page['htmlhead'] .= '<meta property="og:description" content="' . htmlspecialchars(App::$profile['about']) . '">' . "\r\n";
|
||||
}
|
||||
else {
|
||||
App::$page['htmlhead'] .= '<meta property="og:description" content="' . htmlspecialchars(sprintf( t('This is the home page of %s.'), $channel['channel_name'])) . '">' . "\r\n";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function get($update = 0, $load = false) {
|
||||
@ -362,7 +352,7 @@ class Channel extends Controller {
|
||||
|
||||
$parents_str = ids_to_querystr($r,'item_id');
|
||||
|
||||
$items = q("SELECT item.*, item.id AS item_id
|
||||
$r = q("SELECT item.*, item.id AS item_id
|
||||
FROM item
|
||||
WHERE item.uid = %d $item_normal
|
||||
AND item.parent IN ( %s )
|
||||
@ -371,8 +361,8 @@ class Channel extends Controller {
|
||||
dbesc($parents_str)
|
||||
);
|
||||
|
||||
xchan_query($items);
|
||||
$items = fetch_post_tags($items, true);
|
||||
xchan_query($r);
|
||||
$items = fetch_post_tags($r, true);
|
||||
$items = conv_sort($items,$ordering);
|
||||
|
||||
if($load && $mid && (! count($items))) {
|
||||
@ -385,6 +375,9 @@ class Channel extends Controller {
|
||||
$items = array();
|
||||
}
|
||||
|
||||
// Add Opengraph markup
|
||||
opengraph_add_meta((isset($decoded) && (! empty($items)) ? $r[0] : array()), App::$profile);
|
||||
|
||||
if((! $update) && (! $load)) {
|
||||
|
||||
if($decoded)
|
||||
|
@ -324,7 +324,7 @@ class Connections extends \Zotlabs\Web\Controller {
|
||||
'recentlink' => z_root() . '/network/?f=&cid=' . intval($rr['abook_id']) . '&name=' . $rr['xchan_name'],
|
||||
'oneway' => $oneway,
|
||||
'connect' => (intval($rr['abook_not_here']) ? t('Connect') : ''),
|
||||
'follow' => z_root() . '/follow/?f=&url=' . urlencode($rr['xchan_addr']) . '&interactive=0',
|
||||
'follow' => z_root() . '/follow/?f=&url=' . urlencode($rr['xchan_hash']) . '&interactive=0',
|
||||
'connect_hover' => t('Connect at this location')
|
||||
);
|
||||
}
|
||||
|
@ -817,11 +817,6 @@ class Item extends Controller {
|
||||
'revision' => $r['data']['revision']
|
||||
);
|
||||
}
|
||||
$ext = substr($r['data']['filename'],strrpos($r['data']['filename'],'.'));
|
||||
if(strpos($r['data']['filetype'],'audio/') !== false)
|
||||
$attach_link = '[audio]' . z_root() . '/attach/' . $r['data']['hash'] . '/' . $r['data']['revision'] . (($ext) ? $ext : '') . '[/audio]';
|
||||
elseif(strpos($r['data']['filetype'],'video/') !== false)
|
||||
$attach_link = '[video]' . z_root() . '/attach/' . $r['data']['hash'] . '/' . $r['data']['revision'] . (($ext) ? $ext : '') . '[/video]';
|
||||
$body = str_replace($match[1][$i],$attach_link,$body);
|
||||
$i++;
|
||||
}
|
||||
|
@ -54,9 +54,10 @@ class Menu extends \Zotlabs\Web\Controller {
|
||||
if($_REQUEST['menu_system'])
|
||||
$_REQUEST['menu_flags'] |= MENU_SYSTEM;
|
||||
|
||||
$menu_id = ((argc() > 1) ? intval(argv(1)) : 0);
|
||||
$menu_id = ((argc() > 2) ? intval(argv(2)) : 0);
|
||||
|
||||
if($menu_id) {
|
||||
$_REQUEST['menu_id'] = intval(argv(1));
|
||||
$_REQUEST['menu_id'] = $menu_id;
|
||||
$r = menu_edit($_REQUEST);
|
||||
if($r) {
|
||||
menu_sync_packet($uid,get_observer_hash(),$menu_id);
|
||||
|
@ -31,12 +31,7 @@ class Photo extends \Zotlabs\Web\Controller {
|
||||
// NOTREACHED
|
||||
}
|
||||
|
||||
$cache_mode = array(
|
||||
'on' => false,
|
||||
'age' => 86400,
|
||||
'exp' => true,
|
||||
'leak' => false
|
||||
);
|
||||
$cache_mode = [ 'on' => false, 'age' => 86400, 'exp' => true, 'leak' => false ];
|
||||
call_hooks('cache_mode_hook', $cache_mode);
|
||||
|
||||
$observer_xchan = get_observer_hash();
|
||||
@ -144,7 +139,7 @@ class Photo extends \Zotlabs\Web\Controller {
|
||||
$resolution = 1;
|
||||
}
|
||||
|
||||
$r = q("SELECT uid, photo_usage, display_path FROM photo WHERE resource_id = '%s' AND imgscale = %d LIMIT 1",
|
||||
$r = q("SELECT * FROM photo WHERE resource_id = '%s' AND imgscale = %d LIMIT 1",
|
||||
dbesc($photo),
|
||||
intval($resolution)
|
||||
);
|
||||
@ -163,13 +158,10 @@ class Photo extends \Zotlabs\Web\Controller {
|
||||
if($u === PHOTO_CACHE) {
|
||||
// Validate cache
|
||||
if($cache_mode['on']) {
|
||||
$cache = array(
|
||||
'resid' => $photo,
|
||||
'status' => false
|
||||
);
|
||||
$cache = [ 'status' => false, 'item' => $r[0] ];
|
||||
call_hooks('cache_url_hook', $cache);
|
||||
if(! $cache['status']) {
|
||||
$url = html_entity_decode($r[0]['display_path'], ENT_QUOTES);
|
||||
$url = html_entity_decode($cache['item']['display_path'], ENT_QUOTES);
|
||||
// SSLify if needed
|
||||
if(strpos(z_root(),'https:') !== false && strpos($url,'https:') === false)
|
||||
$url = z_root() . '/sslify/' . $filename . '?f=&url=' . urlencode($url);
|
||||
@ -272,7 +264,12 @@ class Photo extends \Zotlabs\Web\Controller {
|
||||
$maxage = $expires - time();
|
||||
|
||||
header("Expires: " . gmdate("D, d M Y H:i:s", $expires) . " GMT");
|
||||
header("Cache-Control: max-age=" . $maxage . $cachecontrol);
|
||||
|
||||
// set CDN/Infrastructure caching much lower than maxage
|
||||
// in the event that infrastructure caching is present.
|
||||
$smaxage = intval($maxage/12);
|
||||
|
||||
header("Cache-Control: s-maxage=" . $smaxage . ", max-age=" . $maxage . $cachecontrol);
|
||||
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,7 @@ class Wall_attach extends \Zotlabs\Web\Controller {
|
||||
$def_attach = get_pconfig($channel['channel_id'],'system','attach_path');
|
||||
|
||||
$r = attach_store($channel,(($observer) ? $observer['xchan_hash'] : ''),'', array('source' => 'editor', 'visible' => 0, 'album' => $def_album, 'directory' => $def_attach, 'allow_cid' => '<' . $channel['channel_hash'] . '>'));
|
||||
|
||||
|
||||
if(! $r['success']) {
|
||||
notice( $r['message'] . EOL);
|
||||
killme();
|
||||
@ -111,7 +111,7 @@ class Wall_attach extends \Zotlabs\Web\Controller {
|
||||
}
|
||||
if(strpos($r['data']['filetype'],'audio') === 0) {
|
||||
$url = z_root() . '/cloud/' . $channel['channel_address'] . '/' . $r['data']['display_path'];
|
||||
echo "\n\n" . '[zaudio]' . $url . '[/zaudio]' . "\n\n";
|
||||
$s = "\n\n" . '[zaudio]' . $url . '[/zaudio]' . "\n\n";
|
||||
}
|
||||
|
||||
$s .= "\n\n" . '[attachment]' . $r['data']['hash'] . ',' . $r['data']['revision'] . '[/attachment]' . "\n";
|
||||
|
11
doc/hook/comments_are_now_closed.bb
Normal file
11
doc/hook/comments_are_now_closed.bb
Normal file
@ -0,0 +1,11 @@
|
||||
[h3]comments_are_now_closed[/h3]
|
||||
|
||||
Called when deciding whether or not commenting is closed for an item.
|
||||
|
||||
|
||||
Hook data (array):
|
||||
item => posted item
|
||||
closed => 'unset'
|
||||
|
||||
|
||||
To over-ride the default behaviour, change closed to true or false
|
@ -154,6 +154,9 @@ Hooks allow plugins/addons to "hook into" the code at many points and alter the
|
||||
[zrl=[baseurl]/help/hook/comment_buttons]comment_buttons[/zrl]
|
||||
Called when rendering the edit buttons for comments
|
||||
|
||||
[zrl=[baseurl]/help/hook/comments_are_now_closed]comments_are_now_closed[/zrl]
|
||||
Called when deciding whether or not to present a comment box for a post
|
||||
|
||||
[zrl=[baseurl]/help/hook/connect_premium]connect_premium[/zrl]
|
||||
Called when connecting to a premium channel
|
||||
|
||||
|
@ -1346,6 +1346,7 @@ function bbcode($Text, $options = []) {
|
||||
$Text = preg_replace("/\[event\-finish\](.*?)\[\/event\-finish\]/ism",'',$Text);
|
||||
$Text = preg_replace("/\[event\-id\](.*?)\[\/event\-id\]/ism",'',$Text);
|
||||
$Text = preg_replace("/\[event\-location\](.*?)\[\/event\-location\]/ism",'',$Text);
|
||||
$Text = preg_replace("/\[event\-timezone\](.*?)\[\/event\-timezone\]/ism",'',$Text);
|
||||
$Text = preg_replace("/\[event\-adjust\](.*?)\[\/event\-adjust\]/ism",'',$Text);
|
||||
|
||||
$Text = str_replace("\0",'$',$Text);
|
||||
|
@ -2254,19 +2254,19 @@ function get_zcard($channel, $observer_hash = '', $args = array()) {
|
||||
$cover_width = 425;
|
||||
$size = 'hz_small';
|
||||
$cover_size = PHOTO_RES_COVER_425;
|
||||
$pphoto = array('mimetype' => $channel['xchan_photo_mimetype'], 'width' => 80 , 'height' => 80, 'href' => $channel['xchan_photo_m']);
|
||||
$pphoto = array('mimetype' => $channel['xchan_photo_mimetype'], 'width' => 80 , 'height' => 80, 'href' => $channel['xchan_photo_m'].'?rev='.strtotime($channel['xchan_photo_date']));
|
||||
} elseif($maxwidth <= 900) {
|
||||
$width = 900;
|
||||
$cover_width = 850;
|
||||
$size = 'hz_medium';
|
||||
$cover_size = PHOTO_RES_COVER_850;
|
||||
$pphoto = array('mimetype' => $channel['xchan_photo_mimetype'], 'width' => 160 , 'height' => 160, 'href' => $channel['xchan_photo_l']);
|
||||
$pphoto = array('mimetype' => $channel['xchan_photo_mimetype'], 'width' => 160 , 'height' => 160, 'href' => $channel['xchan_photo_l'].'?rev='.strtotime($channel['xchan_photo_date']));
|
||||
} elseif($maxwidth <= 1200) {
|
||||
$width = 1200;
|
||||
$cover_width = 1200;
|
||||
$size = 'hz_large';
|
||||
$cover_size = PHOTO_RES_COVER_1200;
|
||||
$pphoto = array('mimetype' => $channel['xchan_photo_mimetype'], 'width' => 300 , 'height' => 300, 'href' => $channel['xchan_photo_l']);
|
||||
$pphoto = array('mimetype' => $channel['xchan_photo_mimetype'], 'width' => 300 , 'height' => 300, 'href' => $channel['xchan_photo_l'].'?rev='.strtotime($channel['xchan_photo_date']));
|
||||
}
|
||||
|
||||
// $scale = (float) $maxwidth / $width;
|
||||
|
@ -276,6 +276,9 @@ function format_event_bbcode($ev) {
|
||||
if($ev['event_hash'])
|
||||
$o .= '[event-id]' . $ev['event_hash'] . '[/event-id]';
|
||||
|
||||
if($ev['timezone'])
|
||||
$o .= '[event-timezone]' . $ev['timezone'] . '[/event-timezone]';
|
||||
|
||||
if($ev['adjust'])
|
||||
$o .= '[event-adjust]' . $ev['adjust'] . '[/event-adjust]';
|
||||
|
||||
@ -324,6 +327,9 @@ function bbtoevent($s) {
|
||||
if(preg_match("/\[event\-id\](.*?)\[\/event\-id\]/is",$s,$match))
|
||||
$ev['event_hash'] = $match[1];
|
||||
$match = '';
|
||||
if(preg_match("/\[event\-timezone\](.*?)\[\/event\-timezone\]/is",$s,$match))
|
||||
$ev['timezone'] = $match[1];
|
||||
$match = '';
|
||||
if(preg_match("/\[event\-adjust\](.*?)\[\/event\-adjust\]/is",$s,$match))
|
||||
$ev['adjust'] = $match[1];
|
||||
if(array_key_exists('dtstart',$ev)) {
|
||||
|
@ -142,7 +142,7 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false)
|
||||
$sql_options = (($protocol) ? " and xchan_network = '" . dbesc($protocol) . "' " : '');
|
||||
|
||||
|
||||
$r = q("select * from xchan where xchan_hash = '%s' or xchan_url = '%s' $sql_options ",
|
||||
$r = q("select * from xchan where (xchan_addr = '%s' or xchan_url = '%s') $sql_options ",
|
||||
dbesc($url),
|
||||
dbesc($url)
|
||||
);
|
||||
|
@ -206,6 +206,25 @@ function collect_recipients($item, &$private_envelope,$include_groups = true) {
|
||||
}
|
||||
|
||||
function comments_are_now_closed($item) {
|
||||
|
||||
$x = [
|
||||
'item' => $item,
|
||||
'closed' => 'unset'
|
||||
];
|
||||
|
||||
/**
|
||||
* @hooks comments_are_now_closed
|
||||
* Called to determine whether commenting should be closed
|
||||
* * \e array \b item
|
||||
* * \e boolean \b closed - return value
|
||||
*/
|
||||
|
||||
call_hooks('comments_are_now_closed', $x);
|
||||
|
||||
if ($x['closed'] != 'unset') {
|
||||
return $x['closed'];
|
||||
}
|
||||
|
||||
if($item['comments_closed'] > NULL_DATE) {
|
||||
$d = datetime_convert();
|
||||
if($d > $item['comments_closed'])
|
||||
|
@ -80,7 +80,7 @@ function nav($template = 'default') {
|
||||
|
||||
if($observer) {
|
||||
$userinfo = [
|
||||
'icon' => $observer['xchan_photo_m'],
|
||||
'icon' => $observer['xchan_photo_m'].'?rev='.strtotime($observer['xchan_photo_date']),
|
||||
'name' => $observer['xchan_addr'],
|
||||
];
|
||||
}
|
||||
|
75
include/opengraph.php
Normal file
75
include/opengraph.php
Normal file
@ -0,0 +1,75 @@
|
||||
<?php
|
||||
/**
|
||||
* @file include/opengraph.php
|
||||
* @brief Add Opengraph metadata and related functions.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @brief Adds Opengraph meta tags into HTML head
|
||||
*
|
||||
* @param array $item
|
||||
* @param array $profile
|
||||
*
|
||||
*/
|
||||
|
||||
function opengraph_add_meta($item, $profile) {
|
||||
|
||||
if(! empty($item)) {
|
||||
|
||||
if(! empty($item['title']))
|
||||
$ogtitle = $item['title'];
|
||||
|
||||
// find first image if exist
|
||||
if(preg_match("/\[[zi]mg(=[0-9]+x[0-9]+)?\]([^\[]+)/is", $item['body'], $matches)) {
|
||||
$ogimage = $matches[2];
|
||||
$ogimagetype = guess_image_type($ogimage);
|
||||
}
|
||||
|
||||
// use summary as description if exist
|
||||
$ogdesc = (empty($item['summary']) ? $item['body'] : $item['summary'] );
|
||||
|
||||
$ogdesc = str_replace("#^[", "[", $ogdesc);
|
||||
|
||||
$ogdesc = bbcode($ogdesc, [ 'tryoembed' => false ]);
|
||||
$ogdesc = trim(html2plain($ogdesc, 0, true));
|
||||
$ogdesc = html_entity_decode($ogdesc, ENT_QUOTES, 'UTF-8');
|
||||
|
||||
// remove all URLs
|
||||
$ogdesc = preg_replace("/https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,\@]+/", "", $ogdesc);
|
||||
|
||||
// shorten description
|
||||
$ogdesc = substr($ogdesc, 0, 300);
|
||||
$ogdesc = str_replace("\n", " ", $ogdesc);
|
||||
while (strpos($ogdesc, " ") !== false)
|
||||
$ogdesc = str_replace(" ", " ", $ogdesc);
|
||||
$ogdesc = rtrim(substr($ogdesc, 0, strrpos($ogdesc, " ")), "?.,:;!-") . "...";
|
||||
|
||||
$ogtype = "article";
|
||||
}
|
||||
|
||||
$channel = channelx_by_n($profile['profile_uid']);
|
||||
|
||||
if(! isset($ogdesc)) {
|
||||
if($profile['about'] && perm_is_allowed($channel['channel_id'],get_observer_hash(),'view_profile')) {
|
||||
$ogdesc = $profile['about'];
|
||||
}
|
||||
else {
|
||||
$ogdesc = sprintf( t('This is the home page of %s.'), $channel['channel_name']);
|
||||
}
|
||||
}
|
||||
|
||||
if(! isset($ogimage)) {
|
||||
$ogimage = $channel['xchan_photo_l'];
|
||||
$ogimagetype = $channel['xchan_photo_mimetype'];
|
||||
}
|
||||
|
||||
App::$page['htmlhead'] .= '<meta property="og:title" content="' . htmlspecialchars((isset($ogtitle) ? $ogtitle : $channel['channel_name'])) . '">' . "\r\n";
|
||||
App::$page['htmlhead'] .= '<meta property="og:image" content="' . $ogimage . '">' . "\r\n";
|
||||
App::$page['htmlhead'] .= '<meta property="og:image:type" content="' . $ogimagetype . '">' . "\r\n";
|
||||
App::$page['htmlhead'] .= '<meta property="og:description" content="' . htmlspecialchars($ogdesc) . '">' . "\r\n";
|
||||
App::$page['htmlhead'] .= '<meta property="og:type" content="' . (isset($ogtype) ? $ogtype : "profile") . '">' . "\r\n";
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -1776,17 +1776,14 @@ function process_delivery($sender, $arr, $deliveries, $relay, $public = false, $
|
||||
|
||||
$DR = new Zotlabs\Lib\DReport(z_root(),$sender['hash'],$d['hash'],$arr['mid']);
|
||||
|
||||
$r = q("select * from channel where channel_hash = '%s' limit 1",
|
||||
dbesc($d['hash'])
|
||||
);
|
||||
$channel = channelx_by_hash($d['hash']);
|
||||
|
||||
if(! $r) {
|
||||
if(! $channel) {
|
||||
$DR->update('recipient not found');
|
||||
$result[] = $DR->get();
|
||||
continue;
|
||||
}
|
||||
|
||||
$channel = $r[0];
|
||||
$DR->set_name($channel['channel_name'] . ' <' . channel_reddress($channel) . '>');
|
||||
|
||||
/* blacklisted channels get a permission denied, no special message to tip them off */
|
||||
@ -2032,7 +2029,7 @@ function process_delivery($sender, $arr, $deliveries, $relay, $public = false, $
|
||||
// if it's a sourced post, call the post_local hooks as if it were
|
||||
// posted locally so that crosspost connectors will be triggered.
|
||||
|
||||
if(check_item_source($arr['uid'], $arr)) {
|
||||
if(check_item_source($arr['uid'], $arr) || ($channel['xchan_pubforum'] == 1)) {
|
||||
/**
|
||||
* @hooks post_local
|
||||
* Called when an item has been posted on this machine via mod/item.php (also via API).
|
||||
|
@ -595,7 +595,7 @@ CREATE TABLE IF NOT EXISTS `item` (
|
||||
`layout_mid` char(191) NOT NULL DEFAULT '',
|
||||
`postopts` text NOT NULL,
|
||||
`route` text NOT NULL,
|
||||
`llink` char(191) NOT NULL DEFAULT '',
|
||||
`llink` text NOT NULL,
|
||||
`plink` text NOT NULL,
|
||||
`resource_id` char(191) NOT NULL DEFAULT '',
|
||||
`resource_type` char(16) NOT NULL DEFAULT '',
|
||||
@ -659,7 +659,6 @@ CREATE TABLE IF NOT EXISTS `item` (
|
||||
KEY `commented` (`commented`),
|
||||
KEY `verb` (`verb`),
|
||||
KEY `obj_type` (`obj_type`),
|
||||
KEY `llink` (`llink`),
|
||||
KEY `expires` (`expires`),
|
||||
KEY `revision` (`revision`),
|
||||
KEY `mimetype` (`mimetype`),
|
||||
|
@ -644,7 +644,6 @@ create index "item_resource_type" on item ("resource_type");
|
||||
create index "item_commented" on item ("commented");
|
||||
create index "item_verb" on item ("verb");
|
||||
create index "item_obj_type" on item ("obj_type");
|
||||
create index "item_llink" on item ("llink");
|
||||
create index "item_expires" on item ("expires");
|
||||
create index "item_revision" on item ("revision");
|
||||
create index "item_mimetype" on item ("mimetype");
|
||||
|
@ -52,7 +52,7 @@ function po2php_run($argc,$argv) {
|
||||
if ($l[0]=="#") $l="";
|
||||
if (substr($l,0,15)=='"Plural-Forms: '){
|
||||
$match=Array();
|
||||
preg_match("|nplurals=([0-9]*);\s*plural=(.*)[;\\\\]|", $l, $match);
|
||||
preg_match("|nplurals=([0-9]*);\s*plural=([^;\\\\]*)|", $l, $match);
|
||||
$cond = str_replace('n','$n',$match[2]);
|
||||
$out .= 'if(! function_exists("' . 'string_plural_select_' . $lang .'")) {' . "\n";
|
||||
$out .= 'function string_plural_select_' . $lang . '($n){'."\n";
|
||||
|
@ -70,21 +70,3 @@
|
||||
margin-top: 0px !important;
|
||||
margin-left: 0px !important;
|
||||
}
|
||||
|
||||
pre code {
|
||||
background: #F5F5F5;
|
||||
font-family: Courier, monospace;
|
||||
font-size: 1em;
|
||||
padding: 1em 1.5em;
|
||||
display: block;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
code {
|
||||
background: #F5F5F5;
|
||||
font-family: Courier, monospace;
|
||||
font-size: 1em;
|
||||
display: inline;
|
||||
padding: 0.2em 0.2em;
|
||||
white-space: pre-wrap;
|
||||
}
|
0
view/ja/.gitkeep
Normal file
0
view/ja/.gitkeep
Normal file
12090
view/ja/hmessages.po
Normal file
12090
view/ja/hmessages.po
Normal file
File diff suppressed because it is too large
Load Diff
2796
view/ja/hstrings.php
Normal file
2796
view/ja/hstrings.php
Normal file
File diff suppressed because it is too large
Load Diff
@ -207,7 +207,7 @@ ACL.prototype.on_button_hide = function(event) {
|
||||
|
||||
ACL.prototype.set_allow = function(itemid) {
|
||||
type = itemid[0];
|
||||
id = itemid.substr(1);
|
||||
id = decodeURIComponent(itemid.substr(1));
|
||||
switch(type) {
|
||||
case "g":
|
||||
if (that.allow_gid.indexOf(id)<0) {
|
||||
@ -231,7 +231,7 @@ ACL.prototype.set_allow = function(itemid) {
|
||||
|
||||
ACL.prototype.set_deny = function(itemid) {
|
||||
type = itemid[0];
|
||||
id = itemid.substr(1);
|
||||
id = decodeURIComponent(itemid.substr(1));
|
||||
switch(type) {
|
||||
case "g":
|
||||
if (that.deny_gid.indexOf(id)<0) {
|
||||
@ -310,8 +310,12 @@ ACL.prototype.update_view = function(value) {
|
||||
|
||||
else {
|
||||
that.list.show(); //show acl-list
|
||||
datasrc2src('#acl-list-content .list-group-item img[data-src]');
|
||||
that.info.hide(); //hide acl-info
|
||||
that.update_select('custom');
|
||||
if(typeof value === 'undefined') {
|
||||
value = 'custom';
|
||||
}
|
||||
|
||||
/* jot acl */
|
||||
if(that.allow_gid.length === 0 && that.allow_cid.length === 0 && that.deny_gid.length === 0 && that.deny_cid.length === 0 && value === 'custom') {
|
||||
@ -334,7 +338,7 @@ ACL.prototype.update_view = function(value) {
|
||||
$("#acl-list-content .acl-list-item").each(function() {
|
||||
itemid = $(this).attr('id');
|
||||
type = itemid[0];
|
||||
id = itemid.substr(1);
|
||||
id = decodeURIComponent(itemid.substr(1));
|
||||
|
||||
btshow = $(this).children(".acl-button-show").removeClass("btn-success").addClass("btn-outline-success");
|
||||
bthide = $(this).children(".acl-button-hide").removeClass("btn-danger").addClass("btn-outline-danger");
|
||||
|
@ -1058,7 +1058,7 @@ function pageUpdate() {
|
||||
bParam_page = 1;
|
||||
}
|
||||
|
||||
update_url = baseurl + '/' + page_query + '/?f=&aj=1&page=' + bParam_page + extra_args ;
|
||||
update_url = baseurl + '/' + decodeURIComponent(page_query) + '/?f=&aj=1&page=' + bParam_page + extra_args ;
|
||||
|
||||
$("#page-spinner").show();
|
||||
update_mode = 'append';
|
||||
|
Reference in New Issue
Block a user