@ -97,7 +97,7 @@ $called_api = null;
*
* Register a function to be the endpont for defined API path .
*
* @ param string $path API URL path , relative to App :: get_baseu rl()
* @ param string $path API URL path , relative to System :: baseU rl()
* @ param string $func Function name to call on path request
* @ param bool $auth API need logged user
* @ param string $method HTTP method reqiured to call this endpoint .
@ -437,12 +437,12 @@ $called_api = null;
$arr [ '$user' ] = $user_info ;
$arr [ '$rss' ] = array (
'alternate' => $user_info [ 'url' ],
'self' => App :: get_baseu rl() . " / " . $a -> query_string ,
'base' => App :: get_baseu rl(),
'self' => System :: baseU rl() . " / " . $a -> query_string ,
'base' => System :: baseU rl(),
'updated' => api_date ( null ),
'atom_updated' => datetime_convert ( 'UTC' , 'UTC' , 'now' , ATOM_TIME ),
'language' => $user_info [ 'language' ],
'logo' => App :: get_baseu rl() . " /images/friendica-32.png " ,
'logo' => System :: baseU rl() . " /images/friendica-32.png " ,
);
return $arr ;
@ -755,7 +755,7 @@ $called_api = null;
'statusnet_blocking' => false ,
'notifications' => false ,
/// @TODO old way?
//'statusnet_profile_url' => App::get_baseu rl()."/contacts/".$uinfo[0]['cid'],
//'statusnet_profile_url' => System::baseU rl()."/contacts/".$uinfo[0]['cid'],
'statusnet_profile_url' => $uinfo [ 0 ][ 'url' ],
'uid' => intval ( $uinfo [ 0 ][ 'uid' ]),
'cid' => intval ( $uinfo [ 0 ][ 'cid' ]),
@ -1165,8 +1165,8 @@ $called_api = null;
if ( dbm :: is_result ( $r )) {
$phototypes = Photo :: supportedTypes ();
$ext = $phototypes [ $r [ 0 ][ 'type' ]];
$_REQUEST [ 'body' ] .= " \n \n " . '[url=' . App :: get_baseu rl() . '/photos/' . $r [ 0 ][ 'nickname' ] . '/image/' . $r [ 0 ][ 'resource-id' ] . ']' ;
$_REQUEST [ 'body' ] .= '[img]' . App :: get_baseu rl() . '/photo/' . $r [ 0 ][ 'resource-id' ] . '-' . $r [ 0 ][ 'scale' ] . '.' . $ext . '[/img][/url]' ;
$_REQUEST [ 'body' ] .= " \n \n " . '[url=' . System :: baseU rl() . '/photos/' . $r [ 0 ][ 'nickname' ] . '/image/' . $r [ 0 ][ 'resource-id' ] . ']' ;
$_REQUEST [ 'body' ] .= '[img]' . System :: baseU rl() . '/photo/' . $r [ 0 ][ 'resource-id' ] . '-' . $r [ 0 ][ 'scale' ] . '.' . $ext . '[/img][/url]' ;
}
}
@ -1930,7 +1930,7 @@ $called_api = null;
$start = $page * $count ;
// Ugly code - should be changed
$myurl = App :: get_baseu rl() . '/profile/' . $a -> user [ 'nickname' ];
$myurl = System :: baseU rl() . '/profile/' . $a -> user [ 'nickname' ];
$myurl = substr ( $myurl , strpos ( $myurl , '://' ) + 3 );
//$myurl = str_replace(array('www.','.'),array('','\\.'),$myurl);
$myurl = str_replace ( 'www.' , '' , $myurl );
@ -2495,7 +2495,7 @@ $called_api = null;
$text = preg_replace_callback (
" |data:image/([^;]+)[^=]+=*|m " ,
function ( $match ) use ( $item ) {
return App :: get_baseu rl() . " /display/ " . $item [ 'guid' ];
return System :: baseU rl() . " /display/ " . $item [ 'guid' ];
},
$text );
return $text ;
@ -2912,7 +2912,7 @@ $called_api = null;
$name = $a -> config [ 'sitename' ];
$server = $a -> get_hostname ();
$logo = App :: get_baseu rl() . '/images/friendica-64.png' ;
$logo = System :: baseU rl() . '/images/friendica-64.png' ;
$email = $a -> config [ 'admin_email' ];
$closed = (( $a -> config [ 'register_policy' ] == REGISTER_CLOSED ) ? 'true' : 'false' );
$private = (( Config :: get ( 'system' , 'block_public' )) ? 'true' : 'false' );
@ -2921,7 +2921,7 @@ $called_api = null;
$texlimit = string ( $a -> config [ 'api_import_size' ]);
}
$ssl = (( Config :: get ( 'system' , 'have_ssl' )) ? 'true' : 'false' );
$sslserver = (( $ssl === 'true' ) ? str_replace ( 'http:' , 'https:' , App :: get_baseu rl()) : '' );
$sslserver = (( $ssl === 'true' ) ? str_replace ( 'http:' , 'https:' , System :: baseU rl()) : '' );
$config = array (
'site' => array ( 'name' => $name , 'server' => $server , 'theme' => 'default' , 'path' => '' ,
@ -3423,7 +3423,7 @@ $called_api = null;
$photo [ 'album' ] = $rr [ 'album' ];
$photo [ 'filename' ] = $rr [ 'filename' ];
$photo [ 'type' ] = $rr [ 'type' ];
$thumb = App :: get_baseu rl() . " /photo/ " . $rr [ 'resource-id' ] . " - " . $rr [ 'scale' ] . " . " . $typetoext [ $rr [ 'type' ]];
$thumb = System :: baseU rl() . " /photo/ " . $rr [ 'resource-id' ] . " - " . $rr [ 'scale' ] . " . " . $typetoext [ $rr [ 'type' ]];
$photo [ 'created' ] = $rr [ 'created' ];
$photo [ 'edited' ] = $rr [ 'edited' ];
$photo [ 'desc' ] = $rr [ 'desc' ];
@ -3721,15 +3721,15 @@ $called_api = null;
);
$r = q ( " UPDATE `contact` SET `photo` = '%s', `thumb` = '%s', `micro` = '%s' WHERE `self` AND `uid` = %d " ,
dbesc ( App :: get_baseu rl() . '/photo/' . $data [ 'photo' ][ 'id' ] . '-4.' . $fileext ),
dbesc ( App :: get_baseu rl() . '/photo/' . $data [ 'photo' ][ 'id' ] . '-5.' . $fileext ),
dbesc ( App :: get_baseu rl() . '/photo/' . $data [ 'photo' ][ 'id' ] . '-6.' . $fileext ),
dbesc ( System :: baseU rl() . '/photo/' . $data [ 'photo' ][ 'id' ] . '-4.' . $fileext ),
dbesc ( System :: baseU rl() . '/photo/' . $data [ 'photo' ][ 'id' ] . '-5.' . $fileext ),
dbesc ( System :: baseU rl() . '/photo/' . $data [ 'photo' ][ 'id' ] . '-6.' . $fileext ),
intval ( local_user ())
);
} else {
$r = q ( " UPDATE `profile` SET `photo` = '%s', `thumb` = '%s' WHERE `id` = %d AND `uid` = %d " ,
dbesc ( App :: get_baseu rl() . '/photo/' . $data [ 'photo' ][ 'id' ] . '-4.' . $filetype ),
dbesc ( App :: get_baseu rl() . '/photo/' . $data [ 'photo' ][ 'id' ] . '-5.' . $filetype ),
dbesc ( System :: baseU rl() . '/photo/' . $data [ 'photo' ][ 'id' ] . '-4.' . $filetype ),
dbesc ( System :: baseU rl() . '/photo/' . $data [ 'photo' ][ 'id' ] . '-5.' . $filetype ),
intval ( $_REQUEST [ 'profile' ]),
intval ( local_user ())
);
@ -3745,7 +3745,7 @@ $called_api = null;
// Update global directory in background
//$user = api_get_user(get_app());
$url = App :: get_baseu rl() . '/profile/' . get_app () -> user [ 'nickname' ];
$url = System :: baseU rl() . '/profile/' . get_app () -> user [ 'nickname' ];
if ( $url && strlen ( get_config ( 'system' , 'directory' ))) {
proc_run ( PRIORITY_LOW , " include/directory.php " , $url );
}
@ -3974,8 +3974,8 @@ $called_api = null;
);
// adds link to the thumbnail scale photo
$arr [ 'body' ] = '[url=' . App :: get_baseu rl() . '/photos/' . $owner_record [ 0 ][ 'name' ] . '/image/' . $hash . ']'
. '[img]' . App :: get_baseu rl() . '/photo/' . $hash . '-' . " 2 " . '.' . $typetoext [ $filetype ] . '[/img]'
$arr [ 'body' ] = '[url=' . System :: baseU rl() . '/photos/' . $owner_record [ 0 ][ 'name' ] . '/image/' . $hash . ']'
. '[img]' . System :: baseU rl() . '/photo/' . $hash . '-' . " 2 " . '.' . $typetoext [ $filetype ] . '[/img]'
. '[/url]' ;
// do the magic for storing the item in the database and trigger the federation to other contacts
@ -4018,14 +4018,14 @@ $called_api = null;
for ( $k = intval ( $data [ 'photo' ][ 'minscale' ]); $k <= intval ( $data [ 'photo' ][ 'maxscale' ]); $k ++ ) {
$data [ 'photo' ][ 'links' ][ $k . " :link " ][ " @attributes " ] = array ( " type " => $data [ 'photo' ][ 'type' ],
" scale " => $k ,
" href " => App :: get_baseu rl() . " /photo/ " . $data [ 'photo' ][ 'resource-id' ] . " - " . $k . " . " . $typetoext [ $data [ 'photo' ][ 'type' ]]);
" href " => System :: baseU rl() . " /photo/ " . $data [ 'photo' ][ 'resource-id' ] . " - " . $k . " . " . $typetoext [ $data [ 'photo' ][ 'type' ]]);
}
} else {
$data [ 'photo' ][ 'link' ] = array ();
// when we have profile images we could have only scales from 4 to 6, but index of array always needs to start with 0
$i = 0 ;
for ( $k = intval ( $data [ 'photo' ][ 'minscale' ]); $k <= intval ( $data [ 'photo' ][ 'maxscale' ]); $k ++ ) {
$data [ 'photo' ][ 'link' ][ $i ] = App :: get_baseu rl() . " /photo/ " . $data [ 'photo' ][ 'resource-id' ] . " - " . $k . " . " . $typetoext [ $data [ 'photo' ][ 'type' ]];
$data [ 'photo' ][ 'link' ][ $i ] = System :: baseU rl() . " /photo/ " . $data [ 'photo' ][ 'resource-id' ] . " - " . $k . " . " . $typetoext [ $data [ 'photo' ][ 'type' ]];
$i ++ ;
}
}