X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Ftext.php;h=fc5e79294f261bfbe1942b42a7daad69f46f3aeb;hb=d0ade828c05545e45ce129c05090fa795d0376c1;hp=253489180552b4822ffc475f1b3fe38d476e1810;hpb=146f386e37670b64c588c65d25c9f068a0e8e066;p=friendica.git diff --git a/include/text.php b/include/text.php index 2534891805..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); @@ -2289,32 +2296,23 @@ function formatBytes($bytes, $precision = 2) { } /** - * @brief Translate the PAGE type flags in human readable string + * @brief translate and format the networkname of a contact * - * @param int $page_type - * @return string $trans_type + * @param string $network + * Networkname of the contact (e.g. dfrn, rss and so on) + * @param sting $url + * The contact url + * @return string */ -function page_type_translate($page_type) { +function format_network_name($network, $url = 0) { + if ($network != "") { + require_once('include/contact_selectors.php'); + if ($url != "") + $network_name = ''.network_to_name($network, $url).""; + else + $network_name = network_to_name($network); - // 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 $network_name; } - return $trans_type; }