From 4506d80198fb30d09239541f21fe11c173c6c84e Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 14 Jan 2016 11:45:48 -0800 Subject: revision update --- mod/cover_photo.php | 4 ++-- version.inc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mod/cover_photo.php b/mod/cover_photo.php index fd7d794f5..a6262ed7c 100644 --- a/mod/cover_photo.php +++ b/mod/cover_photo.php @@ -103,7 +103,7 @@ function cover_photo_post(&$a) { $aid = get_account_id(); $p = array('aid' => $aid, 'uid' => local_channel(), 'resource_id' => $base_image['resource_id'], - 'filename' => $base_image['filename'], 'album' => t('Profile Photos')); + 'filename' => $base_image['filename'], 'album' => t('Cover Photos')); $p['scale'] = 7; $p['photo_usage'] = PHOTO_COVER; @@ -143,7 +143,7 @@ function cover_photo_post(&$a) { require_once('include/attach.php'); - $res = attach_store($a->get_channel(), get_observer_hash(), '', array('album' => t('Profile Photos'), 'hash' => $hash)); + $res = attach_store($a->get_channel(), get_observer_hash(), '', array('album' => t('Cover Photos'), 'hash' => $hash)); logger('attach_store: ' . print_r($res,true)); diff --git a/version.inc b/version.inc index a2d8d6da6..51bef3134 100644 --- a/version.inc +++ b/version.inc @@ -1 +1 @@ -2016-01-13.1277H +2016-01-14.1278H -- cgit v1.2.3 From 588d022fbb8490f0531b7e44a6af0b596409dc38 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 14 Jan 2016 23:23:12 +0100 Subject: provide some info about our contacts - status (archived, hidden, etc.), public forum (like in directory) and show since when we are connected --- mod/connections.php | 25 ++++++++++++++++++++++++- view/css/mod_connections.css | 17 +++++++++++++++++ view/js/autocomplete.js | 2 +- view/js/mod_connections.js | 7 ++++--- view/tpl/connection_template.tpl | 17 +++++++++++++++-- 5 files changed, 61 insertions(+), 7 deletions(-) diff --git a/mod/connections.php b/mod/connections.php index 915d14b77..1635dcee0 100644 --- a/mod/connections.php +++ b/mod/connections.php @@ -228,6 +228,24 @@ function connections_content(&$a) { foreach($r as $rr) { if($rr['xchan_url']) { + + $status_str = ''; + $status = array( + ((intval($rr['abook_pending'])) ? t('Pending') : ''), + ((intval($rr['abook_archived'])) ? t('Archived') : ''), + ((intval($rr['abook_hidden'])) ? t('Hidden') : ''), + ((intval($rr['abook_ignored'])) ? t('Ignored') : ''), + ((intval($rr['abook_blocked'])) ? t('Blocked') : '') + ); + + foreach($status as $str) { + if(!$str) + continue; + $status_str .= $str; + $status_str .= ', '; + } + $status_str = rtrim($status_str, ', '); + $contacts[] = array( 'img_hover' => sprintf( t('%1$s [%2$s]'),$rr['xchan_name'],$rr['xchan_url']), 'edit_hover' => t('Edit connection'), @@ -244,7 +262,12 @@ function connections_content(&$a) { 'edit' => t('Edit'), 'delete' => t('Delete'), 'url' => chanlink_url($rr['xchan_url']), - 'network' => network_to_name($rr['network']), + 'network' => network_to_name($rr['xchan_network']), + 'public_forum' => ((intval($rr['xchan_pubforum'])) ? true : false), + 'status_label' => t('Status'), + 'status' => $status_str, + 'connected_label' => t('Connected'), + 'connected' => datetime_convert('UTC',date_default_timezone_get(),$rr['abook_created'], 'c') ); } } diff --git a/view/css/mod_connections.css b/view/css/mod_connections.css index 0f35c5dbf..a33430e48 100644 --- a/view/css/mod_connections.css +++ b/view/css/mod_connections.css @@ -16,3 +16,20 @@ opacity: 0.3; filter:alpha(opacity=30); } + +.contact-photo-wrapper { + display: table-cell; + table-layout: fixed; + vertical-align: top; +} + +.contact-info { + display: table-cell; + table-layout: fixed; + vertical-align: top; + padding-left: 10px; +} + +.contact-info-label { + font-weight: bold; +} diff --git a/view/js/autocomplete.js b/view/js/autocomplete.js index 511a7f815..437425a0e 100644 --- a/view/js/autocomplete.js +++ b/view/js/autocomplete.js @@ -196,4 +196,4 @@ function submit_form(e) { if(typeof onselect !== 'undefined') a.on('textComplete:select', function(e, value, strategy) { onselect(value); }); }; -})( jQuery ); \ No newline at end of file +})( jQuery ); diff --git a/view/js/mod_connections.js b/view/js/mod_connections.js index f29d96729..112204a5a 100644 --- a/view/js/mod_connections.js +++ b/view/js/mod_connections.js @@ -1,15 +1,16 @@ -$(document).ready(function() { +$(document).ready(function() { $("#contacts-search").contact_autocomplete(baseurl + '/acl', 'a', true); + $(".autotime").timeago(); }); $("#contacts-search").keyup(function(event){ if(event.keyCode == 13){ - $("#contacts-search-submit").click(); + $("#contacts-search").click(); } }); $(".autocomplete-w1 .selected").keyup(function(event){ if(event.keyCode == 13){ - $("#contacts-search-submit").click(); + $("#contacts-search").click(); } }); diff --git a/view/tpl/connection_template.tpl b/view/tpl/connection_template.tpl index aca6aa991..9813b83e2 100755 --- a/view/tpl/connection_template.tpl +++ b/view/tpl/connection_template.tpl @@ -4,12 +4,25 @@ {{$contact.delete}} {{$contact.edit}} -

{{$contact.name}}

+

{{if $contact.public_forum}} {{/if}}{{$contact.name}}

-
+
{{$contact.name}}
+
+ {{if $contact.status}} +
+ {{$contact.status_label}}: {{$contact.status}} +
+ {{/if}} + {{if $contact.connected}} +
+ {{$contact.connected_label}}: +
+ {{/if}} +
+
-- cgit v1.2.3 From 614dcb8bce1de38b4ec0abf3299c975f244728f5 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 14 Jan 2016 23:38:00 +0100 Subject: since the perms will be reset on approval better do not provide the perms tool before we approved a connection --- view/tpl/abook_edit.tpl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/view/tpl/abook_edit.tpl b/view/tpl/abook_edit.tpl index 1ed3baafa..255ed9cfa 100755 --- a/view/tpl/abook_edit.tpl +++ b/view/tpl/abook_edit.tpl @@ -177,6 +177,7 @@ {{/if}} + {{if ! $is_pending}}
{{if $notself}}
+ {{/if}} -- cgit v1.2.3 From ef2890fe5156cf83de00c077f530f1404b5b509a Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 15 Jan 2016 00:03:15 +0100 Subject: this might be controversal - if approving a connection from the popup go back to connections page. if the popup is dismissed and the connection is approved from the page stay on /connedit page to be able to adjust perms etc... --- mod/connedit.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mod/connedit.php b/mod/connedit.php index 77b54d262..bcf2d744b 100644 --- a/mod/connedit.php +++ b/mod/connedit.php @@ -305,6 +305,9 @@ function connedit_post(&$a) { connedit_clone($a); + if(($_REQUEST['pending']) && (!$_REQUEST['done'])) + goaway($a->get_baseurl(true) . '/connections/ifpending'); + return; } -- cgit v1.2.3 From be9442e7b30c27d3ab91dc79c8dd1ff721a2d260 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 14 Jan 2016 16:29:50 -0800 Subject: more cover photo work --- mod/cover_photo.php | 57 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 22 deletions(-) diff --git a/mod/cover_photo.php b/mod/cover_photo.php index a6262ed7c..832d5ad8e 100644 --- a/mod/cover_photo.php +++ b/mod/cover_photo.php @@ -1,7 +1,8 @@ get_channel(); check_form_security_token_redirectOnErr('/cover_photo', 'cover_photo'); @@ -78,12 +81,17 @@ function cover_photo_post(&$a) { $im = photo_factory($base_image['data'], $base_image['type']); if($im->is_valid()) { + // We are scaling and cropping the relative pixel locations to the original photo instead of the + // scaled photo we operated on. + + // First load the scaled photo to check its size. (Should probably pass this in the post form and save + // a query.) + $g = q("select width, height from photo where resource_id = '%s' and uid = %d and scale = 3", dbesc($image_id), intval(local_channel()) ); - // scale these numbers to the original photo instead of the scaled photo we operated on $scaled_width = $g[0]['width']; $scaled_height = $g[0]['height']; @@ -93,6 +101,14 @@ function cover_photo_post(&$a) { return; } + // unset all other cover photos + + q("update photo set photo_usage = %d where photo_usage = %d and uid = %d", + intval(PHOTO_NORMAL), + intval(PHOTO_COVER), + intval(local_channel()) + ); + $orig_srcx = ( $r[0]['width'] / $scaled_width ) * $srcX; $orig_srcy = ( $r[0]['height'] / $scaled_height ) * $srcY; $orig_srcw = ( $srcW / $scaled_width ) * $r[0]['width']; @@ -114,8 +130,14 @@ function cover_photo_post(&$a) { $p['scale'] = 8; $r2 = $im->save($p); + + + $im->doScaleImage(425,160); + $p['scale'] = 9; + + $r3 = $im->save($p); - if($r1 === false || $r2 === false) { + if($r1 === false || $r2 === false || $r3 === false) { // if one failed, delete them all so we can start over. notice( t('Image resize failed.') . EOL ); $x = q("delete from photo where resource_id = '%s' and uid = %d and scale >= 7 ", @@ -126,6 +148,7 @@ function cover_photo_post(&$a) { } $channel = $a->get_channel(); + send_cover_photo_activity($channel,$base_image); } @@ -133,8 +156,8 @@ function cover_photo_post(&$a) { notice( t('Unable to process image') . EOL); } - goaway($a->get_baseurl() . '/profiles'); - return; // NOTREACHED + goaway(z_root() . '/channel/' . $channel['channel_address']); + } @@ -180,12 +203,7 @@ function cover_photo_post(&$a) { } -function send_cover_photo_activity($channel,$photo,$profile) { - - // for now only create activities for the default profile - - if(! intval($profile['is_default'])) - return; +function send_cover_photo_activity($channel,$photo) { $arr = array(); $arr['item_thread_top'] = 1; @@ -196,20 +214,15 @@ function send_cover_photo_activity($channel,$photo,$profile) { $arr['object'] = json_encode(array( 'type' => $arr['obj_type'], - 'id' => z_root() . '/photo/profile/l/' . $channel['channel_id'], - 'link' => array('rel' => 'photo', 'type' => $photo['type'], 'href' => z_root() . '/photo/profile/l/' . $channel['channel_id']) + 'id' => z_root() . '/photo/' . $photo['resource_id'] . '-7', + 'link' => array('rel' => 'photo', 'type' => $photo['type'], 'href' => z_root() . '/photo/' . $photo['resource_id'] . '-7') )); - if(stripos($profile['gender'],t('female')) !== false) - $t = t('%1$s updated her %2$s'); - elseif(stripos($profile['gender'],t('male')) !== false) - $t = t('%1$s updated his %2$s'); - else - $t = t('%1$s updated their %2$s'); + $t = t('%1$s updated their %2$s'); - $ptext = '[zrl=' . z_root() . '/photos/' . $channel['channel_address'] . '/image/' . $photo['resource_id'] . ']' . t('profile photo') . '[/zrl]'; + $ptext = '[zrl=' . z_root() . '/photos/' . $channel['channel_address'] . '/image/' . $photo['resource_id'] . ']' . t('cover photo') . '[/zrl]'; - $ltext = '[zrl=' . z_root() . '/profile/' . $channel['channel_address'] . ']' . '[zmg=150x150]' . z_root() . '/photo/' . $photo['resource_id'] . '-4[/zmg][/zrl]'; + $ltext = '[zrl=' . z_root() . '/profile/' . $channel['channel_address'] . ']' . '[zmg]' . z_root() . '/photo/' . $photo['resource_id'] . '-8[/zmg][/zrl]'; $arr['body'] = sprintf($t,$channel['channel_name'],$ptext) . "\n\n" . $ltext; -- cgit v1.2.3 From 64753effd1cd47c43846e5bc8653180acd7c4bc9 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 14 Jan 2016 17:25:27 -0800 Subject: cover photo fetch and widget --- boot.php | 15 +++++++++++++++ include/identity.php | 35 +++++++++++++++++++++++++++++++++++ include/widgets.php | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+) diff --git a/boot.php b/boot.php index 599514d20..d184969d1 100755 --- a/boot.php +++ b/boot.php @@ -245,6 +245,21 @@ define ( 'PHOTO_COVER', 0x0010 ); define ( 'PHOTO_ADULT', 0x0008 ); define ( 'PHOTO_FLAG_OS', 0x4000 ); + +define ( 'PHOTO_RES_ORIG', 0 ); +define ( 'PHOTO_RES_1024', 1 ); // rectangular 1024 max width or height, floating height if not (4:3) +define ( 'PHOTO_RES_640', 2 ); // to accomodate SMBC vertical comic strips without scrunching the width +define ( 'PHOTO_RES_320', 3 ); // accordingly + +define ( 'PHOTO_RES_PROFILE_300', 4 ); // square 300 px +define ( 'PHOTO_RES_PROFILE_80', 5 ); // square 80 px +define ( 'PHOTO_RES_PROFILE_48', 6 ); // square 48 px + +define ( 'PHOTO_RES_COVER_1200', 7 ); // 1200w x 435h (2.75:1) +define ( 'PHOTO_RES_COVER_850', 8 ); // 850w x 310h +define ( 'PHOTO_RES_COVER_425', 9 ); // 425w x 160h + + /** * Menu types */ diff --git a/include/identity.php b/include/identity.php index 1d908056f..deccaa299 100644 --- a/include/identity.php +++ b/include/identity.php @@ -1737,3 +1737,38 @@ function auto_channel_create($account_id) { } +function get_cover_photo($channel_id,$format = 'bbcode', $res = PHOTO_RES_COVER_1200) { + + $r = q("select height, width, resource_id, type from photo where uid = %d and scale = %d and photo_usage = %d", + intval($channel_id), + intval($res), + intval(PHOTO_COVER) + ); + if(! $r) + return false; + + $output = false; + + $url = z_root() . '/photo/' . $r[0]['resource_id'] . '-' . $res ; + + switch($format) { + case 'bbcode': + $output = '[zrl=' . $r[0]['width'] . 'x' . $r[0]['height'] . ']' . $url . '[/zrl]'; + break; + case 'html': + $output = '' . t('cover photo') . ''; + break; + case 'array': + default: + $output = array( + 'width' => $r[0]['width'], + 'height' => $r[0]['type'], + 'type' => $r[0]['type'], + 'url' => $url + ); + break; + } + + return $output; + +} \ No newline at end of file diff --git a/include/widgets.php b/include/widgets.php index 033ba44fe..7021ef49d 100644 --- a/include/widgets.php +++ b/include/widgets.php @@ -936,6 +936,38 @@ function widget_photo($arr) { } +function widget_cover_photo($arr) { + + require_once('include/identity.php'); + $o = ''; + + $channel_id = 0; + if(array_key_exists('channel_id', $arr) && intval($arr['channel_id'])) + $channel_id = intval($arr['channel_id']); + if(! $channel_id) + $channel_id = get_app()->profile_uid; + if(! $channel_id) + return ''; + + if(array_key_exists('style', $arr) && isset($arr['style'])) + $style = $arr['style']; + else + $style = 'width:100%; padding-right: 10px; height: auto;'; + + // ensure they can't sneak in an eval(js) function + + if(strpos($style,'(') !== false) + return ''; + + $c = get_cover_photo($channel_id,'html'); + + if($c) { + $o = '
' . (($style) ? str_replace('alt=',' style="' . $style . '" alt=',$c) : $c) . '
'; + } + return $o; +} + + function widget_photo_rand($arr) { require_once('include/photos.php'); -- cgit v1.2.3 From 6ff192c4ead307b65df793a138f9c1e18de81e5f Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 14 Jan 2016 18:43:54 -0800 Subject: update widget docs with widget_cover_photo --- doc/Widgets.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/Widgets.md b/doc/Widgets.md index baacffd6f..06f043356 100644 --- a/doc/Widgets.md +++ b/doc/Widgets.md @@ -85,6 +85,13 @@ Some/many of these widgets have restrictions which may restrict the type of page * style - CSS style string
 
+* cover_photo - display the cover photo for the selected channel + * args: + * channel_id - channel to use, default is the profile_uid + * style - CSS style string (default is dynamically resized to width of region) +
 
+ + * photo_rand - display a random photo from one of your photo albums. Photo permissions are honoured * args: * album - album name (very strongly recommended if you have lots of photos) -- cgit v1.2.3 From f888548e0e722933e5b03b49fd5e19dd6e55743e Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 14 Jan 2016 20:51:59 -0800 Subject: issue with plugin loadable layouts --- boot.php | 4 +++- include/comanche.php | 1 + mod/cover_photo.php | 19 ++++++++++++++++--- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/boot.php b/boot.php index d184969d1..fd309451f 100755 --- a/boot.php +++ b/boot.php @@ -2004,12 +2004,14 @@ function load_pdl(&$a) { $arr = array('module' => $a->module, 'layout' => ''); call_hooks('load_pdl',$arr); - $s = $arr['layout']; + $layout = $arr['layout']; $n = 'mod_' . $a->module . '.pdl' ; $u = comanche_get_channel_id(); if($u) $s = get_pconfig($u, 'system', $n); + if(! $s) + $s = $layout; if((! $s) && (($p = theme_include($n)) != '')) $s = @file_get_contents($p); diff --git a/include/comanche.php b/include/comanche.php index ca3ad336b..ddf331321 100644 --- a/include/comanche.php +++ b/include/comanche.php @@ -275,6 +275,7 @@ function comanche_widget($name, $text) { $vars = array(); $matches = array(); + $cnt = preg_match_all("/\[var=(.*?)\](.*?)\[\/var\]/ism", $text, $matches, PREG_SET_ORDER); if ($cnt) { foreach ($matches as $mtch) { diff --git a/mod/cover_photo.php b/mod/cover_photo.php index 832d5ad8e..de11857b0 100644 --- a/mod/cover_photo.php +++ b/mod/cover_photo.php @@ -68,6 +68,14 @@ function cover_photo_post(&$a) { $srcW = $_POST['xfinal'] - $srcX; $srcH = $_POST['yfinal'] - $srcY; + + $r = q("select gender from profile where uid = %d and is_default = 1 limit 1", + intval(local_channel()) + ); + if($r) { + $profile = $r[0]; + } + $r = q("SELECT * FROM photo WHERE resource_id = '%s' AND uid = %d AND scale = 0 LIMIT 1", dbesc($image_id), intval(local_channel()) @@ -148,7 +156,7 @@ function cover_photo_post(&$a) { } $channel = $a->get_channel(); - send_cover_photo_activity($channel,$base_image); + send_cover_photo_activity($channel,$base_image,$profile); } @@ -203,7 +211,7 @@ function cover_photo_post(&$a) { } -function send_cover_photo_activity($channel,$photo) { +function send_cover_photo_activity($channel,$photo,$profile) { $arr = array(); $arr['item_thread_top'] = 1; @@ -218,7 +226,12 @@ function send_cover_photo_activity($channel,$photo) { 'link' => array('rel' => 'photo', 'type' => $photo['type'], 'href' => z_root() . '/photo/' . $photo['resource_id'] . '-7') )); - $t = t('%1$s updated their %2$s'); + if($profile && stripos($profile['gender'],t('female')) !== false) + $t = t('%1$s updated her %2$s'); + elseif($profile && stripos($profile['gender'],t('male')) !== false) + $t = t('%1$s updated his %2$s'); + else + $t = t('%1$s updated their %2$s'); $ptext = '[zrl=' . z_root() . '/photos/' . $channel['channel_address'] . '/image/' . $photo['resource_id'] . ']' . t('cover photo') . '[/zrl]'; -- cgit v1.2.3 From b58177e3c60fd6dfbe01549bb7894d9c84d40710 Mon Sep 17 00:00:00 2001 From: ken restivo Date: Thu, 14 Jan 2016 21:05:36 -0800 Subject: Use ctrl-d for multi-line messages. --- util/hz | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/util/hz b/util/hz index baa5bfb55..cb6ccf419 100755 --- a/util/hz +++ b/util/hz @@ -12,7 +12,7 @@ echo " USER=youruserame " echo " PASS=yourpass" echo " HUB=your.hub.domain.org" echo -echo "Type \"hz\" (with or without a conf file as an arg), then enter your message. Hit ENTER to send." +echo "Type \"hz\" (with or without a conf file as an arg), then enter your message. Use ctrl-D to send.." } @@ -29,8 +29,10 @@ CUR=`which curl` [ "$PASS" ] || { echo "no PASS"; usage; exit 1; } [ "$HUB" ] || { echo "no HUB"; usage; exit 1; } -echo "enter your message to be posted as $USER @ $HUB, then hit ENTER to send:" +echo "enter your message to be posted as $USER @ $HUB, then hit Ctrl-D to send." -(read MSG; curl -ssl -u${USER}:${PASS} --data-urlencode "status=${MSG}" https://${HUB}/api/statuses/update ) +MSG=$(cat) + +curl -ssl -u${USER}:${PASS} --data-urlencode "status=${MSG}" https://${HUB}/api/statuses/update -- cgit v1.2.3 From 63ee0daac51b8c04123479f2ac91e1762492896f Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 15 Jan 2016 10:42:44 +0100 Subject: provide more contact infos and update some protocol type definitions --- boot.php | 8 ++++---- include/contact_selectors.php | 2 +- mod/connections.php | 5 ++++- view/tpl/connection_template.tpl | 10 ++++++++++ 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/boot.php b/boot.php index fd309451f..da1ba2ac5 100755 --- a/boot.php +++ b/boot.php @@ -271,11 +271,11 @@ define ( 'MENU_BOOKMARK', 0x0002 ); * Network and protocol family types */ -define ( 'NETWORK_DFRN', 'dfrn'); // Friendica, Mistpark, other DFRN implementations -define ( 'NETWORK_ZOT', 'zot!'); // Zot! +define ( 'NETWORK_DFRN', 'friendica-over-diaspora'); // Friendica, Mistpark, other DFRN implementations +define ( 'NETWORK_ZOT', 'zot'); // Zot! define ( 'NETWORK_OSTATUS', 'stat'); // status.net, identi.ca, GNU-social, other OStatus implementations -define ( 'NETWORK_FEED', 'feed'); // RSS/Atom feeds with no known "post/notify" protocol -define ( 'NETWORK_DIASPORA', 'dspr'); // Diaspora +define ( 'NETWORK_FEED', 'rss'); // RSS/Atom feeds with no known "post/notify" protocol +define ( 'NETWORK_DIASPORA', 'diaspora'); // Diaspora define ( 'NETWORK_MAIL', 'mail'); // IMAP/POP define ( 'NETWORK_MAIL2', 'mai2'); // extended IMAP/POP define ( 'NETWORK_FACEBOOK', 'face'); // Facebook API diff --git a/include/contact_selectors.php b/include/contact_selectors.php index 8671f1bd1..d44bee784 100644 --- a/include/contact_selectors.php +++ b/include/contact_selectors.php @@ -79,7 +79,7 @@ function network_to_name($s) { NETWORK_MAIL => t('Email'), NETWORK_DIASPORA => t('Diaspora'), NETWORK_FACEBOOK => t('Facebook'), - NETWORK_ZOT => t('Zot!'), + NETWORK_ZOT => t('Zot'), NETWORK_LINKEDIN => t('LinkedIn'), NETWORK_XMPP => t('XMPP/IM'), NETWORK_MYSPACE => t('MySpace'), diff --git a/mod/connections.php b/mod/connections.php index 1635dcee0..08da4a790 100644 --- a/mod/connections.php +++ b/mod/connections.php @@ -231,7 +231,7 @@ function connections_content(&$a) { $status_str = ''; $status = array( - ((intval($rr['abook_pending'])) ? t('Pending') : ''), + ((intval($rr['abook_pending'])) ? t('Pending approval') : ''), ((intval($rr['abook_archived'])) ? t('Archived') : ''), ((intval($rr['abook_hidden'])) ? t('Hidden') : ''), ((intval($rr['abook_ignored'])) ? t('Ignored') : ''), @@ -262,6 +262,9 @@ function connections_content(&$a) { 'edit' => t('Edit'), 'delete' => t('Delete'), 'url' => chanlink_url($rr['xchan_url']), + 'webbie_label' => t('Channel address'), + 'webbie' => $rr['xchan_addr'], + 'network_label' => t('Network'), 'network' => network_to_name($rr['xchan_network']), 'public_forum' => ((intval($rr['xchan_pubforum'])) ? true : false), 'status_label' => t('Status'), diff --git a/view/tpl/connection_template.tpl b/view/tpl/connection_template.tpl index 9813b83e2..a0bdf33aa 100755 --- a/view/tpl/connection_template.tpl +++ b/view/tpl/connection_template.tpl @@ -21,6 +21,16 @@ {{$contact.connected_label}}: {{/if}} + {{if $contact.webbie}} +
+ {{$contact.webbie_label}}: {{$contact.webbie}} +
+ {{/if}} + {{if $contact.network}} +
+ {{$contact.network_label}}: {{$contact.network}} +
+ {{/if}} -- cgit v1.2.3 From f4e1b2123aed39e3f863ee327b27cb0e7f17520c Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 15 Jan 2016 11:28:05 +0100 Subject: add an approve button to /connections and get rid of the modal popup in /connedit. for quick approval (default collection and perms etc.) we now can use the approve button in /connections else click the edit button and make changes and approval from /connedit. hope thats any better... --- mod/connections.php | 8 +++----- mod/connedit.php | 4 ---- view/tpl/abook_edit.tpl | 19 ------------------- view/tpl/connection_template.tpl | 9 ++++++++- 4 files changed, 11 insertions(+), 29 deletions(-) diff --git a/mod/connections.php b/mod/connections.php index 08da4a790..3297ae8f8 100644 --- a/mod/connections.php +++ b/mod/connections.php @@ -251,15 +251,11 @@ function connections_content(&$a) { 'edit_hover' => t('Edit connection'), 'delete_hover' => t('Delete connection'), 'id' => $rr['abook_id'], - 'alt_text' => $alt_text, - 'dir_icon' => $dir_icon, 'thumb' => $rr['xchan_photo_m'], 'name' => $rr['xchan_name'], - 'username' => $rr['xchan_name'], 'classes' => (intval($rr['abook_archived']) ? 'archived' : ''), 'link' => z_root() . '/connedit/' . $rr['abook_id'], 'deletelink' => z_root() . '/connedit/' . $rr['abook_id'] . '/drop', - 'edit' => t('Edit'), 'delete' => t('Delete'), 'url' => chanlink_url($rr['xchan_url']), 'webbie_label' => t('Channel address'), @@ -270,7 +266,9 @@ function connections_content(&$a) { 'status_label' => t('Status'), 'status' => $status_str, 'connected_label' => t('Connected'), - 'connected' => datetime_convert('UTC',date_default_timezone_get(),$rr['abook_created'], 'c') + 'connected' => datetime_convert('UTC',date_default_timezone_get(),$rr['abook_created'], 'c'), + 'approve_hover' => t('Approve connection'), + 'approve' => (($rr['abook_pending']) ? t('Approve') : false) ); } } diff --git a/mod/connedit.php b/mod/connedit.php index bcf2d744b..cb785fc31 100644 --- a/mod/connedit.php +++ b/mod/connedit.php @@ -714,10 +714,6 @@ function connedit_content(&$a) { '$slide' => $slide, '$affinity' => $affinity, '$pending_label' => t('Connection Pending Approval'), - '$pending_modal_title' => t('Connection Request'), - '$pending_modal_body' => sprintf(t('(%s) would like to connect with you. Please approve this connection to allow communication.'), $contact['xchan_addr']), - '$pending_modal_approve' => t('Approve'), - '$pending_modal_dismiss' => t('Approve Later'), '$is_pending' => (intval($contact['abook_pending']) ? 1 : ''), '$unapproved' => $unapproved, '$inherited' => t('inherited'), diff --git a/view/tpl/abook_edit.tpl b/view/tpl/abook_edit.tpl index 255ed9cfa..4fa810cb4 100755 --- a/view/tpl/abook_edit.tpl +++ b/view/tpl/abook_edit.tpl @@ -73,25 +73,6 @@ - - {{/if}} {{if $affinity }} diff --git a/view/tpl/connection_template.tpl b/view/tpl/connection_template.tpl index a0bdf33aa..2629e5cf4 100755 --- a/view/tpl/connection_template.tpl +++ b/view/tpl/connection_template.tpl @@ -1,8 +1,15 @@
+ {{if $contact.approve}} +
+ + {{/if}} {{$contact.delete}} - {{$contact.edit}} + + {{if $contact.approve}} +
+ {{/if}}

{{if $contact.public_forum}} {{/if}}{{$contact.name}}

-- cgit v1.2.3 From d36aa4fc89f99dc408e356347e74eead746f3e53 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 15 Jan 2016 12:08:04 +0100 Subject: provide a recent activity link in /connections --- mod/connections.php | 6 ++++-- view/tpl/connection_template.tpl | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/mod/connections.php b/mod/connections.php index 3297ae8f8..f43dec73e 100644 --- a/mod/connections.php +++ b/mod/connections.php @@ -255,7 +255,7 @@ function connections_content(&$a) { 'name' => $rr['xchan_name'], 'classes' => (intval($rr['abook_archived']) ? 'archived' : ''), 'link' => z_root() . '/connedit/' . $rr['abook_id'], - 'deletelink' => z_root() . '/connedit/' . $rr['abook_id'] . '/drop', + 'deletelink' => z_root() . '/connedit/' . intval($rr['abook_id']) . '/drop', 'delete' => t('Delete'), 'url' => chanlink_url($rr['xchan_url']), 'webbie_label' => t('Channel address'), @@ -268,7 +268,9 @@ function connections_content(&$a) { 'connected_label' => t('Connected'), 'connected' => datetime_convert('UTC',date_default_timezone_get(),$rr['abook_created'], 'c'), 'approve_hover' => t('Approve connection'), - 'approve' => (($rr['abook_pending']) ? t('Approve') : false) + 'approve' => (($rr['abook_pending']) ? t('Approve') : false), + 'recent_label' => t('Recent activity'), + 'recentlink' => z_root() . '/network/?f=&cid=' . intval($rr['abook_id']) ); } } diff --git a/view/tpl/connection_template.tpl b/view/tpl/connection_template.tpl index 2629e5cf4..143989971 100755 --- a/view/tpl/connection_template.tpl +++ b/view/tpl/connection_template.tpl @@ -35,7 +35,7 @@ {{/if}} {{if $contact.network}}
- {{$contact.network_label}}: {{$contact.network}} + {{$contact.network_label}}: {{$contact.network}} - {{$contact.recent_label}}
{{/if}}
-- cgit v1.2.3 From 2498df68c716ec6ed80b5547c721ca9741a85572 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 15 Jan 2016 13:20:45 +0100 Subject: change button order for consistency --- view/tpl/direntry.tpl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/view/tpl/direntry.tpl b/view/tpl/direntry.tpl index ecc38beb9..57e6e1555 100755 --- a/view/tpl/direntry.tpl +++ b/view/tpl/direntry.tpl @@ -1,16 +1,17 @@
- {{if $entry.viewrate}} - {{if $entry.canrate}}{{/if}} - {{if $entry.total_ratings}}{{$entry.total_ratings}}{{/if}} - {{/if}} {{if $entry.ignlink}} {{$entry.ignore_label}} {{/if}} {{if $entry.connect}} {{$entry.conn_label}} {{/if}} + {{if $entry.viewrate}} + {{if $entry.total_ratings}}{{$entry.total_ratings}}{{/if}} + {{if $entry.canrate}}{{/if}} + + {{/if}}

{{if $entry.public_forum}} {{/if}}{{$entry.name}}{{if $entry.online}} {{/if}}

-- cgit v1.2.3