diff options
author | redmatrix <git@macgirvin.com> | 2016-03-30 22:13:24 -0700 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-03-30 22:13:24 -0700 |
commit | 1cd3b4182595b838a535dd6b6990251db05d49e6 (patch) | |
tree | 2d22ab3140caf9d7efcd46a1f30f81a833ebf6fd | |
parent | 4148211086ff53dfb6fb4e969fd067389bcfef29 (diff) | |
download | volse-hubzilla-1cd3b4182595b838a535dd6b6990251db05d49e6.tar.gz volse-hubzilla-1cd3b4182595b838a535dd6b6990251db05d49e6.tar.bz2 volse-hubzilla-1cd3b4182595b838a535dd6b6990251db05d49e6.zip |
deprecate $a->get_baseurl()
80 files changed, 397 insertions, 397 deletions
diff --git a/Zotlabs/Web/Router.php b/Zotlabs/Web/Router.php index af171437d..900ac1e26 100644 --- a/Zotlabs/Web/Router.php +++ b/Zotlabs/Web/Router.php @@ -94,7 +94,7 @@ class Router { if((x($_SERVER, 'QUERY_STRING')) && ($_SERVER['QUERY_STRING'] === 'q=internal_error.html') && $a->config['system']['dreamhost_error_hack']) { logger('index.php: dreamhost_error_hack invoked. Original URI =' . $_SERVER['REQUEST_URI']); - goaway($a->get_baseurl() . $_SERVER['REQUEST_URI']); + goaway(z_root() . $_SERVER['REQUEST_URI']); } logger('index.php: page not found: ' . $_SERVER['REQUEST_URI'] . ' ADDRESS: ' . $_SERVER['REMOTE_ADDR'] . ' QUERY: ' . $_SERVER['QUERY_STRING'], LOGGER_DEBUG); @@ -1206,7 +1206,7 @@ function clean_urls() { function z_path() { global $a; - $base = $a->get_baseurl(); + $base = z_root(); if(! clean_urls()) $base .= '/?q='; @@ -1293,7 +1293,7 @@ function check_config(&$a) { // This will actually set the url to the one stored in .htconfig, and ignore what // we're passing - unless we are installing and it has never been set. - $a->set_baseurl($a->get_baseurl()); + $a->set_baseurl(z_root()); // Make sure each site has a system channel. This is now created on install // so we just need to keep this around a couple of weeks until the hubs that @@ -1355,12 +1355,12 @@ function check_config(&$a) { $email_tpl = get_intltext_template("update_fail_eml.tpl"); $email_msg = replace_macros($email_tpl, array( '$sitename' => $a->config['system']['sitename'], - '$siteurl' => $a->get_baseurl(), + '$siteurl' => z_root(), '$update' => $x, '$error' => sprintf( t('Update %s failed. See error logs.'), $x) )); - $subject = email_header_encode(sprintf(t('Update Error at %s'), $a->get_baseurl())); + $subject = email_header_encode(sprintf(t('Update Error at %s'), z_root())); mail($a->config['system']['admin_email'], $subject, $email_msg, 'From: Administrator' . '@' . $_SERVER['SERVER_NAME'] . "\n" @@ -1535,7 +1535,7 @@ function login($register = false, $form_id = 'main-login', $hiddens=false) { 'link' => (($register) ? $reglink : 'pubsites') ); - $dest_url = $a->get_baseurl(true) . '/' . $a->query_string; + $dest_url = z_root() . '/' . $a->query_string; if(local_channel()) { $tpl = get_markup_template("logout.tpl"); @@ -2177,10 +2177,10 @@ function construct_page(&$a) { if($a->is_mobile || $a->is_tablet) { if(isset($_SESSION['show_mobile']) && !$_SESSION['show_mobile']) { - $link = $a->get_baseurl() . '/toggle_mobile?f=&address=' . curPageURL(); + $link = z_root() . '/toggle_mobile?f=&address=' . curPageURL(); } else { - $link = $a->get_baseurl() . '/toggle_mobile?f=&off=1&address=' . curPageURL(); + $link = z_root() . '/toggle_mobile?f=&off=1&address=' . curPageURL(); } if ((isset($_SESSION) && $_SESSION['mobile_theme'] !='' && $_SESSION['mobile_theme'] !='---' ) || (isset($a->config['system']['mobile_theme']) && !isset($_SESSION['mobile_theme']))) { @@ -2338,7 +2338,7 @@ function cert_bad_email() { $email_tpl = get_intltext_template("cert_bad_eml.tpl"); $email_msg = replace_macros($email_tpl, array( '$sitename' => $a->config['system']['sitename'], - '$siteurl' => $a->get_baseurl(), + '$siteurl' => z_root(), '$error' => t('Website SSL certificate is not valid. Please correct.') )); @@ -2378,7 +2378,7 @@ function check_cron_broken() { $email_tpl = get_intltext_template("cron_bad_eml.tpl"); $email_msg = replace_macros($email_tpl, array( '$sitename' => $a->config['system']['sitename'], - '$siteurl' => $a->get_baseurl(), + '$siteurl' => z_root(), '$error' => t('Cron/Scheduled tasks not running.'), '$lastdate' => (($d)? $d : t('never')) )); diff --git a/doc/Creating-Templates.md b/doc/Creating-Templates.md index 6de627f39..fc3f18dd3 100644 --- a/doc/Creating-Templates.md +++ b/doc/Creating-Templates.md @@ -18,7 +18,7 @@ view/php/default.php <html> <head> <title><?php if(x($page,'title')) echo $page['title'] ?></title> - <script>var baseurl="<?php echo $a->get_baseurl() ?>";</script> + <script>var baseurl="<?php echo z_root() ?>";</script> <?php if(x($page,'htmlhead')) echo $page['htmlhead'] ?> </head> <body> diff --git a/include/Contact.php b/include/Contact.php index 1c61470e1..727d4b062 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -235,7 +235,7 @@ function account_remove($account_id,$local = true,$unset_session=true) { unset($_SESSION['authenticated']); unset($_SESSION['uid']); notice( sprintf(t("User '%s' deleted"),$account_email) . EOL); - goaway(get_app()->get_baseurl()); + goaway(z_root()); } return $r; @@ -390,7 +390,7 @@ function channel_remove($channel_id, $local = true, $unset_session=false) { if($channel_id == local_channel() && $unset_session) { nuke_session(); - goaway($a->get_baseurl()); + goaway(z_root()); } } diff --git a/include/ItemObject.php b/include/ItemObject.php index d42e993e6..623bf0676 100644 --- a/include/ItemObject.php +++ b/include/ItemObject.php @@ -97,7 +97,7 @@ class Item extends BaseObject { $mode = $conv->get_mode(); if(local_channel() && $observer['xchan_hash'] === $item['author_xchan']) - $edpost = array($a->get_baseurl($ssl_state)."/editpost/".$item['id'], t("Edit")); + $edpost = array(z_root()."/editpost/".$item['id'], t("Edit")); else $edpost = false; diff --git a/include/api.php b/include/api.php index e78e6cc37..73fd58d4d 100644 --- a/include/api.php +++ b/include/api.php @@ -171,12 +171,12 @@ require_once('include/api_auth.php'); $arr['$user'] = $user_info; $arr['$rss'] = array( 'alternate' => $user_info['url'], - 'self' => $a->get_baseurl(). "/". $a->query_string, - 'base' => $a->get_baseurl(), + 'self' => z_root(). "/". $a->query_string, + 'base' => z_root(), 'updated' => api_date(null), 'atom_updated' => datetime_convert('UTC','UTC','now',ATOM_TIME), 'language' => $user_info['language'], - 'logo' => $a->get_baseurl()."/images/rm-64.png", + 'logo' => z_root()."/images/rm-64.png", ); return $arr; @@ -318,7 +318,7 @@ require_once('include/api_auth.php'); 'location' => ($usr) ? $usr[0]['channel_location'] : '', 'profile_image_url' => $uinfo[0]['xchan_photo_l'], 'url' => $uinfo[0]['xchan_url'], - 'contact_url' => $a->get_baseurl() . "/connections/".$uinfo[0]['abook_id'], + 'contact_url' => z_root() . "/connections/".$uinfo[0]['abook_id'], 'protected' => false, 'friends_count' => intval($countfriends), 'created_at' => api_date($uinfo[0]['abook_created']), @@ -1273,7 +1273,7 @@ require_once('include/api_auth.php'); case "as": $as = api_format_as($a, $ret, $user_info); $as['title'] = $a->config['sitename']." Home Timeline"; - $as['link']['url'] = $a->get_baseurl()."/".$user_info["screen_name"]."/all"; + $as['link']['url'] = z_root()."/".$user_info["screen_name"]."/all"; return($as); break; } @@ -1334,7 +1334,7 @@ require_once('include/api_auth.php'); case "as": $as = api_format_as($a, $ret, $user_info); $as['title'] = $a->config['sitename']. " " . t('Public Timeline'); - $as['link']['url'] = $a->get_baseurl()."/"; + $as['link']['url'] = z_root()."/"; return($as); break; } @@ -1526,7 +1526,7 @@ require_once('include/api_auth.php'); //$include_entities = (x($_REQUEST,'include_entities')?$_REQUEST['include_entities']:false); - $myurl = $a->get_baseurl() . '/channel/'. $a->user['nickname']; + $myurl = z_root() . '/channel/'. $a->user['nickname']; $myurl = substr($myurl,strpos($myurl,'://')+3); $myurl = str_replace(array('www.','.'),array('','\\.'),$myurl); $diasp_url = str_replace('/channel/','/u/',$myurl); @@ -1562,7 +1562,7 @@ require_once('include/api_auth.php'); case "as": $as = api_format_as($a, $ret, $user_info); $as["title"] = $a->config['sitename']." Mentions"; - $as['link']['url'] = $a->get_baseurl()."/"; + $as['link']['url'] = z_root()."/"; return($as); break; } @@ -1784,7 +1784,7 @@ require_once('include/api_auth.php'); case "as": $as = api_format_as($a, $ret, $user_info); $as['title'] = $a->config['sitename']." Home Timeline"; - $as['link']['url'] = $a->get_baseurl()."/".$user_info["screen_name"]."/all"; + $as['link']['url'] = z_root()."/".$user_info["screen_name"]."/all"; return($as); break; } @@ -1857,7 +1857,7 @@ require_once('include/api_auth.php'); $items[] = $singleitem; } $as['items'] = $items; - $as['link']['url'] = $a->get_baseurl()."/".$user_info["screen_name"]."/all"; + $as['link']['url'] = z_root()."/".$user_info["screen_name"]."/all"; $as['link']['rel'] = "alternate"; $as['link']['type'] = "text/html"; return($as); @@ -1978,8 +1978,8 @@ require_once('include/api_auth.php'); 'entities' => '', 'objecttype' => (($item['obj_type']) ? $item['obj_type'] : ACTIVITY_OBJ_NOTE), 'verb' => (($item['verb']) ? $item['verb'] : ACTIVITY_POST), - 'self' => $a->get_baseurl()."/api/statuses/show/".$item['id'].".".$type, - 'edit' => $a->get_baseurl()."/api/statuses/show/".$item['id'].".".$type, + 'self' => z_root()."/api/statuses/show/".$item['id'].".".$type, + 'edit' => z_root()."/api/statuses/show/".$item['id'].".".$type, ); $status = array_merge($status, $status2); @@ -2089,7 +2089,7 @@ require_once('include/api_auth.php'); $name = get_config('system','sitename'); $server = $a->get_hostname(); - $logo = $a->get_baseurl() . '/images/rm-64.png'; + $logo = z_root() . '/images/rm-64.png'; $email = get_config('system','admin_email'); $closed = ((get_config('system','register_policy') == REGISTER_CLOSED) ? 'true' : 'false'); $private = ((get_config('system','block_public')) ? 'true' : 'false'); @@ -2097,7 +2097,7 @@ require_once('include/api_auth.php'); if(get_config('system','api_import_size')) $texlimit = string(get_config('system','api_import_size')); $ssl = ((get_config('system','have_ssl')) ? 'true' : 'false'); - $sslserver = (($ssl === 'true') ? str_replace('http:','https:',$a->get_baseurl()) : ''); + $sslserver = (($ssl === 'true') ? str_replace('http:','https:',z_root()) : ''); $config = array( 'site' => array('name' => $name,'server' => $server, 'theme' => 'default', 'path' => '', @@ -2272,7 +2272,7 @@ require_once('include/api_auth.php'); $start = $page*$count; $channel = $a->get_channel(); - $profile_url = $a->get_baseurl() . '/channel/' . $channel['channel_address']; + $profile_url = z_root() . '/channel/' . $channel['channel_address']; if ($box=="sentbox") { $sql_extra = "`from_xchan`='".dbesc( $channel['channel_hash'] )."'"; } diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index 81b95b30b..1ed57bfd4 100644 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -473,7 +473,7 @@ function format_event_diaspora($ev) { $ev['start'] , $bd_format )) : day_translate(datetime_convert('UTC', 'UTC', $ev['start'] , $bd_format))) - . '](' . $a->get_baseurl() . '/localtime/?f=&time=' . urlencode(datetime_convert('UTC','UTC',$ev['start'])) . ")\n"; + . '](' . z_root() . '/localtime/?f=&time=' . urlencode(datetime_convert('UTC','UTC',$ev['start'])) . ")\n"; if(! $ev['nofinish']) $o .= t('Finishes:') . ' ' . '[' @@ -481,7 +481,7 @@ function format_event_diaspora($ev) { $ev['finish'] , $bd_format )) : day_translate(datetime_convert('UTC', 'UTC', $ev['finish'] , $bd_format ))) - . '](' . $a->get_baseurl() . '/localtime/?f=&time=' . urlencode(datetime_convert('UTC','UTC',$ev['finish'])) . ")\n"; + . '](' . z_root() . '/localtime/?f=&time=' . urlencode(datetime_convert('UTC','UTC',$ev['finish'])) . ")\n"; if(strlen($ev['location'])) $o .= t('Location:') . bb2diaspora($ev['location']) diff --git a/include/bbcode.php b/include/bbcode.php index eefe7fe98..e243db699 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -850,7 +850,7 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $cache = false) // crypt if (strpos($Text,'[/crypt]') !== false) { $x = random_string(); - $Text = preg_replace("/\[crypt\](.*?)\[\/crypt\]/ism",'<br /><div id="' . $x . '"><img src="' .$a->get_baseurl() . '/images/lock_icon.gif" onclick="red_decrypt(\'rot13\',\'\',\'$1\',\'#' . $x . '\');" alt="' . t('Encrypted content') . '" title="' . t('Encrypted content') . '" /><br /></div>', $Text); + $Text = preg_replace("/\[crypt\](.*?)\[\/crypt\]/ism",'<br /><div id="' . $x . '"><img src="' .z_root() . '/images/lock_icon.gif" onclick="red_decrypt(\'rot13\',\'\',\'$1\',\'#' . $x . '\');" alt="' . t('Encrypted content') . '" title="' . t('Encrypted content') . '" /><br /></div>', $Text); $Text = preg_replace_callback("/\[crypt (.*?)\](.*?)\[\/crypt\]/ism", 'bb_parse_crypt', $Text); } diff --git a/include/contact_widgets.php b/include/contact_widgets.php index a60b8b1c3..66f84f066 100644 --- a/include/contact_widgets.php +++ b/include/contact_widgets.php @@ -126,7 +126,7 @@ function common_friends_visitor_widget($profile_uid) { return replace_macros(get_markup_template('remote_friends_common.tpl'), array( '$desc' => sprintf( tt("%d connection in common", "%d connections in common", $t), $t), - '$base' => $a->get_baseurl(), + '$base' => z_root(), '$uid' => $profile_uid, '$cid' => $observer, '$linkmore' => (($t > 5) ? 'true' : ''), diff --git a/include/conversation.php b/include/conversation.php index 676067f86..e3398543b 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -844,7 +844,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ $o .= replace_macros($page_template, array( - '$baseurl' => $a->get_baseurl($ssl_state), + '$baseurl' => z_root(), '$photo_item' => $content_html, '$live_update' => $live_update_div, '$remove' => t('remove'), @@ -871,7 +871,7 @@ function best_link_url($item) { if((local_channel()) && (local_channel() == $item['uid'])) { if(isset($a->contacts) && x($a->contacts,$clean_url)) { if($a->contacts[$clean_url]['network'] === NETWORK_DFRN) { - $best_url = $a->get_baseurl($ssl_state) . '/redir/' . $a->contacts[$clean_url]['id']; + $best_url = z_root() . '/redir/' . $a->contacts[$clean_url]['id']; $sparkle = true; } else @@ -925,7 +925,7 @@ function item_photo_menu($item){ $profile_link = chanlink_hash($item['author_xchan']); if($item['uid'] > 0) - $pm_url = $a->get_baseurl($ssl_state) . '/mail/new/?f=&hash=' . $item['author_xchan']; + $pm_url = z_root() . '/mail/new/?f=&hash=' . $item['author_xchan']; if($a->contacts && array_key_exists($item['author_xchan'],$a->contacts)) $contact = $a->contacts[$item['author_xchan']]; @@ -934,10 +934,10 @@ function item_photo_menu($item){ $follow_url = z_root() . '/follow/?f=&url=' . $item['author']['xchan_addr']; if($contact) { - $poke_link = $a->get_baseurl($ssl_state) . '/poke/?f=&c=' . $contact['abook_id']; + $poke_link = z_root() . '/poke/?f=&c=' . $contact['abook_id']; if (! intval($contact['abook_self'])) - $contact_url = $a->get_baseurl($ssl_state) . '/connedit/' . $contact['abook_id']; - $posts_link = $a->get_baseurl($ssl_state) . '/network/?cid=' . $contact['abook_id']; + $contact_url = z_root() . '/connedit/' . $contact['abook_id']; + $posts_link = z_root() . '/network/?cid=' . $contact['abook_id']; $clean_url = normalise_link($item['author-link']); } @@ -1161,7 +1161,7 @@ function status_editor($a, $x, $popup = false) { $a->page['htmlhead'] .= replace_macros($tpl, array( '$newpost' => 'true', - '$baseurl' => $a->get_baseurl(true), + '$baseurl' => z_root(), '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'), '$pretext' => ((x($x,'pretext')) ? $x['pretext'] : ''), '$geotag' => $geotag, @@ -1203,7 +1203,7 @@ function status_editor($a, $x, $popup = false) { $o .= replace_macros($tpl, array( '$return_path' => ((x($x, 'return_path')) ? $x['return_path'] : $a->query_string), - '$action' => $a->get_baseurl(true) . '/item', + '$action' => z_root() . '/item', '$share' => (x($x,'button') ? $x['button'] : t('Share')), '$webpage' => $webpage, '$placeholdpagetitle' => ((x($x,'ptlabel')) ? $x['ptlabel'] : t('Page link name')), @@ -1246,7 +1246,7 @@ function status_editor($a, $x, $popup = false) { '$content' => ((x($x,'body')) ? htmlspecialchars($x['body'], ENT_COMPAT,'UTF-8') : ''), '$attachment' => ((x($x, 'attachment')) ? $x['attachment'] : ''), '$post_id' => '', - '$baseurl' => $a->get_baseurl(true), + '$baseurl' => z_root(), '$defloc' => $x['default_location'], '$visitor' => $x['visitor'], '$public' => t('Public post'), @@ -1617,8 +1617,8 @@ function profile_tabs($a, $is_owner = false, $nickname = null){ if (x($_GET, 'tab')) $tab = notags(trim($_GET['tab'])); - $url = $a->get_baseurl() . '/channel/' . $nickname; - $pr = $a->get_baseurl() . '/profile/' . $nickname; + $url = z_root() . '/channel/' . $nickname; + $pr = z_root() . '/profile/' . $nickname; $tabs = array( array( @@ -1644,14 +1644,14 @@ function profile_tabs($a, $is_owner = false, $nickname = null){ if ($p['view_storage']) { $tabs[] = array( 'label' => t('Photos'), - 'url' => $a->get_baseurl() . '/photos/' . $nickname, + 'url' => z_root() . '/photos/' . $nickname, 'sel' => ((argv(0) == 'photos') ? 'active' : ''), 'title' => t('Photo Albums'), 'id' => 'photo-tab', ); $tabs[] = array( 'label' => t('Files'), - 'url' => $a->get_baseurl() . '/cloud/' . $nickname, + 'url' => z_root() . '/cloud/' . $nickname, 'sel' => ((argv(0) == 'cloud' || argv(0) == 'sharedwithme') ? 'active' : ''), 'title' => t('Files and Storage'), 'id' => 'files-tab', @@ -1661,7 +1661,7 @@ function profile_tabs($a, $is_owner = false, $nickname = null){ if($p['view_stream'] && $cal_link) { $tabs[] = array( 'label' => t('Events'), - 'url' => $a->get_baseurl() . $cal_link, + 'url' => z_root() . $cal_link, 'sel' => ((argv(0) == 'cal' || argv(0) == 'events') ? 'active' : ''), 'title' => t('Events'), 'id' => 'event-tab', @@ -1675,7 +1675,7 @@ function profile_tabs($a, $is_owner = false, $nickname = null){ if ($has_chats) { $tabs[] = array( 'label' => t('Chatrooms'), - 'url' => $a->get_baseurl() . '/chat/' . $nickname, + 'url' => z_root() . '/chat/' . $nickname, 'sel' => ((argv(0) == 'chat') ? 'active' : '' ), 'title' => t('Chatrooms'), 'id' => 'chat-tab', @@ -1688,7 +1688,7 @@ function profile_tabs($a, $is_owner = false, $nickname = null){ if ($is_owner && $has_bookmarks) { $tabs[] = array( 'label' => t('Bookmarks'), - 'url' => $a->get_baseurl() . '/bookmarks', + 'url' => z_root() . '/bookmarks', 'sel' => ((argv(0) == 'bookmarks') ? 'active' : ''), 'title' => t('Saved Bookmarks'), 'id' => 'bookmarks-tab', @@ -1698,7 +1698,7 @@ function profile_tabs($a, $is_owner = false, $nickname = null){ if ($p['write_pages'] && feature_enabled($uid,'webpages')) { $tabs[] = array( 'label' => t('Webpages'), - 'url' => $a->get_baseurl() . '/webpages/' . $nickname, + 'url' => z_root() . '/webpages/' . $nickname, 'sel' => ((argv(0) == 'webpages') ? 'active' : ''), 'title' => t('Manage Webpages'), 'id' => 'webpages-tab', diff --git a/include/enotify.php b/include/enotify.php index e182377c0..a44f87537 100644 --- a/include/enotify.php +++ b/include/enotify.php @@ -56,7 +56,7 @@ function notification($params) { $banner = t('$Projectname Notification'); $product = t('$projectname'); // PLATFORM_NAME; - $siteurl = $a->get_baseurl(true); + $siteurl = z_root(); $thanks = t('Thank You,'); $sitename = get_config('system','sitename'); $site_admin = sprintf( t('%s Administrator'), $sitename); @@ -419,7 +419,7 @@ function notification($params) { return; } - $itemlink = $a->get_baseurl() . '/notify/view/' . $notify_id; + $itemlink = z_root() . '/notify/view/' . $notify_id; $msg = str_replace('$itemlink',$itemlink,$epreamble); // wretched hack, but we don't want to duplicate all the preamble variations and we also don't want to screw up a translation diff --git a/include/identity.php b/include/identity.php index 5d18d69e0..03049639d 100644 --- a/include/identity.php +++ b/include/identity.php @@ -321,9 +321,9 @@ function create_identity($arr) { dbesc($guid), dbesc($sig), dbesc($key['pubkey']), - dbesc($a->get_baseurl() . "/photo/profile/l/{$newuid}"), - dbesc($a->get_baseurl() . "/photo/profile/m/{$newuid}"), - dbesc($a->get_baseurl() . "/photo/profile/s/{$newuid}"), + dbesc(z_root() . "/photo/profile/l/{$newuid}"), + dbesc(z_root() . "/photo/profile/m/{$newuid}"), + dbesc(z_root() . "/photo/profile/s/{$newuid}"), dbesc($ret['channel']['channel_address'] . '@' . get_app()->get_hostname()), dbesc(z_root() . '/channel/' . $ret['channel']['channel_address']), dbesc(z_root() . '/follow?f=&url=%s'), @@ -347,8 +347,8 @@ function create_identity($arr) { 1, $publish, dbesc($ret['channel']['channel_name']), - dbesc($a->get_baseurl() . "/photo/profile/l/{$newuid}"), - dbesc($a->get_baseurl() . "/photo/profile/m/{$newuid}") + dbesc(z_root() . "/photo/profile/l/{$newuid}"), + dbesc(z_root() . "/photo/profile/m/{$newuid}") ); if($role_permissions) { @@ -929,11 +929,11 @@ function profile_edit_menu($uid) { $multi_profiles = feature_enabled(local_channel(), 'multi_profiles'); if($multi_profiles) { $ret['multi'] = 1; - $ret['edit'] = array($a->get_baseurl(). '/profiles', t('Edit Profiles'), '', t('Edit')); + $ret['edit'] = array(z_root(). '/profiles', t('Edit Profiles'), '', t('Edit')); $ret['menu']['cr_new'] = t('Create New Profile'); } else { - $ret['edit'] = array($a->get_baseurl() . '/profiles/' . $uid, t('Edit Profile'), '', t('Edit')); + $ret['edit'] = array(z_root() . '/profiles/' . $uid, t('Edit Profile'), '', t('Edit')); } $r = q("SELECT * FROM profile WHERE uid = %d", @@ -1159,7 +1159,7 @@ function profile_sidebar($profile, $block = 0, $show_connect = true, $zcard = fa $url = $rr['url']; if($rr['network'] === NETWORK_DFRN) { $sparkle = " sparkle"; - $url = $a->get_baseurl() . '/redir/' . $rr['cid']; + $url = z_root() . '/redir/' . $rr['cid']; } $rr['link'] = $url; @@ -1172,7 +1172,7 @@ function profile_sidebar($profile, $block = 0, $show_connect = true, $zcard = fa } $tpl = get_markup_template("birthdays_reminder.tpl"); return replace_macros($tpl, array( - '$baseurl' => $a->get_baseurl(), + '$baseurl' => z_root(), '$classtoday' => $classtoday, '$count' => $total, '$event_reminders' => t('Birthday Reminders'), @@ -1244,7 +1244,7 @@ function profile_sidebar($profile, $block = 0, $show_connect = true, $zcard = fa $tpl = get_markup_template("events_reminder.tpl"); return replace_macros($tpl, array( - '$baseurl' => $a->get_baseurl(), + '$baseurl' => z_root(), '$classtoday' => $classtoday, '$count' => count($r), '$event_reminders' => t('Event Reminders'), diff --git a/include/items.php b/include/items.php index 2884d8e52..18e777a7f 100755 --- a/include/items.php +++ b/include/items.php @@ -2966,7 +2966,7 @@ function send_status_notifications($post_id,$item) { if($unfollowed) return; - $link = get_app()->get_baseurl() . '/display/' . $item['mid']; + $link = z_root() . '/display/' . $item['mid']; $y = q("select id from notify where link = '%s' and uid = %d limit 1", dbesc($link), @@ -4297,7 +4297,7 @@ function fix_private_photos($s, $uid, $item = null, $cid = 0) { $a = get_app(); logger('fix_private_photos', LOGGER_DEBUG); - $site = substr($a->get_baseurl(),strpos($a->get_baseurl(),'://')); + $site = substr(z_root(),strpos(z_root(),'://')); $orig_body = $s; $new_body = ''; @@ -4589,7 +4589,7 @@ function drop_item($id,$interactive = true,$stage = DROPITEM_NORMAL,$force = fal if(! $interactive) return 0; notice( t('Item not found.') . EOL); - goaway($a->get_baseurl() . '/' . $_SESSION['return_url']); + goaway(z_root() . '/' . $_SESSION['return_url']); } $item = $r[0]; @@ -4662,13 +4662,13 @@ function drop_item($id,$interactive = true,$stage = DROPITEM_NORMAL,$force = fal if((intval($item['item_wall']) && ($stage != DROPITEM_PHASE2)) || ($stage == DROPITEM_PHASE1)) proc_run('php','include/notifier.php','drop',$notify_id); - goaway($a->get_baseurl() . '/' . $_SESSION['return_url']); + goaway(z_root() . '/' . $_SESSION['return_url']); } else { if(! $interactive) return 0; notice( t('Permission denied.') . EOL); - goaway($a->get_baseurl() . '/' . $_SESSION['return_url']); + goaway(z_root() . '/' . $_SESSION['return_url']); } } diff --git a/include/message.php b/include/message.php index f24bb6e4b..f5115b9f7 100644 --- a/include/message.php +++ b/include/message.php @@ -169,7 +169,7 @@ function send_message($uid = 0, $recipient='', $body='', $subject='', $replyto=' $r = attach_by_hash_nodata($hash,$rev); if($r['success']) { $attachments[] = array( - 'href' => $a->get_baseurl() . '/attach/' . $r['data']['hash'], + 'href' => z_root() . '/attach/' . $r['data']['hash'], 'length' => $r['data']['filesize'], 'type' => $r['data']['filetype'], 'title' => urlencode($r['data']['filename']), @@ -225,7 +225,7 @@ function send_message($uid = 0, $recipient='', $body='', $subject='', $replyto=' if(count($images)) { foreach($images as $image) { - if(! stristr($image,$a->get_baseurl() . '/photo/')) + if(! stristr($image,z_root() . '/photo/')) continue; $image_uri = substr($image,strrpos($image,'/') + 1); $image_uri = substr($image_uri,0, strpos($image_uri,'-')); diff --git a/include/nav.php b/include/nav.php index 4e9a8ab19..7cd1e40d8 100644 --- a/include/nav.php +++ b/include/nav.php @@ -56,7 +56,7 @@ EOT; $banner = get_config('system','sitename'); $a->page['header'] .= replace_macros(get_markup_template('hdr.tpl'), array( - '$baseurl' => $a->get_baseurl(), + '$baseurl' => z_root(), '$sitelocation' => $sitelocation, '$banner' => $banner )); @@ -230,12 +230,12 @@ EOT; // turned off until somebody discovers this and figures out a good location for it. $powered_by = ''; -// $powered_by = '<strong>red<img class="smiley" src="' . $a->get_baseurl() . '/images/rm-16.png" alt="r#" />matrix</strong>'; +// $powered_by = '<strong>red<img class="smiley" src="' . z_root() . '/images/rm-16.png" alt="r#" />matrix</strong>'; $tpl = get_markup_template('nav.tpl'); $a->page['nav'] .= replace_macros($tpl, array( - '$baseurl' => $a->get_baseurl(), + '$baseurl' => z_root(), '$sitelocation' => $sitelocation, '$nav' => $x['nav'], '$banner' => $banner, diff --git a/include/network.php b/include/network.php index 33b62039c..17e61bac5 100644 --- a/include/network.php +++ b/include/network.php @@ -602,7 +602,7 @@ function scale_external_images($s, $include_link = true, $scale_replace = false) continue; } - $hostname = str_replace('www.','',substr($a->get_baseurl(),strpos($a->get_baseurl(),'://')+3)); + $hostname = str_replace('www.','',substr(z_root(),strpos(z_root(),'://')+3)); if(stristr($mtch[3],$hostname)) continue; diff --git a/include/oembed.php b/include/oembed.php index fb7a30e65..751c136d2 100755 --- a/include/oembed.php +++ b/include/oembed.php @@ -195,7 +195,7 @@ function oembed_format_object($j){ } $ret.=replace_macros($tpl, array( - '$baseurl' => $a->get_baseurl(), + '$baseurl' => z_root(), '$embedurl'=>$embedurl, '$escapedhtml'=>base64_encode($jhtml), '$tw'=>$tw, diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php index dce92d8da..3bea54fd4 100644 --- a/include/photo/photo_driver.php +++ b/include/photo/photo_driver.php @@ -679,9 +679,9 @@ function import_xchan_photo($photo,$xchan,$thing = false) { if($r === false) $photo_failure = true; - $photo = $a->get_baseurl() . '/photo/' . $hash . '-4'; - $thumb = $a->get_baseurl() . '/photo/' . $hash . '-5'; - $micro = $a->get_baseurl() . '/photo/' . $hash . '-6'; + $photo = z_root() . '/photo/' . $hash . '-4'; + $thumb = z_root() . '/photo/' . $hash . '-5'; + $micro = z_root() . '/photo/' . $hash . '-6'; } else { logger('import_xchan_photo: invalid image from ' . $photo); @@ -689,9 +689,9 @@ function import_xchan_photo($photo,$xchan,$thing = false) { } } if($photo_failure) { - $photo = $a->get_baseurl() . '/' . get_default_profile_photo(); - $thumb = $a->get_baseurl() . '/' . get_default_profile_photo(80); - $micro = $a->get_baseurl() . '/' . get_default_profile_photo(48); + $photo = z_root() . '/' . get_default_profile_photo(); + $thumb = z_root() . '/' . get_default_profile_photo(80); + $micro = z_root() . '/' . get_default_profile_photo(48); $type = 'image/png'; } diff --git a/include/plugin.php b/include/plugin.php index bd844442f..e0973b976 100755 --- a/include/plugin.php +++ b/include/plugin.php @@ -495,10 +495,10 @@ function get_theme_screenshot($theme) { $exts = array('.png', '.jpg'); foreach($exts as $ext) { if(file_exists('view/theme/' . $theme . '/img/screenshot' . $ext)) - return($a->get_baseurl() . '/view/theme/' . $theme . '/img/screenshot' . $ext); + return(z_root() . '/view/theme/' . $theme . '/img/screenshot' . $ext); } - return($a->get_baseurl() . '/images/blank.png'); + return(z_root() . '/images/blank.png'); } /** diff --git a/include/security.php b/include/security.php index f3cf2d1b6..3b91808d5 100644 --- a/include/security.php +++ b/include/security.php @@ -68,7 +68,7 @@ function authenticate_success($user_record, $login_initial = false, $interactive $return_url = ''; unset($_SESSION['login_return_url']); - goaway($a->get_baseurl() . '/' . $return_url); + goaway(z_root() . '/' . $return_url); } /* This account has never created a channel. Send them to new_channel by default */ @@ -127,7 +127,7 @@ function change_channel($change_channel) { ); if($x) { $_SESSION['my_url'] = $x[0]['xchan_url']; - $_SESSION['my_address'] = $r[0]['channel_address'] . '@' . substr(get_app()->get_baseurl(), strpos(get_app()->get_baseurl(), '://') + 3); + $_SESSION['my_address'] = $r[0]['channel_address'] . '@' . substr(z_root(), strpos(z_root(), '://') + 3); get_app()->set_observer($x[0]); get_app()->set_perms(get_all_perms(local_channel(), $hash)); @@ -393,7 +393,7 @@ function check_form_security_token_redirectOnErr($err_redirect, $typename = '', logger('check_form_security_token failed: user ' . $a->user['guid'] . ' - form element ' . $typename); logger('check_form_security_token failed: _REQUEST data: ' . print_r($_REQUEST, true), LOGGER_DATA); notice( check_form_security_std_err_msg() ); - goaway($a->get_baseurl() . $err_redirect ); + goaway(z_root() . $err_redirect ); } } function check_form_security_token_ForbiddenOnErr($typename = '', $formname = 'form_security_token') { diff --git a/include/text.php b/include/text.php index 8e822532e..7af5db22d 100644 --- a/include/text.php +++ b/include/text.php @@ -386,7 +386,7 @@ function paginate(&$a) { $stripped = str_replace('q=','',$stripped); $stripped = trim($stripped,'/'); $pagenum = $a->pager['page']; - $url = $a->get_baseurl() . '/' . $stripped; + $url = z_root() . '/' . $stripped; if($a->pager['total'] > $a->pager['itemspage']) { $o .= '<div class="pager">'; @@ -443,7 +443,7 @@ function alt_pager(&$a, $i, $more = '', $less = '') { $stripped = str_replace('q=','',$stripped); $stripped = trim($stripped,'/'); //$pagenum = $a->pager['page']; - $url = $a->get_baseurl() . '/' . $stripped; + $url = z_root() . '/' . $stripped; return replace_macros(get_markup_template('alt_pager.tpl'), array( '$has_less' => (($a->pager['page'] > 1) ? true : false), @@ -900,7 +900,7 @@ function search($s,$id='search-box',$url='/search',$save = false) { return replace_macros(get_markup_template('searchbox.tpl'),array( '$s' => $s, '$id' => $id, - '$action_url' => $a->get_baseurl((stristr($url,'network')) ? true : false) . $url, + '$action_url' => z_root() . $url, '$search_label' => t('Search'), '$save_label' => t('Save'), '$savedsearch' => feature_enabled(local_channel(),'savedsearch') @@ -1081,41 +1081,41 @@ function list_smilies() { ); $icons = array( - '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-heart.gif" alt="<3" />', - '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-brokenheart.gif" alt="</3" />', - '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-brokenheart.gif" alt="<\\3" />', - '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-smile.gif" alt=":-)" />', - '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-wink.gif" alt=";-)" />', - '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-frown.gif" alt=":-(" />', - '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-tongue-out.gif" alt=":-P" />', - '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-tongue-out.gif" alt=":-p" />', - '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-kiss.gif" alt=":-\"" />', - '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-kiss.gif" alt=":-\"" />', - '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-kiss.gif" alt=":-x" />', - '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-kiss.gif" alt=":-X" />', - '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-laughing.gif" alt=":-D" />', - '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-surprised.gif" alt="8-|" />', - '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-surprised.gif" alt="8-O" />', - '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-surprised.gif" alt=":-O" />', - '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-thumbsup.gif" alt="\\o/" />', - '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-Oo.gif" alt="o.O" />', - '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-Oo.gif" alt="O.o" />', - '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-Oo.gif" alt="o_O" />', - '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-Oo.gif" alt="O_o" />', - '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-cry.gif" alt=":\'(" />', - '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-foot-in-mouth.gif" alt=":-!" />', - '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-undecided.gif" alt=":-/" />', - '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-embarassed.gif" alt=":-[" />', - '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-cool.gif" alt="8-)" />', - '<img class="smiley" src="' . $a->get_baseurl() . '/images/beer_mug.gif" alt=":beer" />', - '<img class="smiley" src="' . $a->get_baseurl() . '/images/beer_mug.gif" alt=":homebrew" />', - '<img class="smiley" src="' . $a->get_baseurl() . '/images/coffee.gif" alt=":coffee" />', - '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-facepalm.gif" alt=":facepalm" />', - '<img class="smiley" src="' . $a->get_baseurl() . '/images/like.gif" alt=":like" />', - '<img class="smiley" src="' . $a->get_baseurl() . '/images/dislike.gif" alt=":dislike" />', - '<a href="http://getzot.com"><strong>red<img class="smiley bb_rm-logo" src="' . $a->get_baseurl() . '/images/rm-32.png" alt="' . urlencode('red#matrix') . '" />matrix</strong></a>', - '<a href="http://getzot.com"><strong>red<img class="smiley bb_rm-logo" src="' . $a->get_baseurl() . '/images/rm-32.png" alt="' . urlencode('red#') . '" />matrix</strong></a>', - '<a href="http://getzot.com"><strong>red<img class="smiley bb_rm-logo" src="' . $a->get_baseurl() . '/images/rm-32.png" alt="r#" />matrix</strong></a>' + '<img class="smiley" src="' . z_root() . '/images/smiley-heart.gif" alt="<3" />', + '<img class="smiley" src="' . z_root() . '/images/smiley-brokenheart.gif" alt="</3" />', + '<img class="smiley" src="' . z_root() . '/images/smiley-brokenheart.gif" alt="<\\3" />', + '<img class="smiley" src="' . z_root() . '/images/smiley-smile.gif" alt=":-)" />', + '<img class="smiley" src="' . z_root() . '/images/smiley-wink.gif" alt=";-)" />', + '<img class="smiley" src="' . z_root() . '/images/smiley-frown.gif" alt=":-(" />', + '<img class="smiley" src="' . z_root() . '/images/smiley-tongue-out.gif" alt=":-P" />', + '<img class="smiley" src="' . z_root() . '/images/smiley-tongue-out.gif" alt=":-p" />', + '<img class="smiley" src="' . z_root() . '/images/smiley-kiss.gif" alt=":-\"" />', + '<img class="smiley" src="' . z_root() . '/images/smiley-kiss.gif" alt=":-\"" />', + '<img class="smiley" src="' . z_root() . '/images/smiley-kiss.gif" alt=":-x" />', + '<img class="smiley" src="' . z_root() . '/images/smiley-kiss.gif" alt=":-X" />', + '<img class="smiley" src="' . z_root() . '/images/smiley-laughing.gif" alt=":-D" />', + '<img class="smiley" src="' . z_root() . '/images/smiley-surprised.gif" alt="8-|" />', + '<img class="smiley" src="' . z_root() . '/images/smiley-surprised.gif" alt="8-O" />', + '<img class="smiley" src="' . z_root() . '/images/smiley-surprised.gif" alt=":-O" />', + '<img class="smiley" src="' . z_root() . '/images/smiley-thumbsup.gif" alt="\\o/" />', + '<img class="smiley" src="' . z_root() . '/images/smiley-Oo.gif" alt="o.O" />', + '<img class="smiley" src="' . z_root() . '/images/smiley-Oo.gif" alt="O.o" />', + '<img class="smiley" src="' . z_root() . '/images/smiley-Oo.gif" alt="o_O" />', + '<img class="smiley" src="' . z_root() . '/images/smiley-Oo.gif" alt="O_o" />', + '<img class="smiley" src="' . z_root() . '/images/smiley-cry.gif" alt=":\'(" />', + '<img class="smiley" src="' . z_root() . '/images/smiley-foot-in-mouth.gif" alt=":-!" />', + '<img class="smiley" src="' . z_root() . '/images/smiley-undecided.gif" alt=":-/" />', + '<img class="smiley" src="' . z_root() . '/images/smiley-embarassed.gif" alt=":-[" />', + '<img class="smiley" src="' . z_root() . '/images/smiley-cool.gif" alt="8-)" />', + '<img class="smiley" src="' . z_root() . '/images/beer_mug.gif" alt=":beer" />', + '<img class="smiley" src="' . z_root() . '/images/beer_mug.gif" alt=":homebrew" />', + '<img class="smiley" src="' . z_root() . '/images/coffee.gif" alt=":coffee" />', + '<img class="smiley" src="' . z_root() . '/images/smiley-facepalm.gif" alt=":facepalm" />', + '<img class="smiley" src="' . z_root() . '/images/like.gif" alt=":like" />', + '<img class="smiley" src="' . z_root() . '/images/dislike.gif" alt=":dislike" />', + '<a href="http://getzot.com"><strong>red<img class="smiley bb_rm-logo" src="' . z_root() . '/images/rm-32.png" alt="' . urlencode('red#matrix') . '" />matrix</strong></a>', + '<a href="http://getzot.com"><strong>red<img class="smiley bb_rm-logo" src="' . z_root() . '/images/rm-32.png" alt="' . urlencode('red#') . '" />matrix</strong></a>', + '<a href="http://getzot.com"><strong>red<img class="smiley bb_rm-logo" src="' . z_root() . '/images/rm-32.png" alt="r#" />matrix</strong></a>' ); @@ -1192,7 +1192,7 @@ function preg_heart($x) { $t = ''; for($cnt = 0; $cnt < strlen($x[1]); $cnt ++) - $t .= '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-heart.gif" alt="<3" />'; + $t .= '<img class="smiley" src="' . z_root() . '/images/smiley-heart.gif" alt="<3" />'; $r = str_replace($x[0],$t,$x[0]); @@ -1720,12 +1720,12 @@ function feed_hublinks() { function feed_salmonlinks($nick) { $a = get_app(); - $salmon = '<link rel="salmon" href="' . xmlify($a->get_baseurl() . '/salmon/' . $nick) . '" />' . "\n" ; + $salmon = '<link rel="salmon" href="' . xmlify(z_root() . '/salmon/' . $nick) . '" />' . "\n" ; // old style links that status.net still needed as of 12/2010 - $salmon .= ' <link rel="http://salmon-protocol.org/ns/salmon-replies" href="' . xmlify($a->get_baseurl() . '/salmon/' . $nick) . '" />' . "\n" ; - $salmon .= ' <link rel="http://salmon-protocol.org/ns/salmon-mention" href="' . xmlify($a->get_baseurl() . '/salmon/' . $nick) . '" />' . "\n" ; + $salmon .= ' <link rel="http://salmon-protocol.org/ns/salmon-replies" href="' . xmlify(z_root() . '/salmon/' . $nick) . '" />' . "\n" ; + $salmon .= ' <link rel="http://salmon-protocol.org/ns/salmon-mention" href="' . xmlify(z_root() . '/salmon/' . $nick) . '" />' . "\n" ; return $salmon; } @@ -2373,8 +2373,8 @@ function handle_tag($a, &$body, &$access_tag, &$str_tags, $profile_uid, $tag, $d $basetag = str_replace('_',' ',substr($tag,1)); //create text for link - $url = $a->get_baseurl() . '/search?tag=' . rawurlencode($basetag); - $newtag = '#[zrl=' . $a->get_baseurl() . '/search?tag=' . rawurlencode($basetag) . ']' . $basetag . '[/zrl]'; + $url = z_root() . '/search?tag=' . rawurlencode($basetag); + $newtag = '#[zrl=' . z_root() . '/search?tag=' . rawurlencode($basetag) . ']' . $basetag . '[/zrl]'; //replace tag by the link. Make sure to not replace something in the middle of a word // The '=' is needed to not replace color codes if the code is also used as a tag // Much better would be to somehow completely avoiding things in e.g. [color]-tags. diff --git a/include/widgets.php b/include/widgets.php index 3b5e3a17b..014160867 100644 --- a/include/widgets.php +++ b/include/widgets.php @@ -510,13 +510,13 @@ function widget_settings_menu($arr) { $tabs = array( array( 'label' => t('Account settings'), - 'url' => $a->get_baseurl(true).'/settings/account', + 'url' => z_root().'/settings/account', 'selected' => ((argv(1) === 'account') ? 'active' : ''), ), array( 'label' => t('Channel settings'), - 'url' => $a->get_baseurl(true).'/settings/channel', + 'url' => z_root().'/settings/channel', 'selected' => ((argv(1) === 'channel') ? 'active' : ''), ), @@ -525,27 +525,27 @@ function widget_settings_menu($arr) { if(get_features()) { $tabs[] = array( 'label' => t('Additional features'), - 'url' => $a->get_baseurl(true).'/settings/features', + 'url' => z_root().'/settings/features', 'selected' => ((argv(1) === 'features') ? 'active' : ''), ); } $tabs[] = array( 'label' => t('Feature/Addon settings'), - 'url' => $a->get_baseurl(true).'/settings/featured', + 'url' => z_root().'/settings/featured', 'selected' => ((argv(1) === 'featured') ? 'active' : ''), ); $tabs[] = array( 'label' => t('Display settings'), - 'url' => $a->get_baseurl(true).'/settings/display', + 'url' => z_root().'/settings/display', 'selected' => ((argv(1) === 'display') ? 'active' : ''), ); if($hublocs) { $tabs[] = array( 'label' => t('Manage locations'), - 'url' => $a->get_baseurl(true) . '/locs', + 'url' => z_root() . '/locs', 'selected' => ((argv(1) === 'locs') ? 'active' : ''), ); } @@ -554,21 +554,21 @@ function widget_settings_menu($arr) { if(! UNO) { $tabs[] = array( 'label' => t('Export channel'), - 'url' => $a->get_baseurl(true) . '/uexport', + 'url' => z_root() . '/uexport', 'selected' => '' ); } $tabs[] = array( 'label' => t('Connected apps'), - 'url' => $a->get_baseurl(true) . '/settings/oauth', + 'url' => z_root() . '/settings/oauth', 'selected' => ((argv(1) === 'oauth') ? 'active' : ''), ); if($role === false || $role === 'custom') { $tabs[] = array( 'label' => t('Connection Default Permissions'), - 'url' => $a->get_baseurl(true) . '/connedit/' . $abook_self_id, + 'url' => z_root() . '/connedit/' . $abook_self_id, 'selected' => '' ); } @@ -576,7 +576,7 @@ function widget_settings_menu($arr) { if(feature_enabled(local_channel(),'premium_channel')) { $tabs[] = array( 'label' => t('Premium Channel Settings'), - 'url' => $a->get_baseurl(true) . '/connect/' . $channel['channel_address'], + 'url' => z_root() . '/connect/' . $channel['channel_address'], 'selected' => '' ); } @@ -584,7 +584,7 @@ function widget_settings_menu($arr) { if(feature_enabled(local_channel(),'channel_sources')) { $tabs[] = array( 'label' => t('Channel Sources'), - 'url' => $a->get_baseurl(true) . '/sources', + 'url' => z_root() . '/sources', 'selected' => '' ); } @@ -608,22 +608,22 @@ function widget_mailmenu($arr) { '$title' => t('Private Mail Menu'), '$combined'=>array( 'label' => t('Combined View'), - 'url' => $a->get_baseurl(true) . '/mail/combined', + 'url' => z_root() . '/mail/combined', 'sel' => (argv(1) == 'combined'), ), '$inbox'=>array( 'label' => t('Inbox'), - 'url' => $a->get_baseurl(true) . '/mail/inbox', + 'url' => z_root() . '/mail/inbox', 'sel' => (argv(1) == 'inbox'), ), '$outbox'=>array( 'label' => t('Outbox'), - 'url' => $a->get_baseurl(true) . '/mail/outbox', + 'url' => z_root() . '/mail/outbox', 'sel' => (argv(1) == 'outbox'), ), '$new'=>array( 'label' => t('New Message'), - 'url' => $a->get_baseurl(true) . '/mail/new', + 'url' => z_root() . '/mail/new', 'sel'=> (argv(1) == 'new'), ) )); @@ -166,7 +166,7 @@ $Router->Dispatch($a); if(x($_SESSION, 'visitor_home')) { $homebase = $_SESSION['visitor_home']; } elseif(local_channel()) { - $homebase = $a->get_baseurl() . '/channel/' . $a->channel['channel_address']; + $homebase = z_root() . '/channel/' . $a->channel['channel_address']; } if(isset($homebase)) { diff --git a/mod/admin.php b/mod/admin.php index 6300ac027..0d8bf8395 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -40,7 +40,7 @@ function admin_post(&$a){ $func($a); } } - goaway($a->get_baseurl(true) . '/admin/plugins/' . argv(2) ); + goaway(z_root() . '/admin/plugins/' . argv(2) ); break; case 'themes': $theme = argv(2); @@ -54,7 +54,7 @@ function admin_post(&$a){ info(t('Theme settings updated.')); if(is_ajax()) return; - goaway($a->get_baseurl(true) . '/admin/themes/' . $theme ); + goaway(z_root() . '/admin/themes/' . $theme ); break; case 'logs': admin_page_logs_post($a); @@ -77,7 +77,7 @@ function admin_post(&$a){ } } - goaway($a->get_baseurl(true) . '/admin' ); + goaway(z_root() . '/admin' ); } /** @@ -337,7 +337,7 @@ function admin_page_site_post(&$a){ set_config('system','curl_timeout', $timeout); info( t('Site settings updated.') . EOL); - goaway($a->get_baseurl(true) . '/admin/site' ); + goaway(z_root() . '/admin/site' ); } /** @@ -460,7 +460,7 @@ function admin_page_site(&$a) { '$corporate' => t('Policies'), '$advanced' => t('Advanced'), - '$baseurl' => $a->get_baseurl(true), + '$baseurl' => z_root(), // name, label, value, help string, extra data... '$sitename' => array('sitename', t("Site name"), htmlspecialchars(get_config('system','sitename'), ENT_QUOTES, 'UTF-8'),''), '$banner' => array('banner', t("Banner/Logo"), $banner, ""), @@ -536,7 +536,7 @@ function admin_page_hubloc_post(&$a){ //after repair set hubloc flags to 0 } - goaway($a->get_baseurl(true) . '/admin/hubloc' ); + goaway(z_root() . '/admin/hubloc' ); } function trim_array_elems($arr) { @@ -659,7 +659,7 @@ function admin_page_hubloc(&$a) { if(! $hubloc){ notice( t('No server found') . EOL); - goaway($a->get_baseurl(true) . '/admin/hubloc'); + goaway(z_root() . '/admin/hubloc'); } $t = get_markup_template('admin_hubloc.tpl'); @@ -733,7 +733,7 @@ function admin_page_dbsync(&$a) { if(intval(get_config('system','db_version')) <= intval(argv(3))) set_config('system','db_version',intval(argv(3)) + 1); info( t('Update has been marked successful') . EOL); - goaway($a->get_baseurl(true) . '/admin/dbsync'); + goaway(z_root() . '/admin/dbsync'); } if(argc() > 2 && intval(argv(2))) { @@ -771,7 +771,7 @@ function admin_page_dbsync(&$a) { return '<div class="generic-content-wrapper-styled"><h3>' . t('No failed updates.') . '</h3></div>'; $o = replace_macros(get_markup_template('failed_updates.tpl'),array( - '$base' => $a->get_baseurl(true), + '$base' => z_root(), '$banner' => t('Failed Updates'), '$desc' => '', '$mark' => t('Mark success (if update was manually applied)'), @@ -871,7 +871,7 @@ function admin_page_users_post($a) { } } - goaway($a->get_baseurl(true) . '/admin/users' ); + goaway(z_root() . '/admin/users' ); } /** @@ -893,7 +893,7 @@ function admin_page_users(&$a){ if (! $account) { notice( t('Account not found') . EOL); - goaway($a->get_baseurl(true) . '/admin/users' ); + goaway(z_root() . '/admin/users' ); } check_form_security_token_redirectOnErr('/admin/users', 'admin_users', 't'); @@ -924,7 +924,7 @@ function admin_page_users(&$a){ break; } - goaway($a->get_baseurl(true) . '/admin/users' ); + goaway(z_root() . '/admin/users' ); } /* get pending */ @@ -1003,7 +1003,7 @@ function admin_page_users(&$a){ '$form_security_token' => get_form_security_token("admin_users"), // values // - '$baseurl' => $a->get_baseurl(true), + '$baseurl' => z_root(), '$pending' => $pending, '$users' => $users, @@ -1053,7 +1053,7 @@ function admin_page_channels_post(&$a) { notice( sprintf( tt("%s channel deleted", "%s channels deleted", count($channels)), count($channels)) ); } - goaway($a->get_baseurl(true) . '/admin/channels' ); + goaway(z_root() . '/admin/channels' ); } /** @@ -1071,7 +1071,7 @@ function admin_page_channels(&$a){ if (! $channel) { notice( t('Channel not found') . EOL); - goaway($a->get_baseurl(true) . '/admin/channels' ); + goaway(z_root() . '/admin/channels' ); } switch(argv(2)) { @@ -1110,7 +1110,7 @@ function admin_page_channels(&$a){ default: break; } - goaway($a->get_baseurl(true) . '/admin/channels' ); + goaway(z_root() . '/admin/channels' ); } /* get channels */ @@ -1163,7 +1163,7 @@ function admin_page_channels(&$a){ '$form_security_token' => get_form_security_token("admin_channels"), // values // - '$baseurl' => $a->get_baseurl(true), + '$baseurl' => z_root(), '$channels' => $channels, )); $o .= paginate($a); @@ -1222,7 +1222,7 @@ function admin_page_plugins(&$a){ info( sprintf( t("Plugin %s enabled."), $plugin ) ); } set_config("system","addon", implode(", ",$a->plugins)); - goaway($a->get_baseurl(true) . '/admin/plugins' ); + goaway(z_root() . '/admin/plugins' ); } // display plugin details require_once('library/markdown.php'); @@ -1264,7 +1264,7 @@ function admin_page_plugins(&$a){ '$page' => t('Plugins'), '$toggle' => t('Toggle'), '$settings' => t('Settings'), - '$baseurl' => $a->get_baseurl(true), + '$baseurl' => z_root(), '$plugin' => $plugin, '$status' => $status, @@ -1324,7 +1324,7 @@ function admin_page_plugins(&$a){ '$title' => t('Administration'), '$page' => t('Plugins'), '$submit' => t('Submit'), - '$baseurl' => $a->get_baseurl(true), + '$baseurl' => z_root(), '$function' => 'plugins', '$plugins' => $plugins, '$disabled' => t('Disabled - version incompatibility'), @@ -1448,7 +1448,7 @@ function admin_page_themes(&$a){ info( sprintf('Theme %s disabled.', $theme)); set_config('system', 'allowed_themes', $s); - goaway($a->get_baseurl(true) . '/admin/themes' ); + goaway(z_root() . '/admin/themes' ); } // display theme details @@ -1486,7 +1486,7 @@ function admin_page_themes(&$a){ '$page' => t('Themes'), '$toggle' => t('Toggle'), '$settings' => t('Settings'), - '$baseurl' => $a->get_baseurl(true), + '$baseurl' => z_root(), '$plugin' => $theme, '$status' => $status, @@ -1519,7 +1519,7 @@ function admin_page_themes(&$a){ '$title' => t('Administration'), '$page' => t('Themes'), '$submit' => t('Submit'), - '$baseurl' => $a->get_baseurl(true), + '$baseurl' => z_root(), '$function' => 'themes', '$plugins' => $xthemes, '$experimental' => t('[Experimental]'), @@ -1548,7 +1548,7 @@ function admin_page_logs_post(&$a) { } info( t('Log settings updated.') ); - goaway($a->get_baseurl(true) . '/admin/logs' ); + goaway(z_root() . '/admin/logs' ); } /** @@ -1606,7 +1606,7 @@ readable."); '$submit' => t('Submit'), '$clear' => t('Clear'), '$data' => $data, - '$baseurl' => $a->get_baseurl(true), + '$baseurl' => z_root(), '$logname' => get_config('system','logfile'), // name, label, value, help string, extra data... diff --git a/mod/cal.php b/mod/cal.php index 453f46f69..80a484c27 100755 --- a/mod/cal.php +++ b/mod/cal.php @@ -71,7 +71,7 @@ function cal_content(&$a) { $htpl = get_markup_template('event_head.tpl'); $a->page['htmlhead'] .= replace_macros($htpl,array( - '$baseurl' => $a->get_baseurl(), + '$baseurl' => z_root(), '$module_url' => '/cal/' . $channel['channel_address'], '$modparams' => 2, '$lang' => $a->language, @@ -243,7 +243,7 @@ function cal_content(&$a) { foreach($r as $rr) { $j = (($rr['adjust']) ? datetime_convert('UTC',date_default_timezone_get(),$rr['start'], 'j') : datetime_convert('UTC','UTC',$rr['start'],'j')); if(! x($links,$j)) - $links[$j] = $a->get_baseurl() . '/' . $a->cmd . '#link-' . $j; + $links[$j] = z_root() . '/' . $a->cmd . '#link-' . $j; } } @@ -321,11 +321,11 @@ function cal_content(&$a) { $nick = $channel['channel_address']; $o = replace_macros($tpl, array( - '$baseurl' => $a->get_baseurl(), - '$new_event' => array($a->get_baseurl().'/cal',(($event_id) ? t('Edit Event') : t('Create Event')),'',''), - '$previus' => array($a->get_baseurl()."/cal/$nick/$prevyear/$prevmonth",t('Previous'),'',''), - '$next' => array($a->get_baseurl()."/cal/$nick/$nextyear/$nextmonth",t('Next'),'',''), - '$export' => array($a->get_baseurl()."/cal/$nick/$y/$m/export",t('Export'),'',''), + '$baseurl' => z_root(), + '$new_event' => array(z_root().'/cal',(($event_id) ? t('Edit Event') : t('Create Event')),'',''), + '$previus' => array(z_root()."/cal/$nick/$prevyear/$prevmonth",t('Previous'),'',''), + '$next' => array(z_root()."/cal/$nick/$nextyear/$nextmonth",t('Next'),'',''), + '$export' => array(z_root()."/cal/$nick/$y/$m/export",t('Export'),'',''), '$calendar' => cal($y,$m,$links, ' eventcal'), '$events' => $events, '$upload' => t('Import'), diff --git a/mod/channel.php b/mod/channel.php index eb65a66f3..d609d6802 100644 --- a/mod/channel.php +++ b/mod/channel.php @@ -34,12 +34,12 @@ function channel_init(&$a) { $profile = argv(1); } - $a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" title="' . t('Posts and comments') . '" href="' . $a->get_baseurl() . '/feed/' . $which . '" />' . "\r\n" ; - $a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" title="' . t('Only posts') . '" href="' . $a->get_baseurl() . '/feed/' . $which . '?top=1" />' . "\r\n" ; + $a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" title="' . t('Posts and comments') . '" href="' . z_root() . '/feed/' . $which . '" />' . "\r\n" ; + $a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" title="' . t('Only posts') . '" href="' . z_root() . '/feed/' . $which . '?top=1" />' . "\r\n" ; // Not yet ready for prime time -// $a->page['htmlhead'] .= '<link rel="openid.server" href="' . $a->get_baseurl() . '/id/' . $which .'?f=" />' . "\r\n" ; -// $a->page['htmlhead'] .= '<link rel="openid.delegate" href="' . $a->get_baseurl() . '/channel/' . $which .'" />' . "\r\n" ; +// $a->page['htmlhead'] .= '<link rel="openid.server" href="' . z_root() . '/id/' . $which .'?f=" />' . "\r\n" ; +// $a->page['htmlhead'] .= '<link rel="openid.delegate" href="' . z_root() . '/channel/' . $which .'" />' . "\r\n" ; // Run profile_load() here to make sure the theme is set before // we start loading content diff --git a/mod/chat.php b/mod/chat.php index 95b3802a8..682921ec2 100644 --- a/mod/chat.php +++ b/mod/chat.php @@ -28,7 +28,7 @@ function chat_init(&$a) { $profile = argv(1); } - $a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . $a->get_baseurl() . '/feed/' . $which .'" />' . "\r\n" ; + $a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . z_root() . '/feed/' . $which .'" />' . "\r\n" ; // Run profile_load() here to make sure the theme is set before // we start loading content diff --git a/mod/cloud.php b/mod/cloud.php index 82d454477..dc3e11ef3 100644 --- a/mod/cloud.php +++ b/mod/cloud.php @@ -30,7 +30,7 @@ function cloud_init(&$a) { $profile = 0; - $a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . $a->get_baseurl() . '/feed/' . $which . '" />' . "\r\n"; + $a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . z_root() . '/feed/' . $which . '" />' . "\r\n"; if ($which) profile_load($a, $which, $profile); diff --git a/mod/connedit.php b/mod/connedit.php index 008bc21ac..5d087a3b1 100644 --- a/mod/connedit.php +++ b/mod/connedit.php @@ -73,7 +73,7 @@ function connedit_post(&$a) { if(! $orig_record) { notice( t('Could not access contact record.') . EOL); - goaway($a->get_baseurl(true) . '/connections'); + goaway(z_root() . '/connections'); return; // NOTREACHED } @@ -306,7 +306,7 @@ function connedit_post(&$a) { connedit_clone($a); if(($_REQUEST['pending']) && (!$_REQUEST['done'])) - goaway($a->get_baseurl(true) . '/connections/ifpending'); + goaway(z_root() . '/connections/ifpending'); return; @@ -405,13 +405,13 @@ function connedit_content(&$a) { if(! count($orig_record)) { notice( t('Could not access address book record.') . EOL); - goaway($a->get_baseurl(true) . '/connections'); + goaway(z_root() . '/connections'); } if($cmd === 'update') { // pull feed and consume it, which should subscribe to the hub. proc_run('php',"include/poller.php","$contact_id"); - goaway($a->get_baseurl(true) . '/connedit/' . $contact_id); + goaway(z_root() . '/connedit/' . $contact_id); } @@ -425,7 +425,7 @@ function connedit_content(&$a) { // if you are on a different network we'll force a refresh of the connection basic info proc_run('php','include/notifier.php','permission_update',$contact_id); } - goaway($a->get_baseurl(true) . '/connedit/' . $contact_id); + goaway(z_root() . '/connedit/' . $contact_id); } if($cmd === 'block') { @@ -434,7 +434,7 @@ function connedit_content(&$a) { } else notice(t('Unable to set address book parameters.') . EOL); - goaway($a->get_baseurl(true) . '/connedit/' . $contact_id); + goaway(z_root() . '/connedit/' . $contact_id); } if($cmd === 'ignore') { @@ -443,7 +443,7 @@ function connedit_content(&$a) { } else notice(t('Unable to set address book parameters.') . EOL); - goaway($a->get_baseurl(true) . '/connedit/' . $contact_id); + goaway(z_root() . '/connedit/' . $contact_id); } if($cmd === 'archive') { @@ -452,7 +452,7 @@ function connedit_content(&$a) { } else notice(t('Unable to set address book parameters.') . EOL); - goaway($a->get_baseurl(true) . '/connedit/' . $contact_id); + goaway(z_root() . '/connedit/' . $contact_id); } if($cmd === 'hide') { @@ -461,7 +461,7 @@ function connedit_content(&$a) { } else notice(t('Unable to set address book parameters.') . EOL); - goaway($a->get_baseurl(true) . '/connedit/' . $contact_id); + goaway(z_root() . '/connedit/' . $contact_id); } // We'll prevent somebody from unapproving an already approved contact. @@ -475,7 +475,7 @@ function connedit_content(&$a) { else notice(t('Unable to set address book parameters.') . EOL); } - goaway($a->get_baseurl(true) . '/connedit/' . $contact_id); + goaway(z_root() . '/connedit/' . $contact_id); } @@ -499,8 +499,8 @@ function connedit_content(&$a) { info( t('Connection has been removed.') . EOL ); if(x($_SESSION,'return_url')) - goaway($a->get_baseurl(true) . '/' . $_SESSION['return_url']); - goaway($a->get_baseurl(true) . '/contacts'); + goaway(z_root() . '/' . $_SESSION['return_url']); + goaway(z_root() . '/contacts'); } } @@ -521,21 +521,21 @@ function connedit_content(&$a) { 'refresh' => array( 'label' => t('Refresh Permissions'), - 'url' => $a->get_baseurl(true) . '/connedit/' . $contact['abook_id'] . '/refresh', + 'url' => z_root() . '/connedit/' . $contact['abook_id'] . '/refresh', 'sel' => '', 'title' => t('Fetch updated permissions'), ), 'recent' => array( 'label' => t('Recent Activity'), - 'url' => $a->get_baseurl(true) . '/network/?f=&cid=' . $contact['abook_id'], + 'url' => z_root() . '/network/?f=&cid=' . $contact['abook_id'], 'sel' => '', 'title' => t('View recent posts and comments'), ), 'block' => array( 'label' => (intval($contact['abook_blocked']) ? t('Unblock') : t('Block')), - 'url' => $a->get_baseurl(true) . '/connedit/' . $contact['abook_id'] . '/block', + 'url' => z_root() . '/connedit/' . $contact['abook_id'] . '/block', 'sel' => (intval($contact['abook_blocked']) ? 'active' : ''), 'title' => t('Block (or Unblock) all communications with this connection'), 'info' => (intval($contact['abook_blocked']) ? t('This connection is blocked!') : ''), @@ -543,7 +543,7 @@ function connedit_content(&$a) { 'ignore' => array( 'label' => (intval($contact['abook_ignored']) ? t('Unignore') : t('Ignore')), - 'url' => $a->get_baseurl(true) . '/connedit/' . $contact['abook_id'] . '/ignore', + 'url' => z_root() . '/connedit/' . $contact['abook_id'] . '/ignore', 'sel' => (intval($contact['abook_ignored']) ? 'active' : ''), 'title' => t('Ignore (or Unignore) all inbound communications from this connection'), 'info' => (intval($contact['abook_ignored']) ? t('This connection is ignored!') : ''), @@ -551,7 +551,7 @@ function connedit_content(&$a) { 'archive' => array( 'label' => (intval($contact['abook_archived']) ? t('Unarchive') : t('Archive')), - 'url' => $a->get_baseurl(true) . '/connedit/' . $contact['abook_id'] . '/archive', + 'url' => z_root() . '/connedit/' . $contact['abook_id'] . '/archive', 'sel' => (intval($contact['abook_archived']) ? 'active' : ''), 'title' => t('Archive (or Unarchive) this connection - mark channel dead but keep content'), 'info' => (intval($contact['abook_archived']) ? t('This connection is archived!') : ''), @@ -559,7 +559,7 @@ function connedit_content(&$a) { 'hide' => array( 'label' => (intval($contact['abook_hidden']) ? t('Unhide') : t('Hide')), - 'url' => $a->get_baseurl(true) . '/connedit/' . $contact['abook_id'] . '/hide', + 'url' => z_root() . '/connedit/' . $contact['abook_id'] . '/hide', 'sel' => (intval($contact['abook_hidden']) ? 'active' : ''), 'title' => t('Hide or Unhide this connection from your other connections'), 'info' => (intval($contact['abook_hidden']) ? t('This connection is hidden!') : ''), @@ -567,7 +567,7 @@ function connedit_content(&$a) { 'delete' => array( 'label' => t('Delete'), - 'url' => $a->get_baseurl(true) . '/connedit/' . $contact['abook_id'] . '/drop', + 'url' => z_root() . '/connedit/' . $contact['abook_id'] . '/drop', 'sel' => '', 'title' => t('Delete this connection'), ), diff --git a/mod/cover_photo.php b/mod/cover_photo.php index 9c99859ea..9e7136c14 100644 --- a/mod/cover_photo.php +++ b/mod/cover_photo.php @@ -354,7 +354,7 @@ function cover_photo_content(&$a) { '$profiles' => $profiles, '$form_security_token' => get_form_security_token("cover_photo"), // FIXME - yuk - '$select' => sprintf('%s %s', t('or'), ($newuser) ? '<a href="' . $a->get_baseurl() . '">' . t('skip this step') . '</a>' : '<a href="'. $a->get_baseurl() . '/photos/' . $a->channel['channel_address'] . '">' . t('select a photo from your photo albums') . '</a>') + '$select' => sprintf('%s %s', t('or'), ($newuser) ? '<a href="' . z_root() . '">' . t('skip this step') . '</a>' : '<a href="'. z_root() . '/photos/' . $a->channel['channel_address'] . '">' . t('select a photo from your photo albums') . '</a>') )); call_hooks('cover_photo_content_end', $o); @@ -369,7 +369,7 @@ function cover_photo_content(&$a) { '$filename' => $filename, '$profile' => intval($_REQUEST['profile']), '$resource' => $a->data['imagecrop'] . '-3', - '$image_url' => $a->get_baseurl() . '/photo/' . $filename, + '$image_url' => z_root() . '/photo/' . $filename, '$title' => t('Crop Image'), '$desc' => t('Please adjust the image cropping for optimum viewing.'), '$form_security_token' => get_form_security_token("cover_photo"), diff --git a/mod/dav.php b/mod/dav.php index 272dae4c8..b745dbb5c 100644 --- a/mod/dav.php +++ b/mod/dav.php @@ -49,7 +49,7 @@ function dav_init(&$a) { $profile = 0; - $a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . $a->get_baseurl() . '/feed/' . $which . '" />' . "\r\n"; + $a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . z_root() . '/feed/' . $which . '" />' . "\r\n"; if ($which) profile_load($a, $which, $profile); diff --git a/mod/directory.php b/mod/directory.php index dca96694e..fe5799c88 100644 --- a/mod/directory.php +++ b/mod/directory.php @@ -324,7 +324,7 @@ function directory_content(&$a) { 'online' => $online, 'kw' => (($out) ? t('Keywords: ') : ''), 'keywords' => $out, - 'ignlink' => $suggest ? $a->get_baseurl() . '/directory?ignore=' . $rr['hash'] : '', + 'ignlink' => $suggest ? z_root() . '/directory?ignore=' . $rr['hash'] : '', 'ignore_label' => t('Don\'t suggest'), 'common_friends' => (($common[$rr['address']]) ? intval($common[$rr['address']]) : ''), 'common_label' => t('Common connections:'), diff --git a/mod/editblock.php b/mod/editblock.php index 9269676b1..a49beca3d 100644 --- a/mod/editblock.php +++ b/mod/editblock.php @@ -109,7 +109,7 @@ function editblock_content(&$a) { $mimeselect = mimetype_select($itm[0]['uid'],$mimetype); $a->page['htmlhead'] .= replace_macros(get_markup_template('jot-header.tpl'), array( - '$baseurl' => $a->get_baseurl(), + '$baseurl' => z_root(), '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'), '$pretext' => '', '$ispublic' => ' ', // t('Visible to <strong>everybody</strong>'), @@ -153,7 +153,7 @@ function editblock_content(&$a) { '$mimeselect' => $mimeselect, '$content' => undo_post_tagging($itm[0]['body']), '$post_id' => $post_id, - '$baseurl' => $a->get_baseurl(), + '$baseurl' => z_root(), '$defloc' => $channel['channel_location'], '$visitor' => false, '$public' => t('Public post'), diff --git a/mod/editlayout.php b/mod/editlayout.php index fc68cfe3c..2c77a2381 100644 --- a/mod/editlayout.php +++ b/mod/editlayout.php @@ -103,7 +103,7 @@ function editlayout_content(&$a) { $plaintext = true; $a->page['htmlhead'] .= replace_macros(get_markup_template('jot-header.tpl'), array( - '$baseurl' => $a->get_baseurl(), + '$baseurl' => z_root(), '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'), '$pretext' => '', '$ispublic' => ' ', // t('Visible to <strong>everybody</strong>'), @@ -150,7 +150,7 @@ function editlayout_content(&$a) { '$ptyp' => $itm[0]['type'], '$content' => undo_post_tagging($itm[0]['body']), '$post_id' => $post_id, - '$baseurl' => $a->get_baseurl(), + '$baseurl' => z_root(), '$defloc' => $channel['channel_location'], '$visitor' => false, '$public' => t('Public post'), diff --git a/mod/editpost.php b/mod/editpost.php index 030d8d671..7555ef37c 100644 --- a/mod/editpost.php +++ b/mod/editpost.php @@ -47,7 +47,7 @@ function editpost_content(&$a) { $channel = $a->get_channel(); $a->page['htmlhead'] .= replace_macros(get_markup_template('jot-header.tpl'), array( - '$baseurl' => $a->get_baseurl(), + '$baseurl' => z_root(), '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'), '$pretext' => '', '$ispublic' => ' ', // t('Visible to <strong>everybody</strong>'), @@ -132,7 +132,7 @@ function editpost_content(&$a) { '$content' => undo_post_tagging($itm[0]['body']), '$post_id' => $post_id, '$parent' => (($itm[0]['parent'] != $itm[0]['id']) ? $itm[0]['parent'] : ''), - '$baseurl' => $a->get_baseurl(), + '$baseurl' => z_root(), '$defloc' => $channel['channel_location'], '$visitor' => false, '$public' => t('Public post'), diff --git a/mod/editwebpage.php b/mod/editwebpage.php index 0192fd9c0..f6cf22390 100644 --- a/mod/editwebpage.php +++ b/mod/editwebpage.php @@ -144,7 +144,7 @@ function editwebpage_content(&$a) { $layoutselect = layout_select($itm[0]['uid'],$itm[0]['layout_mid']); $a->page['htmlhead'] .= replace_macros(get_markup_template('jot-header.tpl'), array( - '$baseurl' => $a->get_baseurl(), + '$baseurl' => z_root(), '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'), '$pretext' => '', '$ispublic' => ' ', // t('Visible to <strong>everybody</strong>'), @@ -192,7 +192,7 @@ function editwebpage_content(&$a) { '$ptyp' => $itm[0]['type'], '$content' => undo_post_tagging($itm[0]['body']), '$post_id' => $post_id, - '$baseurl' => $a->get_baseurl(), + '$baseurl' => z_root(), '$defloc' => $itm[0]['location'], '$visitor' => ($is_owner) ? true : false, '$acl' => populate_acl($itm[0],false), diff --git a/mod/events.php b/mod/events.php index 8e3b3e06b..30c083e4f 100755 --- a/mod/events.php +++ b/mod/events.php @@ -93,8 +93,8 @@ function events_post(&$a) { //$action = ($event_hash == '') ? 'new' : "event/" . $event_hash; //fixme: this url gives a wsod if there is a linebreak detected in one of the variables ($desc or $location) - //$onerror_url = $a->get_baseurl() . "/events/" . $action . "?summary=$summary&description=$desc&location=$location&start=$start_text&finish=$finish_text&adjust=$adjust&nofinish=$nofinish&type=$type"; - $onerror_url = $a->get_baseurl() . "/events"; + //$onerror_url = z_root() . "/events/" . $action . "?summary=$summary&description=$desc&location=$location&start=$start_text&finish=$finish_text&adjust=$adjust&nofinish=$nofinish&type=$type"; + $onerror_url = z_root() . "/events"; if(strcmp($finish,$start) < 0 && !$nofinish) { notice( t('Event can not end before it has started.') . EOL); @@ -282,7 +282,7 @@ function events_content(&$a) { $htpl = get_markup_template('event_head.tpl'); $a->page['htmlhead'] .= replace_macros($htpl,array( - '$baseurl' => $a->get_baseurl(), + '$baseurl' => z_root(), '$module_url' => '/events', '$modparams' => 1, '$lang' => $a->language, @@ -435,7 +435,7 @@ function events_content(&$a) { $tpl = get_markup_template('event_form.tpl'); $form = replace_macros($tpl,array( - '$post' => $a->get_baseurl() . '/events', + '$post' => z_root() . '/events', '$eid' => $eid, '$type' => $type, '$xchan' => $event_xchan, @@ -571,7 +571,7 @@ function events_content(&$a) { foreach($r as $rr) { $j = (($rr['adjust']) ? datetime_convert('UTC',date_default_timezone_get(),$rr['start'], 'j') : datetime_convert('UTC','UTC',$rr['start'],'j')); if(! x($links,$j)) - $links[$j] = $a->get_baseurl() . '/' . $a->cmd . '#link-' . $j; + $links[$j] = z_root() . '/' . $a->cmd . '#link-' . $j; } } @@ -600,9 +600,9 @@ function events_content(&$a) { $last_date = $d; - $edit = ((local_channel() && $rr['author_xchan'] == get_observer_hash()) ? array($a->get_baseurl().'/events/'.$rr['event_hash'].'?expandform=1',t('Edit event'),'','') : false); + $edit = ((local_channel() && $rr['author_xchan'] == get_observer_hash()) ? array(z_root().'/events/'.$rr['event_hash'].'?expandform=1',t('Edit event'),'','') : false); - $drop = array($a->get_baseurl().'/events/drop/'.$rr['event_hash'],t('Delete event'),'',''); + $drop = array(z_root().'/events/drop/'.$rr['event_hash'],t('Delete event'),'',''); $title = strip_tags(html_entity_decode(bbcode($rr['summary']),ENT_QUOTES,'UTF-8')); if(! $title) { @@ -654,11 +654,11 @@ function events_content(&$a) { } $o = replace_macros($tpl, array( - '$baseurl' => $a->get_baseurl(), - '$new_event' => array($a->get_baseurl().'/events',(($event_id) ? t('Edit Event') : t('Create Event')),'',''), - '$previus' => array($a->get_baseurl()."/events/$prevyear/$prevmonth",t('Previous'),'',''), - '$next' => array($a->get_baseurl()."/events/$nextyear/$nextmonth",t('Next'),'',''), - '$export' => array($a->get_baseurl()."/events/$y/$m/export",t('Export'),'',''), + '$baseurl' => z_root(), + '$new_event' => array(z_root().'/events',(($event_id) ? t('Edit Event') : t('Create Event')),'',''), + '$previus' => array(z_root()."/events/$prevyear/$prevmonth",t('Previous'),'',''), + '$next' => array(z_root()."/events/$nextyear/$nextmonth",t('Next'),'',''), + '$export' => array(z_root()."/events/$y/$m/export",t('Export'),'',''), '$calendar' => cal($y,$m,$links, ' eventcal'), '$events' => $events, '$upload' => t('Import'), diff --git a/mod/fbrowser.php b/mod/fbrowser.php index 13abbfd8a..6ce1292c8 100644 --- a/mod/fbrowser.php +++ b/mod/fbrowser.php @@ -22,7 +22,7 @@ function fbrowser_content($a){ switch($a->argv[1]){ case "image": - $path = array( array($a->get_baseurl()."/fbrowser/image/", t("Photos"))); + $path = array( array(z_root()."/fbrowser/image/", t("Photos"))); $albums = false; $sql_extra = ""; $sql_extra2 = " ORDER BY created DESC LIMIT 0, 10"; @@ -42,7 +42,7 @@ function fbrowser_content($a){ $album = hex2bin($a->argv[2]); $sql_extra = sprintf("AND `album` = '%s' ",dbesc($album)); $sql_extra2 = ""; - $path[]=array($a->get_baseurl()."/fbrowser/image/".$a->argv[2]."/", $album); + $path[]=array(z_root()."/fbrowser/image/".$a->argv[2]."/", $album); } $r = q("SELECT `resource_id`, `id`, `filename`, type, min(`scale`) AS `hiq`,max(`scale`) AS `loq`, `description` @@ -60,9 +60,9 @@ function fbrowser_content($a){ $filename_e = $rr['filename']; return array( - $a->get_baseurl() . '/photo/' . $rr['resource_id'] . '-' . $rr['hiq'] . '.' .$ext, + z_root() . '/photo/' . $rr['resource_id'] . '-' . $rr['hiq'] . '.' .$ext, $filename_e, - $a->get_baseurl() . '/photo/' . $rr['resource_id'] . '-' . $rr['loq'] . '.'. $ext + z_root() . '/photo/' . $rr['resource_id'] . '-' . $rr['loq'] . '.'. $ext ); } $files = array_map("files1", $r); @@ -70,7 +70,7 @@ function fbrowser_content($a){ $tpl = get_markup_template("filebrowser.tpl"); echo replace_macros($tpl, array( '$type' => 'image', - '$baseurl' => $a->get_baseurl(), + '$baseurl' => z_root(), '$path' => $path, '$folders' => $albums, '$files' =>$files, @@ -96,7 +96,7 @@ function fbrowser_content($a){ $filename_e = $rr['filename']; } - return array( $a->get_baseurl() . '/attach/' . $rr['id'], $filename_e, $a->get_baseurl() . '/images/icons/16/' . $filetype . '.png'); + return array( z_root() . '/attach/' . $rr['id'], $filename_e, z_root() . '/images/icons/16/' . $filetype . '.png'); } $files = array_map("files2", $files); //echo "<pre>"; var_dump($files); killme(); @@ -105,8 +105,8 @@ function fbrowser_content($a){ $tpl = get_markup_template("filebrowser.tpl"); echo replace_macros($tpl, array( '$type' => 'file', - '$baseurl' => $a->get_baseurl(), - '$path' => array( array($a->get_baseurl()."/fbrowser/image/", t("Files")) ), + '$baseurl' => z_root(), + '$path' => array( array(z_root()."/fbrowser/image/", t("Files")) ), '$folders' => false, '$files' =>$files, '$cancel' => t('Cancel'), diff --git a/mod/filerm.php b/mod/filerm.php index bd8ce7cfc..6a6c4ff15 100644 --- a/mod/filerm.php +++ b/mod/filerm.php @@ -27,7 +27,7 @@ function filerm_content(&$a) { } if(x($_SESSION,'return_url')) - goaway($a->get_baseurl() . '/' . $_SESSION['return_url']); + goaway(z_root() . '/' . $_SESSION['return_url']); killme(); } diff --git a/mod/group.php b/mod/group.php index c63ccfa9b..defac572a 100644 --- a/mod/group.php +++ b/mod/group.php @@ -20,11 +20,11 @@ function group_post(&$a) { info( t('Privacy group created.') . EOL ); $r = group_byname(local_channel(),$name); if($r) - goaway($a->get_baseurl() . '/group/' . $r); + goaway(z_root() . '/group/' . $r); } else notice( t('Could not create privacy group.') . EOL ); - goaway($a->get_baseurl() . '/group'); + goaway(z_root() . '/group'); } if((argc() == 2) && (intval(argv(1)))) { @@ -36,7 +36,7 @@ function group_post(&$a) { ); if(! $r) { notice( t('Privacy group not found.') . EOL ); - goaway($a->get_baseurl() . '/connections'); + goaway(z_root() . '/connections'); } $group = $r[0]; @@ -108,7 +108,7 @@ function group_content(&$a) { else notice( t('Unable to remove privacy group.') . EOL); } - goaway($a->get_baseurl() . '/group'); + goaway(z_root() . '/group'); // NOTREACHED } @@ -135,7 +135,7 @@ function group_content(&$a) { ); if(! $r) { notice( t('Privacy group not found.') . EOL ); - goaway($a->get_baseurl() . '/connections'); + goaway(z_root() . '/connections'); } $group = $r[0]; diff --git a/mod/hcard.php b/mod/hcard.php index 014a63b35..8339fd013 100644 --- a/mod/hcard.php +++ b/mod/hcard.php @@ -25,7 +25,7 @@ function hcard_init(&$a) { $profile = $r[0]['profile_guid']; } - $a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . $a->get_baseurl() . '/feed/' . $which .'" />' . "\r\n" ; + $a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . z_root() . '/feed/' . $which .'" />' . "\r\n" ; if(! $profile) { $x = q("select channel_id as profile_uid from channel where channel_address = '%s' limit 1", diff --git a/mod/import.php b/mod/import.php index f91f261a5..0e41d41f3 100644 --- a/mod/import.php +++ b/mod/import.php @@ -246,9 +246,9 @@ function import_account(&$a, $account_id) { dbesc($channel['channel_guid']), dbesc($channel['channel_guid_sig']), dbesc($channel['channel_pubkey']), - dbesc($a->get_baseurl() . "/photo/profile/l/" . $channel['channel_id']), - dbesc($a->get_baseurl() . "/photo/profile/m/" . $channel['channel_id']), - dbesc($a->get_baseurl() . "/photo/profile/s/" . $channel['channel_id']), + dbesc(z_root() . "/photo/profile/l/" . $channel['channel_id']), + dbesc(z_root() . "/photo/profile/m/" . $channel['channel_id']), + dbesc(z_root() . "/photo/profile/s/" . $channel['channel_id']), dbesc($channel['channel_address'] . '@' . get_app()->get_hostname()), dbesc(z_root() . '/channel/' . $channel['channel_address']), dbesc(z_root() . '/follow?f=&url=%s'), diff --git a/mod/item.php b/mod/item.php index 038a967b2..b84a7ff8d 100644 --- a/mod/item.php +++ b/mod/item.php @@ -119,7 +119,7 @@ function item_post(&$a) { if (!$ret['success']) { notice( t($ret['message']) . EOL) ; if(x($_REQUEST,'return')) - goaway($a->get_baseurl() . "/" . $return_path ); + goaway(z_root() . "/" . $return_path ); killme(); } } @@ -173,7 +173,7 @@ function item_post(&$a) { if(($r === false) || (! count($r))) { notice( t('Unable to locate original post.') . EOL); if(x($_REQUEST,'return')) - goaway($a->get_baseurl() . "/" . $return_path ); + goaway(z_root() . "/" . $return_path ); killme(); } @@ -205,7 +205,7 @@ function item_post(&$a) { if(! $can_comment) { notice( t('Permission denied.') . EOL) ; if(x($_REQUEST,'return')) - goaway($a->get_baseurl() . "/" . $return_path ); + goaway(z_root() . "/" . $return_path ); killme(); } } @@ -213,7 +213,7 @@ function item_post(&$a) { if(! perm_is_allowed($profile_uid,$observer['xchan_hash'],($webpage) ? 'write_pages' : 'post_wall')) { notice( t('Permission denied.') . EOL) ; if(x($_REQUEST,'return')) - goaway($a->get_baseurl() . "/" . $return_path ); + goaway(z_root() . "/" . $return_path ); killme(); } } @@ -267,7 +267,7 @@ function item_post(&$a) { if(! $channel) { logger("mod_item: no channel."); if(x($_REQUEST,'return')) - goaway($a->get_baseurl() . "/" . $return_path ); + goaway(z_root() . "/" . $return_path ); killme(); } @@ -282,7 +282,7 @@ function item_post(&$a) { else { logger("mod_item: no owner."); if(x($_REQUEST,'return')) - goaway($a->get_baseurl() . "/" . $return_path ); + goaway(z_root() . "/" . $return_path ); killme(); } @@ -422,7 +422,7 @@ function item_post(&$a) { killme(); info( t('Empty post discarded.') . EOL ); if(x($_REQUEST,'return')) - goaway($a->get_baseurl() . "/" . $return_path ); + goaway(z_root() . "/" . $return_path ); killme(); } } @@ -462,7 +462,7 @@ function item_post(&$a) { else { notice( t('Executable content type not permitted to this channel.') . EOL); if(x($_REQUEST,'return')) - goaway($a->get_baseurl() . "/" . $return_path ); + goaway(z_root() . "/" . $return_path ); killme(); } } @@ -636,7 +636,7 @@ function item_post(&$a) { $r = attach_by_hash_nodata($hash,$rev); if($r['success']) { $attachments[] = array( - 'href' => $a->get_baseurl() . '/attach/' . $r['data']['hash'], + 'href' => z_root() . '/attach/' . $r['data']['hash'], 'length' => $r['data']['filesize'], 'type' => $r['data']['filetype'], 'title' => urlencode($r['data']['filename']), @@ -852,10 +852,10 @@ function item_post(&$a) { if(x($datarray,'cancel')) { logger('mod_item: post cancelled by plugin or duplicate suppressed.'); if($return_path) - goaway($a->get_baseurl() . "/" . $return_path); + goaway(z_root() . "/" . $return_path); $json = array('cancel' => 1); - $json['reload'] = $a->get_baseurl() . '/' . $_REQUEST['jsreload']; + $json['reload'] = z_root() . '/' . $_REQUEST['jsreload']; echo json_encode($json); killme(); } @@ -901,7 +901,7 @@ function item_post(&$a) { if((x($_REQUEST,'return')) && strlen($return_path)) { logger('return: ' . $return_path); - goaway($a->get_baseurl() . "/" . $return_path ); + goaway(z_root() . "/" . $return_path ); } killme(); } @@ -926,7 +926,7 @@ function item_post(&$a) { 'from_xchan' => $datarray['author_xchan'], 'to_xchan' => $datarray['owner_xchan'], 'item' => $datarray, - 'link' => $a->get_baseurl() . '/display/' . $datarray['mid'], + 'link' => z_root() . '/display/' . $datarray['mid'], 'verb' => ACTIVITY_POST, 'otype' => 'item', 'parent' => $parent, @@ -944,7 +944,7 @@ function item_post(&$a) { 'from_xchan' => $datarray['author_xchan'], 'to_xchan' => $datarray['owner_xchan'], 'item' => $datarray, - 'link' => $a->get_baseurl() . '/display/' . $datarray['mid'], + 'link' => z_root() . '/display/' . $datarray['mid'], 'verb' => ACTIVITY_POST, 'otype' => 'item' )); @@ -971,7 +971,7 @@ function item_post(&$a) { else { logger('mod_item: unable to retrieve post that was just stored.'); notice( t('System error. Post not saved.') . EOL); - goaway($a->get_baseurl() . "/" . $return_path ); + goaway(z_root() . "/" . $return_path ); // NOTREACHED } @@ -999,7 +999,7 @@ function item_post(&$a) { } $datarray['id'] = $post_id; - $datarray['llink'] = $a->get_baseurl() . '/display/' . $channel['channel_address'] . '/' . $post_id; + $datarray['llink'] = z_root() . '/display/' . $channel['channel_address'] . '/' . $post_id; call_hooks('post_local_end', $datarray); @@ -1019,12 +1019,12 @@ function item_post(&$a) { return $post; if($return_path) { - goaway($a->get_baseurl() . "/" . $return_path); + goaway(z_root() . "/" . $return_path); } $json = array('success' => 1); if(x($_REQUEST,'jsreload') && strlen($_REQUEST['jsreload'])) - $json['reload'] = $a->get_baseurl() . '/' . $_REQUEST['jsreload']; + $json['reload'] = z_root() . '/' . $_REQUEST['jsreload']; logger('post_json: ' . print_r($json,true), LOGGER_DEBUG); @@ -1099,7 +1099,7 @@ function fix_attached_photo_permissions($uid,$xchan_hash,$body, $images = $match[2]; if($images) { foreach($images as $image) { - if(! stristr($image,get_app()->get_baseurl() . '/photo/')) + if(! stristr($image,z_root() . '/photo/')) continue; $image_uri = substr($image,strrpos($image,'/') + 1); if(strpos($image_uri,'-') !== false) diff --git a/mod/like.php b/mod/like.php index 1de7882e9..9901c1cfa 100755 --- a/mod/like.php +++ b/mod/like.php @@ -444,7 +444,7 @@ function like_content(&$a) { $arr['thr_parent'] = $item['mid']; $ulink = '[zrl=' . $item_author['xchan_url'] . ']' . $item_author['xchan_name'] . '[/zrl]'; $alink = '[zrl=' . $observer['xchan_url'] . ']' . $observer['xchan_name'] . '[/zrl]'; - $plink = '[zrl=' . $a->get_baseurl() . '/display/' . $item['mid'] . ']' . $post_type . '[/zrl]'; + $plink = '[zrl=' . z_root() . '/display/' . $item['mid'] . ']' . $post_type . '[/zrl]'; $allow_cid = $item['allow_cid']; $allow_gid = $item['allow_gid']; $deny_cid = $item['deny_cid']; diff --git a/mod/lostpass.php b/mod/lostpass.php index ffdd7b62e..9a52ac7a9 100644 --- a/mod/lostpass.php +++ b/mod/lostpass.php @@ -31,10 +31,10 @@ function lostpass_post(&$a) { $email_tpl = get_intltext_template("lostpass_eml.tpl"); $message = replace_macros($email_tpl, array( '$sitename' => get_config('system','sitename'), - '$siteurl' => $a->get_baseurl(), + '$siteurl' => z_root(), '$username' => sprintf( t('Site Member (%s)'), $email), '$email' => $email, - '$reset_link' => $a->get_baseurl() . '/lostpass?verify=' . $hash + '$reset_link' => z_root() . '/lostpass?verify=' . $hash )); $subject = email_header_encode(sprintf( t('Password reset requested at %s'),get_config('system','sitename')), 'UTF-8'); @@ -87,10 +87,10 @@ function lostpass_content(&$a) { '$lbl2' => t('Your password has been reset as requested.'), '$lbl3' => t('Your new password is'), '$lbl4' => t('Save or copy your new password - and then'), - '$lbl5' => '<a href="' . $a->get_baseurl() . '/login">' . t('click here to login') . '</a>.', + '$lbl5' => '<a href="' . z_root() . '/login">' . t('click here to login') . '</a>.', '$lbl6' => t('Your password may be changed from the <em>Settings</em> page after successful login.'), '$newpass' => $new_password, - '$baseurl' => $a->get_baseurl() + '$baseurl' => z_root() )); @@ -99,7 +99,7 @@ function lostpass_content(&$a) { $email_tpl = get_intltext_template("passchanged_eml.tpl"); $message = replace_macros($email_tpl, array( '$sitename' => $a->config['sitename'], - '$siteurl' => $a->get_baseurl(), + '$siteurl' => z_root(), '$username' => sprintf( t('Site Member (%s)'), $email), '$email' => $email, '$new_password' => $new_password, diff --git a/mod/mail.php b/mod/mail.php index 59d15772b..32bb19952 100644 --- a/mod/mail.php +++ b/mod/mail.php @@ -149,7 +149,7 @@ function mail_content(&$a) { if($r) { //info( t('Message deleted.') . EOL ); } - goaway($a->get_baseurl(true) . '/mail/' . $mailbox); + goaway(z_root() . '/mail/' . $mailbox); } if((argc() == 4) && (argv(2) === 'recall')) { @@ -174,7 +174,7 @@ function mail_content(&$a) { if($r) { info( t('Message recalled.') . EOL ); } - goaway($a->get_baseurl(true) . '/mail/' . $mailbox . '/' . argv(3)); + goaway(z_root() . '/mail/' . $mailbox . '/' . argv(3)); } @@ -186,7 +186,7 @@ function mail_content(&$a) { $r = private_messages_drop(local_channel(), argv(3), true); if($r) info( t('Conversation removed.') . EOL ); - goaway($a->get_baseurl(true) . '/mail/' . $mailbox); + goaway(z_root() . '/mail/' . $mailbox); } if((argc() > 1) && (argv(1) === 'new')) { @@ -196,7 +196,7 @@ function mail_content(&$a) { $tpl = get_markup_template('msg-header.tpl'); $header = replace_macros($tpl, array( - '$baseurl' => $a->get_baseurl(true), + '$baseurl' => z_root(), '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'), '$nickname' => $channel['channel_address'], '$linkurl' => t('Please enter a link URL:'), @@ -311,7 +311,7 @@ function mail_content(&$a) { $a->page['htmlhead'] .= replace_macros($tpl, array( '$nickname' => $channel['channel_address'], - '$baseurl' => $a->get_baseurl(true), + '$baseurl' => z_root(), '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'), '$linkurl' => t('Please enter a link URL:'), '$expireswhen' => t('Expires YYYY-MM-DD HH:MM') diff --git a/mod/match.php b/mod/match.php index fd739ba2c..60c281861 100644 --- a/mod/match.php +++ b/mod/match.php @@ -17,7 +17,7 @@ function match_content(&$a) { if (! local_channel()) return; - $_SESSION['return_url'] = $a->get_baseurl() . '/' . $a->cmd; + $_SESSION['return_url'] = z_root() . '/' . $a->cmd; $o .= '<h2>' . t('Profile Match') . '</h2>'; @@ -43,7 +43,7 @@ function match_content(&$a) { // if(strlen(get_config('system','directory_submit_url'))) // $x = post_url('http://dir.friendica.com/msearch', $params); // else -// $x = post_url($a->get_baseurl() . '/msearch', $params); +// $x = post_url(z_root() . '/msearch', $params); $j = json_decode($x); @@ -55,7 +55,7 @@ function match_content(&$a) { if (count($j->results)) { $tpl = get_markup_template('match.tpl'); foreach ($j->results as $jj) { - $connlnk = $a->get_baseurl() . '/follow/?url=' . $jj->url; + $connlnk = z_root() . '/follow/?url=' . $jj->url; $o .= replace_macros($tpl,array( '$url' => zid($jj->url), '$name' => $jj->name, diff --git a/mod/message.php b/mod/message.php index 73239d2cb..a97ab5399 100644 --- a/mod/message.php +++ b/mod/message.php @@ -32,7 +32,7 @@ function message_content(&$a) { $r = private_messages_drop(local_channel(), argv(2), true); if($r) info( t('Conversation removed.') . EOL ); - goaway($a->get_baseurl(true) . '/mail/combined' ); + goaway(z_root() . '/mail/combined' ); } if(argc() == 2) { diff --git a/mod/msearch.php b/mod/msearch.php index b51c4e097..f94b75910 100644 --- a/mod/msearch.php +++ b/mod/msearch.php @@ -27,8 +27,8 @@ function msearch_post(&$a) { foreach($r as $rr) $results[] = array( 'name' => $rr['name'], - 'url' => $a->get_baseurl() . '/channel/' . $rr['nickname'], - 'photo' => $a->get_baseurl() . '/photo/avatar/' . $rr['uid'], + 'url' => z_root() . '/channel/' . $rr['nickname'], + 'photo' => z_root() . '/photo/avatar/' . $rr['uid'], 'tags' => str_replace(array(',',' '),array(' ',' '),$rr['keywords']) ); } diff --git a/mod/network.php b/mod/network.php index 134a4081d..0def662cc 100644 --- a/mod/network.php +++ b/mod/network.php @@ -89,7 +89,7 @@ function network_content(&$a, $update = 0, $load = false) { if($update) killme(); notice( t('No such group') . EOL ); - goaway($a->get_baseurl(true) . '/network'); + goaway(z_root() . '/network'); // NOTREACHED } @@ -129,7 +129,7 @@ function network_content(&$a, $update = 0, $load = false) { killme(); } notice( t('No such channel') . EOL ); - goaway($a->get_baseurl(true) . '/network'); + goaway(z_root() . '/network'); // NOTREACHED } if($_GET['pf'] === '1') @@ -242,7 +242,7 @@ function network_content(&$a, $update = 0, $load = false) { } else { notice( t('Invalid connection.') . EOL); - goaway($a->get_baseurl(true) . '/network'); + goaway(z_root() . '/network'); } } diff --git a/mod/new_channel.php b/mod/new_channel.php index 577137c37..db5fff82a 100644 --- a/mod/new_channel.php +++ b/mod/new_channel.php @@ -122,7 +122,7 @@ function new_channel_content(&$a) { } $name = array('name', t('Name or caption'), ((x($_REQUEST,'name')) ? $_REQUEST['name'] : ''), t('Examples: "Bob Jameson", "Lisa and her Horses", "Soccer", "Aviation Group"')); - $nickhub = '@' . str_replace(array('http://','https://','/'), '', get_config('system','baseurl')); + $nickhub = '@' . get_app()->get_hostname(); $nickname = array('nickname', t('Choose a short nickname'), ((x($_REQUEST,'nickname')) ? $_REQUEST['nickname'] : ''), sprintf( t('Your nickname will be used to create an easy to remember channel address e.g. nickname%s'), $nickhub)); $privacy_role = ((x($_REQUEST,'permissions_role')) ? $_REQUEST['permissions_role'] : "" ); $role = array('permissions_role' , t('Channel role and privacy'), ($privacy_role) ? $privacy_role : 'social', t('Select a channel role with your privacy requirements.') . ' <a href="help/roles" target="_blank">' . t('Read more about roles') . '</a>',get_roles()); diff --git a/mod/notifications.php b/mod/notifications.php index f679fbb3b..f6a75e2c0 100644 --- a/mod/notifications.php +++ b/mod/notifications.php @@ -46,12 +46,12 @@ function notifications_post(&$a) { intval(local_channel()) ); } - goaway($a->get_baseurl(true) . '/notifications/intros'); + goaway(z_root() . '/notifications/intros'); } if($_POST['submit'] == t('Ignore')) { $r = q("UPDATE `intro` SET `ignore` = 1 WHERE `id` = %d", intval($intro_id)); - goaway($a->get_baseurl(true) . '/notifications/intros'); + goaway(z_root() . '/notifications/intros'); } } } @@ -84,7 +84,7 @@ function notifications_content(&$a) { $notifications_available =1; foreach ($r as $it) { $notif_content .= replace_macros($not_tpl,array( - '$item_link' => $a->get_baseurl(true).'/notify/view/'. $it['id'], + '$item_link' => z_root().'/notify/view/'. $it['id'], '$item_image' => $it['photo'], '$item_text' => strip_tags(bbcode($it['msg'])), '$item_when' => relative_date($it['date']) diff --git a/mod/notify.php b/mod/notify.php index 4c9d1977b..d56871880 100644 --- a/mod/notify.php +++ b/mod/notify.php @@ -19,7 +19,7 @@ function notify_init(&$a) { ); goaway($r[0]['link']); } - goaway($a->get_baseurl(true)); + goaway(z_root()); } @@ -42,7 +42,7 @@ function notify_content(&$a) { if($r) { foreach ($r as $it) { $notif_content .= replace_macros($not_tpl,array( - '$item_link' => $a->get_baseurl(true).'/notify/view/'. $it['id'], + '$item_link' => z_root().'/notify/view/'. $it['id'], '$item_image' => $it['photo'], '$item_text' => strip_tags(bbcode($it['msg'])), '$item_when' => relative_date($it['date']) diff --git a/mod/oexchange.php b/mod/oexchange.php index 867cea6f2..d59a8d127 100644 --- a/mod/oexchange.php +++ b/mod/oexchange.php @@ -6,7 +6,7 @@ function oexchange_init(&$a) { if((argc() > 1) && (argv(1) === 'xrd')) { $tpl = get_markup_template('oexchange_xrd.tpl'); - $o = replace_macros($tpl, array('$base' => $a->get_baseurl())); + $o = replace_macros($tpl, array('$base' => z_root())); echo $o; killme(); } @@ -47,7 +47,7 @@ function oexchange_content(&$a) { $tags = (((x($_REQUEST,'tags')) && strlen($_REQUEST['tags'])) ? '&tags=' . urlencode(notags(trim($_REQUEST['tags']))) : ''); - $ret = z_fetch_url($a->get_baseurl() . '/urlinfo?f=&url=' . $url . $title . $description . $tags); + $ret = z_fetch_url(z_root() . '/urlinfo?f=&url=' . $url . $title . $description . $tags); if($ret['success']) $s = $ret['body']; diff --git a/mod/opensearch.php b/mod/opensearch.php index d28c4f1b8..212773b96 100644 --- a/mod/opensearch.php +++ b/mod/opensearch.php @@ -7,7 +7,7 @@ function opensearch_init(&$a) { header("Content-type: application/opensearchdescription+xml"); $o = replace_macros($tpl, array( - '$baseurl' => $a->get_baseurl(), + '$baseurl' => z_root(), '$nodename' => $a->get_hostname(), )); diff --git a/mod/photos.php b/mod/photos.php index 07138e6cf..ddacc38a3 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -93,12 +93,12 @@ function photos_post(&$a) { if($album === t('Profile Photos')) { // not allowed - goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']); + goaway(z_root() . '/' . $_SESSION['photo_return']); } if(! photos_album_exists($page_owner_uid,$album)) { notice( t('Album not found.') . EOL); - goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']); + goaway(z_root() . '/' . $_SESSION['photo_return']); } @@ -111,12 +111,12 @@ function photos_post(&$a) { // @fixme - syncronise with DAV or disallow completely - goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']); + goaway(z_root() . '/' . $_SESSION['photo_return']); // $x = photos_album_rename($page_owner_uid,$album,$newalbum); // if($x) { // $newurl = str_replace(bin2hex($album),bin2hex($newalbum),$_SESSION['photo_return']); -// goaway($a->get_baseurl() . '/' . $newurl); +// goaway(z_root() . '/' . $newurl); // } } @@ -140,7 +140,7 @@ function photos_post(&$a) { $str = null; } if(! $str) { - goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']); + goaway(z_root() . '/' . $_SESSION['photo_return']); } $r = q("select id from item where resource_id in ( $str ) and resource_type = 'photo' and uid = %d " . item_normal(), @@ -165,7 +165,7 @@ function photos_post(&$a) { } - goaway($a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address']); + goaway(z_root() . '/photos/' . $a->data['channel']['channel_address']); } if((argc() > 2) && (x($_REQUEST,'delete')) && ($_REQUEST['delete'] === t('Delete Photo'))) { @@ -174,7 +174,7 @@ function photos_post(&$a) { $ob_hash = get_observer_hash(); if(! $ob_hash) - goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']); + goaway(z_root() . '/' . $_SESSION['photo_return']); $r = q("SELECT `id`, `resource_id` FROM `photo` WHERE ( xchan = '%s' or `uid` = %d ) AND `resource_id` = '%s' LIMIT 1", dbesc($ob_hash), @@ -197,12 +197,12 @@ function photos_post(&$a) { ); if(count($i)) { drop_item($i[0]['id'],true,DROPITEM_PHASE1); - $url = $a->get_baseurl(); + $url = z_root(); } */ } - goaway($a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/album/' . $_SESSION['album_return']); + goaway(z_root() . '/photos/' . $a->data['channel']['channel_address'] . '/album/' . $_SESSION['album_return']); } @@ -440,7 +440,7 @@ function photos_post(&$a) { } - goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']); + goaway(z_root() . '/' . $_SESSION['photo_return']); return; // NOTREACHED } @@ -470,9 +470,9 @@ function photos_post(&$a) { } if($_REQUEST['newalbum']) - goaway($a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/album/' . bin2hex($_REQUEST['newalbum'])); + goaway(z_root() . '/photos/' . $a->data['channel']['channel_address'] . '/album/' . bin2hex($_REQUEST['newalbum'])); else - goaway($a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/album/' . bin2hex(datetime_convert('UTC',date_default_timezone_get(),'now', 'Y'))); + goaway(z_root() . '/photos/' . $a->data['channel']['channel_address'] . '/album/' . bin2hex(datetime_convert('UTC',date_default_timezone_get(),'now', 'Y'))); } @@ -571,7 +571,7 @@ function photos_content(&$a) { $uploader = ''; - $ret = array('post_url' => $a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'], + $ret = array('post_url' => z_root() . '/photos/' . $a->data['channel']['channel_address'], 'addon_text' => $uploader, 'default_upload' => true); @@ -684,7 +684,7 @@ function photos_content(&$a) { $a->set_pager_total(count($r)); $a->set_pager_itemspage(60); } else { - goaway($a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address']); + goaway(z_root() . '/photos/' . $a->data['channel']['channel_address']); } if($_GET['order'] === 'posted') @@ -731,9 +731,9 @@ function photos_content(&$a) { } if($_GET['order'] === 'posted') - $order = array(t('Show Newest First'), $a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/album/' . bin2hex($album)); + $order = array(t('Show Newest First'), z_root() . '/photos/' . $a->data['channel']['channel_address'] . '/album/' . bin2hex($album)); else - $order = array(t('Show Oldest First'), $a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/album/' . bin2hex($album) . '?f=&order=posted'); + $order = array(t('Show Oldest First'), z_root() . '/photos/' . $a->data['channel']['channel_address'] . '/album/' . bin2hex($album) . '?f=&order=posted'); $photos = array(); if(count($r)) { @@ -750,7 +750,7 @@ function photos_content(&$a) { $imgalt_e = $rr['filename']; $desc_e = $rr['description']; - $imagelink = ($a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/image/' . $rr['resource_id'] + $imagelink = (z_root() . '/photos/' . $a->data['channel']['channel_address'] . '/image/' . $rr['resource_id'] . (($_GET['order'] === 'posted') ? '?f=&order=posted' : '')); $photos[] = array( @@ -758,7 +758,7 @@ function photos_content(&$a) { 'twist' => ' ' . $twist . rand(2,4), 'link' => $imagelink, 'title' => t('View Photo'), - 'src' => $a->get_baseurl() . '/photo/' . $rr['resource_id'] . '-' . $rr['scale'] . '.' .$ext, + 'src' => z_root() . '/photo/' . $rr['resource_id'] . '-' . $rr['scale'] . '.' .$ext, 'alt' => $imgalt_e, 'desc'=> $desc_e, 'ext' => $ext, @@ -790,7 +790,7 @@ function photos_content(&$a) { '$album_id' => bin2hex($album), '$album_edit' => array(t('Edit Album'), $album_edit), '$can_post' => $can_post, - '$upload' => array(t('Upload'), $a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/upload/' . bin2hex($album)), + '$upload' => array(t('Upload'), z_root() . '/photos/' . $a->data['channel']['channel_address'] . '/upload/' . bin2hex($album)), '$order' => $order, '$upload_form' => $upload_form, '$usage' => $usage_message @@ -871,8 +871,8 @@ function photos_content(&$a) { } } - $prevlink = $a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/image/' . $prvnxt[$prv]['resource_id'] . (($_GET['order'] === 'posted') ? '?f=&order=posted' : ''); - $nextlink = $a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/image/' . $prvnxt[$nxt]['resource_id'] . (($_GET['order'] === 'posted') ? '?f=&order=posted' : ''); + $prevlink = z_root() . '/photos/' . $a->data['channel']['channel_address'] . '/image/' . $prvnxt[$prv]['resource_id'] . (($_GET['order'] === 'posted') ? '?f=&order=posted' : ''); + $nextlink = z_root() . '/photos/' . $a->data['channel']['channel_address'] . '/image/' . $prvnxt[$nxt]['resource_id'] . (($_GET['order'] === 'posted') ? '?f=&order=posted' : ''); } @@ -889,14 +889,14 @@ function photos_content(&$a) { } } - $album_link = $a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/album/' . bin2hex($ph[0]['album']); + $album_link = z_root() . '/photos/' . $a->data['channel']['channel_address'] . '/album/' . bin2hex($ph[0]['album']); $tools = Null; $lock = Null; if($can_post && ($ph[0]['uid'] == $owner_uid)) { $tools = array( - 'profile'=>array($a->get_baseurl() . '/profile_photo/use/'.$ph[0]['resource_id'], t('Use as profile photo')), - 'cover'=>array($a->get_baseurl() . '/cover_photo/use/'.$ph[0]['resource_id'], t('Use as cover photo')), + 'profile'=>array(z_root() . '/profile_photo/use/'.$ph[0]['resource_id'], t('Use as profile photo')), + 'cover'=>array(z_root() . '/cover_photo/use/'.$ph[0]['resource_id'], t('Use as cover photo')), ); } @@ -917,9 +917,9 @@ function photos_content(&$a) { $prevlink = array($prevlink, t('Previous')); $photo = array( - 'href' => $a->get_baseurl() . '/photo/' . $hires['resource_id'] . '-' . $hires['scale'] . '.' . $phototypes[$hires['type']], + 'href' => z_root() . '/photo/' . $hires['resource_id'] . '-' . $hires['scale'] . '.' . $phototypes[$hires['type']], 'title'=> t('View Full Size'), - 'src' => $a->get_baseurl() . '/photo/' . $lores['resource_id'] . '-' . $lores['scale'] . '.' . $phototypes[$lores['type']] . '?f=&_u=' . datetime_convert('','','','ymdhis') + 'src' => z_root() . '/photo/' . $lores['resource_id'] . '-' . $lores['scale'] . '.' . $phototypes[$lores['type']] . '?f=&_u=' . datetime_convert('','','','ymdhis') ); if($nextlink) @@ -1123,7 +1123,7 @@ function photos_content(&$a) { if(((activity_match($item['verb'],ACTIVITY_LIKE)) || (activity_match($item['verb'],ACTIVITY_DISLIKE))) && ($item['id'] != $item['parent'])) continue; - $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ; + $redirect_url = z_root() . '/redir/' . $item['cid'] ; $profile_url = zid($item['author']['xchan_url']); @@ -1297,12 +1297,12 @@ function photos_content(&$a) { $photos[] = array( 'id' => $rr['id'], 'twist' => ' ' . $twist . rand(2,4), - 'link' => $a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/image/' . $rr['resource_id'], + 'link' => z_root() . '/photos/' . $a->data['channel']['channel_address'] . '/image/' . $rr['resource_id'], 'title' => t('View Photo'), - 'src' => $a->get_baseurl() . '/photo/' . $rr['resource_id'] . '-' . ((($rr['scale']) == 6) ? 4 : $rr['scale']) . '.' . $ext, + 'src' => z_root() . '/photo/' . $rr['resource_id'] . '-' . ((($rr['scale']) == 6) ? 4 : $rr['scale']) . '.' . $ext, 'alt' => $alt_e, 'album' => array( - 'link' => $a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/album/' . bin2hex($rr['album']), + 'link' => z_root() . '/photos/' . $a->data['channel']['channel_address'] . '/album/' . bin2hex($rr['album']), 'name' => $name_e, 'alt' => t('View Album'), ), @@ -1331,7 +1331,7 @@ function photos_content(&$a) { '$title' => t('Recent Photos'), '$album_id' => bin2hex(t('Recent Photos')), '$can_post' => $can_post, - '$upload' => array(t('Upload'), $a->get_baseurl().'/photos/'.$a->data['channel']['channel_address'].'/upload'), + '$upload' => array(t('Upload'), z_root().'/photos/'.$a->data['channel']['channel_address'].'/upload'), '$photos' => $photos, '$upload_form' => $upload_form, '$usage' => $usage_message diff --git a/mod/ping.php b/mod/ping.php index 69d504da1..c93644317 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -224,7 +224,7 @@ function ping_init(&$a) { if(count($z)) { foreach($z as $zz) { $notifs[] = array( - 'notify_link' => $a->get_baseurl() . '/notify/view/' . $zz['id'], + 'notify_link' => z_root() . '/notify/view/' . $zz['id'], 'name' => $zz['name'], 'url' => $zz['url'], 'photo' => $zz['photo'], @@ -251,7 +251,7 @@ function ping_init(&$a) { if($t) { foreach($t as $zz) { $notifs[] = array( - 'notify_link' => $a->get_baseurl() . '/mail/' . $zz['id'], + 'notify_link' => z_root() . '/mail/' . $zz['id'], 'name' => $zz['xchan_name'], 'url' => $zz['xchan_url'], 'photo' => $zz['xchan_photo_s'], @@ -299,7 +299,7 @@ function ping_init(&$a) { if($r) { foreach($r as $rr) { $result[] = array( - 'notify_link' => $a->get_baseurl() . '/connections/ifpending', + 'notify_link' => z_root() . '/connections/ifpending', 'name' => $rr['xchan_name'], 'url' => $rr['xchan_url'], 'photo' => $rr['xchan_photo_s'], @@ -341,7 +341,7 @@ function ping_init(&$a) { $when = day_translate(datetime_convert('UTC', (($rr['adjust']) ? date_default_timezone_get() : 'UTC'), $rr['start'], $bd_format)) . (($today) ? ' ' . t('[today]') : ''); $result[] = array( - 'notify_link' => $a->get_baseurl() . '/events', // FIXME this takes you to an edit page and it may not be yours, we really want to just view the single event --> '/events/event/' . $rr['event_hash'], + 'notify_link' => z_root() . '/events', // FIXME this takes you to an edit page and it may not be yours, we really want to just view the single event --> '/events/event/' . $rr['event_hash'], 'name' => $rr['xchan_name'], 'url' => $rr['xchan_url'], 'photo' => $rr['xchan_photo_s'], diff --git a/mod/profile.php b/mod/profile.php index 7ee03a77b..3c9c7808d 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -33,7 +33,7 @@ function profile_init(&$a) { $profile = $r[0]['profile_guid']; } - $a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . $a->get_baseurl() . '/feed/' . $which .'" />' . "\r\n" ; + $a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . z_root() . '/feed/' . $which .'" />' . "\r\n" ; if(! $profile) { $x = q("select channel_id as profile_uid from channel where channel_address = '%s' limit 1", diff --git a/mod/profile_photo.php b/mod/profile_photo.php index 9dc71f256..789989ff2 100644 --- a/mod/profile_photo.php +++ b/mod/profile_photo.php @@ -189,8 +189,8 @@ function profile_photo_post(&$a) { } else { $r = q("update profile set photo = '%s', thumb = '%s' where id = %d and uid = %d", - dbesc($a->get_baseurl() . '/photo/' . $base_image['resource_id'] . '-4'), - dbesc($a->get_baseurl() . '/photo/' . $base_image['resource_id'] . '-5'), + dbesc(z_root() . '/photo/' . $base_image['resource_id'] . '-4'), + dbesc(z_root() . '/photo/' . $base_image['resource_id'] . '-5'), intval($_REQUEST['profile']), intval(local_channel()) ); @@ -225,7 +225,7 @@ function profile_photo_post(&$a) { notice( t('Unable to process image') . EOL); } - goaway($a->get_baseurl() . '/profiles'); + goaway(z_root() . '/profiles'); return; // NOTREACHED } @@ -345,7 +345,7 @@ function profile_photo_content(&$a) { profile_photo_set_profile_perms(); //Reset default photo permissions to public proc_run('php','include/directory.php',local_channel()); - goaway($a->get_baseurl() . '/profiles'); + goaway(z_root() . '/profiles'); } $r = q("SELECT `data`, `type`, resource_id, os_storage FROM photo WHERE id = %d and uid = %d limit 1", @@ -404,7 +404,7 @@ function profile_photo_content(&$a) { '$profile0' => $profiles[0], '$form_security_token' => get_form_security_token("profile_photo"), // FIXME - yuk - '$select' => sprintf('%s %s', t('or'), ($newuser) ? '<a href="' . $a->get_baseurl() . '">' . t('skip this step') . '</a>' : '<a href="'. $a->get_baseurl() . '/photos/' . $a->channel['channel_address'] . '">' . t('select a photo from your photo albums') . '</a>') + '$select' => sprintf('%s %s', t('or'), ($newuser) ? '<a href="' . z_root() . '">' . t('skip this step') . '</a>' : '<a href="'. z_root() . '/photos/' . $a->channel['channel_address'] . '">' . t('select a photo from your photo albums') . '</a>') )); call_hooks('profile_photo_content_end', $o); @@ -419,7 +419,7 @@ function profile_photo_content(&$a) { '$filename' => $filename, '$profile' => intval($_REQUEST['profile']), '$resource' => $a->data['imagecrop'] . '-' . $a->data['imagecrop_resolution'], - '$image_url' => $a->get_baseurl() . '/photo/' . $filename, + '$image_url' => z_root() . '/photo/' . $filename, '$title' => t('Crop Image'), '$desc' => t('Please adjust the image cropping for optimum viewing.'), '$form_security_token' => get_form_security_token("profile_photo"), diff --git a/mod/profiles.php b/mod/profiles.php index f891c6033..fca2ff429 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -17,7 +17,7 @@ function profiles_init(&$a) { ); if(! count($r)) { notice( t('Profile not found.') . EOL); - goaway($a->get_baseurl(true) . '/profiles'); + goaway(z_root() . '/profiles'); return; // NOTREACHED } $profile_guid = $r['profile_guid']; @@ -44,7 +44,7 @@ function profiles_init(&$a) { // profiles_build_sync(local_channel()); - goaway($a->get_baseurl(true) . '/profiles'); + goaway(z_root() . '/profiles'); return; // NOTREACHED } @@ -83,9 +83,9 @@ function profiles_init(&$a) { info( t('New profile created.') . EOL); if(count($r3) == 1) - goaway($a->get_baseurl(true) . '/profiles/' . $r3[0]['id']); + goaway(z_root() . '/profiles/' . $r3[0]['id']); - goaway($a->get_baseurl(true) . '/profiles'); + goaway(z_root() . '/profiles'); } if((argc() > 2) && (argv(1) === 'clone')) { @@ -129,9 +129,9 @@ function profiles_init(&$a) { profiles_build_sync(local_channel()); if(($r3) && (count($r3) == 1)) - goaway($a->get_baseurl(true) . '/profiles/' . $r3[0]['id']); + goaway(z_root() . '/profiles/' . $r3[0]['id']); - goaway($a->get_baseurl(true) . '/profiles'); + goaway(z_root() . '/profiles'); return; // NOTREACHED } @@ -629,7 +629,7 @@ function profiles_content(&$a) { // $editselect = 'textareas'; $a->page['htmlhead'] .= replace_macros(get_markup_template('profed_head.tpl'), array( - '$baseurl' => $a->get_baseurl(true), + '$baseurl' => z_root(), '$editselect' => $editselect, )); @@ -703,7 +703,7 @@ function profiles_content(&$a) { '$lbl_gender' => t('Your gender'), '$lbl_marital' => t('Marital status'), '$lbl_sexual' => t('Sexual preference'), - '$baseurl' => $a->get_baseurl(true), + '$baseurl' => z_root(), '$profile_id' => $r[0]['id'], '$profile_name' => array('profile_name', t('Profile name'), $r[0]['profile_name'], t('Required'), '*'), '$is_default' => $is_default, @@ -767,7 +767,7 @@ function profiles_content(&$a) { '$profile_name' => $rr['profile_name'], '$visible' => (($rr['is_default']) ? '<strong>' . translate_scope(map_scope($channel['channel_r_profile'])) . '</strong>' - : '<a href="' . $a->get_baseurl(true) . '/profperm/' . $rr['id'] . '" />' . t('Edit visibility') . '</a>') + : '<a href="' . z_root() . '/profperm/' . $rr['id'] . '" />' . t('Edit visibility') . '</a>') )); } diff --git a/mod/randprof.php b/mod/randprof.php index 9817685c8..124117e96 100644 --- a/mod/randprof.php +++ b/mod/randprof.php @@ -8,5 +8,5 @@ function randprof_init(&$a) { goaway(chanlink_url($x)); /** FIXME this doesn't work at the moment as a fallback */ - goaway($a->get_baseurl() . '/profile'); + goaway(z_root() . '/profile'); } diff --git a/mod/register.php b/mod/register.php index b533483f7..712691547 100644 --- a/mod/register.php +++ b/mod/register.php @@ -206,7 +206,7 @@ function register_content(&$a) { $tosurl = get_config('system','tos_url'); if(! $tosurl) - $tosurl = $a->get_baseurl() . '/help/TermsOfService'; + $tosurl = z_root() . '/help/TermsOfService'; $toslink = '<a href="' . $tosurl . '" target="_blank">' . t('Terms of Service') . '</a>'; diff --git a/mod/removeaccount.php b/mod/removeaccount.php index f3fa53f75..2752a2ee7 100644 --- a/mod/removeaccount.php +++ b/mod/removeaccount.php @@ -52,7 +52,7 @@ function removeaccount_content(&$a) { $_SESSION['remove_account_verify'] = $hash; $tpl = get_markup_template('removeaccount.tpl'); $o .= replace_macros($tpl, array( - '$basedir' => $a->get_baseurl(), + '$basedir' => z_root(), '$hash' => $hash, '$title' => t('Remove This Account'), '$desc' => array(t('WARNING: '), t('This account and all its channels will be completely removed from the network. '), t('This action is permanent and can not be undone!')), diff --git a/mod/removeme.php b/mod/removeme.php index b604bc7db..452ee5ef5 100644 --- a/mod/removeme.php +++ b/mod/removeme.php @@ -52,7 +52,7 @@ function removeme_content(&$a) { $tpl = get_markup_template('removeme.tpl'); $o .= replace_macros($tpl, array( - '$basedir' => $a->get_baseurl(), + '$basedir' => z_root(), '$hash' => $hash, '$title' => t('Remove This Channel'), '$desc' => array(t('WARNING: '), t('This channel will be completely removed from the network. '), t('This action is permanent and can not be undone!')), diff --git a/mod/rsd_xml.php b/mod/rsd_xml.php index 6fd9514cd..4ce82dbe0 100644 --- a/mod/rsd_xml.php +++ b/mod/rsd_xml.php @@ -10,7 +10,7 @@ function rsd_xml_content(&$a) { <engineName>Red</engineName> <engineLink>http://friendica.com/</engineLink> <apis> - <api name="Twitter" preferred="true" apiLink="'.$a->get_baseurl().'/api/" blogID=""> + <api name="Twitter" preferred="true" apiLink="'.z_root().'/api/" blogID=""> <settings> <docs>http://status.net/wiki/TwitterCompatibleAPI</docs> <setting name="OAuth">false</setting> diff --git a/mod/search_ac.php b/mod/search_ac.php index 19c1dc940..6ffdc6ed5 100644 --- a/mod/search_ac.php +++ b/mod/search_ac.php @@ -50,7 +50,7 @@ function search_ac_init(&$a){ if(count($r)) { foreach($r as $g) { $results[] = array( - "photo" => $a->get_baseurl() . '/images/hashtag.png', + "photo" => z_root() . '/images/hashtag.png', "name" => '#'.$g['term'], "id" => $g['tid'], "link" => $g['url'], diff --git a/mod/settings.php b/mod/settings.php index a6655f46a..d8aa069d0 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -57,7 +57,7 @@ function settings_post(&$a) { q("DELETE FROM tokens WHERE id='%s' AND uid=%d", dbesc($key), local_channel()); - goaway($a->get_baseurl(true)."/settings/oauth/"); + goaway(z_root()."/settings/oauth/"); return; } @@ -114,7 +114,7 @@ function settings_post(&$a) { ); } } - goaway($a->get_baseurl(true)."/settings/oauth/"); + goaway(z_root()."/settings/oauth/"); return; } @@ -211,7 +211,7 @@ function settings_post(&$a) { call_hooks('display_settings_post', $_POST); build_sync_packet(); - goaway($a->get_baseurl(true) . '/settings/display' ); + goaway(z_root() . '/settings/display' ); return; // NOTREACHED } @@ -294,7 +294,7 @@ function settings_post(&$a) { foreach($errs as $err) notice($err . EOL); } - goaway($a->get_baseurl(true) . '/settings/account' ); + goaway(z_root() . '/settings/account' ); } @@ -563,7 +563,7 @@ function settings_post(&$a) { } - goaway($a->get_baseurl(true) . '/settings' ); + goaway(z_root() . '/settings' ); return; // NOTREACHED } @@ -637,7 +637,7 @@ function settings_content(&$a) { $r = q("DELETE FROM clients WHERE client_id='%s' AND uid=%d", dbesc(argv(3)), local_channel()); - goaway($a->get_baseurl(true)."/settings/oauth/"); + goaway(z_root()."/settings/oauth/"); return; } @@ -653,7 +653,7 @@ function settings_content(&$a) { $tpl = get_markup_template("settings_oauth.tpl"); $o .= replace_macros($tpl, array( '$form_security_token' => get_form_security_token("settings_oauth"), - '$baseurl' => $a->get_baseurl(true), + '$baseurl' => z_root(), '$title' => t('Connected Apps'), '$add' => t('Add application'), '$edit' => t('Edit'), @@ -847,7 +847,7 @@ function settings_content(&$a) { '$d_cset' => t('Content Settings'), '$form_security_token' => get_form_security_token("settings_display"), '$submit' => t('Submit'), - '$baseurl' => $a->get_baseurl(true), + '$baseurl' => z_root(), '$uid' => local_channel(), '$theme' => (($themes) ? array('theme', t('Display Theme:'), $theme_selected, '', $themes, 'preview') : false), @@ -989,7 +989,7 @@ function settings_content(&$a) { )); - $subdir = ((strlen($a->get_path())) ? '<br />' . t('or') . ' ' . $a->get_baseurl(true) . '/channel/' . $nickname : ''); + $subdir = ((strlen($a->get_path())) ? '<br />' . t('or') . ' ' . z_root() . '/channel/' . $nickname : ''); $tpl_addr = get_markup_template("settings_nick_set.tpl"); @@ -1039,7 +1039,7 @@ function settings_content(&$a) { '$ptitle' => t('Channel Settings'), '$submit' => t('Submit'), - '$baseurl' => $a->get_baseurl(true), + '$baseurl' => z_root(), '$uid' => local_channel(), '$form_security_token' => get_form_security_token("settings"), '$nickname_block' => $prof_addr, diff --git a/mod/setup.php b/mod/setup.php index 282b9cbef..84fb752c3 100755 --- a/mod/setup.php +++ b/mod/setup.php @@ -291,7 +291,7 @@ function setup_content(&$a) { '$next' => t('Next'), '$reload' => t('Check again'), '$phpath' => $phpath, - '$baseurl' => $a->get_baseurl(), + '$baseurl' => z_root(), )); return $o; }; break; @@ -329,7 +329,7 @@ function setup_content(&$a) { '$siteurl' => array('siteurl', t('Website URL'), z_root(), t('Please use SSL (https) URL if available.')), '$lbl_10' => t('Please select a default timezone for your website'), - '$baseurl' => $a->get_baseurl(), + '$baseurl' => z_root(), '$phpath' => $phpath, @@ -372,7 +372,7 @@ function setup_content(&$a) { '$timezone' => array('timezone', t('Please select a default timezone for your website'), $timezone, '', get_timezones()), - '$baseurl' => $a->get_baseurl(), + '$baseurl' => z_root(), '$submit' => t('Submit'), )); @@ -633,7 +633,7 @@ function check_htaccess(&$checks) { $help = ''; $ssl_error = false; - $url = $a->get_baseurl() . '/setup/testrewrite'; + $url = z_root() . '/setup/testrewrite'; if (function_exists('curl_init')){ $test = z_fetch_url($url); @@ -733,7 +733,7 @@ function what_next() { require_once ('include/identity.php'); create_sys_channel(); - $baseurl = $a->get_baseurl(); + $baseurl = z_root(); return t('<h1>What next</h1>') ."<p>".t('IMPORTANT: You will need to [manually] setup a scheduled task for the poller.') diff --git a/mod/subthread.php b/mod/subthread.php index ce087806e..9438b545c 100755 --- a/mod/subthread.php +++ b/mod/subthread.php @@ -134,7 +134,7 @@ function subthread_content(&$a) { $ulink = '[zrl=' . $item_author['xchan_url'] . ']' . $item_author['xchan_name'] . '[/zrl]'; $alink = '[zrl=' . $observer['xchan_url'] . ']' . $observer['xchan_name'] . '[/zrl]'; - $plink = '[zrl=' . $a->get_baseurl() . '/display/' . $item['mid'] . ']' . $post_type . '[/zrl]'; + $plink = '[zrl=' . z_root() . '/display/' . $item['mid'] . ']' . $post_type . '[/zrl]'; $arr['body'] = sprintf( $bodyverb, $alink, $ulink, $plink ); diff --git a/mod/suggest.php b/mod/suggest.php index 438d884ca..ebe0e0f78 100644 --- a/mod/suggest.php +++ b/mod/suggest.php @@ -27,7 +27,7 @@ function suggest_content(&$a) { return; } - $_SESSION['return_url'] = $a->get_baseurl() . '/' . $a->cmd; + $_SESSION['return_url'] = z_root() . '/' . $a->cmd; $r = suggestion_query(local_channel(),get_observer_hash()); @@ -40,7 +40,7 @@ function suggest_content(&$a) { foreach($r as $rr) { - $connlnk = $a->get_baseurl() . '/follow/?url=' . $rr['xchan_addr']; + $connlnk = z_root() . '/follow/?url=' . $rr['xchan_addr']; $arr[] = array( 'url' => chanlink_url($rr['xchan_url']), @@ -48,7 +48,7 @@ function suggest_content(&$a) { 'profile' => $rr['xchan_url'], 'name' => $rr['xchan_name'], 'photo' => $rr['xchan_photo_m'], - 'ignlnk' => $a->get_baseurl() . '/suggest?ignore=' . $rr['xchan_hash'], + 'ignlnk' => z_root() . '/suggest?ignore=' . $rr['xchan_hash'], 'conntxt' => t('Connect'), 'connlnk' => $connlnk, 'ignore' => t('Ignore/Hide') diff --git a/mod/tagger.php b/mod/tagger.php index 27a8a15ea..eba02c9c4 100644 --- a/mod/tagger.php +++ b/mod/tagger.php @@ -80,9 +80,9 @@ function tagger_content(&$a) { $link = xmlify('<link rel="alternate" type="text/html" href="' - . $a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . '" />' . "\n") ; + . z_root() . '/display/' . $owner['nickname'] . '/' . $item['id'] . '" />' . "\n") ; - $tagid = $a->get_baseurl() . '/search?tag=' . $term; + $tagid = z_root() . '/search?tag=' . $term; $objtype = ACTIVITY_OBJ_TAGTERM; $obj = json_encode(array( @@ -98,7 +98,7 @@ function tagger_content(&$a) { // saving here for reference // also check out x22d5 and x2317 and x0d6b and x0db8 and x24d0 and xff20 !!! - $termlink = html_entity_decode('⋕') . '[zrl=' . $a->get_baseurl() . '/search?tag=' . urlencode($term) . ']'. $term . '[/zrl]'; + $termlink = html_entity_decode('⋕') . '[zrl=' . z_root() . '/search?tag=' . urlencode($term) . ']'. $term . '[/zrl]'; $channel = $a->get_channel(); diff --git a/mod/tagrm.php b/mod/tagrm.php index 56e842fb8..5523a8dd3 100644 --- a/mod/tagrm.php +++ b/mod/tagrm.php @@ -5,11 +5,11 @@ require_once('bbcode.php'); function tagrm_post(&$a) { if(! local_channel()) - goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']); + goaway(z_root() . '/' . $_SESSION['photo_return']); if((x($_POST,'submit')) && ($_POST['submit'] === t('Cancel'))) - goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']); + goaway(z_root() . '/' . $_SESSION['photo_return']); $tag = ((x($_POST,'tag')) ? trim($_POST['tag']) : ''); $item = ((x($_POST,'item')) ? intval($_POST['item']) : 0 ); @@ -20,7 +20,7 @@ function tagrm_post(&$a) { ); if(! $r) - goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']); + goaway(z_root() . '/' . $_SESSION['photo_return']); $r = fetch_post_tags($r,true); @@ -42,7 +42,7 @@ function tagrm_post(&$a) { item_store_update($item); info( t('Tag removed') . EOL ); - goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']); + goaway(z_root() . '/' . $_SESSION['photo_return']); // NOTREACHED @@ -53,7 +53,7 @@ function tagrm_post(&$a) { function tagrm_content(&$a) { if(! local_channel()) { - goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']); + goaway(z_root() . '/' . $_SESSION['photo_return']); // NOTREACHED } @@ -69,7 +69,7 @@ function tagrm_content(&$a) { ); if(! $r) - goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']); + goaway(z_root() . '/' . $_SESSION['photo_return']); $r = fetch_post_tags($r,true); @@ -92,7 +92,7 @@ function tagrm_content(&$a) { item_store_update($item); info( t('Tag removed') . EOL ); - goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']); + goaway(z_root() . '/' . $_SESSION['photo_return']); } @@ -109,12 +109,12 @@ function tagrm_content(&$a) { ); if(! $r) - goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']); + goaway(z_root() . '/' . $_SESSION['photo_return']); $r = fetch_post_tags($r,true); if(! count($r[0]['term'])) - goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']); + goaway(z_root() . '/' . $_SESSION['photo_return']); $o .= '<h3>' . t('Remove Item Tag') . '</h3>'; diff --git a/mod/toggle_mobile.php b/mod/toggle_mobile.php index 06dadca04..918c4aad6 100644 --- a/mod/toggle_mobile.php +++ b/mod/toggle_mobile.php @@ -10,7 +10,7 @@ function toggle_mobile_init(&$a) { if(isset($_GET['address'])) $address = $_GET['address']; else - $address = $a->get_baseurl(); + $address = z_root(); goaway($address); } diff --git a/mod/xrd.php b/mod/xrd.php index ed8e1eabe..0719407f6 100644 --- a/mod/xrd.php +++ b/mod/xrd.php @@ -28,7 +28,7 @@ function xrd_init(&$a) { killme(); $dspr = replace_macros(get_markup_template('xrd_diaspora.tpl'),array( - '$baseurl' => $a->get_baseurl(), + '$baseurl' => z_root(), '$dspr_guid' => $r[0]['channel_guid'] . str_replace('.','',$a->get_hostname()), '$dspr_key' => base64_encode(pemtorsa($r[0]['channel_pubkey'])) )); @@ -51,17 +51,17 @@ function xrd_init(&$a) { '$nick' => $r[0]['channel_address'], '$accturi' => $resource, '$aliases' => $aliases, - '$profile_url' => $a->get_baseurl() . '/channel/' . $r[0]['channel_address'], - '$hcard_url' => $a->get_baseurl() . '/hcard/' . $r[0]['channel_address'], - '$atom' => $a->get_baseurl() . '/feed/' . $r[0]['channel_address'], - '$zot_post' => $a->get_baseurl() . '/post/' . $r[0]['channel_address'], - '$poco_url' => $a->get_baseurl() . '/poco/' . $r[0]['channel_address'], - '$photo' => $a->get_baseurl() . '/photo/profile/l/' . $r[0]['channel_id'], + '$profile_url' => z_root() . '/channel/' . $r[0]['channel_address'], + '$hcard_url' => z_root() . '/hcard/' . $r[0]['channel_address'], + '$atom' => z_root() . '/feed/' . $r[0]['channel_address'], + '$zot_post' => z_root() . '/post/' . $r[0]['channel_address'], + '$poco_url' => z_root() . '/poco/' . $r[0]['channel_address'], + '$photo' => z_root() . '/photo/profile/l/' . $r[0]['channel_id'], '$dspr' => $dspr, -// '$salmon' => $a->get_baseurl() . '/salmon/' . $r[0]['channel_address'], -// '$salmen' => $a->get_baseurl() . '/salmon/' . $r[0]['channel_address'] . '/mention', +// '$salmon' => z_root() . '/salmon/' . $r[0]['channel_address'], +// '$salmen' => z_root() . '/salmon/' . $r[0]['channel_address'] . '/mention', '$modexp' => 'data:application/magic-public-key,' . $salmon_key, - '$subscribe' => $a->get_baseurl() . '/follow?url={uri}', + '$subscribe' => z_root() . '/follow?url={uri}', '$bigkey' => salmon_key($r[0]['channel_pubkey']) )); diff --git a/view/php/choklet.php b/view/php/choklet.php index 5f2303e77..00f8a6c56 100644 --- a/view/php/choklet.php +++ b/view/php/choklet.php @@ -2,7 +2,7 @@ <html prefix="og: http://ogp.me/ns#">
<head>
<title><?php if(x($page,'title')) echo $page['title']; ?></title>
- <script>var baseurl="<?php echo $a->get_baseurl(); ?>";</script>
+ <script>var baseurl="<?php echo z_root(); ?>";</script>
<?php if(x($page,'htmlhead')) echo $page['htmlhead'] ?>
</head>
<body>
diff --git a/view/php/default.php b/view/php/default.php index 4a7c1ea19..ad6b7a3d1 100644 --- a/view/php/default.php +++ b/view/php/default.php @@ -2,7 +2,7 @@ <html prefix="og: http://ogp.me/ns#"> <head> <title><?php if(x($page,'title')) echo $page['title'] ?></title> - <script>var baseurl="<?php echo $a->get_baseurl() ?>";</script> + <script>var baseurl="<?php echo z_root() ?>";</script> <?php if(x($page,'htmlhead')) echo $page['htmlhead'] ?> </head> <body> diff --git a/view/php/full.php b/view/php/full.php index bc3b2ed87..9cf567a67 100644 --- a/view/php/full.php +++ b/view/php/full.php @@ -2,7 +2,7 @@ <html prefix="og: http://ogp.me/ns#"> <head> <title><?php if(x($page,'title')) echo $page['title'] ?></title> - <script>var baseurl="<?php echo $a->get_baseurl() ?>";</script> + <script>var baseurl="<?php echo z_root() ?>";</script> <?php if(x($page,'htmlhead')) echo $page['htmlhead'] ?> </head> <body> diff --git a/view/php/minimal.php b/view/php/minimal.php index ade2a0cb7..3572f3b5c 100644 --- a/view/php/minimal.php +++ b/view/php/minimal.php @@ -2,7 +2,7 @@ <html prefix="og: http://ogp.me/ns#">
<head>
<title><?php if(x($page,'title')) echo $page['title'] ?></title>
- <script>var baseurl="<?php echo $a->get_baseurl() ?>";</script>
+ <script>var baseurl="<?php echo z_root() ?>";</script>
<?php if(x($page,'htmlhead')) echo $page['htmlhead'] ?>
</head>
<body>
diff --git a/view/php/redable.php b/view/php/redable.php index 0dcba77d2..a5110e0dc 100644 --- a/view/php/redable.php +++ b/view/php/redable.php @@ -2,7 +2,7 @@ <html prefix="og: http://ogp.me/ns#"> <head> <title><?php if(x($page,'title')) echo $page['title'] ?></title> - <script>var baseurl="<?php echo $a->get_baseurl() ?>";</script> + <script>var baseurl="<?php echo z_root() ?>";</script> <?php if(x($page,'htmlhead')) echo $page['htmlhead'] ?> </head> <body> diff --git a/view/theme/redbasic/php/config.php b/view/theme/redbasic/php/config.php index 66597332c..789efc612 100644 --- a/view/theme/redbasic/php/config.php +++ b/view/theme/redbasic/php/config.php @@ -97,7 +97,7 @@ if(feature_enabled(local_channel(),'expert')) $t = get_markup_template('theme_settings.tpl'); $o .= replace_macros($t, array( '$submit' => t('Submit'), - '$baseurl' => $a->get_baseurl(), + '$baseurl' => z_root(), '$theme' => $a->channel['channel_theme'], '$expert' => $expert, '$title' => t("Theme settings"), |