diff options
author | Thomas Willingham <founder@kakste.com> | 2013-07-03 16:10:58 +0100 |
---|---|---|
committer | Thomas Willingham <founder@kakste.com> | 2013-07-03 16:10:58 +0100 |
commit | d065135d909bf876f4c305d303de7642657f7e3e (patch) | |
tree | c569ec28535fe5e91ab29dffe67c9a74f11fece2 /include | |
parent | d1cae2da2abc3a602f682114bc02cce08a7e7578 (diff) | |
parent | 429ebabfd98240fe7d69ba81879ee35769af305f (diff) | |
download | volse-hubzilla-d065135d909bf876f4c305d303de7642657f7e3e.tar.gz volse-hubzilla-d065135d909bf876f4c305d303de7642657f7e3e.tar.bz2 volse-hubzilla-d065135d909bf876f4c305d303de7642657f7e3e.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'include')
-rw-r--r-- | include/contact_selectors.php | 16 | ||||
-rw-r--r-- | include/dir_fns.php | 5 | ||||
-rw-r--r-- | include/features.php | 1 | ||||
-rwxr-xr-x | include/items.php | 3 | ||||
-rw-r--r-- | include/taxonomy.php | 23 | ||||
-rw-r--r-- | include/zot.php | 6 |
6 files changed, 30 insertions, 24 deletions
diff --git a/include/contact_selectors.php b/include/contact_selectors.php index adcca2c52..b56a77937 100644 --- a/include/contact_selectors.php +++ b/include/contact_selectors.php @@ -1,21 +1,19 @@ <?php /** @file */ -function contact_profile_assign($current,$foreign_net) { +function contact_profile_assign($current) { $o = ''; - $disabled = (($foreign_net) ? ' disabled="true" ' : ''); + $o .= "<select id=\"contact-profile-selector\" name=\"profile-assign\" />\r\n"; - $o .= "<select id=\"contact-profile-selector\" $disabled name=\"profile-assign\" />\r\n"; + $r = q("SELECT profile_guid, profile_name FROM `profile` WHERE `uid` = %d", + intval($_SESSION['uid'])); - $r = q("SELECT `id`, `profile_name` FROM `profile` WHERE `uid` = %d", - intval($_SESSION['uid'])); - - if(count($r)) { + if($r) { foreach($r as $rr) { - $selected = (($rr['id'] == $current) ? " selected=\"selected\" " : ""); - $o .= "<option value=\"{$rr['id']}\" $selected >{$rr['profile_name']}</option>\r\n"; + $selected = (($rr['profile_guid'] == $current) ? " selected=\"selected\" " : ""); + $o .= "<option value=\"{$rr['profile_guid']}\" $selected >{$rr['profile_name']}</option>\r\n"; } } $o .= "</select>\r\n"; diff --git a/include/dir_fns.php b/include/dir_fns.php index 5a1d671cb..0b678fd91 100644 --- a/include/dir_fns.php +++ b/include/dir_fns.php @@ -53,7 +53,7 @@ function syncdirs($uid) { logger('syncdirs', LOGGER_DEBUG); - $p = q("select channel.channel_hash, profile.* from profile left join channel on channel_id = uid where uid = %d and is_default = 1", + $p = q("select channel.channel_hash, channel_timezone, profile.* from profile left join channel on channel_id = uid where uid = %d and is_default = 1", intval($uid) ); @@ -64,6 +64,9 @@ function syncdirs($uid) { $profile['description'] = $p[0]['pdesc']; $profile['birthday'] = $p[0]['dob']; + if($age = age($p[0]['dob'],$p[0]['channel_timezone'],'')) + $profile['age'] = $age; + $profile['gender'] = $p[0]['gender']; $profile['marital'] = $p[0]['marital']; $profile['sexual'] = $p[0]['sexual']; diff --git a/include/features.php b/include/features.php index c2aabbc42..da1322a14 100644 --- a/include/features.php +++ b/include/features.php @@ -58,6 +58,7 @@ function get_features() { array('filing', t('Saved Folders'), t('Ability to file posts under folders')), array('dislike', t('Dislike Posts'), t('Ability to dislike posts/comments')), array('star_posts', t('Star Posts'), t('Ability to mark special posts with a star indicator')), + array('tagadelic', t('Tag Cloud'), t('Provide a personal tag cloud on your channel page')), ), ); diff --git a/include/items.php b/include/items.php index c4ffcbca6..a3d591899 100755 --- a/include/items.php +++ b/include/items.php @@ -1858,9 +1858,6 @@ function tag_deliver($uid,$item_id) { // See if we are the owner of the parent item and have given permission to tag our posts. // If so tag the parent post. - // FIXME --- If the item is deleted, remove the tag from the parent. - // (First ensure that deleted items use this function, or else do that part separately.) - logger('tag_deliver: community tag activity received'); if(($item['owner_xchan'] === $u[0]['channel_hash']) && (! get_pconfig($u[0]['channel_id'],'system','blocktags'))) { diff --git a/include/taxonomy.php b/include/taxonomy.php index 7e9a4c856..e9cc0faf4 100644 --- a/include/taxonomy.php +++ b/include/taxonomy.php @@ -96,12 +96,15 @@ function format_term_for_display($term) { // Tag cloud functions - need to be adpated to this database format -function tagadelic($uid, $count = 0, $type = TERM_HASHTAG) { +function tagadelic($uid, $count = 0, $flags = 0, $type = TERM_HASHTAG) { + if($flags) + $sql_options = " and ((item_flags & " . intval($flags) . ") = " . intval($flags) . ") "; // Fetch tags - $r = q("select term, count(term) as total from term - where uid = %d and type = %d - and otype = %d + $r = q("select term, count(term) as total from term left join item on term.oid = item.id + where term.uid = %d and term.type = %d + and otype = %d and item_restrict = 0 + $sql_options group by term order by total desc %s", intval($uid), intval($type), @@ -145,15 +148,17 @@ function tags_sort($a,$b) { } -function tagblock($link,$uid,$count = 0,$type = TERM_HASHTAG) { +function tagblock($link,$uid,$count = 0,$flags = 0,$type = TERM_HASHTAG) { + $o = ''; $tab = 0; - $r = tagadelic($uid,$count,$type); + $r = tagadelic($uid,$count,$flags,$type); if($r) { - echo '<div class="tags" align="center">'; + $o = '<div class="tagblock widget"><h3>' . t('Tags') . '</h3><div class="tags" align="center">'; foreach($r as $rr) { - echo '<a href="'.$link .'/' . '?f=&tag=' . urlencode($rr[0]).'" class="tag'.$rr[2].'">'.$rr[0].'</a> '; + $o .= '<a href="'.$link .'/' . '?f=&tag=' . urlencode($rr[0]).'" class="tag'.$rr[2].'">'.$rr[0].'</a> ' . "\r\n"; } - echo '</div>'; + $o .= '</div></div>'; } + return $o; } diff --git a/include/zot.php b/include/zot.php index f10a02d47..f9b40c06f 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1312,7 +1312,6 @@ function import_directory_profile($hash,$profile) { $arr['xprof_keywords'] = implode(' ',$clean); - $r = q("select * from xprof where xprof_hash = '%s' limit 1", dbesc($hash) ); @@ -1328,6 +1327,7 @@ function import_directory_profile($hash,$profile) { $x = q("update xprof set xprof_desc = '%s', xprof_dob = '%s', + xprof_age = %d, xprof_gender = '%s', xprof_marital = '%s', xprof_sexual = '%s', @@ -1339,6 +1339,7 @@ function import_directory_profile($hash,$profile) { where xprof_hash = '%s' limit 1", dbesc($arr['xprof_desc']), dbesc($arr['xprof_dob']), + intval($arr['xprof_age']), dbesc($arr['xprof_gender']), dbesc($arr['xprof_marital']), dbesc($arr['xprof_sexual']), @@ -1353,10 +1354,11 @@ function import_directory_profile($hash,$profile) { } else { $update = true; - $x = q("insert into xprof (xprof_hash, xprof_desc, xprof_dob, xprof_gender, xprof_marital, xprof_sexual, xprof_locale, xprof_region, xprof_postcode, xprof_country, xprof_keywords) values ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s') ", + $x = q("insert into xprof (xprof_hash, xprof_desc, xprof_dob, xprof_age, xprof_gender, xprof_marital, xprof_sexual, xprof_locale, xprof_region, xprof_postcode, xprof_country, xprof_keywords) values ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s') ", dbesc($arr['xprof_hash']), dbesc($arr['xprof_desc']), dbesc($arr['xprof_dob']), + intval($arr['xprof_age']), dbesc($arr['xprof_gender']), dbesc($arr['xprof_marital']), dbesc($arr['xprof_sexual']), |