set_time_limit(0);
- define ( 'FRIENDIKA_VERSION', '2.1.933' );
- define ( 'DFRN_PROTOCOL_VERSION', '2.1' );
- define ( 'DB_UPDATE_VERSION', 1045 );
+ define ( 'FRIENDIKA_VERSION', '2.1.938' );
+ define ( 'DFRN_PROTOCOL_VERSION', '2.2' );
+ define ( 'DB_UPDATE_VERSION', 1046 );
define ( 'EOL', "<br />\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
intval($shown)
);
if(count($r)) {
- $o .= '<h4 class="contact-h4">' . sprintf(tt('%d Contact','%d Contacts', $total),$total) . '</h4><div id="contact-block">';
+ $o .= '<h4 class="contact-h4">' . sprintf( tt('%d Contact','%d Contacts', $total),$total) . '</h4><div id="contact-block">';
foreach($r as $rr) {
$redirect_url = $a->get_baseurl() . '/redir/' . $rr['id'];
if(local_user() && ($rr['uid'] == local_user())
if(! local_user())
return $o;
- $bd_format = get_config('system','birthday_format');
- if(! $bd_format)
- $bd_format = 'g A l F d' ; // 8 AM Friday January 18
+ $bd_format = t('g A l F d') ; // 8 AM Friday January 18
$r = q("SELECT `event`.*, `event`.`id` AS `eid`, `contact`.* FROM `event`
LEFT JOIN `contact` ON `contact`.`id` = `event`.`cid`
return array();
}}
-
+if(! function_exists('item_photo_menu')){
+function item_photo_menu($item){
+ $a = get_app();
+
+ if (!isset($a->authors)){
+ $rr = q("SELECT id, network, url FROM contact WHERE uid=%d AND self!=1", intval(local_user()));
+ $authors = array();
+ foreach($rr as $r) $authors[$r['url']]= $r;
+ $a->authors = $authors;
+ }
+
+ $contact_url="";
+ $pm_url="";
+
+ $profile_link = ((strlen($item['author-link'])) ? $item['author-link'] : $item['url']);
+ $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
+
+ if(strlen($item['author-link'])) {
+ if(link_compare($item['author-link'],$item['url']) && ($item['network'] === 'dfrn') && (! $item['self'])) {
+ $profile_link = $redirect_url;
+ $pm_url = $a->get_baseurl() . '/message/new/' . $item['cid'] ;
+ $contact_url = $item['self']?"":$a->get_baseurl() . '/contacts/' . $item['cid'] ;
+ }
+ elseif(isset($a->authors[$item['author-link']])) {
+ $profile_link = $a->get_baseurl() . '/redir/' . $a->authors[$item['author-link']]['id'];
+ if ($a->authors[$item['author-link']]['network']==='dfrn'){
+ $pm_url = $a->get_baseurl() . '/message/new/' . $a->authors[$item['author-link']]['id'];
+ }
+ $contact_url = $item['self']?"":$a->get_baseurl() . '/contacts/' . $a->authors[$item['author-link']]['id'] ;
+
+ }
+ }
+
+
+ $menu = Array(
+ t("View profile") => $profile_link,
+ t("Edit contact") => $contact_url,
+ t("Send PM") => $pm_url
+ );
+
+ $args = array($item, &$menu);
+
+ call_hooks('item_photo_menu', $args);
+
+ $o = "";
+ foreach($menu as $k=>$v){
+ if ($v!="") $o .= "<li><a href='$v'>$k</a></li>\n";
+ }
+ return $o;
+}}
++
+ if(! function_exists('lang_selector')) {
+ function lang_selector() {
+ global $lang;
+ $o .= '<div id="language-selector" style="display: none;" >';
+ $o .= '<form action="" method="post" ><select name="system_language" onchange="this.form.submit();" >';
+ $langs = glob('view/*/strings.php');
+ if(is_array($langs) && count($langs)) {
+ if(! in_array('view/en/strings.php',$langs))
+ $langs[] = 'view/en/';
+ foreach($langs as $l) {
+ $ll = substr($l,5);
+ $ll = substr($ll,0,strrpos($ll,'/'));
+ $selected = (($ll === $lang) ? ' selected="selected" ' : '');
+ $o .= '<option value="' . $ll . '"' . $selected . '>' . $ll . '</option>';
+ }
+ }
+ $o .= '</select></form></div>';
+ return $o;
+ }}
'$linkurl' => t('Please enter a link URL:')
));
- $select = contact_select('messageto','message-to-select', false, 4, true);
+ $preselect = (isset($a->argv[2])?array($a->argv[2]):false);
+
+ $select = contact_select('messageto','message-to-select', $preselect, 4, true);
$tpl = load_view_file('view/prv_message.tpl');
$o .= replace_macros($tpl,array(
'$header' => t('Send Private Message'),
'$delete' => t('Delete conversation'),
'$body' => $rr['body'],
'$to_name' => $rr['name'],
- '$date' => datetime_convert('UTC',date_default_timezone_get(),$rr['mailcreated'],'D, d M Y - g:i A')
+ '$date' => datetime_convert('UTC',date_default_timezone_get(),$rr['mailcreated'], t('D, d M Y - g:i A'))
));
}
$o .= paginate($a);
}
if(! $update) {
+ if(group) {
+ if(($t = group_public_members($group)) && (! get_pconfig(local_user(),'system','nowarn_insecure'))) {
+ $plural_form = sprintf( tt('%d member', '%d members', $t), $t);
+ notice( sprintf( t('Warning: This group contains %s from an insecure network.'), $plural_form ) . EOL);
+ notice( t('Private messages to this group are at risk of public disclosure.') . EOL);
+ }
+ }
+
$o .= '<script> $(document).ready(function() { $(\'#nav-network-link\').addClass(\'nav-selected\'); });</script>';
$_SESSION['return_url'] = $a->cmd;
intval($a->pager['start']),
intval($a->pager['itemspage'])
);
+
}
else {
$drop = replace_macros($droptpl,array('$id' => $item['id']));
$lock = '<div class="wall-item-lock"></div>';
-
+
$o .= replace_macros($tpl,array(
'$id' => $item['item_id'],
'$linktitle' => t('View $name\'s profile'),
'$profile_url' => $profile_link,
+ '$item_photo_menu' => item_photo_menu($item),
'$name' => $profile_name,
'$sparkle' => $sparkle,
'$lock' => $lock,
$indent .= ' shiny';
+
// Build the HTML
$tmp_item = replace_macros($template,array(
'$wall' => t('Wall-to-Wall'),
'$vwall' => t('via Wall-To-Wall:'),
'$profile_url' => $profile_link,
+ '$item_photo_menu' => item_photo_menu($item),
'$name' => $profile_name,
'$thumb' => $profile_avatar,
'$osparkle' => $osparkle,
}
return $o;
-}
+}
margin-bottom: 10px;
width: 100px;
}
+.wall-item-photo-menu-button {
+ display: block;
+ position: absolute;
+ background-image: url("photo-menu.jpg");
+ background-position: top left;
+ background-repeat: no-repeat;
+ margin: 0px; padding: 0px;
+ width: 16px;
+ height: 16px;
+ top: 74px; left:10px;
+ overflow: hidden;
+ text-indent: 40px;
+ display: none;
+
+}
+.wall-item-photo-menu {
+ width: auto;
+ border: 2px solid #444444;
+ background: #FFFFFF;
+ position: absolute;
+ left: 10px; top: 90px;
+ display: none;
+ z-index: 10000;
+}
+.wall-item-photo-menu ul { margin:0px; padding: 0px; list-style: none }
+.wall-item-photo-menu li a { display: block; padding: 2px; }
+.wall-item-photo-menu li a:hover { color: #FFFFFF; background: #3465A4; text-decoration: none; }
+
+
+.comment .wall-item-photo-menu-button { top: 44px;}
+.comment .wall-item-photo-menu { top: 60px; }
.wallwall .wwto {
left: 50px;
width: 30px;
height: 30px;
}
+
.wallwall .wall-item-photo-end {
clear: both;
}
.side-link {
margin-bottom: 15px;
}
+
+ #language-selector {
+ position: absolute;
+ top: 0;
+ left: 0;
+ )
.wall-item-content-wrapper {
margin-top: 10px;
border: 1px solid #CCC;
+ position: relative;
}
.wall-item-content-wrapper.comment {
width: 100px;
float: left;
}
+
+.wall-item-photo-menu-button {
+ display: block;
+ position: absolute;
+ background-image: url("photo-menu.jpg");
+ background-position: top left;
+ background-repeat: no-repeat;
+ margin: 0px; padding: 0px;
+ width: 16px;
+ height: 16px;
+ top: 74px; left:10px;
+ overflow: hidden;
+ text-indent: 40px;
+ display: none;
+}
+.wall-item-photo-menu {
+ width: auto;
+ border: 2px solid #444444;
+ background: #FFFFFF;
+ position: absolute;
+ left: 10px; top: 90px;
+ display: none;
+ z-index: 10000;
+}
+.wall-item-photo-menu ul { margin:0px; padding: 0px; list-style: none }
+.wall-item-photo-menu li a { display: block; padding: 2px; }
+.wall-item-photo-menu li a:hover { color: #FFFFFF; background: #3465A4; text-decoration: none; }
+
+
.wall-item-arrowphoto-wrapper {
margin-top: 40px;
margin-right: 20px;
.side-link {
margin-bottom: 15px;
}
+
+ #language-selector {
+ position: absolute;
+ top: 0;
+ left: 0;
+ )