X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Ftext.php;h=d6a9ef5d3a03a33dbd8b2008e50392ac9cfb1c06;hb=abb9fecf0954e883f19b3cf16279dfa2d8c20271;hp=191f4fca8ab5d04b4d4218fbabbefa84a61973dd;hpb=210586eaed18afc4d9ff613ee8f1ea0acdec621a;p=friendica.git
diff --git a/include/text.php b/include/text.php
index 191f4fca8a..d6a9ef5d3a 100644
--- a/include/text.php
+++ b/include/text.php
@@ -80,6 +80,9 @@ function escape_tags($string) {
if(! function_exists('autoname')) {
function autoname($len) {
+ if($len <= 0)
+ return '';
+
$vowels = array('a','a','ai','au','e','e','e','ee','ea','i','ie','o','ou','u');
if(mt_rand(0,5) == 4)
$vowels[] = 'y';
@@ -225,6 +228,9 @@ if(! function_exists('paginate')) {
function paginate(&$a) {
$o = '';
$stripped = preg_replace('/(&page=[0-9]*)/','',$a->query_string);
+
+// $stripped = preg_replace('/&zrl=(.*?)([\?&]|$)/ism','',$stripped);
+
$stripped = str_replace('q=','',$stripped);
$stripped = trim($stripped,'/');
$pagenum = $a->pager['page'];
@@ -552,7 +558,7 @@ function contact_block() {
if((! is_array($a->profile)) || ($a->profile['hide-friends']))
return $o;
- $r = q("SELECT COUNT(*) AS `total` FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 and `pending` = 0 AND `hidden` = 0",
+ $r = q("SELECT COUNT(*) AS `total` FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 and `pending` = 0 AND `hidden` = 0 AND `archive` = 0",
intval($a->profile['uid'])
);
if(count($r)) {
@@ -563,7 +569,7 @@ 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 ORDER BY RAND() LIMIT %d",
+ $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 and `pending` = 0 AND `hidden` = 0 AND `archive` = 0 ORDER BY RAND() LIMIT %d",
intval($a->profile['uid']),
intval($shown)
);
@@ -640,7 +646,7 @@ function search($s,$id='search-box',$url='/search',$save = false) {
$a = get_app();
$o = '
';
@@ -920,7 +936,8 @@ function prepare_body($item,$attach = false) {
foreach($matches as $mtch) {
if(strlen($x))
$x .= ',';
- $x .= xmlify(file_tag_decode($mtch[1]));
+ $x .= xmlify(file_tag_decode($mtch[1]))
+ . ((local_user() == $item['uid']) ? ' ' . t('[remove]') . '' : '');
}
if(strlen($x))
$s .= '' . t('Categories:') . ' ' . $x . '
';
@@ -1058,10 +1075,12 @@ function unamp($s) {
if(! function_exists('lang_selector')) {
function lang_selector() {
global $lang;
- $o = '';
- $o .= '';
- $o .= '
';
+
+ $tpl = get_markup_template("lang_selector.tpl");
+ $o = replace_macros($tpl, array(
+ '$title' => t('Select an alternate language'),
+ '$langs' => array($lang_options, $selected),
+
+ ));
return $o;
}}
@@ -1314,6 +1338,118 @@ function file_tag_file_query($table,$s,$type = 'file') {
return " AND " . (($table) ? dbesc($table) . '.' : '') . "file regexp '" . dbesc($str) . "' ";
}
+// ex. given music,video return