Set the two new profile fields in run_submit
This commit is contained in:
parent
0aa220daa9
commit
c115141220
1 changed files with 27 additions and 2 deletions
|
@ -115,6 +115,11 @@ function run_submit($url)
|
||||||
$params['comm'] = intval($params['comm']);
|
$params['comm'] = intval($params['comm']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$filled_fields =
|
||||||
|
intval(!empty($params['pdesc'])) * 4
|
||||||
|
+ intval(!empty($params['tags'])) * 2
|
||||||
|
+ intval(!empty($params['locality']) || !empty($params['region']) || !empty($params['postal-code']) || !empty($params['country-name']));
|
||||||
|
|
||||||
if ($profile_exists) {
|
if ($profile_exists) {
|
||||||
$r = q("UPDATE `profile` SET
|
$r = q("UPDATE `profile` SET
|
||||||
`name` = '%s',
|
`name` = '%s',
|
||||||
|
@ -127,6 +132,8 @@ function run_submit($url)
|
||||||
`nurl` = '%s',
|
`nurl` = '%s',
|
||||||
`comm` = %d,
|
`comm` = %d,
|
||||||
`tags` = '%s',
|
`tags` = '%s',
|
||||||
|
`filled_fields` = %d,
|
||||||
|
`last_activity` = '%s',
|
||||||
`available` = 1,
|
`available` = 1,
|
||||||
`updated` = '%s'
|
`updated` = '%s'
|
||||||
WHERE `id` = %d LIMIT 1",
|
WHERE `id` = %d LIMIT 1",
|
||||||
|
@ -140,13 +147,29 @@ function run_submit($url)
|
||||||
dbesc($nurl),
|
dbesc($nurl),
|
||||||
intval($params['comm']),
|
intval($params['comm']),
|
||||||
$params['tags'],
|
$params['tags'],
|
||||||
|
$filled_fields,
|
||||||
|
x($params, 'last-activity') ? $params['last-activity'] : NULL,
|
||||||
dbesc(datetime_convert()),
|
dbesc(datetime_convert()),
|
||||||
intval($profile_id)
|
intval($profile_id)
|
||||||
);
|
);
|
||||||
logger('Update returns: ' . $r);
|
logger('Update returns: ' . $r);
|
||||||
} else {
|
} else {
|
||||||
$r = q("INSERT INTO `profile` ( `name`, `pdesc`, `locality`, `region`, `postal-code`, `country-name`, `homepage`, `nurl`, `comm`, `tags`, `created`, `updated` )
|
$r = q("INSERT INTO `profile` SET
|
||||||
VALUES ( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, '%s', '%s', '%s' )",
|
`name` = '%s',
|
||||||
|
`pdesc` = '%s',
|
||||||
|
`locality` = '%s',
|
||||||
|
`region` = '%s',
|
||||||
|
`postal-code` = '%s',
|
||||||
|
`country-name` = '%s',
|
||||||
|
`homepage` = '%s',
|
||||||
|
`nurl` = '%s',
|
||||||
|
`comm` = %d,
|
||||||
|
`tags` = '%s',
|
||||||
|
`filled_fields` = %d,
|
||||||
|
`last_activity` = '%s',
|
||||||
|
`available` = 1,
|
||||||
|
`created` = '%s',
|
||||||
|
`updated` = '%s'",
|
||||||
$params['fn'],
|
$params['fn'],
|
||||||
x($params, 'pdesc') ? $params['pdesc'] : '',
|
x($params, 'pdesc') ? $params['pdesc'] : '',
|
||||||
x($params, 'locality') ? $params['locality'] : '',
|
x($params, 'locality') ? $params['locality'] : '',
|
||||||
|
@ -157,6 +180,8 @@ function run_submit($url)
|
||||||
dbesc($nurl),
|
dbesc($nurl),
|
||||||
intval($params['comm']),
|
intval($params['comm']),
|
||||||
x($params, 'tags') ? $params['tags'] : '',
|
x($params, 'tags') ? $params['tags'] : '',
|
||||||
|
$filled_fields,
|
||||||
|
x($params, 'last-activity') ? $params['last-activity'] : NULL,
|
||||||
dbesc(datetime_convert()),
|
dbesc(datetime_convert()),
|
||||||
dbesc(datetime_convert())
|
dbesc(datetime_convert())
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue