diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/Contact.php | 4 | ||||
-rw-r--r-- | include/ItemObject.php | 2 | ||||
-rw-r--r-- | include/api.php | 30 | ||||
-rw-r--r-- | include/bb2diaspora.php | 4 | ||||
-rw-r--r-- | include/bbcode.php | 2 | ||||
-rw-r--r-- | include/contact_widgets.php | 2 | ||||
-rw-r--r-- | include/conversation.php | 34 | ||||
-rw-r--r-- | include/enotify.php | 4 | ||||
-rw-r--r-- | include/identity.php | 20 | ||||
-rwxr-xr-x | include/items.php | 10 | ||||
-rw-r--r-- | include/message.php | 4 | ||||
-rw-r--r-- | include/nav.php | 6 | ||||
-rw-r--r-- | include/network.php | 2 | ||||
-rwxr-xr-x | include/oembed.php | 2 | ||||
-rw-r--r-- | include/photo/photo_driver.php | 12 | ||||
-rwxr-xr-x | include/plugin.php | 4 | ||||
-rw-r--r-- | include/security.php | 6 | ||||
-rw-r--r-- | include/text.php | 88 | ||||
-rw-r--r-- | include/widgets.php | 30 |
19 files changed, 133 insertions, 133 deletions
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'), ) )); |