4 function network_init(&$a) {
6 notice( t('Permission denied.') . EOL);
10 $is_a_date_query = false;
13 for($x = 1; $x < $a->argc; $x ++) {
14 if(is_a_date_arg($a->argv[$x])) {
15 $is_a_date_query = true;
21 // convert query string to array and remove first element (wich is friendica args)
22 $query_array = array();
23 parse_str($a->query_string, $query_array);
24 array_shift($query_array);
26 // fetch last used tab and redirect if needed
27 $sel_tabs = network_query_get_sel_tab($a);
28 $last_sel_tabs = get_pconfig(local_user(), 'network.view','tab.selected');
29 if (is_array($last_sel_tabs)){
31 '/network?f=&order=comment',//all
32 '/network?f=&order=post', //postord
33 '/network?f=&conv=1', //conv
35 '/network?f=&star=1', //starred
36 '/network?f=&bmark=1', //bookmarked
37 '/network?f=&spam=1', //spam
40 // redirect if current selected tab is 'no_active' and
41 // last selected tab is _not_ 'all_active'.
42 // and this isn't a date query
44 if ($sel_tabs[0] == 'active' && $last_sel_tabs[0]!='active' && (! $is_a_date_query)) {
45 $k = array_search('active', $last_sel_tabs);
47 // merge tab querystring with request querystring
49 list($dest_url,$dest_qs) = explode("?", $tab_urls[$k]);
50 parse_str( $dest_qs, $dest_qa);
51 $dest_qa = array_merge($query_array, $dest_qa);
52 $dest_qs = build_querystring($dest_qa);
54 // groups filter is in form of "network/nnn". Add it to $dest_url, if it's possible
55 if ($a->argc==2 && is_numeric($a->argv[1]) && strpos($dest_url, "/",1)===false){
56 $dest_url .= "/".$a->argv[1];
59 goaway($a->get_baseurl() . $dest_url."?".$dest_qs);
63 $group_id = (($a->argc > 1 && intval($a->argv[1])) ? intval($a->argv[1]) : 0);
65 require_once('include/group.php');
66 require_once('include/contact_widgets.php');
67 require_once('include/items.php');
69 if(! x($a->page,'aside'))
70 $a->page['aside'] = '';
72 $search = ((x($_GET,'search')) ? escape_tags($_GET['search']) : '');
75 $r = q("select * from `search` where `uid` = %d and `term` = '%s' limit 1",
80 q("insert into `search` ( `uid`,`term` ) values ( %d, '%s') ",
86 if(x($_GET,'remove')) {
87 q("delete from `search` where `uid` = %d and `term` = '%s' limit 1",
95 // search terms header
96 if(x($_GET,'search')) {
97 $a->page['content'] .= '<h2>' . t('Search Results For:') . ' ' . $search . '</h2>';
100 $a->page['aside'] .= group_side('network','network',true,$group_id);
101 $a->page['aside'] .= posted_date_widget($a->get_baseurl() . '/network',local_user(),false);
102 $a->page['aside'] .= networks_widget($a->get_baseurl(true) . '/network',(x($_GET, 'nets') ? $_GET['nets'] : ''));
103 $a->page['aside'] .= saved_searches($search);
104 $a->page['aside'] .= fileas_widget($a->get_baseurl(true) . '/network',(x($_GET, 'file') ? $_GET['file'] : ''));
108 function saved_searches($search) {
112 $srchurl = '/network?f='
113 . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '')
114 . ((x($_GET,'star')) ? '&star=' . $_GET['star'] : '')
115 . ((x($_GET,'bmark')) ? '&bmark=' . $_GET['bmark'] : '')
116 . ((x($_GET,'conv')) ? '&conv=' . $_GET['conv'] : '')
117 . ((x($_GET,'nets')) ? '&nets=' . $_GET['nets'] : '')
118 . ((x($_GET,'cmin')) ? '&cmin=' . $_GET['cmin'] : '')
119 . ((x($_GET,'cmax')) ? '&cmax=' . $_GET['cmax'] : '')
120 . ((x($_GET,'file')) ? '&file=' . $_GET['file'] : '');
125 $r = q("select `id`,`term` from `search` WHERE `uid` = %d",
135 'term' => $rr['term'],
136 'encodedterm' => urlencode($rr['term']),
137 'delete' => t('Remove term'),
138 'selected' => ($search==$rr['term']),
144 $tpl = get_markup_template("saved_searches_aside.tpl");
145 $o = replace_macros($tpl, array(
146 '$title' => t('Saved Searches'),
148 '$searchbox' => search($search,'netsearch-box',$srchurl,true),
157 * Return selected tab from query
160 * '/network' => $no_active = 'active'
161 * '/network?f=&order=comment' => $comment_active = 'active'
162 * '/network?f=&order=post' => $postord_active = 'active'
163 * '/network?f=&conv=1', => $conv_active = 'active'
164 * '/network/new', => $new_active = 'active'
165 * '/network?f=&star=1', => $starred_active = 'active'
166 * '/network?f=&bmark=1', => $bookmarked_active = 'active'
167 * '/network?f=&spam=1', => $spam_active = 'active'
169 * @return Array ( $no_active, $comment_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active, $spam_active );
171 function network_query_get_sel_tab($a) {
173 $starred_active = '';
175 $bookmarked_active = '';
180 $postord_active = '';
182 if(($a->argc > 1 && $a->argv[1] === 'new')
183 || ($a->argc > 2 && $a->argv[2] === 'new')) {
184 $new_active = 'active';
187 if(x($_GET,'search')) {
188 $search_active = 'active';
191 if(x($_GET,'star')) {
192 $starred_active = 'active';
195 if(x($_GET,'bmark')) {
196 $bookmarked_active = 'active';
199 if(x($_GET,'conv')) {
200 $conv_active = 'active';
203 if(x($_GET,'spam')) {
204 $spam_active = 'active';
209 if (($new_active == '')
210 && ($starred_active == '')
211 && ($bookmarked_active == '')
212 && ($conv_active == '')
213 && ($search_active == '')
214 && ($spam_active == '')) {
215 $no_active = 'active';
218 if ($no_active=='active' && x($_GET,'order')) {
219 switch($_GET['order']){
220 case 'post': $postord_active = 'active'; $no_active=''; break;
221 case 'comment' : $all_active = 'active'; $no_active=''; break;
225 return array($no_active, $all_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active, $spam_active);
229 function network_content(&$a, $update = 0) {
231 require_once('include/conversation.php');
234 $_SESSION['return_url'] = $a->query_string;
238 $arr = array('query' => $a->query_string);
240 call_hooks('network_content_init', $arr);
243 $datequery = $datequery2 = '';
250 for($x = 1; $x < $a->argc; $x ++) {
251 if(is_a_date_arg($a->argv[$x])) {
253 $datequery2 = escape_tags($a->argv[$x]);
255 $datequery = escape_tags($a->argv[$x]);
256 $_GET['order'] = 'post';
259 elseif($a->argv[$x] === 'new') {
262 elseif(intval($a->argv[$x])) {
263 $group = intval($a->argv[$x]);
264 $def_acl = array('allow_gid' => '<' . $group . '>');
273 // TODO: fix this logic, reduce duplication
274 //$a->page['content'] .= '<div class="tabs-wrapper">';
276 list($no_active, $all_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active, $spam_active) = network_query_get_sel_tab($a);
277 // if no tabs are selected, defaults to comments
278 if ($no_active=='active') $all_active='active';
279 //echo "<pre>"; var_dump($no_active, $all_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active, $spam_active); killme();
281 $cmd = (($datequery) ? '' : $a->cmd);
282 $len_naked_cmd = strlen(str_replace('/new','',$cmd));
287 'label' => t('Commented Order'),
288 'url'=>$a->get_baseurl(true) . '/' . str_replace('/new', '', $cmd) . '?f=&order=comment' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : ''),
290 'title'=> t('Sort by Comment Date'),
293 'label' => t('Posted Order'),
294 'url'=>$a->get_baseurl(true) . '/' . str_replace('/new', '', $cmd) . '?f=&order=post' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : ''),
295 'sel'=>$postord_active,
296 'title' => t('Sort by Post Date'),
300 'label' => t('Personal'),
301 'url' => $a->get_baseurl(true) . '/' . str_replace('/new', '', $cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '') . '&conv=1',
302 'sel' => $conv_active,
303 'title' => t('Posts that mention or involve you'),
307 'url' => $a->get_baseurl(true) . '/' . str_replace('/new', '', $cmd) . ($len_naked_cmd ? '/' : '') . 'new' . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : ''),
308 'sel' => $new_active,
309 'title' => t('Activity Stream - by date'),
312 'label' => t('Starred'),
313 'url'=>$a->get_baseurl(true) . '/' . str_replace('/new', '', $cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '') . '&star=1',
314 'sel'=>$starred_active,
315 'title' => t('Favourite Posts'),
318 'label' => t('Shared Links'),
319 'url'=>$a->get_baseurl(true) . '/' . str_replace('/new', '', $cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '') . '&bmark=1',
320 'sel'=>$bookmarked_active,
321 'title'=> t('Interesting Links'),
324 // 'label' => t('Spam'),
325 // 'url'=>$a->get_baseurl(true) . '/network?f=&spam=1'
326 // 'sel'=> $spam_active,
327 // 'title' => t('Posts flagged as SPAM'),
332 // save selected tab, but only if not in search or file mode
333 if(!x($_GET,'search') && !x($_GET,'file')) {
334 set_pconfig( local_user(), 'network.view','tab.selected',array($all_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active, $spam_active) );
337 $arr = array('tabs' => $tabs);
338 call_hooks('network_tabs', $arr);
340 $o .= replace_macros(get_markup_template('common_tabs.tpl'), array('$tabs'=> $arr['tabs']));
342 // --- end item filter tabs
348 $contact_id = $a->cid;
350 require_once('include/acl_selectors.php');
352 $cid = ((x($_GET,'cid')) ? intval($_GET['cid']) : 0);
353 $star = ((x($_GET,'star')) ? intval($_GET['star']) : 0);
354 $bmark = ((x($_GET,'bmark')) ? intval($_GET['bmark']) : 0);
355 $order = ((x($_GET,'order')) ? notags($_GET['order']) : 'comment');
356 $liked = ((x($_GET,'liked')) ? intval($_GET['liked']) : 0);
357 $conv = ((x($_GET,'conv')) ? intval($_GET['conv']) : 0);
358 $spam = ((x($_GET,'spam')) ? intval($_GET['spam']) : 0);
359 $nets = ((x($_GET,'nets')) ? $_GET['nets'] : '');
360 $cmin = ((x($_GET,'cmin')) ? intval($_GET['cmin']) : 0);
361 $cmax = ((x($_GET,'cmax')) ? intval($_GET['cmax']) : 99);
362 $file = ((x($_GET,'file')) ? $_GET['file'] : '');
366 if(x($_GET,'search') || x($_GET,'file'))
369 $def_acl = array('allow_cid' => '<' . intval($cid) . '>');
372 $r = q("select id from contact where uid = %d and network = '%s' and self = 0",
373 intval(local_user()),
380 $str .= '<' . $rr['id'] . '>';
382 $def_acl = array('allow_cid' => $str);
387 if(($t = group_public_members($group)) && (! get_pconfig(local_user(),'system','nowarn_insecure'))) {
388 notice( sprintf( tt('Warning: This group contains %s member from an insecure network.',
389 'Warning: This group contains %s members from an insecure network.',
391 notice( t('Private messages to this group are at risk of public disclosure.') . EOL);
395 nav_set_selected('network');
397 $celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false);
401 'allow_location' => $a->user['allow_location'],
402 'default_location' => $a->user['default-location'],
403 'nickname' => $a->user['nickname'],
404 'lockstate' => ((($group) || ($cid) || ($nets) || (is_array($a->user) && ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid']))))) ? 'lock' : 'unlock'),
405 'acl' => populate_acl((($group || $cid || $nets) ? $def_acl : $a->user), $celeb),
406 'bang' => (($group || $cid || $nets) ? '!' : ''),
407 'visitor' => 'block',
408 'profile_uid' => local_user()
411 $o .= status_editor($a,$x);
416 // We don't have to deal with ACL's on this page. You're looking at everything
417 // that belongs to you, hence you can see all of it. We will filter by group if
421 $sql_options = (($star) ? " and starred = 1 " : '');
422 $sql_options .= (($bmark) ? " and bookmark = 1 " : '');
424 $sql_nets = (($nets) ? sprintf(" and `contact`.`network` = '%s' ", dbesc($nets)) : '');
426 $sql_extra = " AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE `id` = `parent` $sql_options ) ";
429 $r = q("SELECT `name`, `id` FROM `group` WHERE `id` = %d AND `uid` = %d LIMIT 1",
431 intval($_SESSION['uid'])
436 notice( t('No such group') . EOL );
437 goaway($a->get_baseurl(true) . '/network');
441 $contacts = expand_groups(array($group));
442 if((is_array($contacts)) && count($contacts)) {
443 $contact_str = implode(',',$contacts);
446 $contact_str = ' 0 ';
447 info( t('Group is empty'));
450 $sql_extra = " AND `item`.`parent` IN ( SELECT DISTINCT(`parent`) FROM `item` WHERE 1 $sql_options AND ( `contact-id` IN ( $contact_str ) OR `allow_gid` like '" . protect_sprintf('%<' . intval($group) . '>%') . "' ) and deleted = 0 ) ";
451 $o = '<h2>' . t('Group: ') . $r[0]['name'] . '</h2>' . $o;
455 $r = q("SELECT `id`,`name`,`network`,`writable`,`nurl` FROM `contact` WHERE `id` = %d
456 AND `blocked` = 0 AND `pending` = 0 LIMIT 1",
460 $sql_extra = " AND `item`.`parent` IN ( SELECT DISTINCT(`parent`) FROM `item` WHERE 1 $sql_options AND `contact-id` = " . intval($cid) . " and deleted = 0 ) ";
461 $o = '<h2>' . t('Contact: ') . $r[0]['name'] . '</h2>' . $o;
462 if($r[0]['network'] === NETWORK_OSTATUS && $r[0]['writable'] && (! get_pconfig(local_user(),'system','nowarn_insecure'))) {
463 notice( t('Private messages to this person are at risk of public disclosure.') . EOL);
468 notice( t('Invalid contact.') . EOL);
469 goaway($a->get_baseurl(true) . '/network');
474 if((! $group) && (! $cid) && (! $update) && (! get_config('theme','hide_eventlist'))) {
475 $o .= get_birthdays();
480 // The special div is needed for liveUpdate to kick in for this page.
481 // We only launch liveUpdate if you aren't filtering in some incompatible
482 // way and also you aren't writing a comment (discovered in javascript).
484 $o .= '<div id="live-network"></div>' . "\r\n";
485 $o .= "<script> var profile_uid = " . $_SESSION['uid']
486 . "; var netargs = '" . substr($a->cmd,8)
488 . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '')
489 . ((x($_GET,'search')) ? '&search=' . $_GET['search'] : '')
490 . ((x($_GET,'star')) ? '&star=' . $_GET['star'] : '')
491 . ((x($_GET,'order')) ? '&order=' . $_GET['order'] : '')
492 . ((x($_GET,'bmark')) ? '&bmark=' . $_GET['bmark'] : '')
493 . ((x($_GET,'liked')) ? '&liked=' . $_GET['liked'] : '')
494 . ((x($_GET,'conv')) ? '&conv=' . $_GET['conv'] : '')
495 . ((x($_GET,'spam')) ? '&spam=' . $_GET['spam'] : '')
496 . ((x($_GET,'nets')) ? '&nets=' . $_GET['nets'] : '')
497 . ((x($_GET,'cmin')) ? '&cmin=' . $_GET['cmin'] : '')
498 . ((x($_GET,'cmax')) ? '&cmax=' . $_GET['cmax'] : '')
499 . ((x($_GET,'file')) ? '&file=' . $_GET['file'] : '')
501 . "'; var profile_page = " . $a->pager['page'] . "; </script>\r\n";
507 $sql_extra3 .= protect_sprintf(sprintf(" AND item.created <= '%s' ", dbesc(datetime_convert(date_default_timezone_get(),'',$datequery))));
510 $sql_extra3 .= protect_sprintf(sprintf(" AND item.created >= '%s' ", dbesc(datetime_convert(date_default_timezone_get(),'',$datequery2))));
513 $sql_extra2 = (($nouveau) ? '' : " AND `item`.`parent` = `item`.`id` ");
514 $sql_extra3 = (($nouveau) ? '' : $sql_extra3);
516 if(x($_GET,'search')) {
517 $search = escape_tags($_GET['search']);
518 if (get_config('system','use_fulltext_engine')) {
519 if(strpos($search,'#') === 0)
520 $sql_extra .= sprintf(" AND (MATCH(tag) AGAINST ('".'"%s"'."' in boolean mode)) ",
521 dbesc(protect_sprintf($search))
524 $sql_extra .= sprintf(" AND (MATCH(`item`.`body`) AGAINST ('".'"%s"'."' in boolean mode) or MATCH(tag) AGAINST ('".'"%s"'."' in boolean mode)) ",
525 dbesc(protect_sprintf($search)),
526 dbesc(protect_sprintf($search))
529 $sql_extra .= sprintf(" AND ( `item`.`body` like '%s' OR `item`.`tag` like '%s' ) ",
530 dbesc(protect_sprintf('%' . $search . '%')),
531 dbesc(protect_sprintf('%]' . $search . '[%'))
536 $sql_extra .= file_tag_file_query('item',unxmlify($file));
540 $myurl = $a->get_baseurl() . '/profile/'. $a->user['nickname'];
541 $myurl = substr($myurl,strpos($myurl,'://')+3);
542 $myurl = str_replace('www.','',$myurl);
543 $diasp_url = str_replace('/profile/','/u/',$myurl);
544 if (get_config('system','use_fulltext_engine'))
545 $sql_extra .= sprintf(" AND `item`.`parent` IN (SELECT distinct(`parent`) from item where (MATCH(`author-link`) AGAINST ('".'"%s"'."' in boolean mode) or MATCH(`tag`) AGAINST ('".'"%s"'."' in boolean mode) or MATCH(tag) AGAINST ('".'"%s"'."' in boolean mode))) ",
546 dbesc(protect_sprintf($myurl)),
547 dbesc(protect_sprintf($myurl)),
548 dbesc(protect_sprintf($diasp_url))
551 $sql_extra .= sprintf(" AND `item`.`parent` IN (SELECT distinct(`parent`) from item where ( `author-link` like '%s' or `tag` like '%s' or tag like '%s' )) ",
552 dbesc(protect_sprintf('%' . $myurl)),
553 dbesc(protect_sprintf('%' . $myurl . ']%')),
554 dbesc(protect_sprintf('%' . $diasp_url . ']%'))
561 // only setup pagination on initial page view
566 if(! get_pconfig(local_user(),'system','alt_pager')) {
567 $r = q("SELECT COUNT(*) AS `total`
568 FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
569 WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
570 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
571 $sql_extra2 $sql_extra3
572 $sql_extra $sql_nets ",
573 intval($_SESSION['uid'])
577 $a->set_pager_total($r[0]['total']);
581 $itemspage_network = get_pconfig(local_user(),'system','itemspage_network');
582 $itemspage_network = ((intval($itemspage_network)) ? $itemspage_network : 40);
583 if(($a->force_max_items > 0) && ($a->force_max_items < $itemspage_network))
584 $itemspage_network = $a->force_max_items;
586 $a->set_pager_itemspage($itemspage_network);
587 $pager_sql = sprintf(" LIMIT %d, %d ",intval($a->pager['start']), intval($a->pager['itemspage']));
590 $simple_update = (($update) ? " and `item`.`unseen` = 1 " : '');
593 // "New Item View" - show all items unthreaded in reverse created date order
595 $items = q("SELECT `item`.*, `item`.`id` AS `item_id`,
596 `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, `contact`.`writable`,
597 `contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
598 `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
599 FROM `item`, `contact`
600 WHERE `item`.`uid` = %d AND `item`.`visible` = 1
601 AND `item`.`deleted` = 0 and `item`.`moderated` = 0
603 AND `contact`.`id` = `item`.`contact-id`
604 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
606 ORDER BY `item`.`received` DESC $pager_sql ",
607 intval($_SESSION['uid'])
613 // Normal conversation view
616 if($order === 'post')
617 $ordering = "`created`";
619 $ordering = "`commented`";
621 // Fetch a page full of parent items for this page
624 $r = q("SELECT `parent` AS `item_id`, `contact`.`uid` AS `contact_uid`
625 FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
626 WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND
627 (`item`.`deleted` = 0 OR item.verb = '" . ACTIVITY_LIKE ."' OR item.verb = '" . ACTIVITY_DISLIKE . "')
628 and `item`.`moderated` = 0 and `item`.`unseen` = 1
629 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
630 $sql_extra3 $sql_extra $sql_nets ",
635 $r = q("SELECT `item`.`id` AS `item_id`, `contact`.`uid` AS `contact_uid`
636 FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
637 WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
638 AND `item`.`moderated` = 0 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
639 AND `item`.`parent` = `item`.`id`
640 $sql_extra3 $sql_extra $sql_nets
641 ORDER BY `item`.$ordering DESC $pager_sql ",
646 // Then fetch all the children of the parents that are on this page
648 $parents_arr = array();
653 if(! in_array($rr['item_id'],$parents_arr))
654 $parents_arr[] = $rr['item_id'];
655 $parents_str = implode(', ', $parents_arr);
657 $items = q("SELECT `item`.*, `item`.`id` AS `item_id`,
658 `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`alias`, `contact`.`rel`, `contact`.`writable`,
659 `contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
660 `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
661 FROM `item`, `contact`
662 WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
663 AND `item`.`moderated` = 0 AND `contact`.`id` = `item`.`contact-id`
664 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
665 AND `item`.`parent` IN ( %s )
667 intval(local_user()),
671 $items = conv_sort($items,$ordering);
679 // We aren't going to try and figure out at the item, group, and page
680 // level which items you've seen and which you haven't. If you're looking
681 // at the top level network page just mark everything seen.
683 if((! $group) && (! $cid) && (! $star)) {
684 $r = q("UPDATE `item` SET `unseen` = 0
685 WHERE `unseen` = 1 AND `uid` = %d",
690 // Set this so that the conversation function can find out contact info for our wall-wall items
691 $a->page_contact = $a->contact;
693 $mode = (($nouveau) ? 'network-new' : 'network');
695 $o .= conversation($a,$items,$mode,$update);
698 if(! get_pconfig(local_user(),'system','alt_pager')) {
702 $o .= alt_pager($a,count($items));