diff options
Diffstat (limited to 'mod')
-rw-r--r-- | mod/network.php | 29 | ||||
-rw-r--r-- | mod/settings.php | 29 |
2 files changed, 46 insertions, 12 deletions
diff --git a/mod/network.php b/mod/network.php index 9fed8592e..763b3693f 100644 --- a/mod/network.php +++ b/mod/network.php @@ -71,21 +71,30 @@ function saved_searches($search) { intval(local_user()) ); - $o .= '<div id="saved-search-list" class="widget">'; - $o .= '<h3 id="search">' . t('Saved Searches') . '</h3>' . "\r\n"; - $o .= search($search,'netsearch-box',$srchurl,true); + $saved = array(); + + if(count($r)) { - $o .= '<ul id="saved-search-ul">' . "\r\n"; foreach($r as $rr) { - $o .= '<li class="saved-search-li clear"><a href="network/?f=&remove=1&search=' . $rr['term'] . '" class="icon drophide savedsearchdrop" title="' . t('Remove term') . '" onclick="return confirmDelete();" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></a> <a href="network/?f=&search=' . urlencode($rr['term']) . '" class="savedsearchterm" >' . $rr['term'] . '</a></li>' . "\r\n"; + $saved[] = array( + 'term' => $rr['term'], + 'encodedterm' => urlencode($rr['term']), + 'delete' => t('Remove term'), + 'selected' => ($search==$rr['term']), + ); } - $o .= '</ul>'; } - $o .= '<div class="clear"></div>'; - - $o .= '</div>' . "\r\n"; + + $tpl = get_markup_template("saved_searches_aside.tpl"); + $o = replace_macros($tpl, array( + '$title' => t('Saved Searches'), + '$add' => t('add'), + '$searchbox' => search($search,'netsearch-box',$srchurl,true), + '$saved' => $saved, + )); + return $o; } @@ -102,7 +111,7 @@ function network_content(&$a, $update = 0) { // item filter tabs // TODO: fix this logic, reduce duplication - $a->page['content'] .= '<div class="tabs-wrapper">'; + //$a->page['content'] .= '<div class="tabs-wrapper">'; $starred_active = ''; $new_active = ''; diff --git a/mod/settings.php b/mod/settings.php index a073a5e98..f51a484c8 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -215,6 +215,12 @@ function settings_post(&$a) { $openid = ((x($_POST,'openid_url')) ? notags(trim($_POST['openid_url'])) : ''); $maxreq = ((x($_POST,'maxreq')) ? intval($_POST['maxreq']) : 0); $expire = ((x($_POST,'expire')) ? intval($_POST['expire']) : 0); + + + $expire_items = ((x($_POST,'expire_items')) ? intval($_POST['expire_items']) : 0); + $expire_notes = ((x($_POST,'expire_notes')) ? intval($_POST['expire_notes']) : 0); + $expire_photos = ((x($_POST,'expire_photos'))? intval($_POST['expire_photos']) : 0); + $allow_location = (((x($_POST,'allow_location')) && (intval($_POST['allow_location']) == 1)) ? 1: 0); $publish = (((x($_POST,'profile_in_directory')) && (intval($_POST['profile_in_directory']) == 1)) ? 1: 0); @@ -297,6 +303,10 @@ function settings_post(&$a) { $openidserver = ''; } + set_pconfig(local_user(),'expire','items', $expire_items); + set_pconfig(local_user(),'expire','notes', $expire_notes); + set_pconfig(local_user(),'expire','photos', $expire_photos); + $r = q("UPDATE `user` SET `username` = '%s', `email` = '%s', `openid` = '%s', `timezone` = '%s', `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s', `notify-flags` = %d, `page-flags` = %d, `default-location` = '%s', `allow_location` = %d, `theme` = '%s', `maxreq` = %d, `expire` = %d, `openidserver` = '%s', `blockwall` = %d, `hidewall` = %d, `blocktags` = %d WHERE `uid` = %d LIMIT 1", dbesc($username), dbesc($email), @@ -586,6 +596,15 @@ function settings_content(&$a) { $blockwall = $a->user['blockwall']; $blocktags = $a->user['blocktags']; + $expire_items = get_pconfig(local_user(), 'expire','items'); + $expire_items = (($expire_items===false)?1:$expire_items); // default if not set: 1 + + $expire_notes = get_pconfig(local_user(), 'expire','notes'); + $expire_notes = (($expire_notes===false)?1:$expire_notes); // default if not set: 1 + + $expire_photos = get_pconfig(local_user(), 'expire','photos'); + $expire_photos = (($expire_photos===false)?0:$expire_photos); // default if not set: 0 + if(! strlen($a->user['timezone'])) $timezone = date_default_timezone_get(); @@ -698,7 +717,13 @@ function settings_content(&$a) { $celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false); - + $expire_arr = array( + 'days' => array('expire', t("Automatically expire posts after days:"), $expire, t('If empty, posts will not expire. Expired posts will be deleted')), + 'advanced' => t('Advanced expire settings'), + 'items' => array('expire_items', t("Expire posts:"), $expire_items, '', array(t('No'),t('Yes'))), + 'notes' => array('expire_notes', t("Expire personal notes:"), $expire_notes, '', array(t('No'),t('Yes'))), + 'photos' => array('expire_photos', t("Expire photos:"), $expire_photos, '', array(t('No'),t('Yes'))), + ); $o .= replace_macros($stpl,array( '$tabs' => $tabs, @@ -736,7 +761,7 @@ function settings_content(&$a) { '$blockwall'=> $blockwall, // array('blockwall', t('Allow friends to post to your profile page:'), !$blockwall, ''), '$blocktags'=> $blocktags, // array('blocktags', t('Allow friends to tag your posts:'), !$blocktags, ''), - '$expire' => array('expire', t("Automatically expire posts after days:"), $expire, t('If empty, posts will not expire. Expired posts will be deleted')), + '$expire' => $expire_arr, '$profile_in_dir' => $profile_in_dir, '$profile_in_net_dir' => $profile_in_net_dir, |