Merge pull request #2370 from annando/1602-mixed-content

Initial work to prevent mixed content, allow hidden tor services ...
This commit is contained in:
fabrixxm 2016-02-23 08:45:19 +01:00
commit 507f8ab4df
25 changed files with 323 additions and 376 deletions

View file

@ -855,11 +855,11 @@ class App {
$shortcut_icon = get_config("system", "shortcut_icon"); $shortcut_icon = get_config("system", "shortcut_icon");
if ($shortcut_icon == "") if ($shortcut_icon == "")
$shortcut_icon = $this->get_baseurl()."/images/friendica-32.png"; $shortcut_icon = "images/friendica-32.png";
$touch_icon = get_config("system", "touch_icon"); $touch_icon = get_config("system", "touch_icon");
if ($touch_icon == "") if ($touch_icon == "")
$touch_icon = $this->get_baseurl()."/images/friendica-128.png"; $touch_icon = "images/friendica-128.png";
$tpl = get_markup_template('head.tpl'); $tpl = get_markup_template('head.tpl');
$this->page['htmlhead'] = replace_macros($tpl,array( $this->page['htmlhead'] = replace_macros($tpl,array(
@ -938,6 +938,25 @@ class App {
} }
/**
* @brief Removes the baseurl from an url. This avoids some mixed content problems.
*
* @param string $url
*
* @return string The cleaned url
*/
function remove_baseurl($url){
// Is the function called statically?
if (!is_object($this))
return(self::$a->remove_baseurl($url));
$url = normalise_link($url);
$base = normalise_link($this->get_baseurl());
$url = str_replace($base."/", "", $url);
return $url;
}
/** /**
* @brief Register template engine class * @brief Register template engine class
* *
@ -1419,7 +1438,7 @@ function login($register = false, $hiddens=false) {
$noid = get_config('system','no_openid'); $noid = get_config('system','no_openid');
$dest_url = $a->get_baseurl(true) . '/' . $a->query_string; $dest_url = $a->query_string;
if(local_user()) { if(local_user()) {
$tpl = get_markup_template("logout.tpl"); $tpl = get_markup_template("logout.tpl");
@ -1738,9 +1757,9 @@ function current_theme_url() {
$opts = (($a->profile_uid) ? '?f=&puid=' . $a->profile_uid : ''); $opts = (($a->profile_uid) ? '?f=&puid=' . $a->profile_uid : '');
if (file_exists('view/theme/' . $t . '/style.php')) if (file_exists('view/theme/' . $t . '/style.php'))
return($a->get_baseurl() . '/view/theme/' . $t . '/style.pcss' . $opts); return('view/theme/'.$t.'/style.pcss'.$opts);
return($a->get_baseurl() . '/view/theme/' . $t . '/style.css'); return('view/theme/'.$t.'/style.css');
} }
function feed_birthday($uid,$tz) { function feed_birthday($uid,$tz) {

View file

@ -95,12 +95,12 @@ class ForumManager {
$selected = (($cid == $contact['id']) ? ' forum-selected' : ''); $selected = (($cid == $contact['id']) ? ' forum-selected' : '');
$entry = array( $entry = array(
'url' => z_root() . '/network?f=&cid=' . $contact['id'], 'url' => 'network?f=&cid=' . $contact['id'],
'external_url' => z_root() . '/redir/' . $contact['id'], 'external_url' => 'redir/' . $contact['id'],
'name' => $contact['name'], 'name' => $contact['name'],
'cid' => $contact['id'], 'cid' => $contact['id'],
'selected' => $selected, 'selected' => $selected,
'micro' => proxy_url($contact['micro'], false, PROXY_SIZE_MICRO), 'micro' => App::remove_baseurl(proxy_url($contact['micro'], false, PROXY_SIZE_MICRO)),
'id' => ++$id, 'id' => ++$id,
); );
$entries[] = $entry; $entries[] = $entry;

View file

@ -614,7 +614,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
if(($normalised != 'mailbox') && (x($a->contacts[$normalised]))) if(($normalised != 'mailbox') && (x($a->contacts[$normalised])))
$profile_avatar = $a->contacts[$normalised]['thumb']; $profile_avatar = $a->contacts[$normalised]['thumb'];
else else
$profile_avatar = ((strlen($item['author-avatar'])) ? $a->get_cached_avatar_image($item['author-avatar']) : $item['thumb']); $profile_avatar = $a->remove_baseurl(((strlen($item['author-avatar'])) ? $item['author-avatar'] : $item['thumb']));
$locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => ''); $locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => '');
call_hooks('render_location',$locate); call_hooks('render_location',$locate);
@ -707,8 +707,8 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
'like' => '', 'like' => '',
'dislike' => '', 'dislike' => '',
'comment' => '', 'comment' => '',
//'conv' => (($preview) ? '' : array('href'=> $a->get_baseurl($ssl_state) . '/display/' . $nickname . '/' . $item['id'], 'title'=> t('View in context'))), //'conv' => (($preview) ? '' : array('href'=> 'display/' . $nickname . '/' . $item['id'], 'title'=> t('View in context'))),
'conv' => (($preview) ? '' : array('href'=> $a->get_baseurl($ssl_state) . '/display/'.$item['guid'], 'title'=> t('View in context'))), 'conv' => (($preview) ? '' : array('href'=> 'display/'.$item['guid'], 'title'=> t('View in context'))),
'previewing' => $previewing, 'previewing' => $previewing,
'wait' => t('Please wait'), 'wait' => t('Please wait'),
'thread_level' => 1, 'thread_level' => 1,
@ -868,7 +868,7 @@ function item_photo_menu($item){
$status_link = $profile_link . "?url=status"; $status_link = $profile_link . "?url=status";
$photos_link = $profile_link . "?url=photos"; $photos_link = $profile_link . "?url=photos";
$profile_link = $profile_link . "?url=profile"; $profile_link = $profile_link . "?url=profile";
$pm_url = $a->get_baseurl($ssl_state) . '/message/new/' . $cid; $pm_url = 'message/new/' . $cid;
$zurl = ''; $zurl = '';
} }
else { else {
@ -882,23 +882,23 @@ function item_photo_menu($item){
$cid = $r[0]["id"]; $cid = $r[0]["id"];
if ($r[0]["network"] == NETWORK_DIASPORA) if ($r[0]["network"] == NETWORK_DIASPORA)
$pm_url = $a->get_baseurl($ssl_state) . '/message/new/' . $cid; $pm_url = 'message/new/' . $cid;
} else } else
$cid = 0; $cid = 0;
} }
} }
if(($cid) && (! $item['self'])) { if(($cid) && (! $item['self'])) {
$poke_link = $a->get_baseurl($ssl_state) . '/poke/?f=&c=' . $cid; $poke_link = 'poke/?f=&c=' . $cid;
$contact_url = $a->get_baseurl($ssl_state) . '/contacts/' . $cid; $contact_url = 'contacts/' . $cid;
$posts_link = $a->get_baseurl($ssl_state) . '/contacts/' . $cid . '/posts'; $posts_link = 'contacts/' . $cid . '/posts';
$clean_url = normalise_link($item['author-link']); $clean_url = normalise_link($item['author-link']);
if((local_user()) && (local_user() == $item['uid'])) { if((local_user()) && (local_user() == $item['uid'])) {
if(isset($a->contacts) && x($a->contacts,$clean_url)) { if(isset($a->contacts) && x($a->contacts,$clean_url)) {
if($a->contacts[$clean_url]['network'] === NETWORK_DIASPORA) { if($a->contacts[$clean_url]['network'] === NETWORK_DIASPORA) {
$pm_url = $a->get_baseurl($ssl_state) . '/message/new/' . $cid; $pm_url = 'message/new/' . $cid;
} }
} }
} }
@ -921,7 +921,7 @@ function item_photo_menu($item){
if ((($cid == 0) OR ($a->contacts[$clean_url]['rel'] == CONTACT_IS_FOLLOWER)) AND if ((($cid == 0) OR ($a->contacts[$clean_url]['rel'] == CONTACT_IS_FOLLOWER)) AND
in_array($item['network'], array(NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_DIASPORA))) in_array($item['network'], array(NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_DIASPORA)))
$menu[t("Connect/Follow")] = $a->get_baseurl($ssl_state)."/follow?url=".urlencode($item['author-link']); $menu[t("Connect/Follow")] = "follow?url=".urlencode($item['author-link']);
} else } else
$menu = array(t("View Profile") => $item['author-link']); $menu = array(t("View Profile") => $item['author-link']);
@ -980,7 +980,7 @@ function builtin_activity_puller($item, &$conv_responses) {
if((activity_match($item['verb'], $verb)) && ($item['id'] != $item['parent'])) { if((activity_match($item['verb'], $verb)) && ($item['id'] != $item['parent'])) {
$url = $item['author-link']; $url = $item['author-link'];
if((local_user()) && (local_user() == $item['uid']) && ($item['network'] === NETWORK_DFRN) && (! $item['self']) && (link_compare($item['author-link'],$item['url']))) { if((local_user()) && (local_user() == $item['uid']) && ($item['network'] === NETWORK_DFRN) && (! $item['self']) && (link_compare($item['author-link'],$item['url']))) {
$url = z_root(true) . '/redir/' . $item['contact-id']; $url = 'redir/' . $item['contact-id'];
$sparkle = ' class="sparkle" '; $sparkle = ' class="sparkle" ';
} }
else else
@ -1178,7 +1178,7 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) {
$o .= replace_macros($tpl,array( $o .= replace_macros($tpl,array(
'$return_path' => $query_str, '$return_path' => $query_str,
'$action' => $a->get_baseurl(true) . '/item', '$action' => 'item',
'$share' => (x($x,'button') ? $x['button'] : t('Share')), '$share' => (x($x,'button') ? $x['button'] : t('Share')),
'$upload' => t('Upload photo'), '$upload' => t('Upload photo'),
'$shortupload' => t('upload photo'), '$shortupload' => t('upload photo'),

View file

@ -332,9 +332,9 @@ function profile_sidebar($profile, $block = 0) {
'fullname' => $profile['name'], 'fullname' => $profile['name'],
'firstname' => $firstname, 'firstname' => $firstname,
'lastname' => $lastname, 'lastname' => $lastname,
'photo300' => $a->get_cached_avatar_image($a->get_baseurl() . '/photo/custom/300/' . $profile['uid'] . '.jpg'), 'photo300' => $a->get_baseurl() . '/photo/custom/300/' . $profile['uid'] . '.jpg',
'photo100' => $a->get_cached_avatar_image($a->get_baseurl() . '/photo/custom/100/' . $profile['uid'] . '.jpg'), 'photo100' => $a->get_baseurl() . '/photo/custom/100/' . $profile['uid'] . '.jpg',
'photo50' => $a->get_cached_avatar_image($a->get_baseurl() . '/photo/custom/50/' . $profile['uid'] . '.jpg'), 'photo50' => $a->get_baseurl() . '/photo/custom/50/' . $profile['uid'] . '.jpg',
); );
if (!$block){ if (!$block){

View file

@ -82,7 +82,7 @@ function nav_info(&$a) {
// user info // user info
$r = q("SELECT micro FROM contact WHERE uid=%d AND self=1", intval($a->user['uid'])); $r = q("SELECT micro FROM contact WHERE uid=%d AND self=1", intval($a->user['uid']));
$userinfo = array( $userinfo = array(
'icon' => (count($r) ? $a->get_cached_avatar_image($r[0]['micro']) : $a->get_baseurl($ssl_state)."/images/person-48.jpg"), 'icon' => (count($r) ? $a->remove_baseurl($r[0]['micro']) : "images/person-48.jpg"),
'name' => $a->user['username'], 'name' => $a->user['username'],
); );
@ -107,7 +107,7 @@ function nav_info(&$a) {
if(($a->config['register_policy'] == REGISTER_OPEN) && (! local_user()) && (! remote_user())) if(($a->config['register_policy'] == REGISTER_OPEN) && (! local_user()) && (! remote_user()))
$nav['register'] = array('register',t('Register'), "", t('Create an account')); $nav['register'] = array('register',t('Register'), "", t('Create an account'));
$help_url = $a->get_baseurl($ssl_state) . '/help'; $help_url = 'help';
if(! get_config('system','hide_help')) if(! get_config('system','hide_help'))
$nav['help'] = array($help_url, t('Help'), "", t('Help and documentation')); $nav['help'] = array($help_url, t('Help'), "", t('Help and documentation'));

View file

@ -285,7 +285,7 @@ function paginate_data(&$a, $count=null) {
if (($a->page_offset != "") AND !preg_match('/[?&].offset=/', $stripped)) if (($a->page_offset != "") AND !preg_match('/[?&].offset=/', $stripped))
$stripped .= "&offset=".urlencode($a->page_offset); $stripped .= "&offset=".urlencode($a->page_offset);
$url = z_root() . '/' . $stripped; $url = $stripped;
$data = array(); $data = array();
function _l(&$d, $name, $url, $text, $class="") { function _l(&$d, $name, $url, $text, $class="") {
@ -923,7 +923,7 @@ function micropro($contact, $redirect = false, $class = '', $textmode = false) {
if($redirect) { if($redirect) {
$a = get_app(); $a = get_app();
$redirect_url = z_root() . '/redir/' . $contact['id']; $redirect_url = 'redir/' . $contact['id'];
if(local_user() && ($contact['uid'] == local_user()) && ($contact['network'] === NETWORK_DFRN)) { if(local_user() && ($contact['uid'] == local_user()) && ($contact['network'] === NETWORK_DFRN)) {
$redir = true; $redir = true;
$url = $redirect_url; $url = $redirect_url;
@ -964,13 +964,13 @@ if(! function_exists('search')) {
* @param string $url search url * @param string $url search url
* @param boolean $savedsearch show save search button * @param boolean $savedsearch show save search button
*/ */
function search($s,$id='search-box',$url='/search',$save = false, $aside = true) { function search($s,$id='search-box',$url='search',$save = false, $aside = true) {
$a = get_app(); $a = get_app();
$values = array( $values = array(
'$s' => $s, '$s' => $s,
'$id' => $id, '$id' => $id,
'$action_url' => $a->get_baseurl((stristr($url,'network')) ? true : false) . $url, '$action_url' => $url,
'$search_label' => t('Search'), '$search_label' => t('Search'),
'$save_label' => t('Save'), '$save_label' => t('Save'),
'$savedsearch' => feature_enabled(local_user(),'savedsearch'), '$savedsearch' => feature_enabled(local_user(),'savedsearch'),
@ -1305,7 +1305,7 @@ function redir_private_images($a, &$item) {
if((local_user() == $item['uid']) && ($item['private'] != 0) && ($item['contact-id'] != $a->contact['id']) && ($item['network'] == NETWORK_DFRN)) { if((local_user() == $item['uid']) && ($item['private'] != 0) && ($item['contact-id'] != $a->contact['id']) && ($item['network'] == NETWORK_DFRN)) {
//logger("redir_private_images: redir"); //logger("redir_private_images: redir");
$img_url = z_root() . '/redir?f=1&quiet=1&url=' . $mtch[1] . '&conurl=' . $item['author-link']; $img_url = 'redir?f=1&quiet=1&url=' . $mtch[1] . '&conurl=' . $item['author-link'];
$item['body'] = str_replace($mtch[0], "[img]".$img_url."[/img]", $item['body']); $item['body'] = str_replace($mtch[0], "[img]".$img_url."[/img]", $item['body']);
} }
} }
@ -1421,7 +1421,7 @@ function prepare_body(&$item,$attach = false, $preview = false) {
$mime = $mtch[3]; $mime = $mtch[3];
if((local_user() == $item['uid']) && ($item['contact-id'] != $a->contact['id']) && ($item['network'] == NETWORK_DFRN)) if((local_user() == $item['uid']) && ($item['contact-id'] != $a->contact['id']) && ($item['network'] == NETWORK_DFRN))
$the_url = z_root() . '/redir/' . $item['contact-id'] . '?f=1&url=' . $mtch[1]; $the_url = 'redir/' . $item['contact-id'] . '?f=1&url=' . $mtch[1];
else else
$the_url = $mtch[1]; $the_url = $mtch[1];
@ -1596,7 +1596,7 @@ function get_cats_and_terms($item) {
$categories[] = array( $categories[] = array(
'name' => xmlify(file_tag_decode($mtch[1])), 'name' => xmlify(file_tag_decode($mtch[1])),
'url' => "#", 'url' => "#",
'removeurl' => ((local_user() == $item['uid'])?z_root() . '/filerm/' . $item['id'] . '?f=&cat=' . xmlify(file_tag_decode($mtch[1])):""), 'removeurl' => ((local_user() == $item['uid'])?'filerm/' . $item['id'] . '?f=&cat=' . xmlify(file_tag_decode($mtch[1])):""),
'first' => $first, 'first' => $first,
'last' => false 'last' => false
); );
@ -1614,7 +1614,7 @@ function get_cats_and_terms($item) {
$folders[] = array( $folders[] = array(
'name' => xmlify(file_tag_decode($mtch[1])), 'name' => xmlify(file_tag_decode($mtch[1])),
'url' => "#", 'url' => "#",
'removeurl' => ((local_user() == $item['uid'])?z_root() . '/filerm/' . $item['id'] . '?f=&term=' . xmlify(file_tag_decode($mtch[1])):""), 'removeurl' => ((local_user() == $item['uid'])?'filerm/' . $item['id'] . '?f=&term=' . xmlify(file_tag_decode($mtch[1])):""),
'first' => $first, 'first' => $first,
'last' => false 'last' => false
); );
@ -1639,15 +1639,15 @@ function get_plink($item) {
if ($a->user['nickname'] != "") { if ($a->user['nickname'] != "") {
$ret = array( $ret = array(
//'href' => z_root()."/display/".$a->user['nickname']."/".$item['id'], //'href' => "display/".$a->user['nickname']."/".$item['id'],
'href' => z_root()."/display/".$item['guid'], 'href' => "display/".$item['guid'],
'orig' => z_root()."/display/".$item['guid'], 'orig' => "display/".$item['guid'],
'title' => t('View on separate page'), 'title' => t('View on separate page'),
'orig_title' => t('view on separate page'), 'orig_title' => t('view on separate page'),
); );
if (x($item,'plink')) { if (x($item,'plink')) {
$ret["href"] = $item['plink']; $ret["href"] = $a->remove_baseurl($item['plink']);
$ret["title"] = t('link to source'); $ret["title"] = t('link to source');
} }

View file

@ -371,7 +371,7 @@ $a->init_page_end();
if(x($_SESSION,'visitor_home')) if(x($_SESSION,'visitor_home'))
$homebase = $_SESSION['visitor_home']; $homebase = $_SESSION['visitor_home'];
elseif(local_user()) elseif(local_user())
$homebase = $a->get_baseurl() . '/profile/' . $a->user['nickname']; $homebase = 'profile/' . $a->user['nickname'];
if(isset($homebase)) if(isset($homebase))
$a->page['content'] .= '<script>var homebase="' . $homebase . '" ; </script>'; $a->page['content'] .= '<script>var homebase="' . $homebase . '" ; </script>';
@ -423,10 +423,10 @@ if($a->module != 'install' && $a->module != 'maintenance') {
if($a->is_mobile || $a->is_tablet) { if($a->is_mobile || $a->is_tablet) {
if(isset($_SESSION['show-mobile']) && !$_SESSION['show-mobile']) { if(isset($_SESSION['show-mobile']) && !$_SESSION['show-mobile']) {
$link = $a->get_baseurl() . '/toggle_mobile?address=' . curPageURL(); $link = 'toggle_mobile?address=' . curPageURL();
} }
else { else {
$link = $a->get_baseurl() . '/toggle_mobile?off=1&address=' . curPageURL(); $link = 'toggle_mobile?off=1&address=' . curPageURL();
} }
$a->page['footer'] = replace_macros(get_markup_template("toggle_mobile_footer.tpl"), array( $a->page['footer'] = replace_macros(get_markup_template("toggle_mobile_footer.tpl"), array(
'$toggle_link' => $link, '$toggle_link' => $link,

View file

@ -55,13 +55,13 @@ function admin_post(&$a){
$func($a); $func($a);
} }
} }
goaway($a->get_baseurl(true) . '/admin/plugins/' . $a->argv[2] ); goaway('admin/plugins/'.$a->argv[2]);
return; // NOTREACHED return; // NOTREACHED
break; break;
case 'themes': case 'themes':
if($a->argc < 2) { if($a->argc < 2) {
if(is_ajax()) return; if(is_ajax()) return;
goaway($a->get_baseurl(true) . '/admin/' ); goaway('admin/');
return; return;
} }
@ -92,7 +92,7 @@ function admin_post(&$a){
info(t('Theme settings updated.')); info(t('Theme settings updated.'));
if(is_ajax()) return; if(is_ajax()) return;
goaway($a->get_baseurl(true) . '/admin/themes/' . $theme ); goaway('admin/themes/'.$theme);
return; return;
break; break;
case 'features': case 'features':
@ -107,7 +107,7 @@ function admin_post(&$a){
} }
} }
goaway($a->get_baseurl(true) . '/admin' ); goaway('admin');
return; // NOTREACHED return; // NOTREACHED
} }
@ -150,17 +150,17 @@ function admin_content(&$a) {
* Side bar links * Side bar links
*/ */
$aside_tools = array(); $aside_tools = array();
// array( url, name, extra css classes ) // array(url, name, extra css classes)
// not part of $aside to make the template more adjustable // not part of $aside to make the template more adjustable
$aside_sub = array( $aside_sub = array(
'site' => array($a->get_baseurl(true)."/admin/site/", t("Site") , "site"), 'site' => array("admin/site/", t("Site") , "site"),
'users' => array($a->get_baseurl(true)."/admin/users/", t("Users") , "users"), 'users' => array("admin/users/", t("Users") , "users"),
'plugins'=> array($a->get_baseurl(true)."/admin/plugins/", t("Plugins") , "plugins"), 'plugins'=> array("admin/plugins/", t("Plugins") , "plugins"),
'themes' => array($a->get_baseurl(true)."/admin/themes/", t("Themes") , "themes"), 'themes' => array("admin/themes/", t("Themes") , "themes"),
'features' => array($a->get_baseurl(true)."/admin/features/", t("Additional features") , "features"), 'features' => array("admin/features/", t("Additional features") , "features"),
'dbsync' => array($a->get_baseurl(true)."/admin/dbsync/", t('DB updates'), "dbsync"), 'dbsync' => array("admin/dbsync/", t('DB updates'), "dbsync"),
'queue' => array($a->get_baseurl(true)."/admin/queue/", t('Inspect Queue'), "queue"), 'queue' => array("admin/queue/", t('Inspect Queue'), "queue"),
'federation' => array($a->get_baseurl(true)."/admin/federation/", t('Federation Statistics'), "federation"), 'federation' => array("admin/federation/", t('Federation Statistics'), "federation"),
); );
/* get plugins admin page */ /* get plugins admin page */
@ -169,18 +169,18 @@ function admin_content(&$a) {
$aside_tools['plugins_admin']=array(); $aside_tools['plugins_admin']=array();
foreach ($r as $h){ foreach ($r as $h){
$plugin =$h['name']; $plugin =$h['name'];
$aside_tools['plugins_admin'][] = array($a->get_baseurl(true)."/admin/plugins/".$plugin, $plugin, "plugin"); $aside_tools['plugins_admin'][] = array("admin/plugins/".$plugin, $plugin, "plugin");
// temp plugins with admin // temp plugins with admin
$a->plugins_admin[] = $plugin; $a->plugins_admin[] = $plugin;
} }
$aside_tools['logs'] = array($a->get_baseurl(true)."/admin/logs/", t("Logs"), "logs"); $aside_tools['logs'] = array("admin/logs/", t("Logs"), "logs");
$aside_tools['viewlogs'] = array($a->get_baseurl(true)."/admin/viewlogs/", t("View Logs"), 'viewlogs'); $aside_tools['viewlogs'] = array("admin/viewlogs/", t("View Logs"), 'viewlogs');
$aside_tools['diagnostics_probe'] = array($a->get_baseurl(true).'/probe/', t('probe address'), 'probe'); $aside_tools['diagnostics_probe'] = array('probe/', t('probe address'), 'probe');
$aside_tools['diagnostics_webfinger'] = array($a->get_baseurl(true).'/webfinger/', t('check webfinger'), 'webfinger'); $aside_tools['diagnostics_webfinger'] = array('webfinger/', t('check webfinger'), 'webfinger');
$t = get_markup_template("admin_aside.tpl"); $t = get_markup_template("admin_aside.tpl");
$a->page['aside'] .= replace_macros( $t, array( $a->page['aside'] .= replace_macros($t, array(
'$admin' => $aside_tools, '$admin' => $aside_tools,
'$subpages' => $aside_sub, '$subpages' => $aside_sub,
'$admtxt' => t('Admin'), '$admtxt' => t('Admin'),
@ -188,7 +188,7 @@ function admin_content(&$a) {
'$logtxt' => t('Logs'), '$logtxt' => t('Logs'),
'$diagnosticstxt' => t('diagnostics'), '$diagnosticstxt' => t('diagnostics'),
'$h_pending' => t('User registrations waiting for confirmation'), '$h_pending' => t('User registrations waiting for confirmation'),
'$admurl'=> $a->get_baseurl(true)."/admin/" '$admurl'=> "admin/"
)); ));
@ -231,7 +231,7 @@ function admin_content(&$a) {
$o = admin_page_federation($a); $o = admin_page_federation($a);
break; break;
default: default:
notice( t("Item not found.") ); notice(t("Item not found."));
} }
} else { } else {
$o = admin_page_summary($a); $o = admin_page_summary($a);
@ -409,18 +409,18 @@ function admin_page_queue(&$a) {
function admin_page_summary(&$a) { function admin_page_summary(&$a) {
$r = q("SELECT `page-flags`, COUNT(uid) as `count` FROM `user` GROUP BY `page-flags`"); $r = q("SELECT `page-flags`, COUNT(uid) as `count` FROM `user` GROUP BY `page-flags`");
$accounts = array( $accounts = array(
array( t('Normal Account'), 0), array(t('Normal Account'), 0),
array( t('Soapbox Account'), 0), array(t('Soapbox Account'), 0),
array( t('Community/Celebrity Account'), 0), array(t('Community/Celebrity Account'), 0),
array( t('Automatic Friend Account'), 0), array(t('Automatic Friend Account'), 0),
array( t('Blog Account'), 0), array(t('Blog Account'), 0),
array( t('Private Forum'), 0) array(t('Private Forum'), 0)
); );
$users=0; $users=0;
foreach ($r as $u){ $accounts[$u['page-flags']][1] = $u['count']; $users+= $u['count']; } foreach ($r as $u){ $accounts[$u['page-flags']][1] = $u['count']; $users+= $u['count']; }
logger('accounts: ' . print_r($accounts,true),LOGGER_DATA); logger('accounts: '.print_r($accounts,true),LOGGER_DATA);
$r = q("SELECT COUNT(id) as `count` FROM `register`"); $r = q("SELECT COUNT(id) as `count` FROM `register`");
$pending = $r[0]['count']; $pending = $r[0]['count'];
@ -433,7 +433,7 @@ function admin_page_summary(&$a) {
// We can do better, but this is a quick queue status // We can do better, but this is a quick queue status
$queues = array( 'label' => t('Message queues'), 'deliverq' => $deliverq, 'queue' => $queue ); $queues = array('label' => t('Message queues'), 'deliverq' => $deliverq, 'queue' => $queue);
$t = get_markup_template("admin_summary.tpl"); $t = get_markup_template("admin_summary.tpl");
@ -441,15 +441,15 @@ function admin_page_summary(&$a) {
'$title' => t('Administration'), '$title' => t('Administration'),
'$page' => t('Summary'), '$page' => t('Summary'),
'$queues' => $queues, '$queues' => $queues,
'$users' => array( t('Registered users'), $users), '$users' => array(t('Registered users'), $users),
'$accounts' => $accounts, '$accounts' => $accounts,
'$pending' => array( t('Pending registrations'), $pending), '$pending' => array(t('Pending registrations'), $pending),
'$version' => array( t('Version'), FRIENDICA_VERSION), '$version' => array(t('Version'), FRIENDICA_VERSION),
'$baseurl' => $a->get_baseurl(), '$baseurl' => $a->get_baseurl(),
'$platform' => FRIENDICA_PLATFORM, '$platform' => FRIENDICA_PLATFORM,
'$codename' => FRIENDICA_CODENAME, '$codename' => FRIENDICA_CODENAME,
'$build' => get_config('system','build'), '$build' => get_config('system','build'),
'$plugins' => array( t('Active plugins'), $a->plugins ) '$plugins' => array(t('Active plugins'), $a->plugins)
)); ));
} }
@ -473,7 +473,7 @@ function admin_page_site_post(&$a) {
$parsed = @parse_url($new_url); $parsed = @parse_url($new_url);
if(!$parsed || (!x($parsed,'host') || !x($parsed,'scheme'))) { if(!$parsed || (!x($parsed,'host') || !x($parsed,'scheme'))) {
notice(t("Can not parse base url. Must have at least <scheme>://<domain>")); notice(t("Can not parse base url. Must have at least <scheme>://<domain>"));
goaway($a->get_baseurl(true) . '/admin/site' ); goaway('admin/site');
} }
/* steps: /* steps:
@ -501,8 +501,8 @@ function admin_page_site_post(&$a) {
$q = sprintf("UPDATE %s SET %s;", $table_name, $upds); $q = sprintf("UPDATE %s SET %s;", $table_name, $upds);
$r = q($q); $r = q($q);
if(!$r) { if(!$r) {
notice( "Failed updating '$table_name': " . $db->error ); notice("Failed updating '$table_name': ".$db->error);
goaway($a->get_baseurl(true) . '/admin/site' ); goaway('admin/site');
} }
} }
@ -526,7 +526,7 @@ function admin_page_site_post(&$a) {
info("Relocation started. Could take a while to complete."); info("Relocation started. Could take a while to complete.");
goaway($a->get_baseurl(true) . '/admin/site' ); goaway('admin/site');
} }
// end relocate // end relocate
@ -695,12 +695,12 @@ function admin_page_site_post(&$a) {
set_config('system','language', $language); set_config('system','language', $language);
set_config('system','theme', $theme); set_config('system','theme', $theme);
if( $theme_mobile === '---' ) { if($theme_mobile === '---') {
del_config('system','mobile-theme'); del_config('system','mobile-theme');
} else { } else {
set_config('system','mobile-theme', $theme_mobile); set_config('system','mobile-theme', $theme_mobile);
} }
if( $singleuser === '---' ) { if($singleuser === '---') {
del_config('system','singleuser'); del_config('system','singleuser');
} else { } else {
set_config('system','singleuser', $singleuser); set_config('system','singleuser', $singleuser);
@ -765,8 +765,8 @@ function admin_page_site_post(&$a) {
set_config('system','embedly', $embedly); set_config('system','embedly', $embedly);
info( t('Site settings updated.') . EOL); info(t('Site settings updated.').EOL);
goaway($a->get_baseurl(true) . '/admin/site' ); goaway('admin/site');
return; // NOTREACHED return; // NOTREACHED
} }
@ -797,12 +797,12 @@ function admin_page_site(&$a) {
$files = glob('view/theme/*'); $files = glob('view/theme/*');
if($files) { if($files) {
foreach($files as $file) { foreach($files as $file) {
if(intval(file_exists($file . '/unsupported'))) if(intval(file_exists($file.'/unsupported')))
continue; continue;
$f = basename($file); $f = basename($file);
$theme_name = ((file_exists($file . '/experimental')) ? sprintf("%s - \x28Experimental\x29", $f) : $f); $theme_name = ((file_exists($file.'/experimental')) ? sprintf("%s - \x28Experimental\x29", $f) : $f);
if(file_exists($file . '/mobile')) { if(file_exists($file.'/mobile')) {
$theme_choices_mobile[$f] = $theme_name; $theme_choices_mobile[$f] = $theme_name;
} else { } else {
$theme_choices[$f] = $theme_name; $theme_choices[$f] = $theme_name;
@ -1003,12 +1003,12 @@ function admin_page_dbsync(&$a) {
$o = ''; $o = '';
if($a->argc > 3 && intval($a->argv[3]) && $a->argv[2] === 'mark') { if($a->argc > 3 && intval($a->argv[3]) && $a->argv[2] === 'mark') {
set_config('database', 'update_' . intval($a->argv[3]), 'success'); set_config('database', 'update_'.intval($a->argv[3]), 'success');
$curr = get_config('system','build'); $curr = get_config('system','build');
if(intval($curr) == intval($a->argv[3])) if(intval($curr) == intval($a->argv[3]))
set_config('system','build',intval($curr) + 1); set_config('system','build',intval($curr) + 1);
info( t('Update has been marked successful') . EOL); info(t('Update has been marked successful').EOL);
goaway($a->get_baseurl(true) . '/admin/dbsync'); goaway('admin/dbsync');
} }
if(($a->argc > 2) AND (intval($a->argv[2]) OR ($a->argv[2] === 'check'))) { if(($a->argc > 2) AND (intval($a->argv[2]) OR ($a->argv[2] === 'check'))) {
@ -1026,7 +1026,7 @@ function admin_page_dbsync(&$a) {
if($a->argc > 2 && intval($a->argv[2])) { if($a->argc > 2 && intval($a->argv[2])) {
require_once('update.php'); require_once('update.php');
$func = 'update_' . intval($a->argv[2]); $func = 'update_'.intval($a->argv[2]);
if(function_exists($func)) { if(function_exists($func)) {
$retval = $func(); $retval = $func();
if($retval === UPDATE_FAILED) { if($retval === UPDATE_FAILED) {
@ -1082,18 +1082,18 @@ function admin_page_dbsync(&$a) {
* @param App $a * @param App $a
*/ */
function admin_page_users_post(&$a){ function admin_page_users_post(&$a){
$pending = ( x($_POST, 'pending') ? $_POST['pending'] : array() ); $pending = (x($_POST, 'pending') ? $_POST['pending'] : array());
$users = ( x($_POST, 'user') ? $_POST['user'] : array() ); $users = (x($_POST, 'user') ? $_POST['user'] : array());
$nu_name = ( x($_POST, 'new_user_name') ? $_POST['new_user_name'] : ''); $nu_name = (x($_POST, 'new_user_name') ? $_POST['new_user_name'] : '');
$nu_nickname = ( x($_POST, 'new_user_nickname') ? $_POST['new_user_nickname'] : ''); $nu_nickname = (x($_POST, 'new_user_nickname') ? $_POST['new_user_nickname'] : '');
$nu_email = ( x($_POST, 'new_user_email') ? $_POST['new_user_email'] : ''); $nu_email = (x($_POST, 'new_user_email') ? $_POST['new_user_email'] : '');
check_form_security_token_redirectOnErr('/admin/users', 'admin_users'); check_form_security_token_redirectOnErr('/admin/users', 'admin_users');
if(!($nu_name==="") && !($nu_email==="") && !($nu_nickname==="")) { if(!($nu_name==="") && !($nu_email==="") && !($nu_nickname==="")) {
require_once('include/user.php'); require_once('include/user.php');
$result = create_user( array('username'=>$nu_name, 'email'=>$nu_email, 'nickname'=>$nu_nickname, 'verified'=>1) ); $result = create_user(array('username'=>$nu_name, 'email'=>$nu_email, 'nickname'=>$nu_nickname, 'verified'=>1));
if(! $result['success']) { if(! $result['success']) {
notice($result['message']); notice($result['message']);
return; return;
@ -1134,7 +1134,7 @@ function admin_page_users_post(&$a){
notification(array( notification(array(
'type' => "SYSTEM_EMAIL", 'type' => "SYSTEM_EMAIL",
'to_email' => $nu['email'], 'to_email' => $nu['email'],
'subject'=> sprintf( t('Registration details for %s'), $a->config['sitename']), 'subject'=> sprintf(t('Registration details for %s'), $a->config['sitename']),
'preamble'=> $preamble, 'preamble'=> $preamble,
'body' => $body)); 'body' => $body));
@ -1143,17 +1143,17 @@ function admin_page_users_post(&$a){
if(x($_POST,'page_users_block')) { if(x($_POST,'page_users_block')) {
foreach($users as $uid){ foreach($users as $uid){
q("UPDATE `user` SET `blocked`=1-`blocked` WHERE `uid`=%s", q("UPDATE `user` SET `blocked`=1-`blocked` WHERE `uid`=%s",
intval( $uid ) intval($uid)
); );
} }
notice( sprintf( tt("%s user blocked/unblocked", "%s users blocked/unblocked", count($users)), count($users)) ); notice(sprintf(tt("%s user blocked/unblocked", "%s users blocked/unblocked", count($users)), count($users)));
} }
if(x($_POST,'page_users_delete')) { if(x($_POST,'page_users_delete')) {
require_once("include/Contact.php"); require_once("include/Contact.php");
foreach($users as $uid){ foreach($users as $uid){
user_remove($uid); user_remove($uid);
} }
notice( sprintf( tt("%s user deleted", "%s users deleted", count($users)), count($users)) ); notice(sprintf(tt("%s user deleted", "%s users deleted", count($users)), count($users)));
} }
if(x($_POST,'page_users_approve')) { if(x($_POST,'page_users_approve')) {
@ -1168,7 +1168,7 @@ function admin_page_users_post(&$a){
user_deny($hash); user_deny($hash);
} }
} }
goaway($a->get_baseurl(true) . '/admin/users' ); goaway('admin/users');
return; // NOTREACHED return; // NOTREACHED
} }
@ -1189,8 +1189,8 @@ function admin_page_users(&$a){
$uid = $a->argv[3]; $uid = $a->argv[3];
$user = q("SELECT username, blocked FROM `user` WHERE `uid`=%d", intval($uid)); $user = q("SELECT username, blocked FROM `user` WHERE `uid`=%d", intval($uid));
if(count($user)==0) { if(count($user)==0) {
notice( 'User not found' . EOL); notice('User not found'.EOL);
goaway($a->get_baseurl(true) . '/admin/users' ); goaway('admin/users');
return ''; // NOTREACHED return ''; // NOTREACHED
} }
switch($a->argv[2]){ switch($a->argv[2]){
@ -1200,18 +1200,18 @@ function admin_page_users(&$a){
require_once("include/Contact.php"); require_once("include/Contact.php");
user_remove($uid); user_remove($uid);
notice( sprintf(t("User '%s' deleted"), $user[0]['username']) . EOL); notice(sprintf(t("User '%s' deleted"), $user[0]['username']).EOL);
}; break; }; break;
case "block":{ case "block":{
check_form_security_token_redirectOnErr('/admin/users', 'admin_users', 't'); check_form_security_token_redirectOnErr('/admin/users', 'admin_users', 't');
q("UPDATE `user` SET `blocked`=%d WHERE `uid`=%s", q("UPDATE `user` SET `blocked`=%d WHERE `uid`=%s",
intval( 1-$user[0]['blocked'] ), intval(1-$user[0]['blocked']),
intval( $uid ) intval($uid)
); );
notice( sprintf( ($user[0]['blocked']?t("User '%s' unblocked"):t("User '%s' blocked")) , $user[0]['username']) . EOL); notice(sprintf(($user[0]['blocked']?t("User '%s' unblocked"):t("User '%s' blocked")) , $user[0]['username']).EOL);
}; break; }; break;
} }
goaway($a->get_baseurl(true) . '/admin/users' ); goaway('admin/users');
return ''; // NOTREACHED return ''; // NOTREACHED
} }
@ -1230,7 +1230,7 @@ function admin_page_users(&$a){
$a->set_pager_itemspage(100); $a->set_pager_itemspage(100);
} }
$users = q("SELECT `user` . * , `contact`.`name` , `contact`.`url` , `contact`.`micro`, `lastitem`.`lastitem_date`, `user`.`account_expired` $users = q("SELECT `user`.* , `contact`.`name` , `contact`.`url` , `contact`.`micro`, `lastitem`.`lastitem_date`, `user`.`account_expired`
FROM FROM
(SELECT MAX(`item`.`changed`) as `lastitem_date`, `item`.`uid` (SELECT MAX(`item`.`changed`) as `lastitem_date`, `item`.`uid`
FROM `item` FROM `item`
@ -1277,7 +1277,7 @@ function admin_page_users(&$a){
while(count($users)) { while(count($users)) {
$new_user = array(); $new_user = array();
foreach( array_pop($users) as $k => $v) { foreach(array_pop($users) as $k => $v) {
$k = str_replace('-','_',$k); $k = str_replace('-','_',$k);
$new_user[$k] = $v; $new_user[$k] = $v;
} }
@ -1303,7 +1303,7 @@ function admin_page_users(&$a){
'$select_all' => t('select all'), '$select_all' => t('select all'),
'$h_pending' => t('User registrations waiting for confirm'), '$h_pending' => t('User registrations waiting for confirm'),
'$h_deleted' => t('User waiting for permanent deletion'), '$h_deleted' => t('User waiting for permanent deletion'),
'$th_pending' => array( t('Request date'), t('Name'), t('Email') ), '$th_pending' => array(t('Request date'), t('Name'), t('Email')),
'$no_pending' => t('No registrations.'), '$no_pending' => t('No registrations.'),
'$approve' => t('Approve'), '$approve' => t('Approve'),
'$deny' => t('Deny'), '$deny' => t('Deny'),
@ -1315,8 +1315,8 @@ function admin_page_users(&$a){
'$h_users' => t('Users'), '$h_users' => t('Users'),
'$h_newuser' => t('New User'), '$h_newuser' => t('New User'),
'$th_deleted' => array( t('Name'), t('Email'), t('Register date'), t('Last login'), t('Last item'), t('Deleted since') ), '$th_deleted' => array(t('Name'), t('Email'), t('Register date'), t('Last login'), t('Last item'), t('Deleted since')),
'$th_users' => array( t('Name'), t('Email'), t('Register date'), t('Last login'), t('Last item'), t('Account') ), '$th_users' => array(t('Name'), t('Email'), t('Register date'), t('Last login'), t('Last item'), t('Account')),
'$confirm_delete_multi' => t('Selected users will be deleted!\n\nEverything these users had posted on this site will be permanently deleted!\n\nAre you sure?'), '$confirm_delete_multi' => t('Selected users will be deleted!\n\nEverything these users had posted on this site will be permanently deleted!\n\nAre you sure?'),
'$confirm_delete' => t('The user {0} will be deleted!\n\nEverything this user has posted on this site will be permanently deleted!\n\nAre you sure?'), '$confirm_delete' => t('The user {0} will be deleted!\n\nEverything this user has posted on this site will be permanently deleted!\n\nAre you sure?'),
@ -1362,7 +1362,7 @@ function admin_page_plugins(&$a){
if($a->argc == 3) { if($a->argc == 3) {
$plugin = $a->argv[2]; $plugin = $a->argv[2];
if(!is_file("addon/$plugin/$plugin.php")) { if(!is_file("addon/$plugin/$plugin.php")) {
notice( t("Item not found.") ); notice(t("Item not found."));
return ''; return '';
} }
@ -1374,14 +1374,14 @@ function admin_page_plugins(&$a){
if($idx !== false) { if($idx !== false) {
unset($a->plugins[$idx]); unset($a->plugins[$idx]);
uninstall_plugin($plugin); uninstall_plugin($plugin);
info( sprintf( t("Plugin %s disabled."), $plugin ) ); info(sprintf(t("Plugin %s disabled."), $plugin));
} else { } else {
$a->plugins[] = $plugin; $a->plugins[] = $plugin;
install_plugin($plugin); install_plugin($plugin);
info( sprintf( t("Plugin %s enabled."), $plugin ) ); info(sprintf(t("Plugin %s enabled."), $plugin));
} }
set_config("system","addon", implode(", ",$a->plugins)); set_config("system","addon", implode(", ",$a->plugins));
goaway($a->get_baseurl(true) . '/admin/plugins' ); goaway('admin/plugins');
return ''; // NOTREACHED return ''; // NOTREACHED
} }
@ -1480,7 +1480,7 @@ function admin_page_plugins(&$a){
'$function' => 'plugins', '$function' => 'plugins',
'$plugins' => $plugins, '$plugins' => $plugins,
'$pcount' => count($plugins), '$pcount' => count($plugins),
'$noplugshint' => sprintf( t('There are currently no plugins available on your node. You can find the official plugin repository at %1$s and might find other interesting plugins in the open plugin registry at %2$s'), 'https://github.com/friendica/friendica-addons', 'http://addons.friendi.ca'), '$noplugshint' => sprintf(t('There are currently no plugins available on your node. You can find the official plugin repository at %1$s and might find other interesting plugins in the open plugin registry at %2$s'), 'https://github.com/friendica/friendica-addons', 'http://addons.friendi.ca'),
'$form_security_token' => get_form_security_token("admin_themes"), '$form_security_token' => get_form_security_token("admin_themes"),
)); ));
} }
@ -1575,8 +1575,8 @@ function admin_page_themes(&$a){
if($files) { if($files) {
foreach($files as $file) { foreach($files as $file) {
$f = basename($file); $f = basename($file);
$is_experimental = intval(file_exists($file . '/experimental')); $is_experimental = intval(file_exists($file.'/experimental'));
$is_supported = 1-(intval(file_exists($file . '/unsupported'))); $is_supported = 1-(intval(file_exists($file.'/unsupported')));
$is_allowed = intval(in_array($f,$allowed_themes)); $is_allowed = intval(in_array($f,$allowed_themes));
if($is_allowed OR $is_supported OR get_config("system", "show_unsupported_themes")) if($is_allowed OR $is_supported OR get_config("system", "show_unsupported_themes"))
@ -1585,7 +1585,7 @@ function admin_page_themes(&$a){
} }
if(! count($themes)) { if(! count($themes)) {
notice( t('No themes found.')); notice(t('No themes found.'));
return ''; return '';
} }
@ -1596,7 +1596,7 @@ function admin_page_themes(&$a){
if($a->argc == 3) { if($a->argc == 3) {
$theme = $a->argv[2]; $theme = $a->argv[2];
if(! is_dir("view/theme/$theme")) { if(! is_dir("view/theme/$theme")) {
notice( t("Item not found.") ); notice(t("Item not found."));
return ''; return '';
} }
@ -1609,15 +1609,15 @@ function admin_page_themes(&$a){
$s = rebuild_theme_table($themes); $s = rebuild_theme_table($themes);
if($result) { if($result) {
install_theme($theme); install_theme($theme);
info( sprintf('Theme %s enabled.',$theme)); info(sprintf('Theme %s enabled.',$theme));
} }
else { else {
uninstall_theme($theme); uninstall_theme($theme);
info( sprintf('Theme %s disabled.',$theme)); info(sprintf('Theme %s disabled.',$theme));
} }
set_config('system','allowed_themes',$s); set_config('system','allowed_themes',$s);
goaway($a->get_baseurl(true) . '/admin/themes' ); goaway('admin/themes');
return ''; // NOTREACHED return ''; // NOTREACHED
} }
@ -1663,7 +1663,7 @@ function admin_page_themes(&$a){
$admin_form = __get_theme_admin_form($a, $theme); $admin_form = __get_theme_admin_form($a, $theme);
} }
$screenshot = array( get_theme_screenshot($theme), t('Screenshot')); $screenshot = array(get_theme_screenshot($theme), t('Screenshot'));
if(! stristr($screenshot[0],$theme)) if(! stristr($screenshot[0],$theme))
$screenshot = null; $screenshot = null;
@ -1754,8 +1754,8 @@ function admin_page_logs_post(&$a) {
set_config('system','loglevel', $loglevel); set_config('system','loglevel', $loglevel);
} }
info( t("Log settings updated.") ); info(t("Log settings updated."));
goaway($a->get_baseurl(true) . '/admin/logs' ); goaway('admin/logs');
return; // NOTREACHED return; // NOTREACHED
} }
@ -1803,7 +1803,7 @@ function admin_page_logs(&$a){
'$form_security_token' => get_form_security_token("admin_logs"), '$form_security_token' => get_form_security_token("admin_logs"),
'$phpheader' => t("PHP logging"), '$phpheader' => t("PHP logging"),
'$phphint' => t("To enable logging of PHP errors and warnings you can add the following to the .htconfig.php file of your installation. The filename set in the 'error_log' line is relative to the friendica top-level directory and must be writeable by the web server. The option '1' for 'log_errors' and 'display_errors' is to enable these options, set to '0' to disable them."), '$phphint' => t("To enable logging of PHP errors and warnings you can add the following to the .htconfig.php file of your installation. The filename set in the 'error_log' line is relative to the friendica top-level directory and must be writeable by the web server. The option '1' for 'log_errors' and 'display_errors' is to enable these options, set to '0' to disable them."),
'$phplogcode' => "error_reporting(E_ERROR | E_WARNING | E_PARSE );\nini_set('error_log','php.out');\nini_set('log_errors','1');\nini_set('display_errors', '1');", '$phplogcode' => "error_reporting(E_ERROR | E_WARNING | E_PARSE);\nini_set('error_log','php.out');\nini_set('log_errors','1');\nini_set('display_errors', '1');",
)); ));
} }
@ -1871,7 +1871,7 @@ function admin_page_features_post(&$a) {
check_form_security_token_redirectOnErr('/admin/features', 'admin_manage_features'); check_form_security_token_redirectOnErr('/admin/features', 'admin_manage_features');
logger('postvars: ' . print_r($_POST,true),LOGGER_DATA); logger('postvars: '.print_r($_POST,true),LOGGER_DATA);
$arr = array(); $arr = array();
$features = get_features(false); $features = get_features(false);
@ -1879,11 +1879,11 @@ function admin_page_features_post(&$a) {
foreach($features as $fname => $fdata) { foreach($features as $fname => $fdata) {
foreach(array_slice($fdata,1) as $f) { foreach(array_slice($fdata,1) as $f) {
$feature = $f[0]; $feature = $f[0];
$feature_state = 'feature_' . $feature; $feature_state = 'feature_'.$feature;
$featurelock = 'featurelock_' . $feature; $featurelock = 'featurelock_'.$feature;
if(x($_POST[$feature_state])) if(x($_POST[$feature_state]))
$val = intval($_POST['feature_' . $feature]); $val = intval($_POST['feature_'.$feature]);
else else
$val = 0; $val = 0;
set_config('feature',$feature,$val); set_config('feature',$feature,$val);
@ -1895,7 +1895,7 @@ function admin_page_features_post(&$a) {
} }
} }
goaway($a->get_baseurl(true) . '/admin/features' ); goaway('admin/features');
return; // NOTREACHED return; // NOTREACHED
} }
@ -1929,7 +1929,7 @@ function admin_page_features(&$a) {
$set = $f[3]; $set = $f[3];
$arr[$fname][1][] = array( $arr[$fname][1][] = array(
array('feature_' .$f[0],$f[1],$set,$f[2],array(t('Off'),t('On'))), array('feature_' .$f[0],$f[1],$set,$f[2],array(t('Off'),t('On'))),
array('featurelock_' .$f[0],sprintf( t('Lock feature %s'),$f[1]),(($f[4] !== false) ? "1" : ''),'',array(t('Off'),t('On'))) array('featurelock_' .$f[0],sprintf(t('Lock feature %s'),$f[1]),(($f[4] !== false) ? "1" : ''),'',array(t('Off'),t('On')))
); );
} }
} }

View file

@ -40,7 +40,7 @@ function common_content(&$a) {
$vcard_widget .= replace_macros(get_markup_template("vcard-widget.tpl"),array( $vcard_widget .= replace_macros(get_markup_template("vcard-widget.tpl"),array(
'$name' => htmlentities($c[0]['name']), '$name' => htmlentities($c[0]['name']),
'$photo' => $c[0]['photo'], '$photo' => $c[0]['photo'],
'url' => z_root() . '/contacts/' . $cid 'url' => 'contacts/' . $cid
)); ));
if(! x($a->page,'aside')) if(! x($a->page,'aside'))

View file

@ -44,7 +44,7 @@ function contacts_init(&$a) {
$vcard_widget = replace_macros(get_markup_template("vcard-widget.tpl"),array( $vcard_widget = replace_macros(get_markup_template("vcard-widget.tpl"),array(
'$name' => htmlentities($a->data['contact']['name']), '$name' => htmlentities($a->data['contact']['name']),
'$photo' => $a->data['contact']['photo'], '$photo' => $a->data['contact']['photo'],
'$url' => ($a->data['contact']['network'] == NETWORK_DFRN) ? z_root()."/redir/".$a->data['contact']['id'] : $a->data['contact']['url'], '$url' => ($a->data['contact']['network'] == NETWORK_DFRN) ? "redir/".$a->data['contact']['id'] : $a->data['contact']['url'],
'$addr' => (($a->data['contact']['addr'] != "") ? ($a->data['contact']['addr']) : ""), '$addr' => (($a->data['contact']['addr'] != "") ? ($a->data['contact']['addr']) : ""),
'$network_name' => $networkname, '$network_name' => $networkname,
'$network' => t('Network:'), '$network' => t('Network:'),
@ -129,9 +129,9 @@ function contacts_batch_actions(&$a){
} }
if(x($_SESSION,'return_url')) if(x($_SESSION,'return_url'))
goaway($a->get_baseurl(true) . '/' . $_SESSION['return_url']); goaway('' . $_SESSION['return_url']);
else else
goaway($a->get_baseurl(true) . '/contacts'); goaway('contacts');
} }
@ -157,7 +157,7 @@ function contacts_post(&$a) {
if(! count($orig_record)) { if(! count($orig_record)) {
notice( t('Could not access contact record.') . EOL); notice( t('Could not access contact record.') . EOL);
goaway($a->get_baseurl(true) . '/contacts'); goaway('contacts');
return; // NOTREACHED return; // NOTREACHED
} }
@ -366,19 +366,19 @@ function contacts_content(&$a) {
if(! count($orig_record)) { if(! count($orig_record)) {
notice( t('Could not access contact record.') . EOL); notice( t('Could not access contact record.') . EOL);
goaway($a->get_baseurl(true) . '/contacts'); goaway('contacts');
return; // NOTREACHED return; // NOTREACHED
} }
if($cmd === 'update') { if($cmd === 'update') {
_contact_update($contact_id); _contact_update($contact_id);
goaway($a->get_baseurl(true) . '/contacts/' . $contact_id); goaway('contacts/' . $contact_id);
// NOTREACHED // NOTREACHED
} }
if($cmd === 'updateprofile') { if($cmd === 'updateprofile') {
_contact_update_profile($contact_id); _contact_update_profile($contact_id);
goaway($a->get_baseurl(true) . '/crepair/' . $contact_id); goaway('crepair/' . $contact_id);
// NOTREACHED // NOTREACHED
} }
@ -389,7 +389,7 @@ function contacts_content(&$a) {
info((($blocked) ? t('Contact has been blocked') : t('Contact has been unblocked')).EOL); info((($blocked) ? t('Contact has been blocked') : t('Contact has been unblocked')).EOL);
} }
goaway($a->get_baseurl(true) . '/contacts/' . $contact_id); goaway('contacts/' . $contact_id);
return; // NOTREACHED return; // NOTREACHED
} }
@ -400,7 +400,7 @@ function contacts_content(&$a) {
info((($readonly) ? t('Contact has been ignored') : t('Contact has been unignored')).EOL); info((($readonly) ? t('Contact has been ignored') : t('Contact has been unignored')).EOL);
} }
goaway($a->get_baseurl(true) . '/contacts/' . $contact_id); goaway('contacts/' . $contact_id);
return; // NOTREACHED return; // NOTREACHED
} }
@ -412,7 +412,7 @@ function contacts_content(&$a) {
info((($archived) ? t('Contact has been archived') : t('Contact has been unarchived')).EOL); info((($archived) ? t('Contact has been archived') : t('Contact has been unarchived')).EOL);
} }
goaway($a->get_baseurl(true) . '/contacts/' . $contact_id); goaway('contacts/' . $contact_id);
return; // NOTREACHED return; // NOTREACHED
} }
@ -447,17 +447,17 @@ function contacts_content(&$a) {
// Now check how the user responded to the confirmation query // Now check how the user responded to the confirmation query
if($_REQUEST['canceled']) { if($_REQUEST['canceled']) {
if(x($_SESSION,'return_url')) if(x($_SESSION,'return_url'))
goaway($a->get_baseurl(true) . '/' . $_SESSION['return_url']); goaway('' . $_SESSION['return_url']);
else else
goaway($a->get_baseurl(true) . '/contacts'); goaway('contacts');
} }
_contact_drop($contact_id, $orig_record[0]); _contact_drop($contact_id, $orig_record[0]);
info( t('Contact has been removed.') . EOL ); info( t('Contact has been removed.') . EOL );
if(x($_SESSION,'return_url')) if(x($_SESSION,'return_url'))
goaway($a->get_baseurl(true) . '/' . $_SESSION['return_url']); goaway('' . $_SESSION['return_url']);
else else
goaway($a->get_baseurl(true) . '/contacts'); goaway('contacts');
return; // NOTREACHED return; // NOTREACHED
} }
if($cmd === 'posts') { if($cmd === 'posts') {
@ -575,7 +575,7 @@ function contacts_content(&$a) {
'$lbl_info1' => t('Contact Information / Notes'), '$lbl_info1' => t('Contact Information / Notes'),
'$infedit' => t('Edit contact notes'), '$infedit' => t('Edit contact notes'),
'$common_text' => $common_text, '$common_text' => $common_text,
'$common_link' => $a->get_baseurl(true) . '/common/loc/' . local_user() . '/' . $contact['id'], '$common_link' => 'common/loc/' . local_user() . '/' . $contact['id'],
'$all_friends' => $all_friends, '$all_friends' => $all_friends,
'$relation_text' => $relation_text, '$relation_text' => $relation_text,
'$visit' => sprintf( t('Visit %s\'s profile [%s]'),$contact['name'],$contact['url']), '$visit' => sprintf( t('Visit %s\'s profile [%s]'),$contact['name'],$contact['url']),
@ -668,7 +668,7 @@ function contacts_content(&$a) {
$tabs = array( $tabs = array(
array( array(
'label' => t('Suggestions'), 'label' => t('Suggestions'),
'url' => $a->get_baseurl(true) . '/suggest', 'url' => 'suggest',
'sel' => '', 'sel' => '',
'title' => t('Suggest potential friends'), 'title' => t('Suggest potential friends'),
'id' => 'suggestions-tab', 'id' => 'suggestions-tab',
@ -676,7 +676,7 @@ function contacts_content(&$a) {
), ),
array( array(
'label' => t('All Contacts'), 'label' => t('All Contacts'),
'url' => $a->get_baseurl(true) . '/contacts/all', 'url' => 'contacts/all',
'sel' => ($all) ? 'active' : '', 'sel' => ($all) ? 'active' : '',
'title' => t('Show all contacts'), 'title' => t('Show all contacts'),
'id' => 'showall-tab', 'id' => 'showall-tab',
@ -684,7 +684,7 @@ function contacts_content(&$a) {
), ),
array( array(
'label' => t('Unblocked'), 'label' => t('Unblocked'),
'url' => $a->get_baseurl(true) . '/contacts', 'url' => 'contacts',
'sel' => ((! $all) && (! $blocked) && (! $hidden) && (! $search) && (! $nets) && (! $ignored) && (! $archived)) ? 'active' : '', 'sel' => ((! $all) && (! $blocked) && (! $hidden) && (! $search) && (! $nets) && (! $ignored) && (! $archived)) ? 'active' : '',
'title' => t('Only show unblocked contacts'), 'title' => t('Only show unblocked contacts'),
'id' => 'showunblocked-tab', 'id' => 'showunblocked-tab',
@ -693,7 +693,7 @@ function contacts_content(&$a) {
array( array(
'label' => t('Blocked'), 'label' => t('Blocked'),
'url' => $a->get_baseurl(true) . '/contacts/blocked', 'url' => 'contacts/blocked',
'sel' => ($blocked) ? 'active' : '', 'sel' => ($blocked) ? 'active' : '',
'title' => t('Only show blocked contacts'), 'title' => t('Only show blocked contacts'),
'id' => 'showblocked-tab', 'id' => 'showblocked-tab',
@ -702,7 +702,7 @@ function contacts_content(&$a) {
array( array(
'label' => t('Ignored'), 'label' => t('Ignored'),
'url' => $a->get_baseurl(true) . '/contacts/ignored', 'url' => 'contacts/ignored',
'sel' => ($ignored) ? 'active' : '', 'sel' => ($ignored) ? 'active' : '',
'title' => t('Only show ignored contacts'), 'title' => t('Only show ignored contacts'),
'id' => 'showignored-tab', 'id' => 'showignored-tab',
@ -711,7 +711,7 @@ function contacts_content(&$a) {
array( array(
'label' => t('Archived'), 'label' => t('Archived'),
'url' => $a->get_baseurl(true) . '/contacts/archived', 'url' => 'contacts/archived',
'sel' => ($archived) ? 'active' : '', 'sel' => ($archived) ? 'active' : '',
'title' => t('Only show archived contacts'), 'title' => t('Only show archived contacts'),
'id' => 'showarchived-tab', 'id' => 'showarchived-tab',
@ -720,7 +720,7 @@ function contacts_content(&$a) {
array( array(
'label' => t('Hidden'), 'label' => t('Hidden'),
'url' => $a->get_baseurl(true) . '/contacts/hidden', 'url' => 'contacts/hidden',
'sel' => ($hidden) ? 'active' : '', 'sel' => ($hidden) ? 'active' : '',
'title' => t('Only show hidden contacts'), 'title' => t('Only show hidden contacts'),
'id' => 'showhidden-tab', 'id' => 'showhidden-tab',
@ -840,7 +840,7 @@ function contacts_tab($a, $contact_id, $active_tab) {
'accesskey' => 'd'); 'accesskey' => 'd');
$tabs[] = array('label' => t('Repair'), $tabs[] = array('label' => t('Repair'),
'url' => $a->get_baseurl(true) . '/crepair/' . $contact_id, 'url' => 'crepair/' . $contact_id,
'sel' => (($active_tab == 5)?'active':''), 'sel' => (($active_tab == 5)?'active':''),
'title' => t('Advanced Contact Settings'), 'title' => t('Advanced Contact Settings'),
'id' => 'repair-tab', 'id' => 'repair-tab',
@ -848,21 +848,21 @@ function contacts_tab($a, $contact_id, $active_tab) {
$tabs[] = array('label' => (($contact['blocked']) ? t('Unblock') : t('Block') ), $tabs[] = array('label' => (($contact['blocked']) ? t('Unblock') : t('Block') ),
'url' => $a->get_baseurl(true) . '/contacts/' . $contact_id . '/block', 'url' => 'contacts/' . $contact_id . '/block',
'sel' => '', 'sel' => '',
'title' => t('Toggle Blocked status'), 'title' => t('Toggle Blocked status'),
'id' => 'toggle-block-tab', 'id' => 'toggle-block-tab',
'accesskey' => 'b'); 'accesskey' => 'b');
$tabs[] = array('label' => (($contact['readonly']) ? t('Unignore') : t('Ignore') ), $tabs[] = array('label' => (($contact['readonly']) ? t('Unignore') : t('Ignore') ),
'url' => $a->get_baseurl(true) . '/contacts/' . $contact_id . '/ignore', 'url' => 'contacts/' . $contact_id . '/ignore',
'sel' => '', 'sel' => '',
'title' => t('Toggle Ignored status'), 'title' => t('Toggle Ignored status'),
'id' => 'toggle-ignore-tab', 'id' => 'toggle-ignore-tab',
'accesskey' => 'i'); 'accesskey' => 'i');
$tabs[] = array('label' => (($contact['archive']) ? t('Unarchive') : t('Archive') ), $tabs[] = array('label' => (($contact['archive']) ? t('Unarchive') : t('Archive') ),
'url' => $a->get_baseurl(true) . '/contacts/' . $contact_id . '/archive', 'url' => 'contacts/' . $contact_id . '/archive',
'sel' => '', 'sel' => '',
'title' => t('Toggle Archive status'), 'title' => t('Toggle Archive status'),
'id' => 'toggle-archive-tab', 'id' => 'toggle-archive-tab',

View file

@ -420,7 +420,7 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
if(($normalised != 'mailbox') && (x($a->contacts[$normalised]))) if(($normalised != 'mailbox') && (x($a->contacts[$normalised])))
$profile_avatar = $a->contacts[$normalised]['thumb']; $profile_avatar = $a->contacts[$normalised]['thumb'];
else else
$profile_avatar = ((strlen($item['author-avatar'])) ? $a->get_cached_avatar_image($item['author-avatar']) : $item['thumb']); $profile_avatar = $a->remove_baseurl(((strlen($item['author-avatar'])) ? $item['author-avatar'] : $item['thumb']));
$locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => ''); $locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => '');
call_hooks('render_location',$locate); call_hooks('render_location',$locate);
@ -615,7 +615,7 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
$comment_lastcollapsed = true; $comment_lastcollapsed = true;
} }
$redirect_url = $a->get_baseurl($ssl_state) . '/redir/' . $item['cid'] ; $redirect_url = 'redir/' . $item['cid'] ;
$lock = ((($item['private'] == 1) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) $lock = ((($item['private'] == 1) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid'])
|| strlen($item['deny_cid']) || strlen($item['deny_gid'])))) || strlen($item['deny_cid']) || strlen($item['deny_gid']))))
@ -791,7 +791,7 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
if(($normalised != 'mailbox') && (x($a->contacts,$normalised))) if(($normalised != 'mailbox') && (x($a->contacts,$normalised)))
$profile_avatar = $a->contacts[$normalised]['thumb']; $profile_avatar = $a->contacts[$normalised]['thumb'];
else else
$profile_avatar = (((strlen($item['author-avatar'])) && $diff_author) ? $item['author-avatar'] : $a->get_cached_avatar_image($thumb)); $profile_avatar = $a->remove_baseurl(((strlen($item['author-avatar']) && $diff_author) ? $item['author-avatar'] : $thumb));
$like = ((x($alike,$item['uri'])) ? format_like($alike[$item['uri']],$alike[$item['uri'] . '-l'],'like',$item['uri']) : ''); $like = ((x($alike,$item['uri'])) ? format_like($alike[$item['uri']],$alike[$item['uri'] . '-l'],'like',$item['uri']) : '');
$dislike = ((x($dlike,$item['uri'])) ? format_like($dlike[$item['uri']],$dlike[$item['uri'] . '-l'],'dislike',$item['uri']) : ''); $dislike = ((x($dlike,$item['uri'])) ? format_like($dlike[$item['uri']],$dlike[$item['uri'] . '-l'],'dislike',$item['uri']) : '');

View file

@ -104,7 +104,7 @@ function directory_content(&$a) {
$itemurl = (($rr['addr'] != "") ? $rr['addr'] : $rr['profile_url']); $itemurl = (($rr['addr'] != "") ? $rr['addr'] : $rr['profile_url']);
$profile_link = z_root() . '/profile/' . ((strlen($rr['nickname'])) ? $rr['nickname'] : $rr['profile_uid']); $profile_link = 'profile/' . ((strlen($rr['nickname'])) ? $rr['nickname'] : $rr['profile_uid']);
$pdesc = (($rr['pdesc']) ? $rr['pdesc'] . '<br />' : ''); $pdesc = (($rr['pdesc']) ? $rr['pdesc'] . '<br />' : '');
@ -165,7 +165,7 @@ function directory_content(&$a) {
'id' => $rr['id'], 'id' => $rr['id'],
'url' => $profile_link, 'url' => $profile_link,
'itemurl' => $itemurl, 'itemurl' => $itemurl,
'thumb' => proxy_url($a->get_cached_avatar_image($rr[$photo]), false, PROXY_SIZE_THUMB), 'thumb' => proxy_url($rr[$photo], false, PROXY_SIZE_THUMB),
'img_hover' => $rr['name'], 'img_hover' => $rr['name'],
'name' => $rr['name'], 'name' => $rr['name'],
'details' => $details, 'details' => $details,

View file

@ -13,7 +13,7 @@ function message_init(&$a) {
$new = array( $new = array(
'label' => t('New Message'), 'label' => t('New Message'),
'url' => $a->get_baseurl(true) . '/message/new', 'url' => 'message/new',
'sel'=> ($a->argv[1] == 'new'), 'sel'=> ($a->argv[1] == 'new'),
'accesskey' => 'm', 'accesskey' => 'm',
); );
@ -90,7 +90,7 @@ function message_post(&$a) {
$a->argv[1] = 'new'; $a->argv[1] = 'new';
} }
else else
goaway($a->get_baseurl(true) . '/' . $_SESSION['return_url']); goaway($_SESSION['return_url']);
} }
@ -182,7 +182,7 @@ function message_content(&$a) {
return; return;
} }
$myprofile = $a->get_baseurl(true) . '/profile/' . $a->user['nickname']; $myprofile = 'profile/' . $a->user['nickname'];
$tpl = get_markup_template('mail_head.tpl'); $tpl = get_markup_template('mail_head.tpl');
$header = replace_macros($tpl, array( $header = replace_macros($tpl, array(
@ -221,7 +221,7 @@ function message_content(&$a) {
} }
// Now check how the user responded to the confirmation query // Now check how the user responded to the confirmation query
if($_REQUEST['canceled']) { if($_REQUEST['canceled']) {
goaway($a->get_baseurl(true) . '/' . $_SESSION['return_url']); goaway($_SESSION['return_url']);
} }
$cmd = $a->argv[1]; $cmd = $a->argv[1];
@ -234,7 +234,7 @@ function message_content(&$a) {
info( t('Message deleted.') . EOL ); info( t('Message deleted.') . EOL );
} }
//goaway($a->get_baseurl(true) . '/message' ); //goaway($a->get_baseurl(true) . '/message' );
goaway($a->get_baseurl(true) . '/' . $_SESSION['return_url']); goaway($_SESSION['return_url']);
} }
else { else {
$r = q("SELECT `parent-uri`,`convid` FROM `mail` WHERE `id` = %d AND `uid` = %d LIMIT 1", $r = q("SELECT `parent-uri`,`convid` FROM `mail` WHERE `id` = %d AND `uid` = %d LIMIT 1",
@ -265,7 +265,7 @@ function message_content(&$a) {
info( t('Conversation removed.') . EOL ); info( t('Conversation removed.') . EOL );
} }
//goaway($a->get_baseurl(true) . '/message' ); //goaway($a->get_baseurl(true) . '/message' );
goaway($a->get_baseurl(true) . '/' . $_SESSION['return_url']); goaway($_SESSION['return_url']);
} }
} }
@ -448,7 +448,7 @@ function message_content(&$a) {
$sparkle = ''; $sparkle = '';
} }
else { else {
$from_url = $a->get_baseurl(true) . '/redir/' . $message['contact-id']; $from_url = 'redir/' . $message['contact-id'];
$sparkle = ' sparkle'; $sparkle = ' sparkle';
} }
@ -549,7 +549,7 @@ function render_messages($msg, $t) {
$tpl = get_markup_template($t); $tpl = get_markup_template($t);
$rslt = ''; $rslt = '';
$myprofile = $a->get_baseurl(true) . '/profile/' . $a->user['nickname']; $myprofile = 'profile/' . $a->user['nickname'];
foreach($msg as $rr) { foreach($msg as $rr) {
@ -577,7 +577,7 @@ function render_messages($msg, $t) {
$rslt .= replace_macros($tpl, array( $rslt .= replace_macros($tpl, array(
'$id' => $rr['id'], '$id' => $rr['id'],
'$from_name' => $participants, '$from_name' => $participants,
'$from_url' => (($rr['network'] === NETWORK_DFRN) ? $a->get_baseurl(true) . '/redir/' . $rr['contact-id'] : $rr['url']), '$from_url' => (($rr['network'] === NETWORK_DFRN) ? 'redir/' . $rr['contact-id'] : $rr['url']),
'$sparkle' => ' sparkle', '$sparkle' => ' sparkle',
'$from_photo' => (($rr['thumb']) ? $rr['thumb'] : $rr['from-photo']), '$from_photo' => (($rr['thumb']) ? $rr['thumb'] : $rr['from-photo']),
'$subject' => $subject_e, '$subject' => $subject_e,

View file

@ -149,10 +149,10 @@ function network_init(&$a) {
$a->page['aside'] .= (feature_enabled(local_user(),'groups') ? group_side('network/0','network','standard',$group_id) : ''); $a->page['aside'] .= (feature_enabled(local_user(),'groups') ? group_side('network/0','network','standard',$group_id) : '');
$a->page['aside'] .= (feature_enabled(local_user(),'forumlist_widget') ? ForumManager::widget(local_user(),$cid) : ''); $a->page['aside'] .= (feature_enabled(local_user(),'forumlist_widget') ? ForumManager::widget(local_user(),$cid) : '');
$a->page['aside'] .= posted_date_widget($a->get_baseurl() . '/network',local_user(),false); $a->page['aside'] .= posted_date_widget('network',local_user(),false);
$a->page['aside'] .= networks_widget($a->get_baseurl(true) . '/network',(x($_GET, 'nets') ? $_GET['nets'] : '')); $a->page['aside'] .= networks_widget('network',(x($_GET, 'nets') ? $_GET['nets'] : ''));
$a->page['aside'] .= saved_searches($search); $a->page['aside'] .= saved_searches($search);
$a->page['aside'] .= fileas_widget($a->get_baseurl(true) . '/network',(x($_GET, 'file') ? $_GET['file'] : '')); $a->page['aside'] .= fileas_widget('network',(x($_GET, 'file') ? $_GET['file'] : ''));
} }
@ -363,7 +363,7 @@ function network_content(&$a, $update = 0) {
$tabs = array( $tabs = array(
array( array(
'label' => t('Commented Order'), 'label' => t('Commented Order'),
'url' => $a->get_baseurl(true) . '/' . str_replace('/new', '', $cmd) . '?f=&order=comment' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : ''), 'url' => str_replace('/new', '', $cmd) . '?f=&order=comment' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : ''),
'sel' => $all_active, 'sel' => $all_active,
'title' => t('Sort by Comment Date'), 'title' => t('Sort by Comment Date'),
'id' => 'commented-order-tab', 'id' => 'commented-order-tab',
@ -371,7 +371,7 @@ function network_content(&$a, $update = 0) {
), ),
array( array(
'label' => t('Posted Order'), 'label' => t('Posted Order'),
'url' => $a->get_baseurl(true) . '/' . str_replace('/new', '', $cmd) . '?f=&order=post' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : ''), 'url' => str_replace('/new', '', $cmd) . '?f=&order=post' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : ''),
'sel' => $postord_active, 'sel' => $postord_active,
'title' => t('Sort by Post Date'), 'title' => t('Sort by Post Date'),
'id' => 'posted-order-tab', 'id' => 'posted-order-tab',
@ -382,7 +382,7 @@ function network_content(&$a, $update = 0) {
if(feature_enabled(local_user(),'personal_tab')) { if(feature_enabled(local_user(),'personal_tab')) {
$tabs[] = array( $tabs[] = array(
'label' => t('Personal'), 'label' => t('Personal'),
'url' => $a->get_baseurl(true) . '/' . str_replace('/new', '', $cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '/?f=') . '&conv=1', 'url' => str_replace('/new', '', $cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '/?f=') . '&conv=1',
'sel' => $conv_active, 'sel' => $conv_active,
'title' => t('Posts that mention or involve you'), 'title' => t('Posts that mention or involve you'),
'id' => 'personal-tab', 'id' => 'personal-tab',
@ -393,7 +393,7 @@ function network_content(&$a, $update = 0) {
if(feature_enabled(local_user(),'new_tab')) { if(feature_enabled(local_user(),'new_tab')) {
$tabs[] = array( $tabs[] = array(
'label' => t('New'), 'label' => t('New'),
'url' => $a->get_baseurl(true) . '/' . str_replace('/new', '', $cmd) . ($len_naked_cmd ? '/' : '') . 'new' . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : ''), 'url' => str_replace('/new', '', $cmd) . ($len_naked_cmd ? '/' : '') . 'new' . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : ''),
'sel' => $new_active, 'sel' => $new_active,
'title' => t('Activity Stream - by date'), 'title' => t('Activity Stream - by date'),
'id' => 'activitiy-by-date-tab', 'id' => 'activitiy-by-date-tab',
@ -404,7 +404,7 @@ function network_content(&$a, $update = 0) {
if(feature_enabled(local_user(),'link_tab')) { if(feature_enabled(local_user(),'link_tab')) {
$tabs[] = array( $tabs[] = array(
'label' => t('Shared Links'), 'label' => t('Shared Links'),
'url' => $a->get_baseurl(true) . '/' . str_replace('/new', '', $cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '/?f=') . '&bmark=1', 'url' => str_replace('/new', '', $cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '/?f=') . '&bmark=1',
'sel' => $bookmarked_active, 'sel' => $bookmarked_active,
'title' => t('Interesting Links'), 'title' => t('Interesting Links'),
'id' => 'shared-links-tab', 'id' => 'shared-links-tab',
@ -415,7 +415,7 @@ function network_content(&$a, $update = 0) {
if(feature_enabled(local_user(),'star_posts')) { if(feature_enabled(local_user(),'star_posts')) {
$tabs[] = array( $tabs[] = array(
'label' => t('Starred'), 'label' => t('Starred'),
'url' => $a->get_baseurl(true) . '/' . str_replace('/new', '', $cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '/?f=') . '&star=1', 'url' => str_replace('/new', '', $cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '/?f=') . '&star=1',
'sel' => $starred_active, 'sel' => $starred_active,
'title' => t('Favourite Posts'), 'title' => t('Favourite Posts'),
'id' => 'starred-posts-tab', 'id' => 'starred-posts-tab',
@ -547,7 +547,7 @@ function network_content(&$a, $update = 0) {
if($update) if($update)
killme(); killme();
notice( t('No such group') . EOL ); notice( t('No such group') . EOL );
goaway($a->get_baseurl(true) . '/network/0'); goaway('network/0');
// NOTREACHED // NOTREACHED
} }
@ -611,7 +611,7 @@ function network_content(&$a, $update = 0) {
} }
else { else {
notice( t('Invalid contact.') . EOL); notice( t('Invalid contact.') . EOL);
goaway($a->get_baseurl(true) . '/network'); goaway('network');
// NOTREACHED // NOTREACHED
} }
} }

View file

@ -49,12 +49,12 @@ function notifications_post(&$a) {
intval(local_user()) intval(local_user())
); );
} }
goaway($a->get_baseurl(true) . '/notifications/intros'); goaway('notifications/intros');
} }
if($_POST['submit'] == t('Ignore')) { if($_POST['submit'] == t('Ignore')) {
$r = q("UPDATE `intro` SET `ignore` = 1 WHERE `id` = %d", $r = q("UPDATE `intro` SET `ignore` = 1 WHERE `id` = %d",
intval($intro_id)); intval($intro_id));
goaway($a->get_baseurl(true) . '/notifications/intros'); goaway('notifications/intros');
} }
} }
} }
@ -79,37 +79,37 @@ function notifications_content(&$a) {
$tabs = array( $tabs = array(
array( array(
'label' => t('System'), 'label' => t('System'),
'url'=>$a->get_baseurl(true) . '/notifications/system', 'url'=>'notifications/system',
'sel'=> (($a->argv[1] == 'system') ? 'active' : ''), 'sel'=> (($a->argv[1] == 'system') ? 'active' : ''),
'accesskey' => 'y', 'accesskey' => 'y',
), ),
array( array(
'label' => t('Network'), 'label' => t('Network'),
'url'=>$a->get_baseurl(true) . '/notifications/network', 'url'=>'notifications/network',
'sel'=> (($a->argv[1] == 'network') ? 'active' : ''), 'sel'=> (($a->argv[1] == 'network') ? 'active' : ''),
'accesskey' => 'w', 'accesskey' => 'w',
), ),
array( array(
'label' => t('Personal'), 'label' => t('Personal'),
'url'=>$a->get_baseurl(true) . '/notifications/personal', 'url'=>'notifications/personal',
'sel'=> (($a->argv[1] == 'personal') ? 'active' : ''), 'sel'=> (($a->argv[1] == 'personal') ? 'active' : ''),
'accesskey' => 'r', 'accesskey' => 'r',
), ),
array( array(
'label' => t('Home'), 'label' => t('Home'),
'url' => $a->get_baseurl(true) . '/notifications/home', 'url' => 'notifications/home',
'sel'=> (($a->argv[1] == 'home') ? 'active' : ''), 'sel'=> (($a->argv[1] == 'home') ? 'active' : ''),
'accesskey' => 'h', 'accesskey' => 'h',
), ),
array( array(
'label' => t('Introductions'), 'label' => t('Introductions'),
'url' => $a->get_baseurl(true) . '/notifications/intros', 'url' => 'notifications/intros',
'sel'=> (($a->argv[1] == 'intros') ? 'active' : ''), 'sel'=> (($a->argv[1] == 'intros') ? 'active' : ''),
'accesskey' => 'i', 'accesskey' => 'i',
), ),
/*array( /*array(
'label' => t('Messages'), 'label' => t('Messages'),
'url' => $a->get_baseurl(true) . '/message', 'url' => 'message',
'sel'=> '', 'sel'=> '',
),*/ /*while I can have notifications for messages, this tablist is not place for message page link */ ),*/ /*while I can have notifications for messages, this tablist is not place for message page link */
); );

View file

@ -80,7 +80,7 @@ function photos_init(&$a) {
$entry = array( $entry = array(
'text' => $album['album'], 'text' => $album['album'],
'total' => $album['total'], 'total' => $album['total'],
'url' => z_root() . '/photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album['album']), 'url' => 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album['album']),
'urlencode' => urlencode($album['album']), 'urlencode' => urlencode($album['album']),
'bin2hex' => bin2hex($album['album']) 'bin2hex' => bin2hex($album['album'])
); );
@ -100,7 +100,7 @@ function photos_init(&$a) {
'$recent' => t('Recent Photos'), '$recent' => t('Recent Photos'),
'$albums' => $albums['albums'], '$albums' => $albums['albums'],
'$baseurl' => z_root(), '$baseurl' => z_root(),
'$upload' => array( t('Upload New Photos'), $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/upload'), '$upload' => array( t('Upload New Photos'), 'photos/' . $a->data['user']['nickname'] . '/upload'),
'$can_post' => $can_post '$can_post' => $can_post
)); ));
} }
@ -190,7 +190,7 @@ function photos_post(&$a) {
$album = hex2bin($a->argv[3]); $album = hex2bin($a->argv[3]);
if($album === t('Profile Photos') || $album === 'Contact Photos' || $album === t('Contact Photos')) { if($album === t('Profile Photos') || $album === 'Contact Photos' || $album === t('Contact Photos')) {
goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']); goaway($_SESSION['photo_return']);
return; // NOTREACHED return; // NOTREACHED
} }
@ -200,13 +200,13 @@ function photos_post(&$a) {
); );
if(! count($r)) { if(! count($r)) {
notice( t('Album not found.') . EOL); notice( t('Album not found.') . EOL);
goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']); goaway($_SESSION['photo_return']);
return; // NOTREACHED return; // NOTREACHED
} }
// Check if the user has responded to a delete confirmation query // Check if the user has responded to a delete confirmation query
if($_REQUEST['canceled']) { if($_REQUEST['canceled']) {
goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']); goaway($_SESSION['photo_return']);
} }
/* /*
@ -221,7 +221,7 @@ function photos_post(&$a) {
intval($page_owner_uid) intval($page_owner_uid)
); );
$newurl = str_replace(bin2hex($album),bin2hex($newalbum),$_SESSION['photo_return']); $newurl = str_replace(bin2hex($album),bin2hex($newalbum),$_SESSION['photo_return']);
goaway($a->get_baseurl() . '/' . $newurl); goaway($newurl);
return; // NOTREACHED return; // NOTREACHED
} }
@ -273,7 +273,7 @@ function photos_post(&$a) {
} }
} }
else { else {
goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']); goaway($_SESSION['photo_return']);
return; // NOTREACHED return; // NOTREACHED
} }
@ -309,14 +309,14 @@ function photos_post(&$a) {
} }
} }
} }
goaway($a->get_baseurl() . '/photos/' . $a->data['user']['nickname']); goaway('photos/' . $a->data['user']['nickname']);
return; // NOTREACHED return; // NOTREACHED
} }
// Check if the user has responded to a delete confirmation query for a single photo // Check if the user has responded to a delete confirmation query for a single photo
if(($a->argc > 2) && $_REQUEST['canceled']) { if(($a->argc > 2) && $_REQUEST['canceled']) {
goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']); goaway($_SESSION['photo_return']);
} }
if(($a->argc > 2) && (x($_POST,'delete')) && ($_POST['delete'] == t('Delete Photo'))) { if(($a->argc > 2) && (x($_POST,'delete')) && ($_POST['delete'] == t('Delete Photo'))) {
@ -379,7 +379,7 @@ function photos_post(&$a) {
} }
} }
goaway($a->get_baseurl() . '/photos/' . $a->data['user']['nickname']); goaway('photos/' . $a->data['user']['nickname']);
return; // NOTREACHED return; // NOTREACHED
} }
@ -718,12 +718,6 @@ function photos_post(&$a) {
$item_id = item_store($arr); $item_id = item_store($arr);
if($item_id) { if($item_id) {
//q("UPDATE `item` SET `plink` = '%s' WHERE `uid` = %d AND `id` = %d",
// dbesc($a->get_baseurl() . '/display/' . $owner_record['nickname'] . '/' . $item_id),
// intval($page_owner_uid),
// intval($item_id)
//);
proc_run('php',"include/notifier.php","tag","$item_id"); proc_run('php',"include/notifier.php","tag","$item_id");
} }
} }
@ -731,7 +725,7 @@ function photos_post(&$a) {
} }
} }
goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']); goaway($_SESSION['photo_return']);
return; // NOTREACHED return; // NOTREACHED
} }
@ -938,14 +932,6 @@ function photos_post(&$a) {
$item_id = item_store($arr); $item_id = item_store($arr);
//if($item_id) {
// q("UPDATE `item` SET `plink` = '%s' WHERE `uid` = %d AND `id` = %d",
// dbesc($a->get_baseurl() . '/display/' . $owner_record['nickname'] . '/' . $item_id),
// intval($page_owner_uid),
// intval($item_id)
// );
//}
if($visible) if($visible)
proc_run('php', "include/notifier.php", 'wall-new', $item_id); proc_run('php', "include/notifier.php", 'wall-new', $item_id);
@ -954,7 +940,7 @@ function photos_post(&$a) {
// addon uploaders should call "killme()" [e.g. exit] within the photo_post_end hook // addon uploaders should call "killme()" [e.g. exit] within the photo_post_end hook
// if they do not wish to be redirected // if they do not wish to be redirected
goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']); goaway($_SESSION['photo_return']);
// NOTREACHED // NOTREACHED
} }
@ -1125,7 +1111,7 @@ function photos_content(&$a) {
$uploader = ''; $uploader = '';
$ret = array('post_url' => $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'], $ret = array('post_url' => 'photos/' . $a->data['user']['nickname'],
'addon_text' => $uploader, 'addon_text' => $uploader,
'default_upload' => true); 'default_upload' => true);
@ -1267,15 +1253,15 @@ function photos_content(&$a) {
else { else {
if(($album !== t('Profile Photos')) && ($album !== 'Contact Photos') && ($album !== t('Contact Photos'))) { if(($album !== t('Profile Photos')) && ($album !== 'Contact Photos') && ($album !== t('Contact Photos'))) {
if($can_post) { if($can_post) {
$edit = array(t('Edit Album'), $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album) . '/edit'); $edit = array(t('Edit Album'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album) . '/edit');
} }
} }
} }
if($_GET['order'] === 'posted') if($_GET['order'] === 'posted')
$order = array(t('Show Newest First'), $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album)); $order = array(t('Show Newest First'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album));
else else
$order = array(t('Show Oldest First'), $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album) . '?f=&order=posted'); $order = array(t('Show Oldest First'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album) . '?f=&order=posted');
$photos = array(); $photos = array();
@ -1301,10 +1287,10 @@ function photos_content(&$a) {
$photos[] = array( $photos[] = array(
'id' => $rr['id'], 'id' => $rr['id'],
'twist' => ' ' . $twist . rand(2,4), 'twist' => ' ' . $twist . rand(2,4),
'link' => $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $rr['resource-id'] 'link' => 'photos/' . $a->data['user']['nickname'] . '/image/' . $rr['resource-id']
. (($_GET['order'] === 'posted') ? '?f=&order=posted' : ''), . (($_GET['order'] === 'posted') ? '?f=&order=posted' : ''),
'title' => t('View Photo'), 'title' => t('View Photo'),
'src' => $a->get_baseurl() . '/photo/' . $rr['resource-id'] . '-' . $rr['scale'] . '.' .$ext, 'src' => 'photo/' . $rr['resource-id'] . '-' . $rr['scale'] . '.' .$ext,
'alt' => $imgalt_e, 'alt' => $imgalt_e,
'desc'=> $desc_e, 'desc'=> $desc_e,
'ext' => $ext, 'ext' => $ext,
@ -1317,7 +1303,7 @@ function photos_content(&$a) {
'$photos' => $photos, '$photos' => $photos,
'$album' => $album, '$album' => $album,
'$can_post' => $can_post, '$can_post' => $can_post,
'$upload' => array(t('Upload New Photos'), $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/upload/' . bin2hex($album)), '$upload' => array(t('Upload New Photos'), 'photos/' . $a->data['user']['nickname'] . '/upload/' . bin2hex($album)),
'$order' => $order, '$order' => $order,
'$edit' => $edit '$edit' => $edit
)); ));
@ -1384,8 +1370,8 @@ function photos_content(&$a) {
} }
} }
$edit_suffix = ((($cmd === 'edit') && ($can_post)) ? '/edit' : ''); $edit_suffix = ((($cmd === 'edit') && ($can_post)) ? '/edit' : '');
$prevlink = $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $prvnxt[$prv]['resource-id'] . $edit_suffix . (($_GET['order'] === 'posted') ? '?f=&order=posted' : ''); $prevlink = 'photos/' . $a->data['user']['nickname'] . '/image/' . $prvnxt[$prv]['resource-id'] . $edit_suffix . (($_GET['order'] === 'posted') ? '?f=&order=posted' : '');
$nextlink = $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $prvnxt[$nxt]['resource-id'] . $edit_suffix . (($_GET['order'] === 'posted') ? '?f=&order=posted' : ''); $nextlink = 'photos/' . $a->data['user']['nickname'] . '/image/' . $prvnxt[$nxt]['resource-id'] . $edit_suffix . (($_GET['order'] === 'posted') ? '?f=&order=posted' : '');
} }
@ -1402,14 +1388,14 @@ function photos_content(&$a) {
} }
} }
$album_link = $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($ph[0]['album']); $album_link = 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($ph[0]['album']);
$tools = Null; $tools = Null;
$lock = Null; $lock = Null;
if($can_post && ($ph[0]['uid'] == $owner_uid)) { if($can_post && ($ph[0]['uid'] == $owner_uid)) {
$tools = array( $tools = array(
'edit' => array($a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $datum . (($cmd === 'edit') ? '' : '/edit'), (($cmd === 'edit') ? t('View photo') : t('Edit photo'))), 'edit' => array('photos/' . $a->data['user']['nickname'] . '/image/' . $datum . (($cmd === 'edit') ? '' : '/edit'), (($cmd === 'edit') ? t('View photo') : t('Edit photo'))),
'profile'=>array($a->get_baseurl() . '/profile_photo/use/'.$ph[0]['resource-id'], t('Use as profile photo')), 'profile'=>array('profile_photo/use/'.$ph[0]['resource-id'], t('Use as profile photo')),
); );
// lock // lock
@ -1433,9 +1419,9 @@ function photos_content(&$a) {
$prevlink = array($prevlink, '<div class="icon prev"></div>') ; $prevlink = array($prevlink, '<div class="icon prev"></div>') ;
$photo = array( $photo = array(
'href' => $a->get_baseurl() . '/photo/' . $hires['resource-id'] . '-' . $hires['scale'] . '.' . $phototypes[$hires['type']], 'href' => 'photo/' . $hires['resource-id'] . '-' . $hires['scale'] . '.' . $phototypes[$hires['type']],
'title'=> t('View Full Size'), 'title'=> t('View Full Size'),
'src' => $a->get_baseurl() . '/photo/' . $lores['resource-id'] . '-' . $lores['scale'] . '.' . $phototypes[$lores['type']] . '?f=&_u=' . datetime_convert('','','','ymdhis'), 'src' => 'photo/' . $lores['resource-id'] . '-' . $lores['scale'] . '.' . $phototypes[$lores['type']] . '?f=&_u=' . datetime_convert('','','','ymdhis'),
'height' => $hires['height'], 'height' => $hires['height'],
'width' => $hires['width'], 'width' => $hires['width'],
'album' => $hires['album'], 'album' => $hires['album'],
@ -1522,7 +1508,7 @@ function photos_content(&$a) {
} }
$tags = array(t('Tags: '), $tag_str); $tags = array(t('Tags: '), $tag_str);
if($cmd === 'edit') { if($cmd === 'edit') {
$tags[] = $a->get_baseurl() . '/tagrm/' . $link_item['id']; $tags[] = 'tagrm/' . $link_item['id'];
$tags[] = t('[Remove any tag]'); $tags[] = t('[Remove any tag]');
} }
} }
@ -1693,7 +1679,7 @@ function photos_content(&$a) {
if(((activity_match($item['verb'],ACTIVITY_LIKE)) || (activity_match($item['verb'],ACTIVITY_DISLIKE))) && ($item['id'] != $item['parent'])) if(((activity_match($item['verb'],ACTIVITY_LIKE)) || (activity_match($item['verb'],ACTIVITY_DISLIKE))) && ($item['id'] != $item['parent']))
continue; continue;
$redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ; $redirect_url = 'redir/' . $item['cid'] ;
if(local_user() && ($item['contact-uid'] == local_user()) if(local_user() && ($item['contact-uid'] == local_user())
@ -1880,12 +1866,12 @@ function photos_content(&$a) {
$photos[] = array( $photos[] = array(
'id' => $rr['id'], 'id' => $rr['id'],
'twist' => ' ' . $twist . rand(2,4), 'twist' => ' ' . $twist . rand(2,4),
'link' => $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $rr['resource-id'], 'link' => 'photos/' . $a->data['user']['nickname'] . '/image/' . $rr['resource-id'],
'title' => t('View Photo'), 'title' => t('View Photo'),
'src' => $a->get_baseurl() . '/photo/' . $rr['resource-id'] . '-' . ((($rr['scale']) == 6) ? 4 : $rr['scale']) . '.' . $ext, 'src' => 'photo/' . $rr['resource-id'] . '-' . ((($rr['scale']) == 6) ? 4 : $rr['scale']) . '.' . $ext,
'alt' => $alt_e, 'alt' => $alt_e,
'album' => array( 'album' => array(
'link' => $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($rr['album']), 'link' => 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($rr['album']),
'name' => $name_e, 'name' => $name_e,
'alt' => t('View Album'), 'alt' => t('View Album'),
), ),
@ -1898,7 +1884,7 @@ function photos_content(&$a) {
$o .= replace_macros($tpl, array( $o .= replace_macros($tpl, array(
'$title' => t('Recent Photos'), '$title' => t('Recent Photos'),
'$can_post' => $can_post, '$can_post' => $can_post,
'$upload' => array(t('Upload New Photos'), $a->get_baseurl().'/photos/'.$a->data['user']['nickname'].'/upload'), '$upload' => array(t('Upload New Photos'), 'photos/'.$a->data['user']['nickname'].'/upload'),
'$photos' => $photos, '$photos' => $photos,
)); ));

View file

@ -16,7 +16,7 @@ function profiles_init(&$a) {
); );
if(! count($r)) { if(! count($r)) {
notice( t('Profile not found.') . EOL); notice( t('Profile not found.') . EOL);
goaway($a->get_baseurl(true) . '/profiles'); goaway('profiles');
return; // NOTREACHED return; // NOTREACHED
} }
@ -34,9 +34,9 @@ function profiles_init(&$a) {
intval(local_user()) intval(local_user())
); );
if($r) if($r)
info( t('Profile deleted.') . EOL); info(t('Profile deleted.').EOL);
goaway($a->get_baseurl(true) . '/profiles'); goaway('profiles');
return; // NOTREACHED return; // NOTREACHED
} }
@ -73,9 +73,9 @@ function profiles_init(&$a) {
info( t('New profile created.') . EOL); info( t('New profile created.') . EOL);
if(count($r3) == 1) if(count($r3) == 1)
goaway($a->get_baseurl(true) . '/profiles/' . $r3[0]['id']); goaway('profiles/'.$r3[0]['id']);
goaway($a->get_baseurl(true) . '/profiles'); goaway('profiles');
} }
if(($a->argc > 2) && ($a->argv[1] === 'clone')) { if(($a->argc > 2) && ($a->argv[1] === 'clone')) {
@ -116,9 +116,9 @@ function profiles_init(&$a) {
); );
info( t('New profile created.') . EOL); info( t('New profile created.') . EOL);
if(count($r3) == 1) if(count($r3) == 1)
goaway($a->get_baseurl(true) . '/profiles/' . $r3[0]['id']); goaway('profiles/'.$r3[0]['id']);
goaway($a->get_baseurl(true) . '/profiles'); goaway('profiles');
return; // NOTREACHED return; // NOTREACHED
} }
@ -582,15 +582,7 @@ function profile_activity($changed, $value) {
$i = item_store($arr); $i = item_store($arr);
if($i) { if($i) {
// give it a permanent link
//q("update item set plink = '%s' where id = %d",
// dbesc($a->get_baseurl() . '/display/' . $a->user['nickname'] . '/' . $i),
// intval($i)
//);
proc_run('php',"include/notifier.php","activity","$i"); proc_run('php',"include/notifier.php","activity","$i");
} }
} }
@ -786,7 +778,7 @@ function profiles_content(&$a) {
); );
if(count($r)){ if(count($r)){
//Go to the default profile. //Go to the default profile.
goaway($a->get_baseurl(true) . '/profiles/'.$r[0]['id']); goaway('profiles/'.$r[0]['id']);
} }
} }
@ -807,12 +799,12 @@ function profiles_content(&$a) {
foreach($r as $rr) { foreach($r as $rr) {
$o .= replace_macros($tpl, array( $o .= replace_macros($tpl, array(
'$photo' => $a->get_cached_avatar_image($rr['thumb']), '$photo' => $a->remove_baseurl($rr['thumb']),
'$id' => $rr['id'], '$id' => $rr['id'],
'$alt' => t('Profile Image'), '$alt' => t('Profile Image'),
'$profile_name' => $rr['profile-name'], '$profile_name' => $rr['profile-name'],
'$visible' => (($rr['is-default']) ? '<strong>' . t('visible to everybody') . '</strong>' '$visible' => (($rr['is-default']) ? '<strong>' . t('visible to everybody') . '</strong>'
: '<a href="' . $a->get_baseurl(true) . '/profperm/' . $rr['id'] . '" />' . t('Edit visibility') . '</a>') : '<a href="'.'profperm/'.$rr['id'].'" />' . t('Edit visibility') . '</a>')
)); ));
} }
} }

View file

@ -147,7 +147,7 @@ function search_content(&$a) {
} }
$o .= search($search,'search-box','/search',((local_user()) ? true : false), false); $o .= search($search,'search-box','search',((local_user()) ? true : false), false);
if(strpos($search,'#') === 0) { if(strpos($search,'#') === 0) {
$tag = true; $tag = true;

View file

@ -39,7 +39,7 @@ function settings_init(&$a) {
$tabs = array( $tabs = array(
array( array(
'label' => t('Account'), 'label' => t('Account'),
'url' => $a->get_baseurl(true).'/settings', 'url' => 'settings',
'selected' => (($a->argc == 1) && ($a->argv[0] === 'settings')?'active':''), 'selected' => (($a->argc == 1) && ($a->argv[0] === 'settings')?'active':''),
'accesskey' => 'o', 'accesskey' => 'o',
), ),
@ -48,7 +48,7 @@ function settings_init(&$a) {
if(get_features()) { if(get_features()) {
$tabs[] = array( $tabs[] = array(
'label' => t('Additional features'), 'label' => t('Additional features'),
'url' => $a->get_baseurl(true).'/settings/features', 'url' => 'settings/features',
'selected' => (($a->argc > 1) && ($a->argv[1] === 'features') ? 'active' : ''), 'selected' => (($a->argc > 1) && ($a->argv[1] === 'features') ? 'active' : ''),
'accesskey' => 't', 'accesskey' => 't',
); );
@ -56,49 +56,49 @@ function settings_init(&$a) {
$tabs[] = array( $tabs[] = array(
'label' => t('Display'), 'label' => t('Display'),
'url' => $a->get_baseurl(true).'/settings/display', 'url' => 'settings/display',
'selected' => (($a->argc > 1) && ($a->argv[1] === 'display')?'active':''), 'selected' => (($a->argc > 1) && ($a->argv[1] === 'display')?'active':''),
'accesskey' => 'i', 'accesskey' => 'i',
); );
$tabs[] = array( $tabs[] = array(
'label' => t('Social Networks'), 'label' => t('Social Networks'),
'url' => $a->get_baseurl(true).'/settings/connectors', 'url' => 'settings/connectors',
'selected' => (($a->argc > 1) && ($a->argv[1] === 'connectors')?'active':''), 'selected' => (($a->argc > 1) && ($a->argv[1] === 'connectors')?'active':''),
'accesskey' => 'w', 'accesskey' => 'w',
); );
$tabs[] = array( $tabs[] = array(
'label' => t('Plugins'), 'label' => t('Plugins'),
'url' => $a->get_baseurl(true).'/settings/addon', 'url' => 'settings/addon',
'selected' => (($a->argc > 1) && ($a->argv[1] === 'addon')?'active':''), 'selected' => (($a->argc > 1) && ($a->argv[1] === 'addon')?'active':''),
'accesskey' => 'l', 'accesskey' => 'l',
); );
$tabs[] = array( $tabs[] = array(
'label' => t('Delegations'), 'label' => t('Delegations'),
'url' => $a->get_baseurl(true).'/delegate', 'url' => 'delegate',
'selected' => (($a->argc == 1) && ($a->argv[0] === 'delegate')?'active':''), 'selected' => (($a->argc == 1) && ($a->argv[0] === 'delegate')?'active':''),
'accesskey' => 'd', 'accesskey' => 'd',
); );
$tabs[] = array( $tabs[] = array(
'label' => t('Connected apps'), 'label' => t('Connected apps'),
'url' => $a->get_baseurl(true) . '/settings/oauth', 'url' => 'settings/oauth',
'selected' => (($a->argc > 1) && ($a->argv[1] === 'oauth')?'active':''), 'selected' => (($a->argc > 1) && ($a->argv[1] === 'oauth')?'active':''),
'accesskey' => 'b', 'accesskey' => 'b',
); );
$tabs[] = array( $tabs[] = array(
'label' => t('Export personal data'), 'label' => t('Export personal data'),
'url' => $a->get_baseurl(true) . '/uexport', 'url' => 'uexport',
'selected' => (($a->argc == 1) && ($a->argv[0] === 'uexport')?'active':''), 'selected' => (($a->argc == 1) && ($a->argv[0] === 'uexport')?'active':''),
'accesskey' => 'e', 'accesskey' => 'e',
); );
$tabs[] = array( $tabs[] = array(
'label' => t('Remove account'), 'label' => t('Remove account'),
'url' => $a->get_baseurl(true) . '/removeme', 'url' => 'removeme',
'selected' => (($a->argc == 1) && ($a->argv[0] === 'removeme')?'active':''), 'selected' => (($a->argc == 1) && ($a->argv[0] === 'removeme')?'active':''),
'accesskey' => 'r', 'accesskey' => 'r',
); );
@ -342,7 +342,7 @@ function settings_post(&$a) {
); );
call_hooks('display_settings_post', $_POST); call_hooks('display_settings_post', $_POST);
goaway($a->get_baseurl(true) . '/settings/display' ); goaway('settings/display' );
return; // NOTREACHED return; // NOTREACHED
} }
@ -351,7 +351,7 @@ function settings_post(&$a) {
if (x($_POST,'resend_relocate')) { if (x($_POST,'resend_relocate')) {
proc_run('php', 'include/notifier.php', 'relocate', local_user()); proc_run('php', 'include/notifier.php', 'relocate', local_user());
info(t("Relocate message has been send to your contacts")); info(t("Relocate message has been send to your contacts"));
goaway($a->get_baseurl(true) . '/settings'); goaway('settings');
} }
call_hooks('settings_post', $_POST); call_hooks('settings_post', $_POST);
@ -627,7 +627,7 @@ function settings_post(&$a) {
} }
goaway($a->get_baseurl(true) . '/settings' ); goaway('settings' );
return; // NOTREACHED return; // NOTREACHED
} }
@ -1152,7 +1152,7 @@ function settings_content(&$a) {
info( t('Profile is <strong>not published</strong>.') . EOL ); info( t('Profile is <strong>not published</strong>.') . EOL );
//$subdir = ((strlen($a->get_path())) ? '<br />' . t('or') . ' ' . $a->get_baseurl(true) . '/profile/' . $nickname : ''); //$subdir = ((strlen($a->get_path())) ? '<br />' . t('or') . ' ' . 'profile/' . $nickname : '');
$tpl_addr = get_markup_template("settings_nick_set.tpl"); $tpl_addr = get_markup_template("settings_nick_set.tpl");

View file

@ -6,54 +6,6 @@ function uexport_init(&$a){
require_once("mod/settings.php"); require_once("mod/settings.php");
settings_init($a); settings_init($a);
/*
$tabs = array(
array(
'label' => t('Account settings'),
'url' => $a->get_baseurl(true).'/settings',
'selected' => '',
),
array(
'label' => t('Display settings'),
'url' => $a->get_baseurl(true).'/settings/display',
'selected' =>'',
),
array(
'label' => t('Connector settings'),
'url' => $a->get_baseurl(true).'/settings/connectors',
'selected' => '',
),
array(
'label' => t('Plugin settings'),
'url' => $a->get_baseurl(true).'/settings/addon',
'selected' => '',
),
array(
'label' => t('Connected apps'),
'url' => $a->get_baseurl(true) . '/settings/oauth',
'selected' => '',
),
array(
'label' => t('Export personal data'),
'url' => $a->get_baseurl(true) . '/uexport',
'selected' => 'active'
),
array(
'label' => t('Remove account'),
'url' => $a->get_baseurl(true) . '/removeme',
'selected' => ''
)
);
$tabtpl = get_markup_template("generic_links_widget.tpl");
$a->page['aside'] = replace_macros($tabtpl, array(
'$title' => t('Settings'),
'$class' => 'settings-widget',
'$items' => $tabs,
));
*/
} }
function uexport_content(&$a){ function uexport_content(&$a){
@ -74,8 +26,8 @@ function uexport_content(&$a){
* list of array( 'link url', 'link text', 'help text' ) * list of array( 'link url', 'link text', 'help text' )
*/ */
$options = array( $options = array(
array('/uexport/account',t('Export account'),t('Export your account info and contacts. Use this to make a backup of your account and/or to move it to another server.')), array('uexport/account',t('Export account'),t('Export your account info and contacts. Use this to make a backup of your account and/or to move it to another server.')),
array('/uexport/backup',t('Export all'),t('Export your accout info, contacts and all your items as json. Could be a very big file, and could take a lot of time. Use this to make a full backup of your account (photos are not exported)')), array('uexport/backup',t('Export all'),t('Export your accout info, contacts and all your items as json. Could be a very big file, and could take a lot of time. Use this to make a full backup of your account (photos are not exported)')),
); );
call_hooks('uexport_options', $options); call_hooks('uexport_options', $options);
@ -172,7 +124,7 @@ function uexport_account($a){
*/ */
function uexport_all(&$a) { function uexport_all(&$a) {
uexport_account($a); uexport_account($a);
echo "\n"; echo "\n";
$r = q("SELECT count(*) as `total` FROM `item` WHERE `uid` = %d ", $r = q("SELECT count(*) as `total` FROM `item` WHERE `uid` = %d ",

View file

@ -50,7 +50,7 @@ class Item extends BaseObject {
$this->writable = ($this->get_data_value('writable') || $this->get_data_value('self')); $this->writable = ($this->get_data_value('writable') || $this->get_data_value('self'));
$ssl_state = ((local_user()) ? true : false); $ssl_state = ((local_user()) ? true : false);
$this->redirect_url = $a->get_baseurl($ssl_state) . '/redir/' . $this->get_data_value('cid') ; $this->redirect_url = 'redir/' . $this->get_data_value('cid') ;
if(get_config('system','thread_allow') && $a->theme_thread_allow && !$this->is_toplevel()) if(get_config('system','thread_allow') && $a->theme_thread_allow && !$this->is_toplevel())
$this->threaded = true; $this->threaded = true;
@ -119,9 +119,9 @@ class Item extends BaseObject {
$shareable = ((($conv->get_profile_owner() == local_user()) && ($item['private'] != 1)) ? true : false); $shareable = ((($conv->get_profile_owner() == local_user()) && ($item['private'] != 1)) ? true : false);
if(local_user() && link_compare($a->contact['url'],$item['author-link'])) { if(local_user() && link_compare($a->contact['url'],$item['author-link'])) {
if ($item["event-id"] != 0) if ($item["event-id"] != 0)
$edpost = array($a->get_baseurl($ssl_state)."/events/event/".$item['event-id'], t("Edit")); $edpost = array("events/event/".$item['event-id'], t("Edit"));
else else
$edpost = array($a->get_baseurl($ssl_state)."/editpost/".$item['id'], t("Edit")); $edpost = array("editpost/".$item['id'], t("Edit"));
} else } else
$edpost = false; $edpost = false;
if(($this->get_data_value('uid') == local_user()) || $this->is_visiting()) if(($this->get_data_value('uid') == local_user()) || $this->is_visiting())
@ -154,13 +154,13 @@ class Item extends BaseObject {
if(($normalised != 'mailbox') && (x($a->contacts,$normalised))) if(($normalised != 'mailbox') && (x($a->contacts,$normalised)))
$profile_avatar = $a->contacts[$normalised]['thumb']; $profile_avatar = $a->contacts[$normalised]['thumb'];
else else
$profile_avatar = (((strlen($item['author-avatar'])) && $diff_author) ? $item['author-avatar'] : $a->get_cached_avatar_image($this->get_data_value('thumb'))); $profile_avatar = (((strlen($item['author-avatar'])) && $diff_author) ? $item['author-avatar'] : $a->remove_baseurl($this->get_data_value('thumb')));
$locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => ''); $locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => '');
call_hooks('render_location',$locate); call_hooks('render_location',$locate);
$location = ((strlen($locate['html'])) ? $locate['html'] : render_location_dummy($locate)); $location = ((strlen($locate['html'])) ? $locate['html'] : render_location_dummy($locate));
$searchpath = $a->get_baseurl()."/search?tag="; $searchpath = "search?tag=";
$tags=array(); $tags=array();
$hashtags = array(); $hashtags = array();
$mentions = array(); $mentions = array();
@ -703,9 +703,9 @@ class Item extends BaseObject {
'$parent' => $this->get_id(), '$parent' => $this->get_id(),
'$qcomment' => $qcomment, '$qcomment' => $qcomment,
'$profile_uid' => $conv->get_profile_owner(), '$profile_uid' => $conv->get_profile_owner(),
'$mylink' => $a->contact['url'], '$mylink' => $a->remove_baseurl($a->contact['url']),
'$mytitle' => t('This is you'), '$mytitle' => t('This is you'),
'$myphoto' => $a->contact['thumb'], '$myphoto' => $a->remove_baseurl($a->contact['thumb']),
'$comment' => t('Comment'), '$comment' => t('Comment'),
'$submit' => t('Submit'), '$submit' => t('Submit'),
'$edbold' => t('Bold'), '$edbold' => t('Bold'),

View file

@ -2,17 +2,17 @@
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<base href="{{$baseurl}}/" /> <base href="{{$baseurl}}/" />
<meta name="generator" content="{{$generator}}" /> <meta name="generator" content="{{$generator}}" />
<link rel="stylesheet" href="{{$baseurl}}/view/global.css" type="text/css" media="all" /> <link rel="stylesheet" href="view/global.css" type="text/css" media="all" />
<link rel="stylesheet" href="{{$baseurl}}/library/colorbox/colorbox.css" type="text/css" media="screen" /> <link rel="stylesheet" href="library/colorbox/colorbox.css" type="text/css" media="screen" />
<link rel="stylesheet" href="{{$baseurl}}/library/jgrowl/jquery.jgrowl.css" type="text/css" media="screen" /> <link rel="stylesheet" href="library/jgrowl/jquery.jgrowl.css" type="text/css" media="screen" />
<link rel="stylesheet" href="{{$baseurl}}/library/datetimepicker/jquery.datetimepicker.css" type="text/css" media="screen" /> <link rel="stylesheet" href="library/datetimepicker/jquery.datetimepicker.css" type="text/css" media="screen" />
<link rel="stylesheet" href="{{$baseurl}}/library/perfect-scrollbar/perfect-scrollbar.min.css" type="text/css" media="screen" /> <link rel="stylesheet" href="library/perfect-scrollbar/perfect-scrollbar.min.css" type="text/css" media="screen" />
<link rel="stylesheet" type="text/css" href="{{$stylesheet}}" media="all" /> <link rel="stylesheet" type="text/css" href="{{$stylesheet}}" media="all" />
<!-- <!--
<link rel="shortcut icon" href="{{$baseurl}}/images/friendica-32.png" /> <link rel="shortcut icon" href="images/friendica-32.png" />
<link rel="apple-touch-icon" href="{{$baseurl}}/images/friendica-128.png"/> <link rel="apple-touch-icon" href="images/friendica-128.png"/>
--> -->
<link rel="shortcut icon" href="{{$shortcut_icon}}" /> <link rel="shortcut icon" href="{{$shortcut_icon}}" />
<link rel="apple-touch-icon" href="{{$touch_icon}}"/> <link rel="apple-touch-icon" href="{{$touch_icon}}"/>
@ -28,20 +28,20 @@
<!--[if IE]> <!--[if IE]>
<script type="text/javascript" src="https://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <script type="text/javascript" src="https://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]--> <![endif]-->
<script type="text/javascript" src="{{$baseurl}}/js/modernizr.js" ></script> <script type="text/javascript" src="js/modernizr.js" ></script>
<script type="text/javascript" src="{{$baseurl}}/js/jquery.js" ></script> <script type="text/javascript" src="js/jquery.js" ></script>
<!-- <script type="text/javascript" src="{{$baseurl}}/js/jquery-migrate.js" ></script>--> <!-- <script type="text/javascript" src="js/jquery-migrate.js" ></script>-->
<script type="text/javascript" src="{{$baseurl}}/js/jquery-migrate.js" ></script> <script type="text/javascript" src="js/jquery-migrate.js" ></script>
<script type="text/javascript" src="{{$baseurl}}/js/jquery.textinputs.js" ></script> <script type="text/javascript" src="js/jquery.textinputs.js" ></script>
<script type="text/javascript" src="{{$baseurl}}/js/fk.autocomplete.js" ></script> <script type="text/javascript" src="js/fk.autocomplete.js" ></script>
<script type="text/javascript" src="{{$baseurl}}/library/colorbox/jquery.colorbox-min.js"></script> <script type="text/javascript" src="library/colorbox/jquery.colorbox-min.js"></script>
<script type="text/javascript" src="{{$baseurl}}/library/jgrowl/jquery.jgrowl_minimized.js"></script> <script type="text/javascript" src="library/jgrowl/jquery.jgrowl_minimized.js"></script>
<script type="text/javascript" src="{{$baseurl}}/library/datetimepicker/jquery.datetimepicker.js"></script> <script type="text/javascript" src="library/datetimepicker/jquery.datetimepicker.js"></script>
<script type="text/javascript" src="{{$baseurl}}/library/tinymce/jscripts/tiny_mce/tiny_mce_src.js" ></script> <script type="text/javascript" src="library/tinymce/jscripts/tiny_mce/tiny_mce_src.js" ></script>
<script type="text/javascript" src="{{$baseurl}}/library/perfect-scrollbar/perfect-scrollbar.jquery.js" ></script> <script type="text/javascript" src="library/perfect-scrollbar/perfect-scrollbar.jquery.js" ></script>
<script type="text/javascript" src="{{$baseurl}}/js/acl.js" ></script> <script type="text/javascript" src="js/acl.js" ></script>
<script type="text/javascript" src="{{$baseurl}}/js/webtoolkit.base64.js" ></script> <script type="text/javascript" src="js/webtoolkit.base64.js" ></script>
<script type="text/javascript" src="{{$baseurl}}/js/main.js" ></script> <script type="text/javascript" src="js/main.js" ></script>
<script> <script>
var updateInterval = {{$update_interval}}; var updateInterval = {{$update_interval}};

View file

@ -4,7 +4,7 @@
{{foreach $options as $o}} {{foreach $options as $o}}
<dl> <dl>
<dt><a href="{{$baseurl}}/{{$o.0}}">{{$o.1}}</a></dt> <dt><a href="{{$o.0}}">{{$o.1}}</a></dt>
<dd>{{$o.2}}</dd> <dd>{{$o.2}}</dd>
</dl> </dl>
{{/foreach}} {{/foreach}}

View file

@ -1432,8 +1432,8 @@ section.minimal {
} }
.children .wall-item-container .wall-item-item .wall-item-content img { .children .wall-item-container .wall-item-item .wall-item-content img {
/* max-width: 650px; */ /* max-width: 650px; */
/* max-width: 580px; */ max-width: 520px;
max-width: 100%; /* max-width: 100%; */
} }
.wall-item-container .wall-item-links, .wall-item-container .wall-item-actions { .wall-item-container .wall-item-links, .wall-item-container .wall-item-actions {
display: table-cell; display: table-cell;

View file

@ -19,8 +19,6 @@ function vier_init(&$a) {
set_template_engine($a, 'smarty3'); set_template_engine($a, 'smarty3');
$baseurl = $a->get_baseurl();
$a->theme_info = array(); $a->theme_info = array();
if ($a->argv[0].$a->argv[1] === "profile".$a->user['nickname'] or $a->argv[0] === "network" && local_user()) { if ($a->argv[0].$a->argv[1] === "profile".$a->user['nickname'] or $a->argv[0] === "network" && local_user()) {
@ -160,7 +158,7 @@ function vier_community_info() {
$entry = replace_macros($tpl,array( $entry = replace_macros($tpl,array(
'$id' => $rr['id'], '$id' => $rr['id'],
//'$profile_link' => zrl($rr['url']), //'$profile_link' => zrl($rr['url']),
'$profile_link' => $a->get_baseurl().'/follow/?url='.urlencode($rr['url']), '$profile_link' => 'follow/?url='.urlencode($rr['url']),
'$photo' => proxy_url($rr['photo'], false, PROXY_SIZE_MICRO), '$photo' => proxy_url($rr['photo'], false, PROXY_SIZE_MICRO),
'$alt_text' => $rr['name'], '$alt_text' => $rr['name'],
)); ));
@ -186,11 +184,11 @@ function vier_community_info() {
$aside['$lastusers_items'] = array(); $aside['$lastusers_items'] = array();
foreach($r as $rr) { foreach($r as $rr) {
$profile_link = $a->get_baseurl() . '/profile/' . ((strlen($rr['nickname'])) ? $rr['nickname'] : $rr['profile_uid']); $profile_link = 'profile/' . ((strlen($rr['nickname'])) ? $rr['nickname'] : $rr['profile_uid']);
$entry = replace_macros($tpl,array( $entry = replace_macros($tpl,array(
'$id' => $rr['id'], '$id' => $rr['id'],
'$profile_link' => $profile_link, '$profile_link' => $profile_link,
'$photo' => $a->get_cached_avatar_image($rr['thumb']), '$photo' => $a->remove_baseurl($rr['thumb']),
'$alt_text' => $rr['name'])); '$alt_text' => $rr['name']));
$aside['$lastusers_items'][] = $entry; $aside['$lastusers_items'][] = $entry;
} }
@ -207,7 +205,7 @@ function vier_community_info() {
$nv['suggest'] = Array('suggest', t('Friend Suggestions'), "", ""); $nv['suggest'] = Array('suggest', t('Friend Suggestions'), "", "");
$nv['invite'] = Array('invite', t('Invite Friends'), "", ""); $nv['invite'] = Array('invite', t('Invite Friends'), "", "");
$nv['search'] = '<form name="simple_bar" method="get" action="'.$a->get_baseurl().'/dirfind"> $nv['search'] = '<form name="simple_bar" method="get" action="dirfind">
<span class="sbox_l"></span> <span class="sbox_l"></span>
<span class="sbox"> <span class="sbox">
<input type="text" name="search" size="13" maxlength="50"> <input type="text" name="search" size="13" maxlength="50">
@ -241,12 +239,12 @@ function vier_community_info() {
$selected = (($cid == $contact['id']) ? ' forum-selected' : ''); $selected = (($cid == $contact['id']) ? ' forum-selected' : '');
$entry = array( $entry = array(
'url' => z_root() . '/network?f=&cid=' . $contact['id'], 'url' => 'network?f=&cid=' . $contact['id'],
'external_url' => z_root() . '/redir/' . $contact['id'], 'external_url' => 'redir/' . $contact['id'],
'name' => $contact['name'], 'name' => $contact['name'],
'cid' => $contact['id'], 'cid' => $contact['id'],
'selected' => $selected, 'selected' => $selected,
'micro' => proxy_url($contact['micro'], false, PROXY_SIZE_MICRO), 'micro' => App::remove_baseurl(proxy_url($contact['micro'], false, PROXY_SIZE_MICRO)),
'id' => ++$id, 'id' => ++$id,
); );
$entries[] = $entry; $entries[] = $entry;