Commit 03897f79 authored by redmatrix's avatar redmatrix

deprecate $a->get_baseurl()

parent ee628c40
...@@ -1466,7 +1466,7 @@ function diaspora_asphoto($importer,$xml,$msg) { ...@@ -1466,7 +1466,7 @@ function diaspora_asphoto($importer,$xml,$msg) {
//if($message_id) { //if($message_id) {
// q("update item set plink = '%s' where id = %d", // q("update item set plink = '%s' where id = %d",
// dbesc($a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $message_id), // dbesc(z_root() . '/display/' . $importer['nickname'] . '/' . $message_id),
// intval($message_id) // intval($message_id)
// ); // );
//} //}
...@@ -2560,7 +2560,7 @@ function diaspora_share($owner,$contact) { ...@@ -2560,7 +2560,7 @@ function diaspora_share($owner,$contact) {
$myaddr = $owner['channel_address'] . '@' . substr($a->get_baseurl(), strpos($a->get_baseurl(),'://') + 3); $myaddr = $owner['channel_address'] . '@' . substr(z_root(), strpos(z_root(),'://') + 3);
if(! array_key_exists('hubloc_hash',$contact)) { if(! array_key_exists('hubloc_hash',$contact)) {
$c = q("select * from xchan left join hubloc on xchan_hash = hubloc_hash where xchan_hash = '%s' limit 1", $c = q("select * from xchan left join hubloc on xchan_hash = hubloc_hash where xchan_hash = '%s' limit 1",
...@@ -2588,7 +2588,7 @@ function diaspora_share($owner,$contact) { ...@@ -2588,7 +2588,7 @@ function diaspora_share($owner,$contact) {
function diaspora_unshare($owner,$contact) { function diaspora_unshare($owner,$contact) {
$a = get_app(); $a = get_app();
$myaddr = $owner['channel_address'] . '@' . substr($a->get_baseurl(), strpos($a->get_baseurl(),'://') + 3); $myaddr = $owner['channel_address'] . '@' . substr(z_root(), strpos(z_root(),'://') + 3);
$tpl = get_markup_template('diaspora_retract.tpl','addon/diaspora'); $tpl = get_markup_template('diaspora_retract.tpl','addon/diaspora');
$msg = replace_macros($tpl, array( $msg = replace_macros($tpl, array(
...@@ -2606,7 +2606,7 @@ function diaspora_unshare($owner,$contact) { ...@@ -2606,7 +2606,7 @@ function diaspora_unshare($owner,$contact) {
function diaspora_send_status($item,$owner,$contact,$public_batch = false) { function diaspora_send_status($item,$owner,$contact,$public_batch = false) {
$a = get_app(); $a = get_app();
$myaddr = $owner['channel_address'] . '@' . substr($a->get_baseurl(), strpos($a->get_baseurl(),'://') + 3); $myaddr = $owner['channel_address'] . '@' . substr(z_root(), strpos(z_root(),'://') + 3);
if(intval($item['id']) != intval($item['parent'])) { if(intval($item['id']) != intval($item['parent'])) {
logger('attempted to send a comment as a top-level post'); logger('attempted to send a comment as a top-level post');
...@@ -2769,7 +2769,7 @@ function diaspora_send_images($item,$owner,$contact,$images,$public_batch = fals ...@@ -2769,7 +2769,7 @@ function diaspora_send_images($item,$owner,$contact,$images,$public_batch = fals
$a = get_app(); $a = get_app();
if(! count($images)) if(! count($images))
return; return;
$mysite = substr($a->get_baseurl(),strpos($a->get_baseurl(),'://') + 3) . '/photo'; $mysite = substr(z_root(),strpos(z_root(),'://') + 3) . '/photo';
$qi = array(); $qi = array();
...@@ -2995,7 +2995,7 @@ function diaspora_send_relay($item,$owner,$contact,$public_batch = false) { ...@@ -2995,7 +2995,7 @@ function diaspora_send_relay($item,$owner,$contact,$public_batch = false) {
// bug - nomadic identity may/will affect diaspora_handle_from_contact // bug - nomadic identity may/will affect diaspora_handle_from_contact
if(! $handle) { if(! $handle) {
if($item['author_xchan'] === $owner['channel_hash']) if($item['author_xchan'] === $owner['channel_hash'])
$handle = $owner['channel_address'] . '@' . substr($a->get_baseurl(), strpos($a->get_baseurl(),'://') + 3); $handle = $owner['channel_address'] . '@' . substr(z_root(), strpos(z_root(),'://') + 3);
else else
$handle = diaspora_handle_from_contact($item['author_xchan']); $handle = diaspora_handle_from_contact($item['author_xchan']);
} }
......
...@@ -115,7 +115,7 @@ function diaspost_settings(&$a,&$s) { ...@@ -115,7 +115,7 @@ function diaspost_settings(&$a,&$s) {
/* Add our stylesheet to the page so we can make our settings look nice */ /* Add our stylesheet to the page so we can make our settings look nice */
//$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->get_baseurl() . '/addon/diaspost/diaspost.css' . '" media="all" />' . "\r\n"; //$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . z_root() . '/addon/diaspost/diaspost.css' . '" media="all" />' . "\r\n";
/* Get the current state of our config variables */ /* Get the current state of our config variables */
......
...@@ -51,7 +51,7 @@ function dwpost_settings(&$a,&$s) { ...@@ -51,7 +51,7 @@ function dwpost_settings(&$a,&$s) {
/* Add our stylesheet to the page so we can make our settings look nice */ /* Add our stylesheet to the page so we can make our settings look nice */
//$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->get_baseurl() . '/addon/dwpost/dwpost.css' . '" media="all" />' . "\r\n"; //$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . z_root() . '/addon/dwpost/dwpost.css' . '" media="all" />' . "\r\n";
/* Get the current state of our config variables */ /* Get the current state of our config variables */
......
...@@ -29,7 +29,7 @@ function flattrwidget_construct_page(&$a,&$b) { ...@@ -29,7 +29,7 @@ function flattrwidget_construct_page(&$a,&$b) {
$enable = intval(get_pconfig($id,'flattrwidget','enable')); $enable = intval(get_pconfig($id,'flattrwidget','enable'));
if (! $enable) if (! $enable)
return; return;
$a->page['htmlhead'] .= '<link rel="stylesheet" href="'.$a->get_baseurl().'/addon/flattrwidget/style.css'.'" media="all" />'; $a->page['htmlhead'] .= '<link rel="stylesheet" href="'.z_root().'/addon/flattrwidget/style.css'.'" media="all" />';
// get alignment and static/dynamic from the settings // get alignment and static/dynamic from the settings
// align is either "aside" or "right_aside" // align is either "aside" or "right_aside"
// sd is either static or dynamic // sd is either static or dynamic
...@@ -47,7 +47,7 @@ function flattrwidget_construct_page(&$a,&$b) { ...@@ -47,7 +47,7 @@ function flattrwidget_construct_page(&$a,&$b) {
$link = 'https://flattr.com/submit/auto?user_id='.$user.'&url=' . rawurlencode($thing).'&title='.rawurlencode($ftitle); $link = 'https://flattr.com/submit/auto?user_id='.$user.'&url=' . rawurlencode($thing).'&title='.rawurlencode($ftitle);
if ($sd == 'static') { if ($sd == 'static') {
// static button graphic from the img folder // static button graphic from the img folder
$img = $a->get_baseurl() .'/addon/flattrwidget/img/flattr-badge-large.png'; $img = z_root() .'/addon/flattrwidget/img/flattr-badge-large.png';
$code = '<a href="'.$link.'" target="_blank"><img src="'.$img.'" alt="'.$title.'" title="'.$title.'" border="0"></a>'; $code = '<a href="'.$link.'" target="_blank"><img src="'.$img.'" alt="'.$title.'" title="'.$title.'" border="0"></a>';
} else { } else {
$code = '<script id=\'fbdu5zs\'>(function(i){var f,s=document.getElementById(i);f=document.createElement(\'iframe\');f.src=\'//api.flattr.com/button/view/?uid='.$user.'&url='.rawurlencode($thing).'&title='.rawurlencode($ftitle).'\';f.title=\''.$title.'\';f.height=72;f.width=65;f.style.borderWidth=0;s.parentNode.insertBefore(f,s);})(\'fbdu5zs\');</script>'; $code = '<script id=\'fbdu5zs\'>(function(i){var f,s=document.getElementById(i);f=document.createElement(\'iframe\');f.src=\'//api.flattr.com/button/view/?uid='.$user.'&url='.rawurlencode($thing).'&title='.rawurlencode($ftitle).'\';f.title=\''.$title.'\';f.height=72;f.width=65;f.style.borderWidth=0;s.parentNode.insertBefore(f,s);})(\'fbdu5zs\');</script>';
...@@ -70,7 +70,7 @@ function flattrwidget_settings_post($a,$s) { ...@@ -70,7 +70,7 @@ function flattrwidget_settings_post($a,$s) {
set_pconfig( local_channel(), 'flattrwidget', 'sd', $_POST['flattrwidget-static'] ); set_pconfig( local_channel(), 'flattrwidget', 'sd', $_POST['flattrwidget-static'] );
$thing = $_POST['flattrwidget-thing']; $thing = $_POST['flattrwidget-thing'];
if ($thing == '') { if ($thing == '') {
$thing = $a->get_baseurl().'/channel/'.$c['channel_address']; $thing = z_root().'/channel/'.$c['channel_address'];
} }
set_pconfig( local_channel(), 'flattrwidget', 'thing', $thing); set_pconfig( local_channel(), 'flattrwidget', 'thing', $thing);
set_pconfig( local_channel(), 'flattrwidget', 'user', $_POST['flattrwidget-user']); set_pconfig( local_channel(), 'flattrwidget', 'user', $_POST['flattrwidget-user']);
...@@ -87,7 +87,7 @@ function flattrwidget_settings(&$a,&$s) { ...@@ -87,7 +87,7 @@ function flattrwidget_settings(&$a,&$s) {
if (! $id) if (! $id)
return; return;
//$a->page['htmlhead'] .= '<link rel="stylesheet" href="'.$a->get_baseurl().'/addon/flattrwidget/style.css'.'" media="all" />'; //$a->page['htmlhead'] .= '<link rel="stylesheet" href="'.z_root().'/addon/flattrwidget/style.css'.'" media="all" />';
$lr = get_pconfig( $id, 'flattrwidget', 'align'); $lr = get_pconfig( $id, 'flattrwidget', 'align');
$sd = get_pconfig( $id, 'flattrwidget', 'sd'); $sd = get_pconfig( $id, 'flattrwidget', 'sd');
$thing = get_pconfig( $id, 'flattrwidget', 'thing'); $thing = get_pconfig( $id, 'flattrwidget', 'thing');
......
...@@ -27,7 +27,7 @@ function fortunate_fetch(&$a,&$b) { ...@@ -27,7 +27,7 @@ function fortunate_fetch(&$a,&$b) {
return; return;
$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' $a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="'
. $a->get_baseurl() . '/addon/fortunate/fortunate.css' . '" media="all" />' . "\r\n"; . z_root() . '/addon/fortunate/fortunate.css' . '" media="all" />' . "\r\n";
$s = z_fetch_url('http://' . $fort_server . '/cookie.php?numlines=4&equal=1&rand=' . mt_rand()); $s = z_fetch_url('http://' . $fort_server . '/cookie.php?numlines=4&equal=1&rand=' . mt_rand());
if($s['success']) if($s['success'])
......
...@@ -51,7 +51,7 @@ function ijpost_settings(&$a,&$s) { ...@@ -51,7 +51,7 @@ function ijpost_settings(&$a,&$s) {
/* Add our stylesheet to the page so we can make our settings look nice */ /* Add our stylesheet to the page so we can make our settings look nice */
//$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->get_baseurl() . '/addon/ijpost/ijpost.css' . '" media="all" />' . "\r\n"; //$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . z_root() . '/addon/ijpost/ijpost.css' . '" media="all" />' . "\r\n";
/* Get the current state of our config variables */ /* Get the current state of our config variables */
......
...@@ -35,7 +35,7 @@ function irc_addon_settings(&$a,&$s) { ...@@ -35,7 +35,7 @@ function irc_addon_settings(&$a,&$s) {
/* Add our stylesheet to the page so we can make our settings look nice */ /* Add our stylesheet to the page so we can make our settings look nice */
//$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->get_baseurl() . '/addon/irc/irc.css' . '" media="all" />' . "\r\n"; //$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . z_root() . '/addon/irc/irc.css' . '" media="all" />' . "\r\n";
/* setting popular channels, auto connect channels */ /* setting popular channels, auto connect channels */
$sitechats = get_config('irc','sitechats'); /* popular channels */ $sitechats = get_config('irc','sitechats'); /* popular channels */
...@@ -82,7 +82,7 @@ return; ...@@ -82,7 +82,7 @@ return;
function irc_content(&$a) { function irc_content(&$a) {
$baseurl = $a->get_baseurl() . '/addon/irc'; $baseurl = z_root() . '/addon/irc';
$o = ''; $o = '';
/* set the list of popular channels */ /* set the list of popular channels */
...@@ -95,7 +95,7 @@ function irc_content(&$a) { ...@@ -95,7 +95,7 @@ function irc_content(&$a) {
$a->page['aside'] .= '<div class="widget"><h3>' . t('Popular Channels') . '</h3><ul>'; $a->page['aside'] .= '<div class="widget"><h3>' . t('Popular Channels') . '</h3><ul>';
foreach($chats as $chat) { foreach($chats as $chat) {
$a->page['aside'] .= '<li><a href="' . $a->get_baseurl() . '/irc?channels=' . $chat . '" >' . '#' . $chat . '</a></li>'; $a->page['aside'] .= '<li><a href="' . z_root() . '/irc?channels=' . $chat . '" >' . '#' . $chat . '</a></li>';
} }
$a->page['aside'] .= '</ul></div>'; $a->page['aside'] .= '</ul></div>';
......
...@@ -297,9 +297,9 @@ function jappixmini_settings(&$a, &$s) { ...@@ -297,9 +297,9 @@ function jappixmini_settings(&$a, &$s) {
if (!$activate) { if (!$activate) {
// load scripts if not yet activated so that password can be saved // load scripts if not yet activated so that password can be saved
$a->page['htmlhead'] .= '<script type="text/javascript" src="' . $a->get_baseurl() . '/addon/jappixmini/jappix/php/get.php?t=js&amp;g=mini.xml"></script>'."\r\n"; $a->page['htmlhead'] .= '<script type="text/javascript" src="' . z_root() . '/addon/jappixmini/jappix/php/get.php?t=js&amp;g=mini.xml"></script>'."\r\n";
$a->page['htmlhead'] .= '<script type="text/javascript" src="' . $a->get_baseurl() . '/addon/jappixmini/jappix/php/get.php?t=js&amp;f=presence.js~caps.js~name.js~roster.js"></script>'."\r\n"; $a->page['htmlhead'] .= '<script type="text/javascript" src="' . z_root() . '/addon/jappixmini/jappix/php/get.php?t=js&amp;f=presence.js~caps.js~name.js~roster.js"></script>'."\r\n";
$a->page['htmlhead'] .= '<script type="text/javascript" src="' . $a->get_baseurl() . '/addon/jappixmini/lib.js"></script>'."\r\n"; $a->page['htmlhead'] .= '<script type="text/javascript" src="' . z_root() . '/addon/jappixmini/lib.js"></script>'."\r\n";
} }
$sc .= '<div class="section-content-info-wrapper form-group">'; $sc .= '<div class="section-content-info-wrapper form-group">';
...@@ -490,10 +490,10 @@ function jappixmini_script(&$a,&$s) { ...@@ -490,10 +490,10 @@ function jappixmini_script(&$a,&$s) {
if (!$activate or $dontinsertchat) { if (!$activate or $dontinsertchat) {
return; return;
} }
$a->page['htmlhead'] .= '<script type="text/javascript" src="' . $a->get_baseurl() . '/addon/jappixmini/jappix/php/get.php?t=js&amp;g=mini.xml"></script>'."\r\n"; $a->page['htmlhead'] .= '<script type="text/javascript" src="' . z_root() . '/addon/jappixmini/jappix/php/get.php?t=js&amp;g=mini.xml"></script>'."\r\n";
$a->page['htmlhead'] .= '<script type="text/javascript" src="' . $a->get_baseurl() . '/addon/jappixmini/jappix/php/get.php?t=js&amp;f=presence.js~caps.js~name.js~roster.js"></script>'."\r\n"; $a->page['htmlhead'] .= '<script type="text/javascript" src="' . z_root() . '/addon/jappixmini/jappix/php/get.php?t=js&amp;f=presence.js~caps.js~name.js~roster.js"></script>'."\r\n";
$a->page['htmlhead'] .= '<script type="text/javascript" src="' . $a->get_baseurl() . '/addon/jappixmini/lib.js"></script>'."\r\n"; $a->page['htmlhead'] .= '<script type="text/javascript" src="' . z_root() . '/addon/jappixmini/lib.js"></script>'."\r\n";
$username = get_pconfig(local_channel(),'jappixmini','username'); $username = get_pconfig(local_channel(),'jappixmini','username');
$username = str_replace("'", "\\'", $username); $username = str_replace("'", "\\'", $username);
...@@ -514,7 +514,7 @@ function jappixmini_script(&$a,&$s) { ...@@ -514,7 +514,7 @@ function jappixmini_script(&$a,&$s) {
// set proxy if necessary // set proxy if necessary
$use_proxy = get_config('jappixmini','bosh_proxy'); $use_proxy = get_config('jappixmini','bosh_proxy');
if ($use_proxy) { if ($use_proxy) {
$proxy = $a->get_baseurl().'/addon/jappixmini/proxy.php'; $proxy = z_root().'/addon/jappixmini/proxy.php';
} }
else { else {
$proxy = ""; $proxy = "";
...@@ -568,10 +568,10 @@ function jappixmini_login(&$a, &$o) { ...@@ -568,10 +568,10 @@ function jappixmini_login(&$a, &$o) {
// create client secret on login to be able to encrypt jabber passwords // create client secret on login to be able to encrypt jabber passwords
// for setDB and str_sha1, needed by jappixmini_addon_set_client_secret // for setDB and str_sha1, needed by jappixmini_addon_set_client_secret
$a->page['htmlhead'] .= '<script type="text/javascript" src="' . $a->get_baseurl() . '/addon/jappixmini/jappix/php/get.php?t=js&amp;f=datastore.js~jsjac.js"></script>'."\r\n"; $a->page['htmlhead'] .= '<script type="text/javascript" src="' . z_root() . '/addon/jappixmini/jappix/php/get.php?t=js&amp;f=datastore.js~jsjac.js"></script>'."\r\n";
// for jappixmini_addon_set_client_secret // for jappixmini_addon_set_client_secret
$a->page['htmlhead'] .= '<script type="text/javascript" src="' . $a->get_baseurl() . '/addon/jappixmini/lib.js"></script>'."\r\n"; $a->page['htmlhead'] .= '<script type="text/javascript" src="' . z_root() . '/addon/jappixmini/lib.js"></script>'."\r\n";
// save hash of password // save hash of password
$o = str_replace("<form ", "<form onsubmit=\"jappixmini_addon_set_client_secret(this.elements['id_password'].value);return true;\" ", $o); $o = str_replace("<form ", "<form onsubmit=\"jappixmini_addon_set_client_secret(this.elements['id_password'].value);return true;\" ", $o);
...@@ -699,6 +699,6 @@ function jappixmini_download_source(&$a,&$b) { ...@@ -699,6 +699,6 @@ function jappixmini_download_source(&$a,&$b) {
// Jappix Mini source download link on About page // Jappix Mini source download link on About page
$b .= '<h1>Jappix Mini</h1>'; $b .= '<h1>Jappix Mini</h1>';
$b .= '<p>This site uses the jappixmini addon, which includes Jappix Mini by the <a href="'.$a->get_baseurl().'/addon/jappixmini/jappix/AUTHORS">Jappix authors</a> and is distributed under the terms of the <a href="'.$a->get_baseurl().'/addon/jappixmini/jappix/COPYING">GNU Affero General Public License</a>.</p>'; $b .= '<p>This site uses the jappixmini addon, which includes Jappix Mini by the <a href="'.z_root().'/addon/jappixmini/jappix/AUTHORS">Jappix authors</a> and is distributed under the terms of the <a href="'.z_root().'/addon/jappixmini/jappix/COPYING">GNU Affero General Public License</a>.</p>';
$b .= '<p>You can download the <a href="'.$a->get_baseurl().'/addon/jappixmini.tgz">source code of the addon</a>. The rest of Hubzilla is distributed under compatible licenses and can be retrieved from <a href="https://github.com/friendica/red">https://github.com/friendica/red</a> and <a href="https://github.com/friendica/red-addons">https://github.com/friendica/red-addons</a></p>'; $b .= '<p>You can download the <a href="'.z_root().'/addon/jappixmini.tgz">source code of the addon</a>. The rest of Hubzilla is distributed under compatible licenses and can be retrieved from <a href="https://github.com/friendica/red">https://github.com/friendica/red</a> and <a href="https://github.com/friendica/red-addons">https://github.com/friendica/red-addons</a></p>';
} }
...@@ -38,8 +38,8 @@ function js_upload_form(&$a,&$b) { ...@@ -38,8 +38,8 @@ function js_upload_form(&$a,&$b) {
$b['default_upload'] = false; $b['default_upload'] = false;
$b['addon_text'] .= '<link href="' . $a->get_baseurl() . '/addon/js_upload/file-uploader/client/fileuploader.css" rel="stylesheet" type="text/css">'; $b['addon_text'] .= '<link href="' . z_root() . '/addon/js_upload/file-uploader/client/fileuploader.css" rel="stylesheet" type="text/css">';
$b['addon_text'] .= '<script src="' . $a->get_baseurl() . '/addon/js_upload/file-uploader/client/fileuploader.js" type="text/javascript"></script>'; $b['addon_text'] .= '<script src="' . z_root() . '/addon/js_upload/file-uploader/client/fileuploader.js" type="text/javascript"></script>';
$upload_msg = t('Upload a file'); $upload_msg = t('Upload a file');
$drop_msg = t('Drop files here to upload'); $drop_msg = t('Drop files here to upload');
......
...@@ -47,7 +47,7 @@ function libertree_settings(&$a,&$s) { ...@@ -47,7 +47,7 @@ function libertree_settings(&$a,&$s) {
/* Add our stylesheet to the page so we can make our settings look nice */ /* Add our stylesheet to the page so we can make our settings look nice */
//$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->get_baseurl() . '/addon/libertree/libertree.css' . '" media="all" />' . "\r\n"; //$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . z_root() . '/addon/libertree/libertree.css' . '" media="all" />' . "\r\n";
/* Get the current state of our config variables */ /* Get the current state of our config variables */
...@@ -152,7 +152,7 @@ function libertree_send(&$a,&$b) { ...@@ -152,7 +152,7 @@ function libertree_send(&$a,&$b) {
$ltree_api_token = get_pconfig($b['uid'],'libertree','libertree_api_token'); $ltree_api_token = get_pconfig($b['uid'],'libertree','libertree_api_token');
$ltree_url = get_pconfig($b['uid'],'libertree','libertree_url'); $ltree_url = get_pconfig($b['uid'],'libertree','libertree_url');
$ltree_blog = "$ltree_url/api/v1/posts/create/?token=$ltree_api_token"; $ltree_blog = "$ltree_url/api/v1/posts/create/?token=$ltree_api_token";
$ltree_source = "[".$a->config['system']['sitename']."](".$a->get_baseurl().")"; $ltree_source = "[".$a->config['system']['sitename']."](".z_root().")";
// $ltree_source = "Hubzilla"; // $ltree_source = "Hubzilla";
logger('sitename: ' . print_r($ltree_source,true)); logger('sitename: ' . print_r($ltree_source,true));
if($ltree_url && $ltree_api_token && $ltree_blog && $ltree_source) { if($ltree_url && $ltree_api_token && $ltree_blog && $ltree_source) {
......
...@@ -51,7 +51,7 @@ function ljpost_settings(&$a,&$s) { ...@@ -51,7 +51,7 @@ function ljpost_settings(&$a,&$s) {
/* Add our stylesheet to the page so we can make our settings look nice */ /* Add our stylesheet to the page so we can make our settings look nice */
//$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->get_baseurl() . '/addon/ljpost/ljpost.css' . '" media="all" />' . "\r\n"; //$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . z_root() . '/addon/ljpost/ljpost.css' . '" media="all" />' . "\r\n";
/* Get the current state of our config variables */ /* Get the current state of our config variables */
......
...@@ -27,7 +27,7 @@ function mahjongg_module() {} ...@@ -27,7 +27,7 @@ function mahjongg_module() {}
function mahjongg_content(&$a) { function mahjongg_content(&$a) {
$baseurl = $a->get_baseurl() . '/addon/mahjongg'; $baseurl = z_root() . '/addon/mahjongg';
$o .= <<< EOT $o .= <<< EOT
<br><br> <br><br>
......
...@@ -143,7 +143,7 @@ function nsabait_settings(&$a,&$s) { ...@@ -143,7 +143,7 @@ function nsabait_settings(&$a,&$s) {
/* Add our stylesheet to the page so we can make our settings look nice */ /* Add our stylesheet to the page so we can make our settings look nice */
//$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->get_baseurl() . '/addon/nsabait/nsabait.css' . '" media="all" />' . "\r\n"; //$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . z_root() . '/addon/nsabait/nsabait.css' . '" media="all" />' . "\r\n";
/* Get the current state of our config variable */ /* Get the current state of our config variable */
......
...@@ -277,8 +277,8 @@ function openclipatar_content(&$a) { ...@@ -277,8 +277,8 @@ function openclipatar_content(&$a) {
else { else {
// not the default profile, set the path in the correct entry in the profile DB // not the default profile, set the path in the correct entry in the profile DB
$r = q("update profile set photo = '%s', thumb = '%s' where id = %d and uid = %d", $r = q("update profile set photo = '%s', thumb = '%s' where id = %d and uid = %d",
dbesc(get_app()->get_baseurl() . '/photo/' . $hash . '-4'), dbesc(z_root() . '/photo/' . $hash . '-4'),
dbesc(get_app()->get_baseurl() . '/photo/' . $hash . '-5'), dbesc(z_root() . '/photo/' . $hash . '-5'),
intval($_REQUEST['profile']), intval($_REQUEST['profile']),
intval(local_channel()) intval(local_channel())
); );
...@@ -294,9 +294,9 @@ function openclipatar_content(&$a) { ...@@ -294,9 +294,9 @@ function openclipatar_content(&$a) {
$returnafter = get_config('openclipatar', 'returnafter'); $returnafter = get_config('openclipatar', 'returnafter');
$returnafter_urls = array( $returnafter_urls = array(
0 => $a->get_baseurl() . '/profile/' . ($_REQUEST['profile'] ? $_REQUEST['profile'].'/view' : $chan['channel_address']), 0 => z_root() . '/profile/' . ($_REQUEST['profile'] ? $_REQUEST['profile'].'/view' : $chan['channel_address']),
1 => $a->get_baseurl() . '/profiles/' . ($_REQUEST['profile'] ? $_REQUEST['profile'] : $a->profile_uid), 1 => z_root() . '/profiles/' . ($_REQUEST['profile'] ? $_REQUEST['profile'] : $a->profile_uid),
2 => $a->get_baseurl() . '/profiles' 2 => z_root() . '/profiles'
); );
goaway($returnafter_urls[$returnafter]); goaway($returnafter_urls[$returnafter]);
......
...@@ -27,7 +27,7 @@ function openstreetmap_unload() { ...@@ -27,7 +27,7 @@ function openstreetmap_unload() {
} }
function openstreetmap_alterheader($a, &$navHtml) { function openstreetmap_alterheader($a, &$navHtml) {
$addScriptTag = '<script type="text/javascript" src="' . $a->get_baseurl() . '/addon/openstreetmap/openstreetmap.js"></script>' . "\r\n"; $addScriptTag = '<script type="text/javascript" src="' . z_root() . '/addon/openstreetmap/openstreetmap.js"></script>' . "\r\n";
$a->page['htmlhead'] .= $addScriptTag; $a->page['htmlhead'] .= $addScriptTag;
} }
......
...@@ -75,7 +75,7 @@ function pageheader_fetch($a,&$b) { ...@@ -75,7 +75,7 @@ function pageheader_fetch($a,&$b) {
$s = file_get_contents('pageheader.html'); $s = file_get_contents('pageheader.html');
} else { } else {
$s = get_config('pageheader', 'text'); $s = get_config('pageheader', 'text');
$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->get_baseurl() . '/addon/pageheader/pageheader.css' . '" media="all" />' . "\r\n"; $a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . z_root() . '/addon/pageheader/pageheader.css' . '" media="all" />' . "\r\n";
} }
if($s) if($s)
......
...@@ -52,7 +52,7 @@ function piwik_analytics($a,&$b) { ...@@ -52,7 +52,7 @@ function piwik_analytics($a,&$b) {
* associated CSS file. We just have to tell Hubzilla to get it * associated CSS file. We just have to tell Hubzilla to get it
* into the page header. * into the page header.
*/ */
$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->get_baseurl() . '/addon/piwik/piwik.css' . '" media="all" />'; $a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . z_root() . '/addon/piwik/piwik.css' . '" media="all" />';
/* /*
* Get the configuration variables from the .htconfig file. * Get the configuration variables from the .htconfig file.
......
...@@ -139,7 +139,7 @@ function planets_settings(&$a,&$s) { ...@@ -139,7 +139,7 @@ function planets_settings(&$a,&$s) {
/* Add our stylesheet to the page so we can make our settings look nice */ /* Add our stylesheet to the page so we can make our settings look nice */
//$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->get_baseurl() . '/addon/planets/planets.css' . '" media="all" />' . "\r\n"; //$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . z_root() . '/addon/planets/planets.css' . '" media="all" />' . "\r\n";
/* Get the current state of our config variable */ /* Get the current state of our config variable */
......
...@@ -173,7 +173,7 @@ function pumpio_settings(&$a,&$s) { ...@@ -173,7 +173,7 @@ function pumpio_settings(&$a,&$s) {
/* Add our stylesheet to the page so we can make our settings look nice */ /* Add our stylesheet to the page so we can make our settings look nice */
//$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->get_baseurl() . '/addon/pumpio/pumpio.css' . '" media="all" />' . "\r\n"; //$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . z_root() . '/addon/pumpio/pumpio.css' . '" media="all" />' . "\r\n";
/* Get the current state of our config variables */ /* Get the current state of our config variables */
...@@ -212,7 +212,7 @@ function pumpio_settings(&$a,&$s) { ...@@ -212,7 +212,7 @@ function pumpio_settings(&$a,&$s) {
$sc .= '<div class="section-content-danger-wrapper">'; $sc .= '<div class="section-content-danger-wrapper">';
$sc .= '<strong>' . t("You are not authenticated to pumpio") . '</strong>'; $sc .= '<strong>' . t("You are not authenticated to pumpio") . '</strong>';
$sc .= '</div>'; $sc .= '</div>';
$sc .= '<a href="'.$a->get_baseurl().'/pumpio/connect" class="btn btn-primary btn-xs">'.t("(Re-)Authenticate your pump.io connection").'</a>'; $sc .= '<a href="'.z_root().'/pumpio/connect" class="btn btn-primary btn-xs">'.t("(Re-)Authenticate your pump.io connection").'</a>';
} }
$sc .= replace_macros(get_markup_template('field_checkbox.tpl'), array( $sc .= replace_macros(get_markup_template('field_checkbox.tpl'), array(
......
...@@ -61,7 +61,7 @@ function randpost_enotify_store(&$a,&$b) { ...@@ -61,7 +61,7 @@ function randpost_enotify_store(&$a,&$b) {
$my_conversation = true; $my_conversation = true;
elseif($p[0]['term']) { elseif($p[0]['term']) {
$v = get_terms_oftype($p[0]['term'],TERM_MENTION); $v = get_terms_oftype($p[0]['term'],TERM_MENTION);
$link = normalise_link($a->get_baseurl() . '/channel/' . $c[0]['channel_address']); $link = normalise_link(z_root() . '/channel/' . $c[0]['channel_address']);
if($v) { if($v) {
foreach($v as $vv) { foreach($v as $vv) {
if(link_compare($vv['url'],$link)) { if(link_compare($vv['url'],$link)) {
......
...@@ -95,28 +95,28 @@ function show_button($a, &$b) { ...@@ -95,28 +95,28 @@ function show_button($a, &$b) {
); );
$icons = array( $icons = array(
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-heart.gif" alt="<3" />', '<img class="smiley" src="' . z_root() . '/images/smiley-heart.gif" alt="<3" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-brokenheart.gif" alt="</3" />', '<img class="smiley" src="' . z_root() . '/images/smiley-brokenheart.gif" alt="</3" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-smile.gif" alt=":-)" />', '<img class="smiley" src="' . z_root() . '/images/smiley-smile.gif" alt=":-)" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-wink.gif" alt=";-)" />', '<img class="smiley" src="' . z_root() . '/images/smiley-wink.gif" alt=";-)" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-frown.gif" alt=":-(" />', '<img class="smiley" src="' . z_root() . '/images/smiley-frown.gif" alt=":-(" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-tongue-out.gif" alt=":-P" />', '<img class="smiley" src="' . z_root() . '/images/smiley-tongue-out.gif" alt=":-P" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-kiss.gif" alt=":-X" />', '<img class="smiley" src="' . z_root() . '/images/smiley-kiss.gif" alt=":-X" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-laughing.gif" alt=":-D" />', '<img class="smiley" src="' . z_root() . '/images/smiley-laughing.gif" alt=":-D" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-surprised.gif" alt=":-O" />', '<img class="smiley" src="' . z_root() . '/images/smiley-surprised.gif" alt=":-O" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-thumbsup.gif" alt="\\o/" />', '<img class="smiley" src="' . z_root() . '/images/smiley-thumbsup.gif" alt="\\o/" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-Oo.gif" alt="O_o" />', '<img class="smiley" src="' . z_root() . '/images/smiley-Oo.gif" alt="O_o" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-cry.gif" alt=":\'(" />', '<img class="smiley" src="' . z_root() . '/images/smiley-cry.gif" alt=":\'(" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-foot-in-mouth.gif" alt=":-!" />', '<img class="smiley" src="' . z_root() . '/images/smiley-foot-in-mouth.gif" alt=":-!" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-undecided.gif" alt=":-/" />', '<img class="smiley" src="' . z_root() . '/images/smiley-undecided.gif" alt=":-/" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-embarassed.gif" alt=":-[" />', '<img class="smiley" src="' . z_root() . '/images/smiley-embarassed.gif" alt=":-[" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-cool.gif" alt="8-)" />', '<img class="smiley" src="' . z_root() . '/images/smiley-cool.gif" alt="8-)" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/beer_mug.gif" alt=":beer" />', '<img class="smiley" src="' . z_root() . '/images/beer_mug.gif" alt=":beer" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/coffee.gif" alt=":coffee" />', '<img class="smiley" src="' . z_root() . '/images/coffee.gif" alt=":coffee" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-facepalm.gif" alt=":facepalm" />', '<img class="smiley" src="' . z_root() . '/images/smiley-facepalm.gif" alt=":facepalm" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/like.gif" alt=":like" />', '<img class="smiley" src="' . z_root() . '/images/like.gif" alt=":like" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/dislike.gif" alt=":dislike" />', '<img class="smiley" src="' . z_root() . '/images/dislike.gif" alt=":dislike" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/rhash-16.png" alt="red" />' '<img class="smiley" src="' . z_root() . '/images/rhash-16.png" alt="red" />'
); );
/** /**
...@@ -152,7 +152,7 @@ function show_button($a, &$b) { ...@@ -152,7 +152,7 @@ function show_button($a, &$b) {
* *
*/ */
$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->get_baseurl() . '/addon/smileybutton/smileybutton.css' . '" media="all" />' . "\r\n"; $a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . z_root() . '/addon/smileybutton/smileybutton.css' . '" media="all" />' . "\r\n";
/** /**
* *
...@@ -161,7 +161,7 @@ function show_button($a, &$b) { ...@@ -161,7 +161,7 @@ function show_button($a, &$b) {
*/ */
if (! $nobutton and ! $deactivated) { if (! $nobutton and ! $deactivated) {
$b .= "<div id=\"profile-smiley-wrapper\" >\n"; $b .= "<div id=\"profile-smiley-wrapper\" >\n";
//$b .= "\t<img src=\"" . $a->get_baseurl() . "/addon/smileybutton/icon.gif\" onclick=\"toggle_smileybutton(); return false;\" alt=\"smiley\">\n"; //$b .= "\t<img src=\"" . z_root() . "/addon/smileybutton/icon.gif\" onclick=\"toggle_smileybutton(); return false;\" alt=\"smiley\">\n";
$b .= "\t<button class=\"btn btn-default btn-sm\" onclick=\"toggle_smileybutton(); return false;\"><i id=\"profile-smiley-button\" class=\"icon-smile jot-icons\" ></i></button>\n"; $b .= "\t<button class=\"btn btn-default btn-sm\" onclick=\"toggle_smileybutton(); return false;\"><i id=\"profile-smiley-button\" class=\"icon-smile jot-icons\" ></i></button>\n";
$b .= "\t</div>\n"; $b .= "\t</div>\n";
} }
...@@ -262,7 +262,7 @@ function smileybutton_settings(&$a,&$s) { ...@@ -262,7 +262,7 @@ function smileybutton_settings(&$a,&$s) {
/* Add our stylesheet to the page so we can make our settings look nice */ /* Add our stylesheet to the page so we can make our settings look nice */
//$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->get_baseurl() . '/addon/smileybutton/smileybutton.css' . '" media="all" />' . "\r\n"; //$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . z_root() . '/addon/smileybutton/smileybutton.css' . '" media="all" />' . "\r\n";
/* Get the current state of our config variable */ /* Get the current state of our config variable */
......
...@@ -42,7 +42,7 @@ function startpage_home_init($a, $b) { ...@@ -42,7 +42,7 @@ function startpage_home_init($a, $b) {
if(stristr($page,'://')) if(stristr($page,'://'))
goaway(z_root() . '/' . $page); goaway(z_root() . '/' . $page);
goaway($a->get_baseurl() . (($slash) ? '' : '/') . $page); goaway(z_root() . (($slash) ? '' : '/') . $page);
} }
return; return;
} }
......
...@@ -196,7 +196,7 @@ function statusnet_settings_post ($a,$post) { ...@@ -196,7 +196,7 @@ function statusnet_settings_post ($a,$post) {
} }
} }
} }
goaway($a->get_baseurl().'/settings/featured'); goaway(z_root().'/settings/featured');
} }
else { else {
...@@ -232,7 +232,7 @@ function statusnet_settings_post ($a,$post) { ...@@ -232,7 +232,7 @@ function statusnet_settings_post ($a,$post) {
notice( t('We could not contact the GNU social API with the Path you entered.').EOL ); notice( t('We could not contact the GNU social API with the Path you entered.').EOL );
} }
} }
goaway($a->get_baseurl().'/settings/featured'); goaway(z_root().'/settings/featured');
} }
else { else {
...@@ -253,7 +253,7 @@ function statusnet_settings_post ($a,$post) { ...@@ -253,7 +253,7 @@ function statusnet_settings_post ($a,$post) {
set_pconfig(local_channel(),'statusnet', 'post', 1); set_pconfig(local_channel(),'statusnet', 'post', 1);
set_pconfig(local_channel(),'statusnet', 'post_taglinks', 1); set_pconfig(local_channel(),'statusnet', 'post_taglinks', 1);
// reload the Addon Settings page, if we don't do it see Bug #42 // reload the Addon Settings page, if we don't do it see Bug #42
goaway($a->get_baseurl().'/settings/featured'); goaway(z_root().'/settings/featured');
} }
else { else {
// if no PIN is supplied in the POST variables, the user has changed the setting // if no PIN is supplied in the POST variables, the user has changed the setting
...@@ -274,7 +274,7 @@ function statusnet_settings(&$a,&$s) { ...@@ -274,7 +274,7 @@ function statusnet_settings(&$a,&$s) {
if(! local_channel()) if(! local_channel())
return; return;
$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->get_baseurl() . '/addon/statusnet/statusnet.css' . '" media="all" />' . "\r\n"; $a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . z_root() . '/addon/statusnet/statusnet.css' . '" media="all" />' . "\r\n";
/*** /***
* 1) Check that we have a base api url and a consumer key & secret * 1) Check that we have a base api url and a consumer key & secret
......
...@@ -45,7 +45,7 @@ function superblock_addon_settings(&$a,&$s) { ...@@ -45,7 +45,7 @@ function superblock_addon_settings(&$a,&$s) {
/* Add our stylesheet to the page so we can make our settings look nice */ /* Add our stylesheet to the page so we can make our settings look nice */
//if(! array_key_exists('htmlhead',$a->page)) //if(! array_key_exists('htmlhead',$a->page))
//$a->page['htmlhead'] = ''; //$a->page['htmlhead'] = '';
//$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->get_baseurl() . '/addon/superblock/superblock.css' . '" media="all" />' . "\r\n"; //$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . z_root() . '/addon/superblock/superblock.css' . '" media="all" />' . "\r\n";
$words = get_pconfig(local_channel(),'system','blocked'); $words = get_pconfig(local_channel(),'system','blocked');
if(! $words) if(! $words)
......
...@@ -61,8 +61,8 @@ function tour_addfooter($a,&$navHtml) { ...@@ -61,8 +61,8 @@ function tour_addfooter($a,&$navHtml) {
if(get_pconfig(local_channel(),'tour','showtour') != 1) if(get_pconfig(local_channel(),'tour','showtour') != 1)
return; return;
$content = '<script type="text/javascript" src="' . $a->get_baseurl() . '/addon/tour/jquery-tourbus.min.js"></script>' . "\r\n"; $content = '<script type="text/javascript" src="' . z_root() . '/addon/tour/jquery-tourbus.min.js"></script>' . "\r\n";
$content .= '<script type="text/javascript" src="' . $a->get_baseurl() . '/addon/tour/jquery.scrollTo.min.js"></script>' . "\r\n"; $content .= '<script type="text/javascript" src="' . z_root() . '/addon/tour/jquery.scrollTo.min.js"></script>' . "\r\n";