]> git.mxchange.org Git - friendica.git/blob - object/Item.php
update fancybox, remove tiptip from head.tpl
[friendica.git] / object / Item.php
1 <?php
2 if(class_exists('Item'))
3         return;
4
5 require_once('object/BaseObject.php');
6 require_once('include/text.php');
7 require_once('boot.php');
8
9 /**
10  * An item
11  */
12 class Item extends BaseObject {
13         private $data = array();
14         private $template = null;
15         private $available_templates = array(
16                 'wall' => 'wall_thread.tpl',
17                 'wall2wall' => 'wallwall_thread.tpl'
18         );
19         private $comment_box_template = 'comment_item.tpl';
20         private $toplevel = false;
21         private $writable = false;
22         private $children = array();
23         private $parent = null;
24         private $conversation = null;
25         private $redirect_url = null;
26         private $owner_url = '';
27         private $owner_photo = '';
28         private $owner_name = '';
29         private $wall_to_wall = false;
30         private $threaded = false;
31         private $visiting = false;
32
33         public function __construct($data) {
34                 $a = $this->get_app();
35                 
36                 $this->data = $data;
37                 $this->set_template('wall');
38                 $this->toplevel = ($this->get_id() == $this->get_data_value('parent'));
39
40                 if(is_array($_SESSION['remote'])) {
41                         foreach($_SESSION['remote'] as $visitor) {
42                                 if($visitor['cid'] == $this->get_data_value('contact-id')) {
43                                         $this->visiting = true;
44                                         break;
45                                 }
46                         }
47                 }
48                 
49                 $this->writable = ($this->get_data_value('writable') || $this->get_data_value('self'));
50
51                 $ssl_state = ((local_user()) ? true : false);
52                 $this->redirect_url = $a->get_baseurl($ssl_state) . '/redir/' . $this->get_data_value('cid') ;
53
54                 if(get_config('system','thread_allow') && $a->theme_thread_allow && !$this->is_toplevel())
55                         $this->threaded = true;
56
57                 // Prepare the children
58                 if(count($data['children'])) {
59                         foreach($data['children'] as $item) {
60                                 /*
61                                  * Only add will be displayed
62                                  */
63                                 if($item['network'] === NETWORK_MAIL && local_user() != $item['uid']) {
64                                         continue;
65                                 }
66                                 if(! visible_activity($item)) {
67                                         continue;
68                                 }
69                                 $item['pagedrop'] = $data['pagedrop'];
70                                 $child = new Item($item);
71                                 $this->add_child($child);
72                         }
73                 }
74         }
75
76         /**
77          * Get data in a form usable by a conversation template
78          *
79          * Returns:
80          *      _ The data requested on success
81          *      _ false on failure
82          */
83         public function get_template_data($alike, $dlike, $thread_level=1) {
84                 $result = array();
85
86                 $a = $this->get_app();
87
88                 $item = $this->get_data();
89
90                 $commentww = '';
91                 $sparkle = '';
92                 $buttons = '';
93                 $dropping = false;
94                 $star = false;
95                 $isstarred = "unstarred";
96                 $indent = '';
97                 $shiny = '';
98                 $osparkle = '';
99                 $total_children = $this->count_descendants();
100
101                 $conv = $this->get_conversation();
102
103
104                 $lock = ((($item['private'] == 1) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) 
105                         || strlen($item['deny_cid']) || strlen($item['deny_gid']))))
106                         ? t('Private Message')
107                         : false);
108                 $shareable = ((($conv->get_profile_owner() == local_user()) && ($item['private'] != 1)) ? true : false);
109                 if(local_user() && link_compare($a->contact['url'],$item['author-link']))
110                         $edpost = array($a->get_baseurl($ssl_state)."/editpost/".$item['id'], t("Edit"));
111                 else
112                         $edpost = false;
113                 if(($this->get_data_value('uid') == local_user()) || $this->is_visiting())
114                         $dropping = true;
115
116                 $drop = array(
117                         'dropping' => $dropping,
118                         'pagedrop' => ((feature_enabled($conv->get_profile_owner(),'multi_delete')) ? $item['pagedrop'] : ''),
119                         'select' => t('Select'),
120                         'delete' => t('Delete'),
121                 );
122
123                 $filer = (($conv->get_profile_owner() == local_user()) ? t("save to folder") : false);
124
125                 $diff_author    = ((link_compare($item['url'],$item['author-link'])) ? false : true);
126                 $profile_name   = (((strlen($item['author-name']))   && $diff_author) ? $item['author-name']   : $item['name']);
127                 if($item['author-link'] && (! $item['author-name']))
128                         $profile_name = $item['author-link'];
129
130                 $sp = false;
131                 $profile_link = best_link_url($item,$sp);
132                 if($profile_link === 'mailbox')
133                         $profile_link = '';
134                 if($sp)
135                         $sparkle = ' sparkle';
136                 else
137                         $profile_link = zrl($profile_link);
138
139                 $normalised = normalise_link((strlen($item['author-link'])) ? $item['author-link'] : $item['url']);
140                 if(($normalised != 'mailbox') && (x($a->contacts,$normalised)))
141                         $profile_avatar = $a->contacts[$normalised]['thumb'];
142                 else
143                         $profile_avatar = (((strlen($item['author-avatar'])) && $diff_author) ? $item['author-avatar'] : $a->get_cached_avatar_image($this->get_data_value('thumb')));
144
145                 $locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => '');
146                 call_hooks('render_location',$locate);
147                 $location = ((strlen($locate['html'])) ? $locate['html'] : render_location_google($locate));
148
149                 $tags=array();
150                 $hashtags = array();
151                 $mentions = array();
152                 foreach(explode(',',$item['tag']) as $tag){
153                         $tag = trim($tag);
154                         if ($tag!="") {
155                                 $t = bbcode($tag);
156                                 $tags[] = $t;
157                                 if($t[0] == '#')
158                                         $hashtags[] = $t;
159                                 elseif($t[0] == '@')
160                                         $mentions[] = $t;
161                         }
162
163                 }        
164
165                 $like    = ((x($alike,$item['uri'])) ? format_like($alike[$item['uri']],$alike[$item['uri'] . '-l'],'like',$item['uri']) : '');
166                 $dislike = ((x($dlike,$item['uri'])) ? format_like($dlike[$item['uri']],$dlike[$item['uri'] . '-l'],'dislike',$item['uri']) : '');
167
168                 /*
169                  * We should avoid doing this all the time, but it depends on the conversation mode
170                  * And the conv mode may change when we change the conv, or it changes its mode
171                  * Maybe we should establish a way to be notified about conversation changes
172                  */
173                 $this->check_wall_to_wall();
174                 
175                 if($this->is_wall_to_wall() && ($this->get_owner_url() == $this->get_redirect_url()))
176                         $osparkle = ' sparkle';
177                 
178                 if($this->is_toplevel()) {
179                         if($conv->get_profile_owner() == local_user()) {
180                                 $isstarred = (($item['starred']) ? "starred" : "unstarred");
181
182                                 $star = array(
183                                         'do' => t("add star"),
184                                         'undo' => t("remove star"),
185                                         'toggle' => t("toggle star status"),
186                                         'classdo' => (($item['starred']) ? "hidden" : ""),
187                                         'classundo' => (($item['starred']) ? "" : "hidden"),
188                                         'starred' =>  t('starred'),
189                                 );
190                                 $tagger = '';
191                                 if(feature_enabled($conv->get_profile_owner(),'commtag')) {
192                                         $tagger = array(
193                                                 'add' => t("add tag"),
194                                                 'class' => "",
195                                         );
196                                 }
197                         }
198                 } else {
199                         $indent = 'comment';
200                 }
201
202                 if($conv->is_writable()) {
203                         $buttons = array(
204                                 'like' => array( t("I like this \x28toggle\x29"), t("like")),
205                                 'dislike' => ((feature_enabled($conv->get_profile_owner(),'dislike')) ? array( t("I don't like this \x28toggle\x29"), t("dislike")) : ''),
206                         );
207                         if ($shareable) $buttons['share'] = array( t('Share this'), t('share'));
208                 }
209
210                 if(strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC','now - 12 hours')) > 0){
211                         $shiny = 'shiny';
212                 }
213
214                 localize_item($item);
215
216                 if ($item["postopts"]) {
217                         $langdata = explode(";", $item["postopts"]);
218                         $langstr = substr($langdata[0], 5)." (".round($langdata[1]*100, 1)."%)";
219                 }
220
221                 $body = prepare_body($item,true);
222
223                 list($categories, $folders) = get_cats_and_terms($item);
224
225                 if($a->theme['template_engine'] === 'internal') {
226                         $body_e = template_escape($body);
227                         $text_e = strip_tags(template_escape($body));
228                         $name_e = template_escape($profile_name);
229                         $title_e = template_escape($item['title']);
230                         $location_e = template_escape($location);
231                         $owner_name_e = template_escape($this->get_owner_name());
232                 }
233                 else {
234                         $body_e = $body;
235                         $text_e = strip_tags($body);
236                         $name_e = $profile_name;
237                         $title_e = $item['title'];
238                         $location_e = $location;
239                         $owner_name_e = $this->get_owner_name();
240                 }
241
242                 $tmp_item = array(
243                         'template' => $this->get_template(),
244
245                         'type' => implode("",array_slice(explode("/",$item['verb']),-1)),
246                         'tags' => $tags,
247             'hashtags' => $hashtags,
248             'mentions' => $mentions,
249                         'txt_cats' => t('Categories:'),
250                         'txt_folders' => t('Filed under:'),
251                         'has_cats' => ((count($categories)) ? 'true' : ''),
252                         'has_folders' => ((count($folders)) ? 'true' : ''),
253             'categories' => $categories,
254             'folders' => $folders,            
255                         'body' => $body_e,
256                         'text' => $text_e,
257                         'id' => $this->get_id(),
258                         'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, ((strlen($item['author-link'])) ? $item['author-link'] : $item['url'])),
259                         'olinktitle' => sprintf( t('View %s\'s profile @ %s'), $this->get_owner_name(), ((strlen($item['owner-link'])) ? $item['owner-link'] : $item['url'])),
260                         'to' => t('to'),
261                         'via' => t('via'),
262                         'wall' => t('Wall-to-Wall'),
263                         'vwall' => t('via Wall-To-Wall:'),
264                         'profile_url' => $profile_link,
265                         'item_photo_menu' => item_photo_menu($item),
266                         'name' => $name_e,
267                         'thumb' => $profile_avatar,
268                         'osparkle' => $osparkle,
269                         'sparkle' => $sparkle,
270                         'title' => $title_e,
271                         'localtime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'r'),
272                         'ago' => (($item['app']) ? sprintf( t('%s from %s'),relative_date($item['created']),$item['app']) : relative_date($item['created'])),
273                         'lock' => $lock,
274                         'location' => $location_e,
275                         'indent' => $indent,
276                         'shiny' => $shiny,
277                         'owner_url' => $this->get_owner_url(),
278                         'owner_photo' => $this->get_owner_photo(),
279                         'owner_name' => $owner_name_e,
280                         'plink' => get_plink($item),
281                         'edpost'    => ((feature_enabled($conv->get_profile_owner(),'edit_posts')) ? $edpost : ''),
282                         'isstarred' => $isstarred,
283                         'star'      => ((feature_enabled($conv->get_profile_owner(),'star_posts')) ? $star : ''),
284                         'tagger'        => $tagger,
285                         'filer'     => ((feature_enabled($conv->get_profile_owner(),'filing')) ? $filer : ''),
286                         'drop' => $drop,
287                         'vote' => $buttons,
288                         'like' => $like,
289                         'dislike'   => $dislike,
290                         'switchcomment' => t('Comment'),
291                         'comment' => $this->get_comment_box($indent),
292                         'previewing' => ($conv->is_preview() ? ' preview ' : ''),
293                         'wait' => t('Please wait'),
294                         'thread_level' => $thread_level,
295                         'postopts' => $langstr
296                 );
297
298                 $arr = array('item' => $item, 'output' => $tmp_item);
299                 call_hooks('display_item', $arr);
300
301                 $result = $arr['output'];
302
303                 $result['children'] = array();
304                 $children = $this->get_children();
305                 $nb_children = count($children);
306                 if($nb_children > 0) {
307                         foreach($children as $child) {
308                                 $result['children'][] = $child->get_template_data($alike, $dlike, $thread_level + 1);
309                         }
310                         // Collapse
311                         if(($nb_children > 2) || ($thread_level > 1)) {
312                                 $result['children'][0]['comment_firstcollapsed'] = true;
313                                 $result['children'][0]['num_comments'] = sprintf( tt('%d comment','%d comments',$total_children),$total_children );
314                                 $result['children'][0]['hidden_comments_num'] = $total_children;
315                                 $result['children'][0]['hidden_comments_text'] = tt('comment', 'comments', $total_children);
316                                 $result['children'][0]['hide_text'] = t('show more');
317                                 if($thread_level > 1) {
318                                         $result['children'][$nb_children - 1]['comment_lastcollapsed'] = true;
319                                 }
320                                 else {
321                                         $result['children'][$nb_children - 3]['comment_lastcollapsed'] = true;
322                                 }
323                         }
324                 }
325                 
326         if ($this->is_toplevel()) {
327             $result['total_comments_num'] = "$total_children";
328             $result['total_comments_text'] = tt('comment', 'comments', $total_children);
329         }
330         
331                 $result['private'] = $item['private'];
332                 $result['toplevel'] = ($this->is_toplevel() ? 'toplevel_item' : '');
333
334                 if($this->is_threaded()) {
335                         $result['flatten'] = false;
336                         $result['threaded'] = true;
337                 }
338                 else {
339                         $result['flatten'] = true;
340                         $result['threaded'] = false;
341                 }
342
343                 return $result;
344         }
345         
346         public function get_id() {
347                 return $this->get_data_value('id');
348         }
349
350         public function is_threaded() {
351                 return $this->threaded;
352         }
353
354         /**
355          * Add a child item
356          */
357         public function add_child($item) {
358                 $item_id = $item->get_id();
359                 if(!$item_id) {
360                         logger('[ERROR] Item::add_child : Item has no ID!!', LOGGER_DEBUG);
361                         return false;
362                 }
363                 if($this->get_child($item->get_id())) {
364                         logger('[WARN] Item::add_child : Item already exists ('. $item->get_id() .').', LOGGER_DEBUG);
365                         return false;
366                 }
367                 /*
368                  * Only add what will be displayed
369                  */
370                 if($item->get_data_value('network') === NETWORK_MAIL && local_user() != $item->get_data_value('uid')) {
371                         return false;
372                 }
373                 if(activity_match($item->get_data_value('verb'),ACTIVITY_LIKE) || activity_match($item->get_data_value('verb'),ACTIVITY_DISLIKE)) {
374                         return false;
375                 }
376                 
377                 $item->set_parent($this);
378                 $this->children[] = $item;
379                 return end($this->children);
380         }
381
382         /**
383          * Get a child by its ID
384          */
385         public function get_child($id) {
386                 foreach($this->get_children() as $child) {
387                         if($child->get_id() == $id)
388                                 return $child;
389                 }
390                 return null;
391         }
392
393         /**
394          * Get all ou children
395          */
396         public function get_children() {
397                 return $this->children;
398         }
399
400         /**
401          * Set our parent
402          */
403         protected function set_parent($item) {
404                 $parent = $this->get_parent();
405                 if($parent) {
406                         $parent->remove_child($this);
407                 }
408                 $this->parent = $item;
409                 $this->set_conversation($item->get_conversation());
410         }
411
412         /**
413          * Remove our parent
414          */
415         protected function remove_parent() {
416                 $this->parent = null;
417                 $this->conversation = null;
418         }
419
420         /**
421          * Remove a child
422          */
423         public function remove_child($item) {
424                 $id = $item->get_id();
425                 foreach($this->get_children() as $key => $child) {
426                         if($child->get_id() == $id) {
427                                 $child->remove_parent();
428                                 unset($this->children[$key]);
429                                 // Reindex the array, in order to make sure there won't be any trouble on loops using count()
430                                 $this->children = array_values($this->children);
431                                 return true;
432                         }
433                 }
434                 logger('[WARN] Item::remove_child : Item is not a child ('. $id .').', LOGGER_DEBUG);
435                 return false;
436         }
437
438         /**
439          * Get parent item
440          */
441         protected function get_parent() {
442                 return $this->parent;
443         }
444
445         /**
446          * set conversation
447          */
448         public function set_conversation($conv) {
449                 $previous_mode = ($this->conversation ? $this->conversation->get_mode() : '');
450                 
451                 $this->conversation = $conv;
452
453                 // Set it on our children too
454                 foreach($this->get_children() as $child)
455                         $child->set_conversation($conv);
456         }
457
458         /**
459          * get conversation
460          */
461         public function get_conversation() {
462                 return $this->conversation;
463         }
464
465         /**
466          * Get raw data
467          *
468          * We shouldn't need this
469          */
470         public function get_data() {
471                 return $this->data;
472         }
473
474         /**
475          * Get a data value
476          *
477          * Returns:
478          *      _ value on success
479          *      _ false on failure
480          */
481         public function get_data_value($name) {
482                 if(!isset($this->data[$name])) {
483                         logger('[ERROR] Item::get_data_value : Item has no value name "'. $name .'".', LOGGER_DEBUG);
484                         return false;
485                 }
486
487                 return $this->data[$name];
488         }
489
490         /**
491          * Set template
492          */
493         private function set_template($name) {
494                 $a = get_app();
495
496                 if(!x($this->available_templates, $name)) {
497                         logger('[ERROR] Item::set_template : Template not available ("'. $name .'").', LOGGER_DEBUG);
498                         return false;
499                 }
500
501                 $this->template = $this->available_templates[$name];
502         }
503
504         /**
505          * Get template
506          */
507         private function get_template() {
508                 return $this->template;
509         }
510
511         /**
512          * Check if this is a toplevel post
513          */
514         private function is_toplevel() {
515                 return $this->toplevel;
516         }
517
518         /**
519          * Check if this is writable
520          */
521         private function is_writable() {
522                 $conv = $this->get_conversation();
523
524                 if($conv) {
525                         // This will allow us to comment on wall-to-wall items owned by our friends
526                         // and community forums even if somebody else wrote the post.
527
528                         // bug #517 - this fixes for conversation owner
529                         if($conv->get_mode() == 'profile' && $conv->get_profile_owner() == local_user())
530                                 return true; 
531
532                         // this fixes for visitors
533                         return ($this->writable || ($this->is_visiting() && $conv->get_mode() == 'profile'));
534                 }
535                 return $this->writable;
536         }
537
538         /**
539          * Count the total of our descendants
540          */
541         private function count_descendants() {
542                 $children = $this->get_children();
543                 $total = count($children);
544                 if($total > 0) {
545                         foreach($children as $child) {
546                                 $total += $child->count_descendants();
547                         }
548                 }
549                 return $total;
550         }
551
552         /**
553          * Get the template for the comment box
554          */
555         private function get_comment_box_template() {
556                 return $this->comment_box_template;
557         }
558
559         /**
560          * Get the comment box
561          *
562          * Returns:
563          *      _ The comment box string (empty if no comment box)
564          *      _ false on failure
565          */
566         private function get_comment_box($indent) {
567                 $a = $this->get_app();
568                 if(!$this->is_toplevel() && !(get_config('system','thread_allow') && $a->theme_thread_allow)) {
569                         return '';
570                 }
571                 
572                 $comment_box = '';
573                 $conv = $this->get_conversation();
574                 $template = get_markup_template($this->get_comment_box_template());
575                 $ww = '';
576                 if( ($conv->get_mode() === 'network') && $this->is_wall_to_wall() )
577                         $ww = 'ww';
578
579                 if($conv->is_writable() && $this->is_writable()) {
580                         $qc = $qcomment =  null;
581
582                         /*
583                          * Hmmm, code depending on the presence of a particular plugin?
584                          * This should be better if done by a hook
585                          */
586                         if(in_array('qcomment',$a->plugins)) {
587                                 $qc = ((local_user()) ? get_pconfig(local_user(),'qcomment','words') : null);
588                                 $qcomment = (($qc) ? explode("\n",$qc) : null);
589                         }
590                         $comment_box = replace_macros($template,array(
591                                 '$return_path' => '',
592                                 '$threaded' => $this->is_threaded(),
593 //                              '$jsreload' => (($conv->get_mode() === 'display') ? $_SESSION['return_url'] : ''),
594                                 '$jsreload' => '',
595                                 '$type' => (($conv->get_mode() === 'profile') ? 'wall-comment' : 'net-comment'),
596                                 '$id' => $this->get_id(),
597                                 '$parent' => $this->get_id(),
598                                 '$qcomment' => $qcomment,
599                                 '$profile_uid' =>  $conv->get_profile_owner(),
600                                 '$mylink' => $a->contact['url'],
601                                 '$mytitle' => t('This is you'),
602                                 '$myphoto' => $a->contact['thumb'],
603                                 '$comment' => t('Comment'),
604                                 '$submit' => t('Submit'),
605                                 '$edbold' => t('Bold'),
606                                 '$editalic' => t('Italic'),
607                                 '$eduline' => t('Underline'),
608                                 '$edquote' => t('Quote'),
609                                 '$edcode' => t('Code'),
610                                 '$edimg' => t('Image'),
611                                 '$edurl' => t('Link'),
612                                 '$edvideo' => t('Video'),
613                                 '$preview' => ((feature_enabled($conv->get_profile_owner(),'preview')) ? t('Preview') : ''),
614                                 '$indent' => $indent,
615                                 '$sourceapp' => t($a->sourcename),
616                                 '$ww' => (($conv->get_mode() === 'network') ? $ww : ''),
617                                 '$rand_num' => random_digits(12)
618                         ));
619                 }
620
621                 return $comment_box;
622         }
623
624         private function get_redirect_url() {
625                 return $this->redirect_url;
626         }
627
628         /**
629          * Check if we are a wall to wall item and set the relevant properties
630          */
631         protected function check_wall_to_wall() {
632                 $a = $this->get_app();
633                 $conv = $this->get_conversation();
634                 $this->wall_to_wall = false;
635                 
636                 if($this->is_toplevel()) {
637                         if( (! $this->get_data_value('self')) && ($conv->get_mode() !== 'profile')) {
638                                 if($this->get_data_value('wall')) {
639
640                                         // On the network page, I am the owner. On the display page it will be the profile owner.
641                                         // This will have been stored in $a->page_contact by our calling page.
642                                         // Put this person as the wall owner of the wall-to-wall notice.
643
644                                         $this->owner_url = zrl($a->page_contact['url']);
645                                         $this->owner_photo = $a->page_contact['thumb'];
646                                         $this->owner_name = $a->page_contact['name'];
647                                         $this->wall_to_wall = true;
648                                 }
649                                 else if($this->get_data_value('owner-link')) {
650
651                                         $owner_linkmatch = (($this->get_data_value('owner-link')) && link_compare($this->get_data_value('owner-link'),$this->get_data_value('author-link')));
652                                         $alias_linkmatch = (($this->get_data_value('alias')) && link_compare($this->get_data_value('alias'),$this->get_data_value('author-link')));
653                                         $owner_namematch = (($this->get_data_value('owner-name')) && $this->get_data_value('owner-name') == $this->get_data_value('author-name'));
654                                         if((! $owner_linkmatch) && (! $alias_linkmatch) && (! $owner_namematch)) {
655
656                                                 // The author url doesn't match the owner (typically the contact)
657                                                 // and also doesn't match the contact alias. 
658                                                 // The name match is a hack to catch several weird cases where URLs are 
659                                                 // all over the park. It can be tricked, but this prevents you from
660                                                 // seeing "Bob Smith to Bob Smith via Wall-to-wall" and you know darn
661                                                 // well that it's the same Bob Smith. 
662
663                                                 // But it could be somebody else with the same name. It just isn't highly likely. 
664                                                 
665
666                                                 $this->owner_photo = $this->get_data_value('owner-avatar');
667                                                 $this->owner_name = $this->get_data_value('owner-name');
668                                                 $this->wall_to_wall = true;
669                                                 // If it is our contact, use a friendly redirect link
670                                                 if((link_compare($this->get_data_value('owner-link'),$this->get_data_value('url'))) 
671                                                         && ($this->get_data_value('network') === NETWORK_DFRN)) {
672                                                         $this->owner_url = $this->get_redirect_url();
673                                                 }
674                                                 else
675                                                         $this->owner_url = zrl($this->get_data_value('owner-link'));
676                                         }
677                                 }
678                         }
679                 }
680
681                 if(!$this->wall_to_wall) {
682                         $this->set_template('wall');
683                         $this->owner_url = '';
684                         $this->owner_photo = '';
685                         $this->owner_name = '';
686                 }
687         }
688
689         private function is_wall_to_wall() {
690                 return $this->wall_to_wall;
691         }
692
693         private function get_owner_url() {
694                 return $this->owner_url;
695         }
696
697         private function get_owner_photo() {
698                 return $this->owner_photo;
699         }
700
701         private function get_owner_name() {
702                 return $this->owner_name;
703         }
704
705         private function is_visiting() {
706                 return $this->visiting;
707         }
708
709
710
711
712 }
713 ?>