aboutsummaryrefslogtreecommitdiffstats
path: root/mod/profiles.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-08-20 23:01:25 -0700
committerfriendica <info@friendica.com>2014-08-20 23:01:25 -0700
commitb4aed1212930e40377665dc45271f2b1f428511f (patch)
tree394e73b1ef775d7aaeefcb44792967ecd1279763 /mod/profiles.php
parentaf45b34ee044966210e6101585fe362acf1ca098 (diff)
downloadvolse-hubzilla-b4aed1212930e40377665dc45271f2b1f428511f.tar.gz
volse-hubzilla-b4aed1212930e40377665dc45271f2b1f428511f.tar.bz2
volse-hubzilla-b4aed1212930e40377665dc45271f2b1f428511f.zip
extensible profiles - add the input form elements. Still needs styling and we're not yet storing the results. And right now we're ignoring the type and only doing type=string. Oh yeah - and I split off starting the second delivery chain into its own function in tag_deliver since it was largely duplicate code.
Diffstat (limited to 'mod/profiles.php')
-rw-r--r--mod/profiles.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/mod/profiles.php b/mod/profiles.php
index b938e836b..d6df09e9a 100644
--- a/mod/profiles.php
+++ b/mod/profiles.php
@@ -568,6 +568,24 @@ function profiles_content(&$a) {
'$no_selected' => (($r[0]['hide_friends'] == 0) ? " checked=\"checked\" " : "")
));
+ $q = q("select * from profdef where true");
+ if($q) {
+ $extra_fields = array();
+
+ foreach($q as $qq) {
+ $mine = q("select v from profext where k = '%s' and hash = '%s' and channel_id = %d limit 1",
+ dbesc($qq['field_name']),
+ dbesc($r[0]['profile_guid']),
+ intval(local_user())
+ );
+
+ if(array_key_exists($qq['field_name'],$fields)) {
+ $extra_fields[] = array($qq['field_name'],$qq['field_desc'],(($mine) ? $mine[0]['v'] : ''), $qq['field_help']);
+ }
+ }
+ }
+
+logger('extra_fields: ' . print_r($extra_fields,true));
$f = get_config('system','birthday_input_format');
if(! $f)
@@ -674,6 +692,7 @@ function profiles_content(&$a) {
'$education' => $r[0]['education'],
'$contact' => $r[0]['contact'],
'$channels' => $r[0]['channels'],
+ '$extra_fields' => $extra_fields,
));
$arr = array('profile' => $r[0], 'entry' => $o);