diff options
author | zotlabs <mike@macgirvin.com> | 2020-01-24 19:38:21 -0800 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2020-01-24 19:38:21 -0800 |
commit | 19a8dfaa5c55b674df25ae7af5c1ffcf9070e522 (patch) | |
tree | 72461b15f54d222d12a1657c5ec534c25f93a236 /include | |
parent | 293d411efb28b8f20a0208e3c52883e9fbb8cea7 (diff) | |
parent | fa45ea1d84f27c6b4ddfdcffeed622cca354f3d9 (diff) | |
download | volse-hubzilla-19a8dfaa5c55b674df25ae7af5c1ffcf9070e522.tar.gz volse-hubzilla-19a8dfaa5c55b674df25ae7af5c1ffcf9070e522.tar.bz2 volse-hubzilla-19a8dfaa5c55b674df25ae7af5c1ffcf9070e522.zip |
Merge branch 'dev' of https://framagit.org/hubzilla/core into dev
Diffstat (limited to 'include')
-rw-r--r-- | include/bbcode.php | 8 | ||||
-rw-r--r-- | include/conversation.php | 18 | ||||
-rwxr-xr-x | include/dba/dba_driver.php | 4 | ||||
-rwxr-xr-x | include/dba/dba_pdo.php | 9 | ||||
-rw-r--r-- | include/feedutils.php | 4 | ||||
-rwxr-xr-x | include/items.php | 13 | ||||
-rw-r--r-- | include/message.php | 4 | ||||
-rw-r--r-- | include/network.php | 2 |
8 files changed, 46 insertions, 16 deletions
diff --git a/include/bbcode.php b/include/bbcode.php index c7dea53c5..301ffbd24 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -382,7 +382,7 @@ function bb_ShareAttributes($match) { // Bob Smith wrote the following post 2 hours ago $fmt = sprintf( t('%1$s wrote the following %2$s %3$s'), - '<a href="' . (($auth) ? zid($profile) : $profile) . '" >' . $author . '</a>', + '<a href="' . (($auth) ? zid($profile) : $profile) . '" ><bdi>' . $author . '</bdi></a>', '<a href="' . (($auth) ? zid($link) : $link) . '" >' . $type . '</a>', $reldate ); @@ -1111,6 +1111,12 @@ function bbcode($Text, $options = []) { if (strpos($Text,'[/footer]') !== false) { $Text = preg_replace("(\[footer\](.*?)\[\/footer\])ism", "<div class=\"wall-item-footer\">$1</div>", $Text); } + + // Check for bdi + if (strpos($Text,'[/bdi]') !== false) { + $Text = preg_replace("(\[bdi\](.*?)\[\/bdi\])ism", "<bdi>$1</bdi>", $Text); + } + // Check for list text $Text = preg_replace("/<br \/>\[\*\]/ism",'[*]',$Text); diff --git a/include/conversation.php b/include/conversation.php index a80adb933..07d43e660 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -172,9 +172,9 @@ function localize_item(&$item){ $shortbodyverb = t('doesn\'t like %1$s\'s %2$s'); } - $item['shortlocalize'] = sprintf($shortbodyverb, $objauthor, $plink); + $item['shortlocalize'] = sprintf($shortbodyverb, '[bdi]' . $author_name . '[/bdi]', $post_type); - $item['body'] = $item['localize'] = sprintf($bodyverb, $author, $objauthor, $plink); + $item['body'] = $item['localize'] = sprintf($bodyverb, '[bdi]' . $author . '[/bdi]', '[bdi]' . $objauthor . '[/bdi]', $plink); if($Bphoto != "") $item['body'] .= "\n\n\n" . '[zrl=' . chanlink_url($author_link) . '][zmg=80x80]' . $Bphoto . '[/zmg][/zrl]'; @@ -205,10 +205,12 @@ function localize_item(&$item){ $Bname = $obj['title']; - $A = '[zrl=' . chanlink_url($Alink) . ']' . $Aname . '[/zrl]'; - $B = '[zrl=' . chanlink_url($Blink) . ']' . $Bname . '[/zrl]'; + $A = '[zrl=' . chanlink_url($Alink) . '][bdi]' . $Aname . '[/bdi][/zrl]'; + $B = '[zrl=' . chanlink_url($Blink) . '][bdi]' . $Bname . '[/bdi][/zrl]'; if ($Bphoto!="") $Bphoto = '[zrl=' . chanlink_url($Blink) . '][zmg=80x80]' . $Bphoto . '[/zmg][/zrl]'; + $item['shortlocalize'] = sprintf( t('%1$s is now connected with %2$s'), '[bdi]' . $Aname . '[/bdi]', '[bdi]' . $Bname . '[/bdi]'); + $item['body'] = $item['localize'] = sprintf( t('%1$s is now connected with %2$s'), $A, $B); $item['body'] .= "\n\n\n" . $Bphoto; } @@ -237,8 +239,8 @@ function localize_item(&$item){ } $Bname = $obj['title']; - $A = '[zrl=' . chanlink_url($Alink) . ']' . $Aname . '[/zrl]'; - $B = '[zrl=' . chanlink_url($Blink) . ']' . $Bname . '[/zrl]'; + $A = '[zrl=' . chanlink_url($Alink) . '][bdi]' . $Aname . '[/bdi][/zrl]'; + $B = '[zrl=' . chanlink_url($Blink) . '][bdi]' . $Bname . '[/bdi][/zrl]'; if ($Bphoto!="") $Bphoto = '[zrl=' . chanlink_url($Blink) . '][zmg=80x80]' . $Bphoto . '[/zmg][/zrl]'; // we can't have a translation string with three positions but no distinguishable text @@ -252,6 +254,8 @@ function localize_item(&$item){ // then do the sprintf on the translation string + $item['shortlocalize'] = sprintf($txt, '[bdi]' . $Aname . '[/bdi]', '[bdi]' . $Bname . '[/bdi]'); + $item['body'] = $item['localize'] = sprintf($txt, $A, $B); $item['body'] .= "\n\n\n" . $Bphoto; } @@ -263,7 +267,7 @@ function localize_item(&$item){ $Aname = $item['author']['xchan_name']; $Alink = $item['author']['xchan_url']; - $A = '[zrl=' . chanlink_url($Alink) . ']' . $Aname . '[/zrl]'; + $A = '[zrl=' . chanlink_url($Alink) . '][bdi]' . $Aname . '[/bdi][/zrl]'; $txt = t('%1$s is %2$s','mood'); diff --git a/include/dba/dba_driver.php b/include/dba/dba_driver.php index cfb208e2d..b96601fec 100755 --- a/include/dba/dba_driver.php +++ b/include/dba/dba_driver.php @@ -307,6 +307,10 @@ function db_use_index($str) { return \DBA::$dba->use_index($str); } +function db_str_to_date($str) { + return \DBA::$dba->str_to_date($str); +} + /** * @brief Execute a SQL query with printf style args. * diff --git a/include/dba/dba_pdo.php b/include/dba/dba_pdo.php index 0279342ec..49f741601 100755 --- a/include/dba/dba_pdo.php +++ b/include/dba/dba_pdo.php @@ -139,6 +139,15 @@ class dba_pdo extends dba_driver { } } + function str_to_date($str) { + if($this->driver_dbtype === 'pgsql') { + return "TO_TIMESTAMP($str, 'YYYY-MM-DD HH24:MI:SS')"; + } + else { + return "STR_TO_DATE($str, '%Y-%m-%d %H:%i:%s')"; + } + } + function quote_interval($txt) { if($this->driver_dbtype === 'pgsql') { return "'$txt'"; diff --git a/include/feedutils.php b/include/feedutils.php index 6d14eb5c4..9ff09cc66 100644 --- a/include/feedutils.php +++ b/include/feedutils.php @@ -155,7 +155,7 @@ function get_feed_for($channel, $observer_hash, $params) { if($item['item_private']) continue; - $atom .= atom_entry($item, $type, null, $owner, true, '', $params['compat']); + $atom .= atom_entry($item, $type, null, $channel, true, '', $params['compat']); } } @@ -1921,7 +1921,7 @@ function atom_entry($item, $type, $author, $owner, $comment = false, $cid = 0, $ $summary = ''; if($item['allow_cid'] || $item['allow_gid'] || $item['deny_cid'] || $item['deny_gid']) - $body = fix_private_photos($body,$owner['uid'],$item,$cid); + $body = fix_private_photos($body,$owner['channel_id'],$item,$cid); if($compat) { $compat_photos = compat_photos_list($body); diff --git a/include/items.php b/include/items.php index 917808ad5..9f90b2f3b 100755 --- a/include/items.php +++ b/include/items.php @@ -930,8 +930,19 @@ function import_author_xchan($x) { } // if we were told that it's a zot connection, don't probe/import anything else - if(array_key_exists('network',$x) && $x['network'] === 'zot') + if(array_key_exists('network',$x) && $x['network'] === 'zot') { + if($x['url']) { + // check if we already have the zot6 xchan of this xchan_url. if not import it. + $r = q("SELECT xchan_hash FROM xchan WHERE xchan_url = '%s' AND xchan_network = 'zot6'", + dbesc($x['url']) + ); + + if(! $r) + discover_by_webbie($x['url'], 'zot6'); + } + return $y; + } // perform zot6 discovery diff --git a/include/message.php b/include/message.php index 7d05b9ab7..37fe6749d 100644 --- a/include/message.php +++ b/include/message.php @@ -299,10 +299,6 @@ function create_conversation($channel,$recipient,$subject) { } - - - - function private_messages_list($uid, $mailbox = '', $start = 0, $numitems = 0) { $where = ''; diff --git a/include/network.php b/include/network.php index f6992291d..c2edb4f8a 100644 --- a/include/network.php +++ b/include/network.php @@ -505,7 +505,7 @@ function z_dns_check($h,$check_mx = 0) { // Otherwise we will assume dns_get_record() works as documented - $opts = DNS_A + DNS_CNAME + DNS_PTR; + $opts = DNS_A + DNS_AAAA; if($check_mx) $opts += DNS_MX; |