diff options
Diffstat (limited to 'mod')
-rw-r--r-- | mod/display.php | 2 | ||||
-rw-r--r-- | mod/item.php | 8 | ||||
-rwxr-xr-x | mod/mood.php | 2 | ||||
-rw-r--r-- | mod/network.php | 61 | ||||
-rw-r--r-- | mod/photos.php | 11 | ||||
-rw-r--r-- | mod/search.php | 2 | ||||
-rw-r--r-- | mod/settings.php | 3 |
7 files changed, 21 insertions, 68 deletions
diff --git a/mod/display.php b/mod/display.php index 15b76e63d..31cce95d3 100644 --- a/mod/display.php +++ b/mod/display.php @@ -175,7 +175,7 @@ function display_content(&$a, $update = 0, $load = false) { and mid = '%s' AND (((( `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' AND item_private = 0 ) - and owner_xchan in ( " . stream_perms_xchans(($observer) ? PERMS_NETWORK : PERMS_PUBLIC) . " )) + and owner_xchan in ( " . stream_perms_xchans(($observer) ? (PERMS_NETWORK|PERMS_PUBLIC) : PERMS_PUBLIC) . " )) OR owner_xchan = '%s') $sql_extra ) group by mid limit 1", diff --git a/mod/item.php b/mod/item.php index d4c8a6f4a..5ddafb709 100644 --- a/mod/item.php +++ b/mod/item.php @@ -46,7 +46,7 @@ function item_post(&$a) { call_hooks('post_local_start', $_REQUEST); - logger('postvars ' . print_r($_REQUEST,true), LOGGER_DATA); +// logger('postvars ' . print_r($_REQUEST,true), LOGGER_DATA); $api_source = ((x($_REQUEST,'api_source') && $_REQUEST['api_source']) ? true : false); @@ -376,6 +376,7 @@ function item_post(&$a) { } } + $expires = '0000-00-00 00:00:00'; if(feature_enabled($profile_uid,'content_expire')) { @@ -396,6 +397,7 @@ function item_post(&$a) { $body = z_input_filter($profile_uid,$body,$mimetype); } + // Verify ability to use html or php!!! $execflag = false; @@ -417,6 +419,7 @@ function item_post(&$a) { } } + if($mimetype === 'text/bbcode') { // BBCODE alert: the following functions assume bbcode input @@ -465,7 +468,6 @@ function item_post(&$a) { $body = preg_replace_callback('/\[img(.*?)\](.*?)\[\/img\]/ism','red_zrlify_img_callback',$body); - /** * * When a photo was uploaded into the message using the (profile wall) ajax @@ -513,6 +515,7 @@ function item_post(&$a) { $body = scale_external_images($body,false); + /** * Look for any tags and linkify them */ @@ -603,7 +606,6 @@ function item_post(&$a) { // BBCODE end alert - if(strlen($categories)) { $cats = explode(',',$categories); foreach($cats as $cat) { diff --git a/mod/mood.php b/mod/mood.php index 5508fcb5a..ff765fcac 100755 --- a/mod/mood.php +++ b/mod/mood.php @@ -19,7 +19,7 @@ function mood_init(&$a) { $verbs = get_mood_verbs(); - if(! in_array($verb,$verbs)) + if(! array_key_exists($verb,$verbs)) return; $activity = ACTIVITY_MOOD . '#' . urlencode($verb); diff --git a/mod/network.php b/mod/network.php index 8202b1044..f12471467 100644 --- a/mod/network.php +++ b/mod/network.php @@ -104,7 +104,6 @@ function network_content(&$a, $update = 0, $load = false) { $file = ((x($_GET,'file')) ? $_GET['file'] : ''); - if(x($_GET,'search') || x($_GET,'file')) $nouveau = true; if($cid) @@ -205,25 +204,11 @@ function network_content(&$a, $update = 0, $load = false) { // We only launch liveUpdate if you aren't filtering in some incompatible // way and also you aren't writing a comment (discovered in javascript). - $o .= '<div id="live-network"></div>' . "\r\n"; - $o .= "<script> var profile_uid = " . $_SESSION['uid'] - . "; var netargs = '" . substr($a->cmd,8) - . '?f=' - . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') - . ((x($_GET,'search')) ? '&search=' . $_GET['search'] : '') - . ((x($_GET,'star')) ? '&star=' . $_GET['star'] : '') - . ((x($_GET,'order')) ? '&order=' . $_GET['order'] : '') - . ((x($_GET,'liked')) ? '&liked=' . $_GET['liked'] : '') - . ((x($_GET,'conv')) ? '&conv=' . $_GET['conv'] : '') - . ((x($_GET,'spam')) ? '&spam=' . $_GET['spam'] : '') - . ((x($_GET,'cmin')) ? '&cmin=' . $_GET['cmin'] : '') - . ((x($_GET,'cmax')) ? '&cmax=' . $_GET['cmax'] : '') - . ((x($_GET,'file')) ? '&file=' . $_GET['file'] : '') - . ((x($_GET,'fh')) ? '&fh=' . $_GET['fh'] : '') - - . "'; var profile_page = " . $a->pager['page'] . ";</script>"; - + if($gid || $cid || $cmin || ($cmax != 99) || $star || $liked || $conv || $spam || $nouveau || $list) + $firehose = 0; + $o .= '<div id="live-network"></div>' . "\r\n"; + $o .= "<script> var profile_uid = " . $_SESSION['uid'] . "; var profile_page = " . $a->pager['page'] . ";</script>"; $a->page['htmlhead'] .= replace_macros(get_markup_template("build_query.tpl"),array( '$baseurl' => z_root(), @@ -329,13 +314,10 @@ function network_content(&$a, $update = 0, $load = false) { $uids = " and item.uid = " . local_user() . " "; } - $simple_update = (($update) ? " and ( item.item_flags & " . intval(ITEM_UNSEEN) . " ) " : ''); if($load) $simple_update = ''; - $start = dba_timer(); - if($nouveau && $load) { // "New Item View" - show all items unthreaded in reverse created date order @@ -389,8 +371,6 @@ function network_content(&$a, $update = 0, $load = false) { } } - $first = dba_timer(); - // Then fetch all the children of the parents that are on this page $parents_str = ''; $update_unseen = ''; @@ -406,22 +386,9 @@ function network_content(&$a, $update = 0, $load = false) { dbesc($parents_str) ); - $second = dba_timer(); - xchan_query($items); - - $third = dba_timer(); - $items = fetch_post_tags($items,true); - - $fourth = dba_timer(); - $items = conv_sort($items,$ordering); - - - - //logger('items: ' . print_r($items,true)); - } else { $items = array(); @@ -432,8 +399,6 @@ function network_content(&$a, $update = 0, $load = false) { } -// logger('items: ' . count($items)); - if(($update_unseen) && (! $firehose)) $r = q("UPDATE `item` SET item_flags = ( item_flags ^ %d) WHERE (item_flags & %d) AND `uid` = %d $update_unseen ", @@ -444,28 +409,10 @@ function network_content(&$a, $update = 0, $load = false) { $mode = (($nouveau) ? 'network-new' : 'network'); - $fifth = dba_timer(); - $o .= conversation($a,$items,$mode,$update,'client'); - $sixth = dba_timer(); - - if(($items) && (! $update)) $o .= alt_pager($a,count($items)); - if($load) { -// logger('mod_network: load: ' . count($items) . ' items', LOGGER_DATA); - - profiler($start,$first,'network parents'); - profiler($first,$second,'network children'); - profiler($second,$third,'network authors'); - profiler($third,$fourth,'network tags'); - profiler($fourth,$fifth,'network sort'); - profiler($fifth,$sixth,'network render'); - profiler($start,$sixth,'network total'); - profiler(1,1,'-- ' . count($items)); - } - return $o; } diff --git a/mod/photos.php b/mod/photos.php index a3ca933b1..c43beb8d4 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -539,8 +539,8 @@ function photos_content(&$a) { $albumselect = '<select id="photos-upload-album-select" name="album" size="4">'; $albumselect .= '<option value="" ' . ((! $selname) ? ' selected="selected" ' : '') . '> </option>'; - if(count($albums)) { - foreach($albums as $album) { + if(count($albums['albums'])) { + foreach($albums['albums'] as $album) { if(! $album['text']) continue; $selected = (($selname === $album['text']) ? ' selected="selected" ' : ''); @@ -548,8 +548,6 @@ function photos_content(&$a) { } } - $celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false); - $albumselect .= '</select>'; $uploader = ''; @@ -929,6 +927,10 @@ function photos_content(&$a) { $edit = null; if($can_post) { + if(array_key_exists('albums', $a->data)) + $albums = get_app()->data['albums']; + else + $albums = photos_albums_list($a->data['channel'],$a->data['observer']); $album_e = $ph[0]['album']; $caption_e = $ph[0]['description']; @@ -939,6 +941,7 @@ function photos_content(&$a) { 'id' => $ph[0]['id'], 'rotatecw' => t('Rotate CW (right)'), 'rotateccw' => t('Rotate CCW (left)'), + 'albums' => $albums['albums'], 'album' => $album_e, 'newalbum' => t('New album name'), 'nickname' => $a->data['channel']['channel_address'], diff --git a/mod/search.php b/mod/search.php index 2c2e8c86a..663d355e2 100644 --- a/mod/search.php +++ b/mod/search.php @@ -143,7 +143,7 @@ function search_content(&$a,$update = 0, $load = false) { WHERE item_restrict = 0 AND (((( `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' AND item_private = 0 ) - and owner_xchan in ( " . stream_perms_xchans(($observer) ? PERMS_NETWORK : PERMS_PUBLIC) . " )) + and owner_xchan in ( " . stream_perms_xchans(($observer) ? (PERMS_NETWORK|PERMS_PUBLIC) : PERMS_PUBLIC) . " )) $pub_sql ) OR owner_xchan = '%s') $sql_extra group by mid ORDER BY created DESC $pager_sql", diff --git a/mod/settings.php b/mod/settings.php index bdf30bae2..c72fdc8c4 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -792,7 +792,8 @@ function settings_content(&$a) { $perm_opts = array( array( t('Nobody except yourself'), 0), array( t('Only those you specifically allow'), PERMS_SPECIFIC), - array( t('Anybody in your address book'), PERMS_CONTACTS), + array( t('Approved connections'), PERMS_CONTACTS), + array( t('Any connections'), PERMS_PENDING), array( t('Anybody on this website'), PERMS_SITE), array( t('Anybody in this network'), PERMS_NETWORK), array( t('Anybody authenticated'), PERMS_AUTHED), |