]> git.mxchange.org Git - friendica.git/blobdiff - boot.php
use zrl to get home again
[friendica.git] / boot.php
index 4a4adbbc82110e3a0ce1306077180223bbd25e74..1f2b690773cae4318326cc24a5f862796ec56e7d 100755 (executable)
--- a/boot.php
+++ b/boot.php
@@ -1415,3 +1415,21 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){
 
        return replace_macros($tpl,array('$tabs' => $arr['tabs']));
 }}     
+
+function get_my_url() {
+       if(x($_SESSION,'my_url'))
+               return $_SESSION['my_url'];
+       return false;
+}
+
+function zrl($s) {
+       if(! strlen($s))
+               return $s;
+       if(! strpos($s,'/profile/'))
+               return $s;      
+       $achar = strpos($s,'?') ? '&' : '?';
+       $mine = get_my_url();
+       if($mine and ! link_compare($mine,$s))
+               return $s . $achar . 'zrl=' . urlencode($mine);
+       return $s;
+}
\ No newline at end of file