X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Ftext.php;h=f210bff72100c363ee4355fb0a07eed4a86d90f8;hb=b67f33f6d5431b18f1da9a3b75f3097c848d0d09;hp=18ce232f1d12650674502db2757fe8a342655e35;hpb=645dc13455d9d7e6f36b64945266e64b36d62aa6;p=friendica.git
diff --git a/include/text.php b/include/text.php
index 18ce232f1d..f210bff721 100644
--- a/include/text.php
+++ b/include/text.php
@@ -20,6 +20,10 @@ function replace_macros($s,$r) {
$stamp1 = microtime(true);
$a = get_app();
+
+ // pass $baseurl to all templates
+ $r['$baseurl'] = $a->get_baseurl();
+
$t = $a->template_engine();
try {
@@ -470,11 +474,17 @@ if(! function_exists('item_new_uri')) {
* @param int $uid
* @return string
*/
-function item_new_uri($hostname,$uid) {
+function item_new_uri($hostname,$uid, $guid = "") {
do {
$dups = false;
- $hash = random_string();
+
+ if ($guid == "")
+ $hash = get_guid(32);
+ else {
+ $hash = $guid;
+ $guid = "";
+ }
$uri = "urn:X-dfrn:" . $hostname . ':' . $uid . ':' . $hash;
@@ -964,7 +974,7 @@ function micropro($contact, $redirect = false, $class = '', $textmode = false) {
. (($click) ? ' fakelink' : '') . '" '
. (($redir) ? ' target="redir" ' : '')
. (($url) ? ' href="' . $url . '"' : '') . $click . ' >' . "\r\n";
}
}}
@@ -980,16 +990,29 @@ if(! function_exists('search')) {
* @param string $url search url
* @param boolean $savedsearch show save search button
*/
-function search($s,$id='search-box',$url='/search',$save = false) {
+function search($s,$id='search-box',$url='/search',$save = false, $aside = true) {
$a = get_app();
- return replace_macros(get_markup_template('searchbox.tpl'), array(
- '$s' => $s,
- '$id' => $id,
- '$action_url' => $a->get_baseurl((stristr($url,'network')) ? true : false) . $url,
- '$search_label' => t('Search'),
- '$save_label' => t('Save'),
- '$savedsearch' => feature_enabled(local_user(),'savedsearch'),
- ));
+
+ $values = array(
+ '$s' => $s,
+ '$id' => $id,
+ '$action_url' => $a->get_baseurl((stristr($url,'network')) ? true : false) . $url,
+ '$search_label' => t('Search'),
+ '$save_label' => t('Save'),
+ '$savedsearch' => feature_enabled(local_user(),'savedsearch'),
+ );
+
+ if (!$aside) {
+ $values['$searchoption'] = array(
+ t("Full Text"),
+ t("Tags"),
+ t("Contacts"));
+
+ if (get_config('system','poco_local_search'))
+ $values['$searchoption'][] = t("Forums");
+ }
+
+ return replace_macros(get_markup_template('searchbox.tpl'), $values);
}}
if(! function_exists('valid_email')) {
@@ -1001,8 +1024,9 @@ if(! function_exists('valid_email')) {
*/
function valid_email($x){
- if(get_config('system','disable_email_validation'))
- return true;
+ // Removed because Fabio told me so.
+ //if(get_config('system','disable_email_validation'))
+ // return true;
if(preg_match('/^[_a-zA-Z0-9\-\+]+(\.[_a-zA-Z0-9\-\+]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)+$/',$x))
return true;
@@ -1391,9 +1415,6 @@ function prepare_body(&$item,$attach = false, $preview = false) {
put_item_in_cache($item, true);
$s = $item["rendered-html"];
- require_once("mod/proxy.php");
- $s = proxy_parse_html($s);
-
$prep_arr = array('item' => $item, 'html' => $s, 'preview' => $preview);
call_hooks('prepare_body', $prep_arr);
$s = $prep_arr['html'];
@@ -1486,7 +1507,7 @@ function prepare_body(&$item,$attach = false, $preview = false) {
if($x) {
$s = preg_replace('/\