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