4 * Render actions localized
6 function localize_item(&$item){
8 if ($item['verb']=== ACTIVITY_LIKE || $item['verb']=== ACTIVITY_DISLIKE){
10 $r = q("SELECT * from `item`,`contact` WHERE
11 `item`.`contact-id`=`contact`.`id` AND `item`.`uri`='%s';",
12 dbesc($item['parent-uri']));
13 if(count($r)==0) return;
16 $author = '[url=' . $item['author-link'] . ']' . $item['author-name'] . '[/url]';
17 $objauthor = '[url=' . $obj['author-link'] . ']' . $obj['author-name'] . '[/url]';
21 switch ($obj['object-type']){
22 case ACTIVITY_OBJ_EVENT:
23 $post_type = t('event');
26 $post_type = t('status');
30 if($obj['resource-id']){
31 $post_type = t('photo');
32 $m=array(); preg_match("/\[url=([^]]*)\]/", $obj['body'], $m);
35 $post_type = t('status');
39 $plink = '[url=' . $obj['plink'] . ']' . $post_type . '[/url]';
41 switch($item['verb']){
43 $bodyverb = t('%1$s likes %2$s\'s %3$s');
45 case ACTIVITY_DISLIKE:
46 $bodyverb = t('%1$s doesn\'t like %2$s\'s %3$s');
49 $item['body'] = sprintf($bodyverb, $author, $objauthor, $plink);
52 if ($item['verb']=== ACTIVITY_FRIEND){
54 if ($item['object-type']=="" || $item['object-type']!== ACTIVITY_OBJ_PERSON) return;
56 $Aname = $item['author-name'];
57 $Alink = $item['author-link'];
59 $xmlhead="<"."?xml version='1.0' encoding='UTF-8' ?".">";
61 $obj = parse_xml_string($xmlhead.$item['object']);
62 $links = parse_xml_string($xmlhead."<links>".unxmlify($obj->link)."</links>");
65 $Blink = ""; $Bphoto = "";
66 foreach ($links->link as $l){
67 $atts = $l->attributes();
69 case "alternate": $Blink = $atts['href'];
70 case "photo": $Bphoto = $atts['href'];
75 $A = '[url=' . $Alink . ']' . $Aname . '[/url]';
76 $B = '[url=' . $Blink . ']' . $Bname . '[/url]';
77 if ($Bphoto!="") $Bphoto = '[url=' . $Blink . '][img]' . $Bphoto . '[/img][/url]';
79 $item['body'] = sprintf( t('%1$s is now friends with %2$s'), $A, $B)."\n\n\n".$Bphoto;
87 * "Render" a conversation or list of items for HTML display.
88 * There are two major forms of display:
89 * - Sequential or unthreaded ("New Item View" or search results)
91 * The $mode parameter decides between the various renderings and also
92 * figures out how to determine page owner and other contextual items
93 * that are based on unique features of the calling module.
96 function conversation(&$a, $items, $mode, $update) {
98 require_once('bbcode.php');
101 $page_writeable = false;
103 if($mode === 'network') {
104 $profile_owner = local_user();
105 $page_writeable = true;
108 if($mode === 'profile') {
109 $profile_owner = $a->profile['profile_uid'];
110 $page_writeable = can_write_wall($a,$profile_owner);
113 if($mode === 'notes') {
114 $profile_owner = local_user();
115 $page_writeable = true;
118 if($mode === 'display') {
119 $profile_owner = $a->profile['uid'];
120 $page_writeable = can_write_wall($a,$profile_owner);
123 if($mode === 'community') {
125 $page_writeable = false;
129 $return_url = $_SESSION['return_url'];
131 $return_url = $_SESSION['return_url'] = $a->cmd;
133 load_contact_links(local_user());
136 $cmnt_tpl = get_markup_template('comment_item.tpl');
137 $tpl = get_markup_template('wall_item.tpl');
138 $wallwall = get_markup_template('wallwall_item.tpl');
144 // array with html for each thread (parent+comments)
150 if($mode === 'network-new' || $mode === 'search' || $mode === 'community') {
152 // "New Item View" on network page or search page results
153 // - just loop through the items and format them minimally for display
155 $tpl = get_markup_template('search_item.tpl');
157 foreach($items as $item) {
166 if($mode === 'search' || $mode === 'community') {
167 if(((activity_match($item['verb'],ACTIVITY_LIKE)) || (activity_match($item['verb'],ACTIVITY_DISLIKE)))
168 && ($item['id'] != $item['parent']))
170 $nickname = $item['nickname'];
173 $nickname = $a->user['nickname'];
175 $profile_name = ((strlen($item['author-name'])) ? $item['author-name'] : $item['name']);
178 $profile_link = best_link_url($item,$sp);
180 $sparkle = ' sparkle';
181 if($profile_link === 'mailbox')
185 $normalised = normalise_link((strlen($item['author-link'])) ? $item['author-link'] : $item['url']);
186 if(($normalised != 'mailbox') && (x($a->contacts[$normalised])))
187 $profile_avatar = $a->contacts[$normalised]['thumb'];
189 $profile_avatar = ((strlen($item['author-avatar'])) ? $item['author-avatar'] : $item['thumb']);
191 $location = (($item['location']) ? '<a target="map" title="' . $item['location'] . '" href="http://maps.google.com/?q=' . urlencode($item['location']) . '">' . $item['location'] . '</a>' : '');
192 $coord = (($item['coord']) ? '<a target="map" title="' . $item['coord'] . '" href="http://maps.google.com/?q=' . urlencode($item['coord']) . '">' . $item['coord'] . '</a>' : '');
195 $location .= '<br /><span class="smalltext">(' . $coord . ')</span>';
197 $location = '<span class="smalltext">' . $coord . '</span>';
201 localize_item($item);
202 if($mode === 'network-new')
209 'dropping' => $dropping,
210 'select' => t('Select'),
211 'delete' => t('Delete'),
215 $isstarred = "unstarred";
218 $likebuttons = false;
221 $body = prepare_body($item,true);
223 $tmp_item = replace_macros($tpl,array(
224 '$id' => $item['item_id'],
225 '$linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, ((strlen($item['author-link'])) ? $item['author-link'] : $item['url'])),
226 '$profile_url' => $profile_link,
227 '$item_photo_menu' => item_photo_menu($item),
228 '$name' => template_escape($profile_name),
229 '$sparkle' => $sparkle,
231 '$thumb' => $profile_avatar,
232 '$title' => template_escape($item['title']),
233 '$body' => template_escape($body),
234 '$ago' => (($item['app']) ? sprintf( t('%s from %s'),relative_date($item['created']),$item['app']) : relative_date($item['created'])),
236 '$location' => template_escape($location),
238 '$owner_name' => template_escape($owner_name),
239 '$owner_url' => $owner_url,
240 '$owner_photo' => $owner_photo,
241 '$plink' => get_plink($item),
243 '$isstarred' => $isstarred,
246 '$vote' => $likebuttons,
250 '$conv' => array('href'=> $a->get_baseurl() . '/display/' . $nickname . '/' . $item['id'], 'title'=> t('View in context')),
251 '$wait' => t('Please wait'),
254 $arr = array('item' => $item, 'output' => $tmp_item);
255 call_hooks('display_item', $arr);
257 $threads[$threadsid] .= $arr['output'];
267 // Figure out how many comments each parent has
268 // (Comments all have gravity of 6)
269 // Store the result in the $comments array
272 foreach($items as $item) {
273 if((intval($item['gravity']) == 6) && ($item['id'] != $item['parent'])) {
274 if(! x($comments,$item['parent']))
275 $comments[$item['parent']] = 1;
277 $comments[$item['parent']] += 1;
281 // map all the like/dislike activities for each parent item
282 // Store these in the $alike and $dlike arrays
284 foreach($items as $item) {
285 like_puller($a,$item,$alike,'like');
286 like_puller($a,$item,$dlike,'dislike');
289 $comments_collapsed = false;
294 foreach($items as $item) {
300 $owner_url = $owner_photo = $owner_name = '';
302 // We've already parsed out like/dislike for special treatment. We can ignore them now
304 if(((activity_match($item['verb'],ACTIVITY_LIKE))
305 || (activity_match($item['verb'],ACTIVITY_DISLIKE)))
306 && ($item['id'] != $item['parent']))
309 $toplevelpost = (($item['id'] == $item['parent']) ? true : false);
310 $toplevelprivate = false;
312 // Take care of author collapsing and comment collapsing
313 // If a single author has more than 3 consecutive top-level posts, squash the remaining ones.
314 // If there are more than two comments, squash all but the last 2.
317 $toplevelprivate = (($toplevelpost && $item['private']) ? true : false);
318 $item_writeable = (($item['writable'] || $item['self']) ? true : false);
320 /*if($blowhard == $item['cid'] && (! $item['self']) && ($mode != 'profile') && ($mode != 'notes')) {
322 if($blowhard_count == 3) {
323 $o .= '<div class="icollapse-wrapper fakelink" id="icollapse-wrapper-' . $item['parent']
324 . '" onclick="openClose(' . '\'icollapse-' . $item['parent'] . '\'); $(\'#icollapse-wrapper-' . $item['parent'] . '\').hide();" >'
325 . t('See more posts like this') . '</div>' . '<div class="icollapse" id="icollapse-'
326 . $item['parent'] . '" style="display: none;" >';
330 $blowhard = $item['cid'];
331 if($blowhard_count >= 3)
337 $comments_collapsed = false;
340 $threads[$threadsid] = "";
343 // prevent private email from leaking into public conversation
344 if((! $toplevelpost) && (! toplevelprivate) && ($item['private']) && ($profile_owner != local_user()))
349 $override_comment_box = ((($page_writeable) && ($item_writeable)) ? true : false);
350 $show_comment_box = ((($page_writeable) && ($item_writeable) && ($comments_seen == $comments[$item['parent']])) ? true : false);
352 if(($comments[$item['parent']] > 2) && ($comments_seen <= ($comments[$item['parent']] - 2)) && ($item['gravity'] == 6)) {
353 if(! $comments_collapsed) {
354 $threads[$threadsid] .= '<div class="ccollapse-wrapper fakelink" id="ccollapse-wrapper-' . $item['parent']
355 . '" onclick="openClose(' . '\'ccollapse-' . $item['parent'] . '\'); $(\'#ccollapse-wrapper-' . $item['parent'] . '\').hide();" >'
356 . sprintf( t('See all %d comments'), $comments[$item['parent']]) . '</div>'
357 . '<div class="ccollapse" id="ccollapse-' . $item['parent'] . '" style="display: none;" >';
358 $comments_collapsed = true;
361 if(($comments[$item['parent']] > 2) && ($comments_seen == ($comments[$item['parent']] - 1))) {
362 $threads[$threadsid] .= '</div>';
365 $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
367 $lock = ((($item['private']) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid'])
368 || strlen($item['deny_cid']) || strlen($item['deny_gid']))))
369 ? t('Private Message')
373 // Top-level wall post not written by the wall owner (wall-to-wall)
374 // First figure out who owns it.
378 if(($toplevelpost) && (! $item['self']) && ($mode !== 'profile')) {
382 // On the network page, I am the owner. On the display page it will be the profile owner.
383 // This will have been stored in $a->page_contact by our calling page.
384 // Put this person on the left of the wall-to-wall notice.
386 $owner_url = $a->page_contact['url'];
387 $owner_photo = $a->page_contact['thumb'];
388 $owner_name = $a->page_contact['name'];
389 $template = $wallwall;
392 if((! $item['wall']) && (strlen($item['owner-link'])) && ($item['owner-link'] != $item['author-link'])) {
396 $owner_url = $item['owner-link'];
397 $owner_photo = $item['owner-avatar'];
398 $owner_name = $item['owner-name'];
399 $template = $wallwall;
401 // If it is our contact, use a friendly redirect link
402 if((link_compare($item['owner-link'],$item['url']))
403 && ($item['network'] === 'dfrn')) {
404 $owner_url = $redirect_url;
405 $osparkle = ' sparkle';
411 $shareable = ((($profile_owner == local_user()) && ($mode != 'display') && (! $item['private'])) ? true : false);
413 if($page_writeable) {
415 $likebuttons = array(
416 'like' => array( t("I like this \x28toggle\x29"), t("like")),
417 'dislike' => array( t("I don't like this \x28toggle\x29"), t("dislike")),
419 if ($shareable) $likebuttons['share'] = array( t('Share this'), t('share'));
422 if(($show_comment_box) || (($show_comment_box == false) && ($override_comment_box == false) && ($item['last-child']))) {
423 $comment = replace_macros($cmnt_tpl,array(
424 '$return_path' => '',
425 '$jsreload' => (($mode === 'display') ? $_SESSION['return_url'] : ''),
426 '$type' => (($mode === 'profile') ? 'wall-comment' : 'net-comment'),
427 '$id' => $item['item_id'],
428 '$parent' => $item['parent'],
429 '$profile_uid' => $profile_owner,
430 '$mylink' => $a->contact['url'],
431 '$mytitle' => t('This is you'),
432 '$myphoto' => $a->contact['thumb'],
433 '$comment' => t('Comment'),
434 '$submit' => t('Submit'),
435 '$ww' => (($mode === 'network') ? $commentww : '')
440 $edpost = (((($profile_owner == local_user()) && ($toplevelpost) && (intval($item['wall']) == 1)) || ($mode === 'notes'))
441 ? array($a->get_baseurl()."/editpost/".$item['id'], t("Edit"))
448 if((intval($item['contact-id']) && $item['contact-id'] == remote_user()) || ($item['uid'] == local_user()))
452 'dropping' => $dropping,
453 'select' => t('Select'),
454 'delete' => t('Delete'),
458 $isstarred = "unstarred";
459 if ($profile_owner == local_user() && $toplevelpost) {
460 $isstarred = (($item['starred']) ? "starred" : "unstarred");
463 'do' => t("add star"),
464 'undo' => t("remove star"),
465 'toggle' => t("toggle star status"),
466 'classdo' => (($item['starred']) ? "hidden" : ""),
467 'classundo' => (($item['starred']) ? "" : "hidden"),
468 'starred' => t('starred'),
474 $photo = $item['photo'];
475 $thumb = $item['thumb'];
477 // Post was remotely authored.
479 $diff_author = ((link_compare($item['url'],$item['author-link'])) ? false : true);
481 $profile_name = (((strlen($item['author-name'])) && $diff_author) ? $item['author-name'] : $item['name']);
484 $profile_link = best_link_url($item,$sp);
486 $sparkle = ' sparkle';
488 if($profile_link === 'mailbox')
491 $normalised = normalise_link((strlen($item['author-link'])) ? $item['author-link'] : $item['url']);
492 if(($normalised != 'mailbox') && (x($a->contacts,$normalised)))
493 $profile_avatar = $a->contacts[$normalised]['thumb'];
495 $profile_avatar = (((strlen($item['author-avatar'])) && $diff_author) ? $item['author-avatar'] : $thumb);
501 $like = ((x($alike,$item['id'])) ? format_like($alike[$item['id']],$alike[$item['id'] . '-l'],'like',$item['id']) : '');
502 $dislike = ((x($dlike,$item['id'])) ? format_like($dlike[$item['id']],$dlike[$item['id'] . '-l'],'dislike',$item['id']) : '');
504 $location = (($item['location']) ? '<a target="map" title="' . $item['location']
505 . '" href="http://maps.google.com/?q=' . urlencode($item['location']) . '">' . $item['location'] . '</a>' : '');
506 $coord = (($item['coord']) ? '<a target="map" title="' . $item['coord']
507 . '" href="http://maps.google.com/?q=' . urlencode($item['coord']) . '">' . $item['coord'] . '</a>' : '');
510 $location .= '<br /><span class="smalltext">(' . $coord . ')</span>';
512 $location = '<span class="smalltext">' . $coord . '</span>';
515 $indent = (($toplevelpost) ? '' : ' comment');
517 if(strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC','now - 12 hours')) > 0)
521 localize_item($item);
525 $body = prepare_body($item,true);
528 $tmp_item = replace_macros($template,array(
529 '$body' => template_escape($body),
530 '$id' => $item['item_id'],
531 '$linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, ((strlen($item['author-link'])) ? $item['author-link'] : $item['url'])),
532 '$olinktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, ((strlen($item['owner-link'])) ? $item['owner-link'] : $item['url'])),
534 '$wall' => t('Wall-to-Wall'),
535 '$vwall' => t('via Wall-To-Wall:'),
536 '$profile_url' => $profile_link,
537 '$item_photo_menu' => item_photo_menu($item),
538 '$name' => template_escape($profile_name),
539 '$thumb' => $profile_avatar,
540 '$osparkle' => $osparkle,
541 '$sparkle' => $sparkle,
542 '$title' => template_escape($item['title']),
543 '$ago' => ((($item['app']) && ($item['id'] == $item['parent'])) ? sprintf( t('%s from %s'),relative_date($item['created']),$item['app']) : relative_date($item['created'])),
545 '$location' => template_escape($location),
546 '$indent' => $indent,
547 '$owner_url' => $owner_url,
548 '$owner_photo' => $owner_photo,
549 '$owner_name' => template_escape($owner_name),
550 '$plink' => get_plink($item),
551 '$edpost' => $edpost,
552 '$isstarred' => $isstarred,
555 '$vote' => $likebuttons,
557 '$dislike' => $dislike,
558 '$comment' => $comment,
559 '$wait' => t('Please wait'),
564 $arr = array('item' => $item, 'output' => $tmp_item);
565 call_hooks('display_item', $arr);
567 $threads[$threadsid] .= $arr['output'];
573 // if author collapsing is in force but didn't get closed, close it off now.
575 /*if($blowhard_count >= 3)
576 $threads[$threadsid] .= '</div>';*/
578 $page_template = get_markup_template("conversation.tpl");
579 $o .= replace_macros($page_template, array(
580 '$threads' => $threads,
581 '$dropping' => ($dropping?t('Delete Selected Items'):False),
587 function best_link_url($item,&$sparkle) {
594 $clean_url = normalise_link($item['author-link']);
596 if((local_user()) && (local_user() == $item['uid'])) {
597 if(isset($a->contacts) && x($a->contacts,$clean_url)) {
598 if($a->contacts[$clean_url]['network'] === NETWORK_DFRN) {
599 $best_url = $a->get_baseurl() . '/redir/' . $a->contacts[$clean_url]['id'];
603 $best_url = $a->contacts[$clean_url]['url'];
607 if(strlen($item['author-link']))
608 $best_url = $item['author-link'];
610 $best_url = $item['url'];
617 if(! function_exists('item_photo_menu')){
618 function item_photo_menu($item){
621 if (local_user() && (! count($a->contacts)))
622 load_contact_links(local_user());
631 $profile_link = best_link_url($item,$sparkle);
632 if($profile_link === 'mailbox')
636 $cid = intval(basename($profile_link));
637 $status_link = $profile_link . "?url=status";
638 $photos_link = $profile_link . "?url=photos";
639 $profile_link = $profile_link . "?url=profile";
640 $pm_url = $a->get_baseurl() . '/message/new/' . $cid;
643 if(local_user() && local_user() == $item['uid'] && link_compare($item['url'],$item['author-link'])) {
644 $cid = $item['contact-id'];
650 if(($cid) && (! $item['self'])) {
651 $contact_url = $a->get_baseurl() . '/contacts/' . $cid;
652 $posts_link = $a->get_baseurl() . '/network/?cid=' . $cid;
656 t("View status") => $status_link,
657 t("View profile") => $profile_link,
658 t("View photos") => $photos_link,
659 t("View recent") => $posts_link,
660 t("Edit contact") => $contact_url,
661 t("Send PM") => $pm_url,
665 $args = array($item, &$menu);
667 call_hooks('item_photo_menu', $args);
670 foreach($menu as $k=>$v){
671 if ($v!="") $o .= "<li><a href='$v'>$k</a></li>\n";
676 if(! function_exists('like_puller')) {
677 function like_puller($a,$item,&$arr,$mode) {
681 $verb = (($mode === 'like') ? ACTIVITY_LIKE : ACTIVITY_DISLIKE);
683 if((activity_match($item['verb'],$verb)) && ($item['id'] != $item['parent'])) {
684 $url = $item['author-link'];
685 if((local_user()) && (local_user() == $item['uid']) && ($item['network'] === 'dfrn') && (! $item['self']) && (link_compare($item['author-link'],$item['url']))) {
686 $url = $a->get_baseurl() . '/redir/' . $item['contact-id'];
687 $sparkle = ' class="sparkle" ';
689 if(! ((isset($arr[$item['parent'] . '-l'])) && (is_array($arr[$item['parent'] . '-l']))))
690 $arr[$item['parent'] . '-l'] = array();
691 if(! isset($arr[$item['parent']]))
692 $arr[$item['parent']] = 1;
694 $arr[$item['parent']] ++;
695 $arr[$item['parent'] . '-l'][] = '<a href="'. $url . '"'. $sparkle .'>' . $item['author-name'] . '</a>';
700 // Format the like/dislike text for a profile item
701 // $cnt = number of people who like/dislike the item
702 // $arr = array of pre-linked names of likers/dislikers
703 // $type = one of 'like, 'dislike'
705 // returns formatted text
707 if(! function_exists('format_like')) {
708 function format_like($cnt,$arr,$type,$id) {
711 $o .= (($type === 'like') ? sprintf( t('%s likes this.'), $arr[0]) : sprintf( t('%s doesn\'t like this.'), $arr[0])) . EOL ;
713 $spanatts = 'class="fakelink" onclick="openClose(\'' . $type . 'list-' . $id . '\');"';
714 $o .= (($type === 'like') ?
715 sprintf( t('<span %1$s>%2$d people</span> like this.'), $spanatts, $cnt)
717 sprintf( t('<span %1$s>%2$d people</span> don\'t like this.'), $spanatts, $cnt) );
719 $total = count($arr);
720 if($total >= MAX_LIKERS)
721 $arr = array_slice($arr, 0, MAX_LIKERS - 1);
722 if($total < MAX_LIKERS)
723 $arr[count($arr)-1] = t('and') . ' ' . $arr[count($arr)-1];
724 $str = implode(', ', $arr);
725 if($total >= MAX_LIKERS)
726 $str .= sprintf( t(', and %d other people'), $total - MAX_LIKERS );
727 $str = (($type === 'like') ? sprintf( t('%s like this.'), $str) : sprintf( t('%s don\'t like this.'), $str));
728 $o .= "\t" . '<div id="' . $type . 'list-' . $id . '" style="display: none;" >' . $str . '</div>';
734 function status_editor($a,$x, $notes_cid = 0) {
738 $geotag = (($x['allow_location']) ? get_markup_template('jot_geotag.tpl') : '');
740 $tpl = get_markup_template('jot-header.tpl');
742 $a->page['htmlhead'] .= replace_macros($tpl, array(
743 '$baseurl' => $a->get_baseurl(),
744 '$geotag' => $geotag,
745 '$nickname' => $x['nickname'],
746 '$ispublic' => t('Visible to <strong>everybody</strong>'),
747 '$linkurl' => t('Please enter a link URL:'),
748 '$utubeurl' => t('Please enter a YouTube link:'),
749 '$vidurl' => t("Please enter a video\x28.ogg\x29 link/URL:"),
750 '$audurl' => t("Please enter an audio\x28.ogg\x29 link/URL:"),
751 '$whereareu' => t('Where are you right now?'),
752 '$title' => t('Enter a title for this item')
756 $tpl = get_markup_template("jot.tpl");
761 $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
763 $mail_enabled = false;
764 $pubmail_enabled = false;
766 if(($x['is_owner']) && (! $mail_disabled)) {
767 $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d AND `server` != '' LIMIT 1",
771 $mail_enabled = true;
772 if(intval($r[0]['pubmail']))
773 $pubmail_enabled = true;
778 $selected = (($pubmail_enabled) ? ' checked="checked" ' : '');
779 $jotnets .= '<div class="profile-jot-net"><input type="checkbox" name="pubmail_enable"' . $selected . ' value="1" /> '
780 . t("Post to Email") . '</div>';
783 call_hooks('jot_tool', $jotplugins);
784 call_hooks('jot_networks', $jotnets);
787 $jotnets .= '<input type="hidden" name="contact_allow[]" value="' . $notes_cid .'" />';
789 $tpl = replace_macros($tpl,array('$jotplugins' => $jotplugins));
791 $o .= replace_macros($tpl,array(
792 '$return_path' => $a->cmd,
794 '$share' => (($x['button']) ? $x['button'] : t('Share')),
795 '$upload' => t('Upload photo'),
796 '$attach' => t('Attach file'),
797 '$weblink' => t('Insert web link'),
798 '$youtube' => t('Insert YouTube video'),
799 '$video' => t('Insert Vorbis [.ogg] video'),
800 '$audio' => t('Insert Vorbis [.ogg] audio'),
801 '$setloc' => t('Set your location'),
802 '$noloc' => t('Clear browser location'),
803 '$title' => t('Set title'),
804 '$wait' => t('Please wait'),
805 '$permset' => t('Permission settings'),
806 '$ptyp' => (($notes_cid) ? 'note' : 'wall'),
809 '$baseurl' => $a->get_baseurl(),
810 '$defloc' => $x['default_location'],
811 '$visitor' => $x['visitor'],
812 '$pvisit' => (($notes_cid) ? 'none' : $x['visitor']),
813 '$emailcc' => t('CC: email addresses'),
814 '$public' => t('Public post'),
815 '$jotnets' => $jotnets,
816 '$emtitle' => t('Example: bob@example.com, mary@example.com'),
817 '$lockstate' => $x['lockstate'],
819 '$bang' => $x['bang'],
820 '$profile_uid' => $x['profile_uid'],