add hometown to profiles
This commit is contained in:
parent
3d39e6e594
commit
d27c6de84e
8 changed files with 34 additions and 4 deletions
2
boot.php
2
boot.php
|
@ -11,7 +11,7 @@ require_once('include/cache.php');
|
||||||
define ( 'FRIENDICA_PLATFORM', 'Friendica');
|
define ( 'FRIENDICA_PLATFORM', 'Friendica');
|
||||||
define ( 'FRIENDICA_VERSION', '3.0.1362' );
|
define ( 'FRIENDICA_VERSION', '3.0.1362' );
|
||||||
define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
|
define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
|
||||||
define ( 'DB_UPDATE_VERSION', 1146 );
|
define ( 'DB_UPDATE_VERSION', 1147 );
|
||||||
|
|
||||||
define ( 'EOL', "<br />\r\n" );
|
define ( 'EOL', "<br />\r\n" );
|
||||||
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
|
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
|
||||||
|
|
|
@ -820,6 +820,7 @@ CREATE TABLE IF NOT EXISTS `profile` (
|
||||||
`region` char(255) NOT NULL,
|
`region` char(255) NOT NULL,
|
||||||
`postal-code` char(32) NOT NULL,
|
`postal-code` char(32) NOT NULL,
|
||||||
`country-name` char(255) NOT NULL,
|
`country-name` char(255) NOT NULL,
|
||||||
|
`hometown` char(255) NOT NULL,
|
||||||
`gender` char(32) NOT NULL,
|
`gender` char(32) NOT NULL,
|
||||||
`marital` char(255) NOT NULL,
|
`marital` char(255) NOT NULL,
|
||||||
`with` text NOT NULL,
|
`with` text NOT NULL,
|
||||||
|
|
|
@ -47,6 +47,8 @@ function advanced_profile(&$a) {
|
||||||
|
|
||||||
if($a->profile['homepage']) $profile['homepage'] = array( t('Homepage:'), linkify($a->profile['homepage']) );
|
if($a->profile['homepage']) $profile['homepage'] = array( t('Homepage:'), linkify($a->profile['homepage']) );
|
||||||
|
|
||||||
|
if($a->profile['hometown']) $profile['hometown'] = array( t('Hometown:'), linkify($a->profile['hometown']) );
|
||||||
|
|
||||||
if($a->profile['pub_keywords']) $profile['pub_keywords'] = array( t('Tags:'), $a->profile['pub_keywords']);
|
if($a->profile['pub_keywords']) $profile['pub_keywords'] = array( t('Tags:'), $a->profile['pub_keywords']);
|
||||||
|
|
||||||
if($a->profile['politic']) $profile['politic'] = array( t('Political Views:'), $a->profile['politic']);
|
if($a->profile['politic']) $profile['politic'] = array( t('Political Views:'), $a->profile['politic']);
|
||||||
|
|
|
@ -126,6 +126,7 @@ function profiles_post(&$a) {
|
||||||
|
|
||||||
$sexual = notags(trim($_POST['sexual']));
|
$sexual = notags(trim($_POST['sexual']));
|
||||||
$homepage = notags(trim($_POST['homepage']));
|
$homepage = notags(trim($_POST['homepage']));
|
||||||
|
$hometown = notags(trim($_POST['hometown']));
|
||||||
$politic = notags(trim($_POST['politic']));
|
$politic = notags(trim($_POST['politic']));
|
||||||
$religion = notags(trim($_POST['religion']));
|
$religion = notags(trim($_POST['religion']));
|
||||||
|
|
||||||
|
@ -216,6 +217,7 @@ function profiles_post(&$a) {
|
||||||
`howlong` = '%s',
|
`howlong` = '%s',
|
||||||
`sexual` = '%s',
|
`sexual` = '%s',
|
||||||
`homepage` = '%s',
|
`homepage` = '%s',
|
||||||
|
`hometown` = '%s',
|
||||||
`politic` = '%s',
|
`politic` = '%s',
|
||||||
`religion` = '%s',
|
`religion` = '%s',
|
||||||
`pub_keywords` = '%s',
|
`pub_keywords` = '%s',
|
||||||
|
@ -247,6 +249,7 @@ function profiles_post(&$a) {
|
||||||
dbesc($howlong),
|
dbesc($howlong),
|
||||||
dbesc($sexual),
|
dbesc($sexual),
|
||||||
dbesc($homepage),
|
dbesc($homepage),
|
||||||
|
dbesc($hometown),
|
||||||
dbesc($politic),
|
dbesc($politic),
|
||||||
dbesc($religion),
|
dbesc($religion),
|
||||||
dbesc($pub_keywords),
|
dbesc($pub_keywords),
|
||||||
|
@ -569,6 +572,7 @@ function profiles_content(&$a) {
|
||||||
'$lbl_howlong' => t('Since [date]:'),
|
'$lbl_howlong' => t('Since [date]:'),
|
||||||
'$lbl_sexual' => t('Sexual Preference:'),
|
'$lbl_sexual' => t('Sexual Preference:'),
|
||||||
'$lbl_homepage' => t('Homepage URL:'),
|
'$lbl_homepage' => t('Homepage URL:'),
|
||||||
|
'$lbl_hometown' => t('Hometown:'),
|
||||||
'$lbl_politic' => t('Political Views:'),
|
'$lbl_politic' => t('Political Views:'),
|
||||||
'$lbl_religion' => t('Religious Views:'),
|
'$lbl_religion' => t('Religious Views:'),
|
||||||
'$lbl_pubkey' => t('Public Keywords:'),
|
'$lbl_pubkey' => t('Public Keywords:'),
|
||||||
|
@ -608,6 +612,7 @@ function profiles_content(&$a) {
|
||||||
'$sexual' => sexpref_selector($r[0]['sexual']),
|
'$sexual' => sexpref_selector($r[0]['sexual']),
|
||||||
'$about' => $r[0]['about'],
|
'$about' => $r[0]['about'],
|
||||||
'$homepage' => $r[0]['homepage'],
|
'$homepage' => $r[0]['homepage'],
|
||||||
|
'$hometown' => $r[0]['hometown'],
|
||||||
'$politic' => $r[0]['politic'],
|
'$politic' => $r[0]['politic'],
|
||||||
'$religion' => $r[0]['religion'],
|
'$religion' => $r[0]['religion'],
|
||||||
'$pub_keywords' => $r[0]['pub_keywords'],
|
'$pub_keywords' => $r[0]['pub_keywords'],
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
define( 'UPDATE_VERSION' , 1146 );
|
define( 'UPDATE_VERSION' , 1147 );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -1267,4 +1267,11 @@ function update_1145() {
|
||||||
return UPDATE_SUCCESS ;
|
return UPDATE_SUCCESS ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function update_1146() {
|
||||||
|
$r = q("alter table profile add hometown char(255) not null after `country-name`, add index ( `hometown` ) ");
|
||||||
|
if(! $r)
|
||||||
|
return UPDATE_FAILED ;
|
||||||
|
return UPDATE_SUCCESS ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,13 @@
|
||||||
</dl>
|
</dl>
|
||||||
{{ endif }}
|
{{ endif }}
|
||||||
|
|
||||||
|
{{ if $profile.hometown }}
|
||||||
|
<dl id="aprofile-hometown" class="aprofile">
|
||||||
|
<dt>$profile.hometown.0</dt>
|
||||||
|
<dd>$profile.hometown.1</dd>
|
||||||
|
</dl>
|
||||||
|
{{ endif }}
|
||||||
|
|
||||||
{{ if $profile.politic }}
|
{{ if $profile.politic }}
|
||||||
<dl id="aprofile-politic" class="aprofile">
|
<dl id="aprofile-politic" class="aprofile">
|
||||||
<dt>$profile.politic.0</dt>
|
<dt>$profile.politic.0</dt>
|
||||||
|
|
|
@ -97,6 +97,12 @@ $hide_friends
|
||||||
</div>
|
</div>
|
||||||
<div id="profile-edit-region-end"></div>
|
<div id="profile-edit-region-end"></div>
|
||||||
|
|
||||||
|
<div id="profile-edit-hometown-wrapper" >
|
||||||
|
<label id="profile-edit-hometown-label" for="profile-edit-hometown" >$lbl_hometown </label>
|
||||||
|
<input type="text" size="32" name="hometown" id="profile-edit-hometown" value="$hometown" />
|
||||||
|
</div>
|
||||||
|
<div id="profile-edit-hometown-end"></div>
|
||||||
|
|
||||||
<div class="profile-edit-submit-wrapper" >
|
<div class="profile-edit-submit-wrapper" >
|
||||||
<input type="submit" name="submit" class="profile-edit-submit-button" value="$submit" />
|
<input type="submit" name="submit" class="profile-edit-submit-button" value="$submit" />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -679,7 +679,8 @@ input#dfrn-url {
|
||||||
#profile-edit-religion-label,
|
#profile-edit-religion-label,
|
||||||
#profile-edit-pubkeywords-label,
|
#profile-edit-pubkeywords-label,
|
||||||
#profile-edit-prvkeywords-label,
|
#profile-edit-prvkeywords-label,
|
||||||
#profile-edit-homepage-label {
|
#profile-edit-homepage-label,
|
||||||
|
#profile-edit-hometown-label {
|
||||||
float: left;
|
float: left;
|
||||||
width: 175px;
|
width: 175px;
|
||||||
}
|
}
|
||||||
|
@ -774,7 +775,7 @@ input#dfrn-url {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#profile-edit-homepage {
|
#profile-edit-homepage, #profile-edit-hometown {
|
||||||
float: left;
|
float: left;
|
||||||
margin-bottom: 35px;
|
margin-bottom: 35px;
|
||||||
}
|
}
|
||||||
|
@ -814,6 +815,7 @@ input#dfrn-url {
|
||||||
#profile-edit-pubkeywords-end,
|
#profile-edit-pubkeywords-end,
|
||||||
#profile-edit-prvkeywords-end,
|
#profile-edit-prvkeywords-end,
|
||||||
#profile-edit-homepage-end,
|
#profile-edit-homepage-end,
|
||||||
|
#profile-edit-hometown-end,
|
||||||
#profile-in-dir-break,
|
#profile-in-dir-break,
|
||||||
#profile-in-dir-end,
|
#profile-in-dir-end,
|
||||||
#profile-in-netdir-break,
|
#profile-in-netdir-break,
|
||||||
|
|
Loading…
Reference in a new issue