aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-08-30 18:17:38 -0700
committerfriendica <info@friendica.com>2012-08-30 18:17:38 -0700
commiteac29badb2fade43dfe3fd6373ffc675858143dd (patch)
treeecf3ec6007a22a755900c46a4bc1e4862cc08d06
parentf6d198ce5dcd9fe416975ff760439dfacbb83812 (diff)
downloadvolse-hubzilla-eac29badb2fade43dfe3fd6373ffc675858143dd.tar.gz
volse-hubzilla-eac29badb2fade43dfe3fd6373ffc675858143dd.tar.bz2
volse-hubzilla-eac29badb2fade43dfe3fd6373ffc675858143dd.zip
start on contacts/profiles
-rw-r--r--boot.php16
-rw-r--r--database.sql17
-rw-r--r--include/api.php2
-rw-r--r--include/identity.php2
-rw-r--r--include/text.php2
-rw-r--r--include/user.php2
-rw-r--r--mod/dfrn_confirm.php8
-rw-r--r--mod/directory.php14
-rw-r--r--mod/hcard.php1
-rw-r--r--mod/match.php2
-rw-r--r--mod/msearch.php4
-rw-r--r--mod/poco.php6
-rw-r--r--mod/profile_photo.php6
-rw-r--r--mod/profiles.php35
-rw-r--r--mod/profperm.php2
-rw-r--r--mod/regmod.php4
-rw-r--r--mod/settings.php23
-rw-r--r--mod/viewcontacts.php2
-rw-r--r--mod/viewsrc.php16
-rw-r--r--mod/zfinger.php16
-rw-r--r--update.php2
-rw-r--r--version.inc2
-rw-r--r--view/theme/diabook/directory_item.tpl4
-rw-r--r--view/theme/diabook/profile_vcard.tpl4
-rw-r--r--view/theme/diabook/theme.php2
-rw-r--r--view/theme/dispy/profile_vcard.tpl4
-rw-r--r--view/theme/quattro/tpl/profile_vcard.tpl4
-rw-r--r--view/tpl/profile_vcard.tpl4
28 files changed, 102 insertions, 104 deletions
diff --git a/boot.php b/boot.php
index 98855971e..c9430f753 100644
--- a/boot.php
+++ b/boot.php
@@ -1083,7 +1083,7 @@ function profile_load(&$a, $nickname, $profile = 0) {
if((! $r) && (! count($r))) {
$r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `entity`.* FROM `profile`
left join `contact` on `contact`.`uid` = `profile`.`uid` LEFT JOIN `entity` ON `profile`.`uid` = entity.entity_id
- WHERE entity.entity_address = '%s' AND `profile`.`is-default` = 1 and `contact`.`self` = 1 LIMIT 1",
+ WHERE entity.entity_address = '%s' AND `profile`.`is_default` = 1 and `contact`.`self` = 1 LIMIT 1",
dbesc($nickname)
);
}
@@ -1097,8 +1097,8 @@ function profile_load(&$a, $nickname, $profile = 0) {
// fetch user tags if this isn't the default profile
- if(! $r[0]['is-default']) {
- $x = q("select `pub_keywords` from `profile` where uid = %d and `is-default` = 1 limit 1",
+ if(! $r[0]['is_default']) {
+ $x = q("select `pub_keywords` from `profile` where uid = %d and `is_default` = 1 limit 1",
intval($profile_uid)
);
if($x && count($x))
@@ -1213,7 +1213,7 @@ if(! function_exists('profile_sidebar')) {
'id' => $rr['id'],
'alt' => t('Profile Image'),
'profile_name' => $rr['profile_name'],
- 'isdefault' => $rr['is-default'],
+ 'isdefault' => $rr['is_default'],
'visibile_to_everybody' => t('visible to everybody'),
'edit_visibility' => t('Edit visibility'),
@@ -1232,8 +1232,8 @@ if(! function_exists('profile_sidebar')) {
if((x($profile,'address') == 1)
|| (x($profile,'locality') == 1)
|| (x($profile,'region') == 1)
- || (x($profile,'postal-code') == 1)
- || (x($profile,'country-name') == 1))
+ || (x($profile,'postal_code') == 1)
+ || (x($profile,'country_name') == 1))
$location = t('Location:');
$gender = ((x($profile,'gender') == 1) ? t('Gender:') : False);
@@ -1253,7 +1253,7 @@ if(! function_exists('profile_sidebar')) {
$diaspora = array(
'podloc' => $a->get_baseurl(),
- 'searchable' => (($profile['publish'] && $profile['net-publish']) ? 'true' : 'false' ),
+ 'searchable' => (($profile['publish']) ? 'true' : 'false' ),
'nickname' => $profile['nickname'],
'fullname' => $profile['name'],
'firstname' => $firstname,
@@ -1577,7 +1577,7 @@ if(! function_exists('feed_birthday')) {
if(! strlen($tz))
$tz = 'UTC';
- $p = q("SELECT `dob` FROM `profile` WHERE `is-default` = 1 AND `uid` = %d LIMIT 1",
+ $p = q("SELECT `dob` FROM `profile` WHERE `is_default` = 1 AND `uid` = %d LIMIT 1",
intval($uid)
);
diff --git a/database.sql b/database.sql
index 08832af11..d96b7b554 100644
--- a/database.sql
+++ b/database.sql
@@ -700,16 +700,16 @@ CREATE TABLE IF NOT EXISTS `profile` (
`aid` int(10) unsigned NOT NULL DEFAULT '0',
`uid` int(11) NOT NULL,
`profile_name` char(255) NOT NULL,
- `is-default` tinyint(1) NOT NULL DEFAULT '0',
- `hide-friends` tinyint(1) NOT NULL DEFAULT '0',
+ `is_default` tinyint(1) NOT NULL DEFAULT '0',
+ `hide_friends` tinyint(1) NOT NULL DEFAULT '0',
`name` char(255) NOT NULL,
`pdesc` char(255) NOT NULL,
`dob` char(32) NOT NULL DEFAULT '0000-00-00',
`address` char(255) NOT NULL,
`locality` char(255) NOT NULL,
`region` char(255) NOT NULL,
- `postal-code` char(32) NOT NULL,
- `country-name` char(255) NOT NULL,
+ `postal_code` char(32) NOT NULL,
+ `country_name` char(255) NOT NULL,
`hometown` char(255) NOT NULL,
`gender` char(32) NOT NULL,
`marital` char(255) NOT NULL,
@@ -737,20 +737,19 @@ CREATE TABLE IF NOT EXISTS `profile` (
`photo` char(255) NOT NULL,
`thumb` char(255) NOT NULL,
`publish` tinyint(1) NOT NULL DEFAULT '0',
- `net-publish` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `uid` (`uid`),
- KEY `is-default` (`is-default`),
KEY `locality` (`locality`),
- KEY `postal-code` (`postal-code`),
- KEY `country-name` (`country-name`),
KEY `hometown` (`hometown`),
KEY `gender` (`gender`),
KEY `marital` (`marital`),
KEY `sexual` (`sexual`),
KEY `publish` (`publish`),
- KEY `net-publish` (`net-publish`),
KEY `aid` (`aid`),
+ KEY `is_default` (`is_default`),
+ KEY `hide_friends` (`hide_friends`),
+ KEY `postal_code` (`postal_code`),
+ KEY `country_name` (`country_name`),
FULLTEXT KEY `pub_keywords` (`pub_keywords`),
FULLTEXT KEY `prv_keywords` (`prv_keywords`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
diff --git a/include/api.php b/include/api.php
index 296fba1a7..b63ae0fee 100644
--- a/include/api.php
+++ b/include/api.php
@@ -261,7 +261,7 @@
$usr = q("select * from user where uid = %d limit 1",
intval(local_user())
);
- $profile = q("select * from profile where uid = %d and `is-default` = 1 limit 1",
+ $profile = q("select * from profile where uid = %d and `is_default` = 1 limit 1",
intval(local_user())
);
diff --git a/include/identity.php b/include/identity.php
index a1bf4196b..9f262f1c0 100644
--- a/include/identity.php
+++ b/include/identity.php
@@ -101,7 +101,7 @@ function create_identity($arr) {
$newuid = $ret['entity']['entity_id'];
- $r = q("INSERT INTO `profile` ( `uid`, `profile_name`, `is-default`, `name`, `photo`, `thumb`)
+ $r = q("INSERT INTO `profile` ( `uid`, `profile_name`, `is_default`, `name`, `photo`, `thumb`)
VALUES ( %d, '%s', %d, '%s', '%s', '%s') ",
intval($ret['entity']['entity_id']),
t('default'),
diff --git a/include/text.php b/include/text.php
index a1b718d44..0b4ed6ee6 100644
--- a/include/text.php
+++ b/include/text.php
@@ -528,7 +528,7 @@ function contact_block() {
if($shown == 0)
return;
- if((! is_array($a->profile)) || ($a->profile['hide-friends']))
+ if((! is_array($a->profile)) || ($a->profile['hide_friends']))
return $o;
$r = q("SELECT COUNT(*) AS `total` FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 and `pending` = 0 AND `hidden` = 0 AND `archive` = 0",
intval($a->profile['uid'])
diff --git a/include/user.php b/include/user.php
index 502384261..6514b269a 100644
--- a/include/user.php
+++ b/include/user.php
@@ -213,7 +213,7 @@ function create_user($arr) {
}
if(x($newuid) !== false) {
- $r = q("INSERT INTO `profile` ( `uid`, `profile_name`, `is-default`, `name`, `photo`, `thumb`, `publish`, `net-publish` )
+ $r = q("INSERT INTO `profile` ( `uid`, `profile_name`, `is_default`, `name`, `photo`, `thumb`, `publish`, `net-publish` )
VALUES ( %d, '%s', %d, '%s', '%s', '%s', %d, %d ) ",
intval($newuid),
t('default'),
diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php
index eef80f8dd..7002b870f 100644
--- a/mod/dfrn_confirm.php
+++ b/mod/dfrn_confirm.php
@@ -424,11 +424,11 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
// Send a new friend post if we are allowed to...
- $r = q("SELECT `hide-friends` FROM `profile` WHERE `uid` = %d AND `is-default` = 1 LIMIT 1",
+ $r = q("SELECT `hide_friends` FROM `profile` WHERE `uid` = %d AND `is_default` = 1 LIMIT 1",
intval($uid)
);
- if((count($r)) && ($r[0]['hide-friends'] == 0) && ($activity) && (! $hidden)) {
+ if((count($r)) && ($r[0]['hide_friends'] == 0) && ($activity) && (! $hidden)) {
require_once('include/items.php');
@@ -745,11 +745,11 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
// Send a new friend post if we are allowed to...
if($page && intval(get_pconfig($local_uid,'system','post_joingroup'))) {
- $r = q("SELECT `hide-friends` FROM `profile` WHERE `uid` = %d AND `is-default` = 1 LIMIT 1",
+ $r = q("SELECT `hide_friends` FROM `profile` WHERE `uid` = %d AND `is_default` = 1 LIMIT 1",
intval($local_uid)
);
- if((count($r)) && ($r[0]['hide-friends'] == 0)) {
+ if((count($r)) && ($r[0]['hide_friends'] == 0)) {
require_once('include/items.php');
diff --git a/mod/directory.php b/mod/directory.php
index 8a5685c9a..4e7626ed5 100644
--- a/mod/directory.php
+++ b/mod/directory.php
@@ -61,19 +61,19 @@ function directory_content(&$a) {
if($search)
$search = dbesc($search);
- $sql_extra = ((strlen($search)) ? " AND MATCH (`profile`.`name`, `user`.`nickname`, `pdesc`, `locality`,`region`,`country-name`,`gender`,`marital`,`sexual`,`about`,`romance`,`work`,`education`,`pub_keywords`,`prv_keywords` ) AGAINST ('$search' IN BOOLEAN MODE) " : "");
+ $sql_extra = ((strlen($search)) ? " AND MATCH (`profile`.`name`, `user`.`nickname`, `pdesc`, `locality`,`region`,`country_name`,`gender`,`marital`,`sexual`,`about`,`romance`,`work`,`education`,`pub_keywords`,`prv_keywords` ) AGAINST ('$search' IN BOOLEAN MODE) " : "");
$publish = ((get_config('system','publish_all')) ? '' : " AND `publish` = 1 " );
- $r = q("SELECT COUNT(*) AS `total` FROM `profile` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid` WHERE `is-default` = 1 $publish AND `user`.`blocked` = 0 $sql_extra ");
+ $r = q("SELECT COUNT(*) AS `total` FROM `profile` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid` WHERE `is_default` = 1 $publish AND `user`.`blocked` = 0 $sql_extra ");
if(count($r))
$a->set_pager_total($r[0]['total']);
$order = " ORDER BY `name` ASC ";
- $r = q("SELECT `profile`.*, `profile`.`uid` AS `profile_uid`, `user`.`nickname`, `user`.`timezone` , `user`.`page-flags` FROM `profile` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid` WHERE `is-default` = 1 $publish AND `user`.`blocked` = 0 $sql_extra $order LIMIT %d , %d ",
+ $r = q("SELECT `profile`.*, `profile`.`uid` AS `profile_uid`, `user`.`nickname`, `user`.`timezone` , `user`.`page-flags` FROM `profile` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid` WHERE `is_default` = 1 $publish AND `user`.`blocked` = 0 $sql_extra $order LIMIT %d , %d ",
intval($a->pager['start']),
intval($a->pager['itemspage'])
);
@@ -99,10 +99,10 @@ function directory_content(&$a) {
$details .= ', ';
$details .= $rr['region'];
}
- if(strlen($rr['country-name'])) {
+ if(strlen($rr['country_name'])) {
if(strlen($details))
$details .= ', ';
- $details .= $rr['country-name'];
+ $details .= $rr['country_name'];
}
if(strlen($rr['dob'])) {
if(($years = age($rr['dob'],$rr['timezone'],'')) != 0)
@@ -127,8 +127,8 @@ function directory_content(&$a) {
if((x($profile,'address') == 1)
|| (x($profile,'locality') == 1)
|| (x($profile,'region') == 1)
- || (x($profile,'postal-code') == 1)
- || (x($profile,'country-name') == 1))
+ || (x($profile,'postal_code') == 1)
+ || (x($profile,'country_name') == 1))
$location = t('Location:');
$gender = ((x($profile,'gender') == 1) ? t('Gender:') : False);
diff --git a/mod/hcard.php b/mod/hcard.php
index 6d2d9e2eb..7a2c81c13 100644
--- a/mod/hcard.php
+++ b/mod/hcard.php
@@ -37,7 +37,6 @@ function hcard_init(&$a) {
$a->page['htmlhead'] .= '<meta name="keywords" content="' . $keywords . '" />' . "\r\n" ;
}
- $a->page['htmlhead'] .= '<meta name="dfrn-global-visibility" content="' . (($a->profile['net-publish']) ? 'true' : 'false') . '" />' . "\r\n" ;
$a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . $a->get_baseurl() . '/dfrn_poll/' . $which .'" />' . "\r\n" ;
$uri = urlencode('acct:' . $a->profile['nickname'] . '@' . $a->get_hostname() . (($a->path) ? '/' . $a->path : ''));
$a->page['htmlhead'] .= '<link rel="lrdd" type="application/xrd+xml" href="' . $a->get_baseurl() . '/xrd/?uri=' . $uri . '" />' . "\r\n";
diff --git a/mod/match.php b/mod/match.php
index 926df1dff..fbe3aa91f 100644
--- a/mod/match.php
+++ b/mod/match.php
@@ -11,7 +11,7 @@ function match_content(&$a) {
$o .= '<h2>' . t('Profile Match') . '</h2>';
- $r = q("SELECT `pub_keywords`, `prv_keywords` FROM `profile` WHERE `is-default` = 1 AND `uid` = %d LIMIT 1",
+ $r = q("SELECT `pub_keywords`, `prv_keywords` FROM `profile` WHERE `is_default` = 1 AND `uid` = %d LIMIT 1",
intval(local_user())
);
if(! count($r))
diff --git a/mod/msearch.php b/mod/msearch.php
index c4d69839c..e8e7d447b 100644
--- a/mod/msearch.php
+++ b/mod/msearch.php
@@ -10,13 +10,13 @@ function msearch_post(&$a) {
if(! strlen($search))
killme();
- $r = q("SELECT COUNT(*) AS `total` FROM `profile` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid` WHERE `is-default` = 1 AND `user`.`hidewall` = 0 AND MATCH `pub_keywords` AGAINST ('%s') ",
+ $r = q("SELECT COUNT(*) AS `total` FROM `profile` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid` WHERE `is_default` = 1 AND `user`.`hidewall` = 0 AND MATCH `pub_keywords` AGAINST ('%s') ",
dbesc($search)
);
if(count($r))
$total = $r[0]['total'];
- $r = q("SELECT `pub_keywords`, `username`, `nickname`, `user`.`uid` FROM `user` LEFT JOIN `profile` ON `user`.`uid` = `profile`.`uid` WHERE `is-default` = 1 AND `user`.`hidewall` = 0 AND MATCH `pub_keywords` AGAINST ('%s') LIMIT %d , %d ",
+ $r = q("SELECT `pub_keywords`, `username`, `nickname`, `user`.`uid` FROM `user` LEFT JOIN `profile` ON `user`.`uid` = `profile`.`uid` WHERE `is_default` = 1 AND `user`.`hidewall` = 0 AND MATCH `pub_keywords` AGAINST ('%s') LIMIT %d , %d ",
dbesc($search),
intval($startrec),
intval($perpage)
diff --git a/mod/poco.php b/mod/poco.php
index acfa3ffaa..2a5d47909 100644
--- a/mod/poco.php
+++ b/mod/poco.php
@@ -33,11 +33,11 @@ function poco_init(&$a) {
if(! $system_mode) {
- $r = q("SELECT `user`.*,`profile`.`hide-friends` from user left join profile on `user`.`uid` = `profile`.`uid`
- where `user`.`nickname` = '%s' and `profile`.`is-default` = 1 limit 1",
+ $r = q("SELECT `user`.*,`profile`.`hide_friends` from user left join profile on `user`.`uid` = `profile`.`uid`
+ where `user`.`nickname` = '%s' and `profile`.`is_default` = 1 limit 1",
dbesc($user)
);
- if(! count($r) || $r[0]['hidewall'] || $r[0]['hide-friends'])
+ if(! count($r) || $r[0]['hidewall'] || $r[0]['hide_friends'])
http_status_exit(404);
$user = $r[0];
diff --git a/mod/profile_photo.php b/mod/profile_photo.php
index 1285bf08e..058948ef0 100644
--- a/mod/profile_photo.php
+++ b/mod/profile_photo.php
@@ -28,11 +28,11 @@ function profile_photo_post(&$a) {
$is_default_profile = 1;
if($_REQUEST['profile']) {
- $r = q("select id, `is-default` from profile where id = %d and uid = %d limit 1",
+ $r = q("select id, `is_default` from profile where id = %d and uid = %d limit 1",
intval($_REQUEST['profile']),
intval(local_user())
);
- if(count($r) && (! intval($r[0]['is-default'])))
+ if(count($r) && (! intval($r[0]['is_default'])))
$is_default_profile = 0;
}
@@ -225,7 +225,7 @@ function profile_photo_content(&$a) {
// go ahead as we have jus uploaded a new photo to crop
}
- $profiles = q("select `id`,`profile_name` as `name`,`is-default` as `default` from profile where uid = %d",
+ $profiles = q("select `id`,`profile_name` as `name`,`is_default` as `default` from profile where uid = %d",
intval(local_user())
);
diff --git a/mod/profiles.php b/mod/profiles.php
index db063cccb..276fcaf64 100644
--- a/mod/profiles.php
+++ b/mod/profiles.php
@@ -24,7 +24,7 @@ function profiles_post(&$a) {
check_form_security_token_redirectOnErr('/profiles', 'profile_edit');
- $is_default = (($orig[0]['is-default']) ? 1 : 0);
+ $is_default = (($orig[0]['is_default']) ? 1 : 0);
$profile_name = notags(trim($_POST['profile_name']));
if(! strlen($profile_name)) {
@@ -144,7 +144,7 @@ function profiles_post(&$a) {
$work = fix_mce_lf(escape_tags(trim($_POST['work'])));
$education = fix_mce_lf(escape_tags(trim($_POST['education'])));
- $hide_friends = (($_POST['hide-friends'] == 1) ? 1: 0);
+ $hide_friends = (($_POST['hide_friends'] == 1) ? 1: 0);
@@ -201,7 +201,7 @@ function profiles_post(&$a) {
// profile but that doesn't mean we have to broadcast it to everybody.
}
if($locality != $orig[0]['locality'] || $region != $orig[0]['region']
- || $country_name != $orig[0]['country-name']) {
+ || $country_name != $orig[0]['country_name']) {
$changes[] = t('Location');
$comma1 = ((($locality) && ($region || $country_name)) ? ', ' : ' ');
$comma2 = (($region && $country_name) ? ', ' : '');
@@ -221,8 +221,8 @@ function profiles_post(&$a) {
`address` = '%s',
`locality` = '%s',
`region` = '%s',
- `postal-code` = '%s',
- `country-name` = '%s',
+ `postal_code` = '%s',
+ `country_name` = '%s',
`marital` = '%s',
`with` = '%s',
`howlong` = '%s',
@@ -245,7 +245,7 @@ function profiles_post(&$a) {
`romance` = '%s',
`work` = '%s',
`education` = '%s',
- `hide-friends` = %d
+ `hide_friends` = %d
WHERE `id` = %d AND `uid` = %d LIMIT 1",
dbesc($profile_name),
dbesc($name),
@@ -406,7 +406,7 @@ function profiles_content(&$a) {
}
if(($a->argc > 2) && ($a->argv[1] === "drop") && intval($a->argv[2])) {
- $r = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d AND `is-default` = 0 LIMIT 1",
+ $r = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d AND `is_default` = 0 LIMIT 1",
intval($a->argv[2]),
intval(local_user())
);
@@ -420,7 +420,7 @@ function profiles_content(&$a) {
// move every contact using this profile as their default to the user default
- $r = q("UPDATE `contact` SET `profile-id` = (SELECT `profile`.`id` AS `profile-id` FROM `profile` WHERE `profile`.`is-default` = 1 AND `profile`.`uid` = %d LIMIT 1) WHERE `profile-id` = %d AND `uid` = %d ",
+ $r = q("UPDATE `contact` SET `profile-id` = (SELECT `profile`.`id` AS `profile-id` FROM `profile` WHERE `profile`.`is_default` = 1 AND `profile`.`uid` = %d LIMIT 1) WHERE `profile-id` = %d AND `uid` = %d ",
intval(local_user()),
intval($a->argv[2]),
intval(local_user())
@@ -450,7 +450,7 @@ function profiles_content(&$a) {
$name = t('Profile-') . ($num_profiles + 1);
- $r1 = q("SELECT `name`, `photo`, `thumb` FROM `profile` WHERE `uid` = %d AND `is-default` = 1 LIMIT 1",
+ $r1 = q("SELECT `name`, `photo`, `thumb` FROM `profile` WHERE `uid` = %d AND `is_default` = 1 LIMIT 1",
intval(local_user()));
$r2 = q("INSERT INTO `profile` (`uid` , `profile_name` , `name`, `photo`, `thumb`)
@@ -492,9 +492,8 @@ function profiles_content(&$a) {
return;
}
unset($r1[0]['id']);
- $r1[0]['is-default'] = 0;
+ $r1[0]['is_default'] = 0;
$r1[0]['publish'] = 0;
- $r1[0]['net-publish'] = 0;
$r1[0]['profile_name'] = dbesc($name);
dbesc_array($r1[0]);
@@ -544,13 +543,13 @@ function profiles_content(&$a) {
));
- $opt_tpl = get_markup_template("profile-hide-friends.tpl");
+ $opt_tpl = get_markup_template("profile-hide_friends.tpl");
$hide_friends = replace_macros($opt_tpl,array(
'$desc' => t('Hide your contact/friend list from viewers of this profile?'),
'$yes_str' => t('Yes'),
'$no_str' => t('No'),
- '$yes_selected' => (($r[0]['hide-friends']) ? " checked=\"checked\" " : ""),
- '$no_selected' => (($r[0]['hide-friends'] == 0) ? " checked=\"checked\" " : "")
+ '$yes_selected' => (($r[0]['hide_friends']) ? " checked=\"checked\" " : ""),
+ '$no_selected' => (($r[0]['hide_friends'] == 0) ? " checked=\"checked\" " : "")
));
$a->page['htmlhead'] .= "<script type=\"text/javascript\" src=\"js/country.js\" ></script>";
@@ -563,7 +562,7 @@ function profiles_content(&$a) {
if(! $f)
$f = 'ymd';
- $is_default = (($r[0]['is-default']) ? 1 : 0);
+ $is_default = (($r[0]['is_default']) ? 1 : 0);
$tpl = get_markup_template("profile_edit.tpl");
$o .= replace_macros($tpl,array(
'$form_security_token' => get_form_security_token("profile_edit"),
@@ -623,8 +622,8 @@ function profiles_content(&$a) {
'$address' => $r[0]['address'],
'$locality' => $r[0]['locality'],
'$region' => $r[0]['region'],
- '$postal_code' => $r[0]['postal-code'],
- '$country_name' => $r[0]['country-name'],
+ '$postal_code' => $r[0]['postal_code'],
+ '$country_name' => $r[0]['country_name'],
'$age' => ((intval($r[0]['dob'])) ? '(' . t('Age: ') . age($r[0]['dob'],$a->user['timezone'],$a->user['timezone']) . ')' : ''),
'$gender' => gender_selector($r[0]['gender']),
'$marital' => marital_selector($r[0]['marital']),
@@ -679,7 +678,7 @@ function profiles_content(&$a) {
'$id' => $rr['id'],
'$alt' => t('Profile Image'),
'$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>')
));
}
diff --git a/mod/profperm.php b/mod/profperm.php
index c7ab45324..d29581beb 100644
--- a/mod/profperm.php
+++ b/mod/profperm.php
@@ -47,7 +47,7 @@ function profperm_content(&$a) {
if(($a->argc > 1) && (intval($a->argv[1]))) {
- $r = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d AND `is-default` = 0 LIMIT 1",
+ $r = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d AND `is_default` = 0 LIMIT 1",
intval($a->argv[1]),
intval(local_user())
);
diff --git a/mod/regmod.php b/mod/regmod.php
index 21f41eb01..120d21cae 100644
--- a/mod/regmod.php
+++ b/mod/regmod.php
@@ -28,10 +28,10 @@ function user_allow($hash) {
intval($register[0]['uid'])
);
- $r = q("SELECT * FROM `profile` WHERE `uid` = %d AND `is-default` = 1",
+ $r = q("SELECT * FROM `profile` WHERE `uid` = %d AND `is_default` = 1",
intval($user[0]['uid'])
);
- if(count($r) && $r[0]['net-publish']) {
+ if(count($r) && $r[0]['publish']) {
$url = $a->get_baseurl() . '/profile/' . $user[0]['nickname'];
if($url && strlen(get_config('system','directory_submit_url')))
proc_run('php',"include/directory.php","$url");
diff --git a/mod/settings.php b/mod/settings.php
index 478158b68..0699e94d8 100644
--- a/mod/settings.php
+++ b/mod/settings.php
@@ -251,7 +251,7 @@ function settings_post(&$a) {
$unkmail = (((x($_POST,'unkmail')) && (intval($_POST['unkmail']) == 1)) ? 1: 0);
$cntunkmail = ((x($_POST,'cntunkmail')) ? intval($_POST['cntunkmail']) : 0);
$suggestme = ((x($_POST,'suggestme')) ? intval($_POST['suggestme']) : 0);
- $hide_friends = (($_POST['hide-friends'] == 1) ? 1: 0);
+ $hide_friends = (($_POST['hide_friends'] == 1) ? 1: 0);
$hidewall = (($_POST['hidewall'] == 1) ? 1: 0);
$post_newfriend = (($_POST['post_newfriend'] == 1) ? 1: 0);
$post_joingroup = (($_POST['post_joingroup'] == 1) ? 1: 0);
@@ -387,11 +387,9 @@ function settings_post(&$a) {
$r = q("UPDATE `profile`
SET `publish` = %d,
- `net-publish` = %d,
- `hide-friends` = %d
- WHERE `is-default` = 1 AND `uid` = %d LIMIT 1",
+ `hide_friends` = %d
+ WHERE `is_default` = 1 AND `uid` = %d LIMIT 1",
intval($publish),
- intval($net_publish),
intval($hide_friends),
intval(local_user())
);
@@ -636,7 +634,7 @@ function settings_content(&$a) {
require_once('include/acl_selectors.php');
- $p = q("SELECT * FROM `profile` WHERE `is-default` = 1 AND `uid` = %d LIMIT 1",
+ $p = q("SELECT * FROM `profile` WHERE `is_default` = 1 AND `uid` = %d LIMIT 1",
intval(local_user())
);
if(count($p))
@@ -727,17 +725,11 @@ function settings_content(&$a) {
));
}
- if(strlen(get_config('system','directory_submit_url'))) {
- $profile_in_net_dir = replace_macros($opt_tpl,array(
- '$field' => array('profile_in_netdirectory', t('Publish your default profile in the global social directory?'), $profile['net-publish'], '', array(t('No'),t('Yes'))),
- ));
- }
- else
- $profile_in_net_dir = '';
+ $profile_in_net_dir = '';
$hide_friends = replace_macros($opt_tpl,array(
- '$field' => array('hide-friends', t('Hide your contact/friend list from viewers of your default profile?'), $profile['hide-friends'], '', array(t('No'),t('Yes'))),
+ '$field' => array('hide_friends', t('Hide your contact/friend list from viewers of your default profile?'), $profile['hide_friends'], '', array(t('No'),t('Yes'))),
));
$hide_wall = replace_macros($opt_tpl,array(
@@ -768,8 +760,7 @@ function settings_content(&$a) {
));
- $invisible = (((! $profile['publish']) && (! $profile['net-publish']))
- ? true : false);
+ $invisible = ((! $profile['publish']) ? true : false);
if($invisible)
info( t('Profile is <strong>not published</strong>.') . EOL );
diff --git a/mod/viewcontacts.php b/mod/viewcontacts.php
index 8e261e711..3c595567f 100644
--- a/mod/viewcontacts.php
+++ b/mod/viewcontacts.php
@@ -18,7 +18,7 @@ function viewcontacts_content(&$a) {
return;
}
- if(((! count($a->profile)) || ($a->profile['hide-friends']))) {
+ if(((! count($a->profile)) || ($a->profile['hide_friends']))) {
notice( t('Permission denied.') . EOL);
return;
}
diff --git a/mod/viewsrc.php b/mod/viewsrc.php
index 3fa4eaed5..bc7f771d6 100644
--- a/mod/viewsrc.php
+++ b/mod/viewsrc.php
@@ -8,7 +8,7 @@ function viewsrc_content(&$a) {
return;
}
- $item_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
+ $item_id = ((argc() > 1) ? intval(argv(1)) : 0);
if(! $item_id) {
$a->error = 404;
@@ -19,18 +19,18 @@ function viewsrc_content(&$a) {
$r = q("SELECT `item`.`body` FROM `item`
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
and `item`.`moderated` = 0
- AND `item`.`id` = '%s' LIMIT 1",
+ AND `item`.`id` = %d LIMIT 1",
intval(local_user()),
- dbesc($item_id)
+ intval($item_id)
);
- if(count($r))
+ if(count($r)) {
+ $o = str_replace("\n",'<br />',$r[0]['body']);
if(is_ajax()) {
- echo str_replace("\n",'<br />',$r[0]['body']);
+ echo $o;
killme();
- } else {
- $o .= str_replace("\n",'<br />',$r[0]['body']);
- }
+ }
+ }
return $o;
}
diff --git a/mod/zfinger.php b/mod/zfinger.php
index 5b02d4695..550d613b5 100644
--- a/mod/zfinger.php
+++ b/mod/zfinger.php
@@ -33,6 +33,17 @@ function zfinger_init(&$a) {
$e = $r[0];
+ $id = $e['entity_id'];
+ $r = q("select contact.*, profile.*
+ from contact left join profile on contact.uid = profile.uid
+ where contact.uid = %d && contact.self = 1 and profile.is_default = 1 limit 1",
+ intval($id)
+ );
+ if($r && count($r)) {
+ $profile = $r[0];
+ }
+
+
$ret['success'] = true;
// Communication details
@@ -43,6 +54,8 @@ function zfinger_init(&$a) {
$ret['name'] = $e['entity_name'];
$ret['address'] = $e['entity_address'];
+ $ret['profile'] = $profile;
+
// array of (verified) hubs this entity uses
$ret['hubs'] = array();
@@ -61,9 +74,6 @@ function zfinger_init(&$a) {
}
}
-
- // more stuff, e.g. the basic public profile
-
json_return_and_die($ret);
} \ No newline at end of file
diff --git a/update.php b/update.php
index 756bc7a51..c5091420e 100644
--- a/update.php
+++ b/update.php
@@ -592,7 +592,7 @@ function update_1073() {
function update_1074() {
q("ALTER TABLE `user` ADD `hidewall` TINYINT( 1) NOT NULL DEFAULT '0' AFTER `blockwall` ");
- $r = q("SELECT `uid` FROM `profile` WHERE `is-default` = 1 AND `hidewall` = 1");
+ $r = q("SELECT `uid` FROM `profile` WHERE `is_default` = 1 AND `hidewall` = 1");
if(count($r)) {
foreach($r as $rr)
q("UPDATE `user` SET `hidewall` = 1 WHERE `uid` = %d LIMIT 1",
diff --git a/version.inc b/version.inc
index 358d9fdb9..e4bb0228c 100644
--- a/version.inc
+++ b/version.inc
@@ -1 +1 @@
-2012-08-29.61
+2012-08-30.62
diff --git a/view/theme/diabook/directory_item.tpl b/view/theme/diabook/directory_item.tpl
index 70d197955..d2ed0ee8f 100644
--- a/view/theme/diabook/directory_item.tpl
+++ b/view/theme/diabook/directory_item.tpl
@@ -20,9 +20,9 @@
<span class="city-state-zip">
<span class="locality">$profile.locality</span>{{ if $profile.locality }}, {{ endif }}
<span class="region">$profile.region</span>
- <span class="postal-code">$profile.postal-code</span>
+ <span class="postal-code">$profile.postal_code</span>
</span>
- {{ if $profile.country-name }}<span class="country-name">$profile.country-name</span>{{ endif }}
+ {{ if $profile.country_name }}<span class="country-name">$profile.country_name</span>{{ endif }}
</dd>
</dl>
{{ endif }}
diff --git a/view/theme/diabook/profile_vcard.tpl b/view/theme/diabook/profile_vcard.tpl
index b982a2069..825145825 100644
--- a/view/theme/diabook/profile_vcard.tpl
+++ b/view/theme/diabook/profile_vcard.tpl
@@ -33,9 +33,9 @@
<span class="city-state-zip">
<span class="locality">$profile.locality</span>{{ if $profile.locality }}, {{ endif }}
<span class="region">$profile.region</span>
- <span class="postal-code">$profile.postal-code</span>
+ <span class="postal-code">$profile.postal_code</span>
</span>
- {{ if $profile.country-name }}<span class="country-name">$profile.country-name</span>{{ endif }}
+ {{ if $profile.country_name }}<span class="country-name">$profile.country_name</span>{{ endif }}
</dd>
</dl>
{{ endif }}
diff --git a/view/theme/diabook/theme.php b/view/theme/diabook/theme.php
index 2c8290344..718db2ccf 100644
--- a/view/theme/diabook/theme.php
+++ b/view/theme/diabook/theme.php
@@ -516,7 +516,7 @@ if ($color=="dark") $color_path = "/diabook-dark/";
$r = q("SELECT `profile`.*, `profile`.`uid` AS `profile_uid`, `user`.`nickname`
FROM `profile` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid`
- WHERE `is-default` = 1 $publish AND `user`.`blocked` = 0 $sql_extra $order LIMIT %d , %d ",
+ WHERE `is_default` = 1 $publish AND `user`.`blocked` = 0 $sql_extra $order LIMIT %d , %d ",
0,
9
);
diff --git a/view/theme/dispy/profile_vcard.tpl b/view/theme/dispy/profile_vcard.tpl
index cf0054a67..b7c99edd9 100644
--- a/view/theme/dispy/profile_vcard.tpl
+++ b/view/theme/dispy/profile_vcard.tpl
@@ -34,9 +34,9 @@
<span class="city-state-zip">
<span class="locality">$profile.locality</span>{{ if $profile.locality }}, {{ endif }}
<span class="region">$profile.region</span>
- <span class="postal-code">$profile.postal-code</span>
+ <span class="postal-code">$profile.postal_code</span>
</span>
- {{ if $profile.country-name }}<span class="country-name">$profile.country-name</span>{{ endif }}
+ {{ if $profile.country_name }}<span class="country-name">$profile.country_name</span>{{ endif }}
</div>
</div>
{{ endif }}
diff --git a/view/theme/quattro/tpl/profile_vcard.tpl b/view/theme/quattro/tpl/profile_vcard.tpl
index 7cd02f164..5d7e92131 100644
--- a/view/theme/quattro/tpl/profile_vcard.tpl
+++ b/view/theme/quattro/tpl/profile_vcard.tpl
@@ -32,9 +32,9 @@
<span class="city-state-zip">
<span class="locality">$profile.locality</span>{{ if $profile.locality }}, {{ endif }}
<span class="region">$profile.region</span>
- <span class="postal-code">$profile.postal-code</span>
+ <span class="postal-code">$profile.postal_code</span>
</span>
- {{ if $profile.country-name }}<span class="country-name">$profile.country-name</span>{{ endif }}
+ {{ if $profile.country_name }}<span class="country-name">$profile.country_name</span>{{ endif }}
</dd>
</dl>
{{ endif }}
diff --git a/view/tpl/profile_vcard.tpl b/view/tpl/profile_vcard.tpl
index 8de1b03da..3360016bc 100644
--- a/view/tpl/profile_vcard.tpl
+++ b/view/tpl/profile_vcard.tpl
@@ -16,9 +16,9 @@
<span class="city-state-zip">
<span class="locality">$profile.locality</span>{{ if $profile.locality }}, {{ endif }}
<span class="region">$profile.region</span>
- <span class="postal-code">$profile.postal-code</span>
+ <span class="postal-code">$profile.postal_code</span>
</span>
- {{ if $profile.country-name }}<span class="country-name">$profile.country-name</span>{{ endif }}
+ {{ if $profile.country_name }}<span class="country-name">$profile.country_name</span>{{ endif }}
</dd>
</dl>
{{ endif }}