4 function display_content(&$a) {
6 if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
7 notice( t('Public access denied.') . EOL);
11 require_once("include/bbcode.php");
12 require_once('include/security.php');
13 require_once('include/conversation.php');
16 $o = '<div id="live-display"></div>' . "\r\n";
18 $nick = (($a->argc > 1) ? $a->argv[1] : '');
19 profile_load($a,$nick);
21 $item_id = (($a->argc > 2) ? intval($a->argv[2]) : 0);
25 notice( t('Item not found.') . EOL);
34 $remote_contact = false;
37 $contact_id = $_SESSION['visitor_id'];
38 $groups = init_groups_visitor($contact_id);
39 $r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
41 intval($a->profile['uid'])
45 $remote_contact = true;
49 if(! $remote_contact) {
51 $contact_id = $_SESSION['cid'];
52 $contact = $a->contact;
56 $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 1 LIMIT 1",
57 intval($a->profile['uid'])
60 $a->page_contact = $r[0];
62 $sql_extra = permissions_sql($a->profile['uid'],$remote_contact,$groups);
64 $r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
65 `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
66 `contact`.`network`, `contact`.`thumb`, `contact`.`self`, `contact`.`writable`,
67 `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
68 FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
69 WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
70 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
71 AND `item`.`parent` = ( SELECT `parent` FROM `item` WHERE ( `id` = '%s' OR `uri` = '%s' ))
73 ORDER BY `parent` DESC, `gravity` ASC, `id` ASC ",
74 intval($a->profile['uid']),
82 if((local_user()) && (local_user() == $a->profile['uid'])) {
83 q("UPDATE `item` SET `unseen` = 0
84 WHERE `parent` = %d AND `unseen` = 1",
85 intval($r[0]['parent'])
90 $o .= conversation($a,$r,'display', false);
94 $r = q("SELECT `id` FROM `item` WHERE `id` = '%s' OR `uri` = '%s' LIMIT 1",
99 if($r[0]['deleted']) {
100 notice( t('Item has been removed.') . EOL );
103 notice( t('Permission denied.') . EOL );
107 notice( t('Item not found.') . EOL );
112 $o .= '<div class="cc-license">' . t('Shared content is covered by the <a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0</a> license.') . '</div>';