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');
139 $droptpl = get_markup_template('wall_item_drop.tpl');
140 $fakedrop = get_markup_template('wall_fake_drop.tpl');
147 if($mode === 'network-new' || $mode === 'search' || $mode === 'community') {
149 // "New Item View" on network page or search page results
150 // - just loop through the items and format them minimally for display
152 $tpl = get_markup_template('search_item.tpl');
154 foreach($items as $item) {
162 if($mode === 'search' || $mode === 'community') {
163 if(((activity_match($item['verb'],ACTIVITY_LIKE)) || (activity_match($item['verb'],ACTIVITY_DISLIKE)))
164 && ($item['id'] != $item['parent']))
166 $nickname = $item['nickname'];
169 $nickname = $a->user['nickname'];
171 $profile_name = ((strlen($item['author-name'])) ? $item['author-name'] : $item['name']);
174 $profile_link = best_link_url($item,$sp);
176 $sparkle = ' sparkle';
177 if($profile_link === 'mailbox')
181 $normalised = normalise_link((strlen($item['author-link'])) ? $item['author-link'] : $item['url']);
182 if(($normalised != 'mailbox') && (x($a->contacts[$normalised])))
183 $profile_avatar = $a->contacts[$normalised]['thumb'];
185 $profile_avatar = ((strlen($item['author-avatar'])) ? $item['author-avatar'] : $item['thumb']);
187 $location = (($item['location']) ? '<a target="map" title="' . $item['location'] . '" href="http://maps.google.com/?q=' . urlencode($item['location']) . '">' . $item['location'] . '</a>' : '');
188 $coord = (($item['coord']) ? '<a target="map" title="' . $item['coord'] . '" href="http://maps.google.com/?q=' . urlencode($item['coord']) . '">' . $item['coord'] . '</a>' : '');
191 $location .= '<br /><span class="smalltext">(' . $coord . ')</span>';
193 $location = '<span class="smalltext">' . $coord . '</span>';
198 localize_item($item);
199 if($mode === 'network-new')
204 $drop = replace_macros($t,array('$id' => $item['id']));
205 $lock = '<div class="wall-item-lock"></div>';
208 $body = prepare_body($item,true);
210 $o .= replace_macros($tpl,array(
211 '$id' => $item['item_id'],
212 '$linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, ((strlen($item['author-link'])) ? $item['author-link'] : $item['url'])),
213 '$profile_url' => $profile_link,
214 '$item_photo_menu' => item_photo_menu($item),
215 '$name' => template_escape($profile_name),
216 '$sparkle' => $sparkle,
218 '$thumb' => $profile_avatar,
219 '$title' => template_escape($item['title']),
220 '$body' => template_escape($body),
221 '$ago' => (($item['app']) ? sprintf( t('%s from %s'),relative_date($item['created']),$item['app']) : relative_date($item['created'])),
222 '$location' => template_escape($location),
224 '$owner_url' => $owner_url,
225 '$owner_photo' => $owner_photo,
226 '$owner_name' => template_escape($owner_name),
229 '$conv' => '<a href="' . $a->get_baseurl() . '/display/' . $nickname . '/' . $item['id'] . '">' . t('View in context') . '</a>'
243 // Figure out how many comments each parent has
244 // (Comments all have gravity of 6)
245 // Store the result in the $comments array
248 foreach($items as $item) {
249 if((intval($item['gravity']) == 6) && ($item['id'] != $item['parent'])) {
250 if(! x($comments,$item['parent']))
251 $comments[$item['parent']] = 1;
253 $comments[$item['parent']] += 1;
257 // map all the like/dislike activities for each parent item
258 // Store these in the $alike and $dlike arrays
260 foreach($items as $item) {
261 like_puller($a,$item,$alike,'like');
262 like_puller($a,$item,$dlike,'dislike');
265 $comments_collapsed = false;
269 // array with html for each thread (parent+comments)
273 foreach($items as $item) {
279 $owner_url = $owner_photo = $owner_name = '';
281 // We've already parsed out like/dislike for special treatment. We can ignore them now
283 if(((activity_match($item['verb'],ACTIVITY_LIKE))
284 || (activity_match($item['verb'],ACTIVITY_DISLIKE)))
285 && ($item['id'] != $item['parent']))
288 $toplevelpost = (($item['id'] == $item['parent']) ? true : false);
289 $toplevelprivate = false;
291 // Take care of author collapsing and comment collapsing
292 // If a single author has more than 3 consecutive top-level posts, squash the remaining ones.
293 // If there are more than two comments, squash all but the last 2.
296 $toplevelprivate = (($toplevelpost && $item['private']) ? true : false);
297 $item_writeable = (($item['writable'] || $item['self']) ? true : false);
299 /*if($blowhard == $item['cid'] && (! $item['self']) && ($mode != 'profile') && ($mode != 'notes')) {
301 if($blowhard_count == 3) {
302 $o .= '<div class="icollapse-wrapper fakelink" id="icollapse-wrapper-' . $item['parent']
303 . '" onclick="openClose(' . '\'icollapse-' . $item['parent'] . '\'); $(\'#icollapse-wrapper-' . $item['parent'] . '\').hide();" >'
304 . t('See more posts like this') . '</div>' . '<div class="icollapse" id="icollapse-'
305 . $item['parent'] . '" style="display: none;" >';
309 $blowhard = $item['cid'];
310 if($blowhard_count >= 3)
316 $comments_collapsed = false;
319 $treads[$treadsid] = "";
322 // prevent private email from leaking into public conversation
323 if((! $toplevelpost) && (! toplevelprivate) && ($item['private']) && ($profile_owner != local_user()))
328 $override_comment_box = ((($page_writeable) && ($item_writeable)) ? true : false);
329 $show_comment_box = ((($page_writeable) && ($item_writeable) && ($comments_seen == $comments[$item['parent']])) ? true : false);
331 if(($comments[$item['parent']] > 2) && ($comments_seen <= ($comments[$item['parent']] - 2)) && ($item['gravity'] == 6)) {
332 if(! $comments_collapsed) {
333 $treads[$treadsid] .= '<div class="ccollapse-wrapper fakelink" id="ccollapse-wrapper-' . $item['parent']
334 . '" onclick="openClose(' . '\'ccollapse-' . $item['parent'] . '\'); $(\'#ccollapse-wrapper-' . $item['parent'] . '\').hide();" >'
335 . sprintf( t('See all %d comments'), $comments[$item['parent']]) . '</div>'
336 . '<div class="ccollapse" id="ccollapse-' . $item['parent'] . '" style="display: none;" >';
337 $comments_collapsed = true;
340 if(($comments[$item['parent']] > 2) && ($comments_seen == ($comments[$item['parent']] - 1))) {
341 $treads[$treadsid] .= '</div>';
344 $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
346 $lock = ((($item['private']) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid'])
347 || strlen($item['deny_cid']) || strlen($item['deny_gid']))))
348 ? t('Private Message')
352 // Top-level wall post not written by the wall owner (wall-to-wall)
353 // First figure out who owns it.
357 if(($toplevelpost) && (! $item['self']) && ($mode !== 'profile')) {
361 // On the network page, I am the owner. On the display page it will be the profile owner.
362 // This will have been stored in $a->page_contact by our calling page.
363 // Put this person on the left of the wall-to-wall notice.
365 $owner_url = $a->page_contact['url'];
366 $owner_photo = $a->page_contact['thumb'];
367 $owner_name = $a->page_contact['name'];
368 $template = $wallwall;
371 if((! $item['wall']) && (strlen($item['owner-link'])) && ($item['owner-link'] != $item['author-link'])) {
375 $owner_url = $item['owner-link'];
376 $owner_photo = $item['owner-avatar'];
377 $owner_name = $item['owner-name'];
378 $template = $wallwall;
380 // If it is our contact, use a friendly redirect link
381 if((link_compare($item['owner-link'],$item['url']))
382 && ($item['network'] === 'dfrn')) {
383 $owner_url = $redirect_url;
384 $osparkle = ' sparkle';
390 $shareable = ((($profile_owner == local_user()) && ($mode != 'display') && (! $item['private'])) ? true : false);
392 if($page_writeable) {
394 /*$likebuttons = replace_macros(((($shareable)) ? $like_tpl : $noshare_tpl),array(
395 '$id' => $item['id'],
396 '$likethis' => t("I like this \x28toggle\x29"),
397 '$nolike' => t("I don't like this \x28toggle\x29"),
398 '$share' => t('Share'),
399 '$wait' => t('Please wait')
401 $likebuttons = array(
402 'like' => array( t("I like this \x28toggle\x29"), t("like")),
403 'dislike' => array( t("I don't like this \x28toggle\x29"), t("dislike")),
405 if ($shareable) $likebuttons['share'] = array( t('Share this'), t('share'));
408 if(($show_comment_box) || (($show_comment_box == false) && ($override_comment_box == false) && ($item['last-child']))) {
409 $comment = replace_macros($cmnt_tpl,array(
410 '$return_path' => '',
411 '$jsreload' => (($mode === 'display') ? $_SESSION['return_url'] : ''),
412 '$type' => (($mode === 'profile') ? 'wall-comment' : 'net-comment'),
413 '$id' => $item['item_id'],
414 '$parent' => $item['parent'],
415 '$profile_uid' => $profile_owner,
416 '$mylink' => $a->contact['url'],
417 '$mytitle' => t('This is you'),
418 '$myphoto' => $a->contact['thumb'],
419 '$comment' => t('Comment'),
420 '$submit' => t('Submit'),
421 '$ww' => (($mode === 'network') ? $commentww : '')
426 $edpost = (((($profile_owner == local_user()) && ($toplevelpost) && (intval($item['wall']) == 1)) || ($mode === 'notes'))
427 ? array($a->get_baseurl()."/editpost/".$item['id'], t("Edit"))
434 if((intval($item['contact-id']) && $item['contact-id'] == remote_user()) || ($item['uid'] == local_user()))
438 'dropping' => $dropping,
439 'select' => t('Select'),
440 'delete' => t('Delete'),
445 if ($profile_owner == local_user() && $toplevelpost) {
446 $isstarred = (($item['starred']) ? "starred" : "unstarred");
449 'do' => t("add star"),
450 'undo' => t("remove star"),
451 'toggle' => t("toggle star status"),
452 'classdo' => (($item['starred']) ? "hidden" : ""),
453 'classundo' => (($item['starred']) ? "" : "hidden"),
454 'starred' => t('starred'),
460 $photo = $item['photo'];
461 $thumb = $item['thumb'];
463 // Post was remotely authored.
465 $diff_author = ((link_compare($item['url'],$item['author-link'])) ? false : true);
467 $profile_name = (((strlen($item['author-name'])) && $diff_author) ? $item['author-name'] : $item['name']);
470 $profile_link = best_link_url($item,$sp);
472 $sparkle = ' sparkle';
474 if($profile_link === 'mailbox')
477 $normalised = normalise_link((strlen($item['author-link'])) ? $item['author-link'] : $item['url']);
478 if(($normalised != 'mailbox') && (x($a->contacts,$normalised)))
479 $profile_avatar = $a->contacts[$normalised]['thumb'];
481 $profile_avatar = (((strlen($item['author-avatar'])) && $diff_author) ? $item['author-avatar'] : $thumb);
487 $like = ((x($alike,$item['id'])) ? format_like($alike[$item['id']],$alike[$item['id'] . '-l'],'like',$item['id']) : '');
488 $dislike = ((x($dlike,$item['id'])) ? format_like($dlike[$item['id']],$dlike[$item['id'] . '-l'],'dislike',$item['id']) : '');
490 $location = (($item['location']) ? '<a target="map" title="' . $item['location']
491 . '" href="http://maps.google.com/?q=' . urlencode($item['location']) . '">' . $item['location'] . '</a>' : '');
492 $coord = (($item['coord']) ? '<a target="map" title="' . $item['coord']
493 . '" href="http://maps.google.com/?q=' . urlencode($item['coord']) . '">' . $item['coord'] . '</a>' : '');
496 $location .= '<br /><span class="smalltext">(' . $coord . ')</span>';
498 $location = '<span class="smalltext">' . $coord . '</span>';
501 $indent = (($toplevelpost) ? '' : ' comment');
503 if(strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC','now - 12 hours')) > 0)
507 localize_item($item);
511 $body = prepare_body($item,true);
514 $tmp_item = replace_macros($template,array(
515 '$body' => template_escape($body),
516 '$id' => $item['item_id'],
517 '$linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, ((strlen($item['author-link'])) ? $item['author-link'] : $item['url'])),
518 '$olinktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, ((strlen($item['owner-link'])) ? $item['owner-link'] : $item['url'])),
520 '$wall' => t('Wall-to-Wall'),
521 '$vwall' => t('via Wall-To-Wall:'),
522 '$profile_url' => $profile_link,
523 '$item_photo_menu' => item_photo_menu($item),
524 '$name' => template_escape($profile_name),
525 '$thumb' => $profile_avatar,
526 '$osparkle' => $osparkle,
527 '$sparkle' => $sparkle,
528 '$title' => template_escape($item['title']),
529 '$ago' => ((($item['app']) && ($item['id'] == $item['parent'])) ? sprintf( t('%s from %s'),relative_date($item['created']),$item['app']) : relative_date($item['created'])),
531 '$location' => template_escape($location),
532 '$indent' => $indent,
533 '$owner_url' => $owner_url,
534 '$owner_photo' => $owner_photo,
535 '$owner_name' => template_escape($owner_name),
536 '$plink' => get_plink($item),
537 '$edpost' => $edpost,
538 '$isstarred' => $isstarred,
541 '$vote' => $likebuttons,
543 '$dislike' => $dislike,
544 '$comment' => $comment,
545 '$wait' => t('Please wait'),
550 $arr = array('item' => $item, 'output' => $tmp_item);
551 call_hooks('display_item', $arr);
553 $treads[$treadsid] .= $arr['output'];
559 // if author collapsing is in force but didn't get closed, close it off now.
561 if($blowhard_count >= 3)
562 $treads[$treadsid] .= '</div>';
564 $page_template = get_markup_template("conversation.tpl");
565 $o .= replace_macros($page_template, array(
566 '$treads' => $treads,
567 '$dropping' => $dropping,
570 // $o .= '<div id="item-delete-selected" class="fakelink" onclick="deleteCheckedItems();"><div id="item-delete-selected-icon" class="icon drophide" title="' . t('Delete Selected Items') . '" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></div><div id="item-delete-selected-desc" >' . t('Delete Selected Items') . '</div></div><div id="item-delete-selected-end"></div>';
575 function best_link_url($item,&$sparkle) {
582 $clean_url = normalise_link($item['author-link']);
584 if((local_user()) && (local_user() == $item['uid'])) {
585 if(isset($a->contacts) && x($a->contacts,$clean_url)) {
586 if($a->contacts[$clean_url]['network'] === NETWORK_DFRN) {
587 $best_url = $a->get_baseurl() . '/redir/' . $a->contacts[$clean_url]['id'];
591 $best_url = $a->contacts[$clean_url]['url'];
595 if(strlen($item['author-link']))
596 $best_url = $item['author-link'];
598 $best_url = $item['url'];
605 if(! function_exists('item_photo_menu')){
606 function item_photo_menu($item){
609 if (local_user() && (! count($a->contacts)))
610 load_contact_links(local_user());
619 $profile_link = best_link_url($item,$sparkle);
620 if($profile_link === 'mailbox')
624 $cid = intval(basename($profile_link));
625 $status_link = $profile_link . "?url=status";
626 $photos_link = $profile_link . "?url=photos";
627 $profile_link = $profile_link . "?url=profile";
628 $pm_url = $a->get_baseurl() . '/message/new/' . $cid;
631 if(local_user() && local_user() == $item['uid'] && link_compare($item['url'],$item['author-link'])) {
632 $cid = $item['contact-id'];
638 if(($cid) && (! $item['self'])) {
639 $contact_url = $a->get_baseurl() . '/contacts/' . $cid;
640 $posts_link = $a->get_baseurl() . '/network/?cid=' . $cid;
644 t("View status") => $status_link,
645 t("View profile") => $profile_link,
646 t("View photos") => $photos_link,
647 t("View recent") => $posts_link,
648 t("Edit contact") => $contact_url,
649 t("Send PM") => $pm_url,
653 $args = array($item, &$menu);
655 call_hooks('item_photo_menu', $args);
658 foreach($menu as $k=>$v){
659 if ($v!="") $o .= "<li><a href='$v'>$k</a></li>\n";
664 if(! function_exists('like_puller')) {
665 function like_puller($a,$item,&$arr,$mode) {
669 $verb = (($mode === 'like') ? ACTIVITY_LIKE : ACTIVITY_DISLIKE);
671 if((activity_match($item['verb'],$verb)) && ($item['id'] != $item['parent'])) {
672 $url = $item['author-link'];
673 if((local_user()) && (local_user() == $item['uid']) && ($item['network'] === 'dfrn') && (! $item['self']) && (link_compare($item['author-link'],$item['url']))) {
674 $url = $a->get_baseurl() . '/redir/' . $item['contact-id'];
675 $sparkle = ' class="sparkle" ';
677 if(! ((isset($arr[$item['parent'] . '-l'])) && (is_array($arr[$item['parent'] . '-l']))))
678 $arr[$item['parent'] . '-l'] = array();
679 if(! isset($arr[$item['parent']]))
680 $arr[$item['parent']] = 1;
682 $arr[$item['parent']] ++;
683 $arr[$item['parent'] . '-l'][] = '<a href="'. $url . '"'. $sparkle .'>' . $item['author-name'] . '</a>';
688 // Format the like/dislike text for a profile item
689 // $cnt = number of people who like/dislike the item
690 // $arr = array of pre-linked names of likers/dislikers
691 // $type = one of 'like, 'dislike'
693 // returns formatted text
695 if(! function_exists('format_like')) {
696 function format_like($cnt,$arr,$type,$id) {
699 $o .= (($type === 'like') ? sprintf( t('%s likes this.'), $arr[0]) : sprintf( t('%s doesn\'t like this.'), $arr[0])) . EOL ;
701 $spanatts = 'class="fakelink" onclick="openClose(\'' . $type . 'list-' . $id . '\');"';
702 $o .= (($type === 'like') ?
703 sprintf( t('<span %1$s>%2$d people</span> like this.'), $spanatts, $cnt)
705 sprintf( t('<span %1$s>%2$d people</span> don\'t like this.'), $spanatts, $cnt) );
707 $total = count($arr);
708 if($total >= MAX_LIKERS)
709 $arr = array_slice($arr, 0, MAX_LIKERS - 1);
710 if($total < MAX_LIKERS)
711 $arr[count($arr)-1] = t('and') . ' ' . $arr[count($arr)-1];
712 $str = implode(', ', $arr);
713 if($total >= MAX_LIKERS)
714 $str .= sprintf( t(', and %d other people'), $total - MAX_LIKERS );
715 $str = (($type === 'like') ? sprintf( t('%s like this.'), $str) : sprintf( t('%s don\'t like this.'), $str));
716 $o .= "\t" . '<div id="' . $type . 'list-' . $id . '" style="display: none;" >' . $str . '</div>';
722 function status_editor($a,$x, $notes_cid = 0) {
726 $geotag = (($x['allow_location']) ? get_markup_template('jot_geotag.tpl') : '');
728 $tpl = get_markup_template('jot-header.tpl');
730 $a->page['htmlhead'] .= replace_macros($tpl, array(
731 '$baseurl' => $a->get_baseurl(),
732 '$geotag' => $geotag,
733 '$nickname' => $x['nickname'],
734 '$ispublic' => t('Visible to <strong>everybody</strong>'),
735 '$linkurl' => t('Please enter a link URL:'),
736 '$utubeurl' => t('Please enter a YouTube link:'),
737 '$vidurl' => t("Please enter a video\x28.ogg\x29 link/URL:"),
738 '$audurl' => t("Please enter an audio\x28.ogg\x29 link/URL:"),
739 '$whereareu' => t('Where are you right now?'),
740 '$title' => t('Enter a title for this item')
744 $tpl = get_markup_template("jot.tpl");
749 $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
751 $mail_enabled = false;
752 $pubmail_enabled = false;
754 if(($x['is_owner']) && (! $mail_disabled)) {
755 $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d AND `server` != '' LIMIT 1",
759 $mail_enabled = true;
760 if(intval($r[0]['pubmail']))
761 $pubmail_enabled = true;
766 $selected = (($pubmail_enabled) ? ' checked="checked" ' : '');
767 $jotnets .= '<div class="profile-jot-net"><input type="checkbox" name="pubmail_enable"' . $selected . ' value="1" /> '
768 . t("Post to Email") . '</div>';
771 call_hooks('jot_tool', $jotplugins);
772 call_hooks('jot_networks', $jotnets);
775 $jotnets .= '<input type="hidden" name="contact_allow[]" value="' . $notes_cid .'" />';
777 $tpl = replace_macros($tpl,array('$jotplugins' => $jotplugins));
779 $o .= replace_macros($tpl,array(
780 '$return_path' => $a->cmd,
782 '$share' => (($x['button']) ? $x['button'] : t('Share')),
783 '$upload' => t('Upload photo'),
784 '$attach' => t('Attach file'),
785 '$weblink' => t('Insert web link'),
786 '$youtube' => t('Insert YouTube video'),
787 '$video' => t('Insert Vorbis [.ogg] video'),
788 '$audio' => t('Insert Vorbis [.ogg] audio'),
789 '$setloc' => t('Set your location'),
790 '$noloc' => t('Clear browser location'),
791 '$title' => t('Set title'),
792 '$wait' => t('Please wait'),
793 '$permset' => t('Permission settings'),
794 '$ptyp' => (($notes_cid) ? 'note' : 'wall'),
797 '$baseurl' => $a->get_baseurl(),
798 '$defloc' => $x['default_location'],
799 '$visitor' => $x['visitor'],
800 '$pvisit' => (($notes_cid) ? 'none' : $x['visitor']),
801 '$emailcc' => t('CC: email addresses'),
802 '$public' => t('Public post'),
803 '$jotnets' => $jotnets,
804 '$emtitle' => t('Example: bob@example.com, mary@example.com'),
805 '$lockstate' => $x['lockstate'],
807 '$bang' => $x['bang'],
808 '$profile_uid' => $x['profile_uid'],