X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Ftext.php;h=fc5e79294f261bfbe1942b42a7daad69f46f3aeb;hb=d0ade828c05545e45ce129c05090fa795d0376c1;hp=89a58cccc07f5b8e381f93f363907e8e17d61b75;hpb=39b37281a78b58b50503056e69b2aaa9885257b0;p=friendica.git diff --git a/include/text.php b/include/text.php index 89a58cccc0..fc5e79294f 100644 --- a/include/text.php +++ b/include/text.php @@ -20,10 +20,10 @@ function replace_macros($s,$r) { $stamp1 = microtime(true); $a = get_app(); - + // pass $baseurl to all templates $r['$baseurl'] = z_root(); - + $t = $a->template_engine(); try { @@ -895,9 +895,9 @@ function contact_block() { $micropro = Null; } else { - $r = q("SELECT * FROM `contact` - WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 and `pending` = 0 - AND `hidden` = 0 AND `archive` = 0 + $r = q("SELECT `id`, `uid`, `addr`, `url`, `name`, `micro`, `network` FROM `contact` + WHERE `uid` = %d AND NOT `self` AND NOT `blocked` AND NOT `pending` + AND NOT `hidden` AND NOT `archive` AND `network` IN ('%s', '%s', '%s') ORDER BY RAND() LIMIT %d", intval($a->profile['uid']), dbesc(NETWORK_DFRN), @@ -1415,7 +1415,14 @@ function prepare_body(&$item,$attach = false, $preview = false) { $item['hashtags'] = $hashtags; $item['mentions'] = $mentions; - put_item_in_cache($item, true); + // Update the cached values if there is no "zrl=..." on the links + $update = (!local_user() and !remote_user() and ($item["uid"] == 0)); + + // Or update it if the current viewer is the intented viewer + if (($item["uid"] == local_user()) AND ($item["uid"] != 0)) + $update = true; + + put_item_in_cache($item, $update); $s = $item["rendered-html"]; $prep_arr = array('item' => $item, 'html' => $s, 'preview' => $preview); @@ -2288,37 +2295,6 @@ function formatBytes($bytes, $precision = 2) { return round($bytes, $precision) . ' ' . $units[$pow]; } -/** - * @brief Translate the PAGE type flags in human readable string - * - * @param int $page_type - * @return string $trans_type - */ -function page_type_translate($page_type) { - - // ToDo: we need a good interpretable translation for PAGE_SOAPBOX - // and PAGE_PRVGROUP - switch ($page_type) { - case PAGE_NORMAL: - $trans_type = t('Normal Account'); - break; - case PAGE_SOAPBOX: - $trans_type = t('Fan Page'); - break; - case PAGE_COMMUNITY: - $trans_type = t('Community Forum'); - break; - case PAGE_FREELOVE: - $trans_type = t('Open Forum'); - break; - case PAGE_PRVGROUP: - $trans_type = t('Private Forum'); - break; - } - - return $trans_type; -} - /** * @brief translate and format the networkname of a contact *