Merge pull request #951 from MrPetovan/task/7817-custom-profile-fields

[various] New custom profile field feature
This commit is contained in:
Philipp 2020-01-28 15:40:36 +01:00 committed by GitHub
commit 5398962506
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 13 deletions

View file

@ -85,23 +85,16 @@ function forumdirectory_content(App $a)
(`profile`.`locality` LIKE '%$search%') OR (`profile`.`locality` LIKE '%$search%') OR
(`profile`.`region` LIKE '%$search%') OR (`profile`.`region` LIKE '%$search%') OR
(`profile`.`country-name` LIKE '%$search%') OR (`profile`.`country-name` LIKE '%$search%') OR
(`profile`.`gender` LIKE '%$search%') OR
(`profile`.`marital` LIKE '%$search%') OR
(`profile`.`sexual` LIKE '%$search%') OR
(`profile`.`about` LIKE '%$search%') OR
(`profile`.`romance` LIKE '%$search%') OR
(`profile`.`work` LIKE '%$search%') OR
(`profile`.`education` LIKE '%$search%') OR
(`profile`.`pub_keywords` LIKE '%$search%') OR (`profile`.`pub_keywords` LIKE '%$search%') OR
(`profile`.`prv_keywords` LIKE '%$search%'))"; (`profile`.`prv_keywords` LIKE '%$search%'))";
} }
$publish = DI::config()->get('system', 'publish_all') ? '' : " AND `publish` = 1 "; $publish = DI::config()->get('system', 'publish_all') ? '' : "`publish` = 1";
$total = 0; $total = 0;
$cnt = DBA::fetchFirst("SELECT COUNT(*) AS `total` FROM `profile` $cnt = DBA::fetchFirst("SELECT COUNT(*) AS `total` FROM `profile`
LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid`
WHERE `is-default` $publish AND NOT `user`.`blocked` AND NOT `user`.`account_removed` `user`.`page-flags` = 2 $sql_extra"); WHERE $publish AND NOT `user`.`blocked` AND NOT `user`.`account_removed` `user`.`page-flags` = 2 $sql_extra");
if (DBA::isResult($cnt)) { if (DBA::isResult($cnt)) {
$total = $cnt['total']; $total = $cnt['total'];
} }
@ -116,7 +109,7 @@ function forumdirectory_content(App $a)
`contact`.`addr`, `contact`.`url` AS `profile_url` FROM `profile` `contact`.`addr`, `contact`.`url` AS `profile_url` FROM `profile`
LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid`
LEFT JOIN `contact` ON `contact`.`uid` = `user`.`uid` LEFT JOIN `contact` ON `contact`.`uid` = `user`.`uid`
WHERE `is-default` $publish AND NOT `user`.`blocked` AND NOT `user`.`account_removed` AND `user`.`page-flags` = 2 AND `contact`.`self` WHERE $publish AND NOT `user`.`blocked` AND NOT `user`.`account_removed` AND `user`.`page-flags` = 2 AND `contact`.`self`
$sql_extra $order LIMIT $limit" $sql_extra $order LIMIT $limit"
); );

View file

@ -5,7 +5,7 @@
* Version: 1.0 * Version: 1.0
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike> * Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
* - who takes no responsibility for any additional content which may appear herein * - who takes no responsibility for any additional content which may appear herein
* * Status: Deprecated
*/ */
use Friendica\Core\Hook; use Friendica\Core\Hook;

View file

@ -27,7 +27,7 @@ function friendheader_widget_content(&$a, $conf)
{ {
$r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `user`.* FROM `profile` $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `user`.* FROM `profile`
LEFT JOIN `user` ON `profile`.`uid` = `user`.`uid` LEFT JOIN `user` ON `profile`.`uid` = `user`.`uid`
WHERE `user`.`uid` = %s AND `profile`.`is-default` = 1 LIMIT 1", WHERE `user`.`uid` = %s LIMIT 1",
intval($conf['uid']) intval($conf['uid'])
); );
if (!count($r)) { if (!count($r)) {

View file

@ -29,7 +29,7 @@ function friends_widget_content(&$a, $conf)
{ {
$r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `user`.* FROM `profile` $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `user`.* FROM `profile`
LEFT JOIN `user` ON `profile`.`uid` = `user`.`uid` LEFT JOIN `user` ON `profile`.`uid` = `user`.`uid`
WHERE `user`.`uid` = %s AND `profile`.`is-default` = 1 LIMIT 1", WHERE `user`.`uid` = %s LIMIT 1",
intval($conf['uid']) intval($conf['uid'])
); );