From 42d622d6bfb5768205573cb6b149340d28f46886 Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 9 Mar 2012 02:50:57 -0800 Subject: recover contacts total count which got lost --- mod/contacts.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'mod') diff --git a/mod/contacts.php b/mod/contacts.php index c99ac1452..001bf12af 100755 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -447,9 +447,10 @@ function contacts_content(&$a) { $r = q("SELECT COUNT(*) AS `total` FROM `contact` WHERE `uid` = %d AND `pending` = 0 $sql_extra $sql_extra2 ", intval($_SESSION['uid'])); - if(count($r)) + if(count($r)) { $a->set_pager_total($r[0]['total']); - + $total = $r[0]['total']; + } @@ -518,7 +519,7 @@ function contacts_content(&$a) { $o .= replace_macros($tpl,array( '$header' => t('Contacts') . (($nets) ? ' - ' . network_to_name($nets) : ''), '$tabs' => $t, - '$total' => $r[0]['total'], + '$total' => $total, '$search' => $search_hdr, '$desc' => t('Search your contacts'), '$finding' => (strlen($search) ? t('Finding: ') . "'" . $search . "'" : ""), -- cgit v1.2.3 From fd1f8fb4361b415defa8d6da2c93d2f19fb59ba1 Mon Sep 17 00:00:00 2001 From: Michael Johnston Date: Fri, 9 Mar 2012 21:29:39 -0500 Subject: allow user to set number of items to show on network page --- mod/network.php | 3 ++- mod/settings.php | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/network.php b/mod/network.php index 27c6e315b..b04a7b489 100755 --- a/mod/network.php +++ b/mod/network.php @@ -403,7 +403,8 @@ function network_content(&$a, $update = 0) { if(count($r)) { $a->set_pager_total($r[0]['total']); - $a->set_pager_itemspage(40); + $itemspage_network = get_pconfig(local_user(),'system','itemspage_network'); + $a->set_pager_itemspage(((intval($itemspage_network)) ? $itemspage_network : 40)); } $pager_sql = sprintf(" LIMIT %d, %d ",intval($a->pager['start']), intval($a->pager['itemspage'])); } diff --git a/mod/settings.php b/mod/settings.php index a9d00bc98..2ef582fdf 100755 --- a/mod/settings.php +++ b/mod/settings.php @@ -237,6 +237,10 @@ function settings_post(&$a) { if($browser_update < 10000) $browser_update = 40000; + $itemspage_network = ((x($_POST,'itemspage_network')) ? intval($_POST['itemspage_network']) : 40); + if($itemspage_network > 100) + $itemspage_network = 40; + $allow_location = (((x($_POST,'allow_location')) && (intval($_POST['allow_location']) == 1)) ? 1: 0); $publish = (((x($_POST,'profile_in_directory')) && (intval($_POST['profile_in_directory']) == 1)) ? 1: 0); @@ -331,6 +335,7 @@ function settings_post(&$a) { set_pconfig(local_user(),'system','suggestme', $suggestme); set_pconfig(local_user(),'system','update_interval', $browser_update); + set_pconfig(local_user(),'system','itemspage_network', $itemspage_network); $r = q("UPDATE `user` SET `username` = '%s', `email` = '%s', `openid` = '%s', `timezone` = '%s', `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s', `notify-flags` = %d, `page-flags` = %d, `default-location` = '%s', `allow_location` = %d, `theme` = '%s', `maxreq` = %d, `expire` = %d, `openidserver` = '%s', `blockwall` = %d, `hidewall` = %d, `blocktags` = %d WHERE `uid` = %d LIMIT 1", dbesc($username), @@ -648,6 +653,9 @@ function settings_content(&$a) { $browser_update = intval(get_pconfig(local_user(), 'system','update_interval')); $browser_update = (($browser_update == 0) ? 40 : $browser_update / 1000); // default if not set: 40 seconds + + $itemspage_network = intval(get_pconfig(local_user(), 'system','itemspage_network')); + $itemspage_network = (($itemspage_network > 0 && $itemspage_network < 101) ? $itemspage_network : 40); // default if not set: 40 items if(! strlen($a->user['timezone'])) $timezone = date_default_timezone_get(); @@ -814,6 +822,7 @@ function settings_content(&$a) { '$allowloc' => array('allow_location', t('Use Browser Location:'), ($a->user['allow_location'] == 1), ''), '$theme' => array('theme', t('Display Theme:'), $theme_selected, '', $themes), '$ajaxint' => array('browser_update', t("Update browser every xx seconds"), $browser_update, t('Minimum of 10 seconds, no maximum')), + '$itemspage_network' => array('itemspage_network', t("Number of items to display on the network page:"), $itemspage_network, t('Maximum of 100 items')), '$h_prv' => t('Security and Privacy Settings'), -- cgit v1.2.3 From 1bddd4866151f53f4469dee636a3742fe8381306 Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 10 Mar 2012 15:50:51 -0800 Subject: bug #327 - composed private message is lost if no recip specified. --- mod/message.php | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'mod') diff --git a/mod/message.php b/mod/message.php index 91db5baef..dcaaf6975 100755 --- a/mod/message.php +++ b/mod/message.php @@ -10,17 +10,19 @@ function message_post(&$a) { return; } - $replyto = ((x($_POST,'replyto')) ? notags(trim($_POST['replyto'])) : ''); - $subject = ((x($_POST,'subject')) ? notags(trim($_POST['subject'])) : ''); - $body = ((x($_POST,'body')) ? escape_tags(trim($_POST['body'])) : ''); - $recipient = ((x($_POST,'messageto')) ? intval($_POST['messageto']) : 0 ); + $replyto = ((x($_REQUEST,'replyto')) ? notags(trim($_REQUEST['replyto'])) : ''); + $subject = ((x($_REQUEST,'subject')) ? notags(trim($_REQUEST['subject'])) : ''); + $body = ((x($_REQUEST,'body')) ? escape_tags(trim($_REQUEST['body'])) : ''); + $recipient = ((x($_REQUEST,'messageto')) ? intval($_REQUEST['messageto']) : 0 ); $ret = send_message($recipient, $body, $subject, $replyto); + $norecip = false; switch($ret){ case -1: notice( t('No recipient selected.') . EOL ); + $norecip = true; break; case -2: notice( t('Unable to locate contact information.') . EOL ); @@ -35,6 +37,13 @@ function message_post(&$a) { info( t('Message sent.') . EOL ); } + // fake it to go back to the input form if no recipient listed + + if($norecip) { + $a->argc = 2; + $a->argv[1] = 'new'; + } + } function message_content(&$a) { @@ -151,7 +160,8 @@ function message_content(&$a) { '$header' => t('Send Private Message'), '$to' => t('To:'), '$subject' => t('Subject:'), - '$subjtxt' => '', + '$subjtxt' => ((x($_REQUEST,'subject')) ? strip_tags($_REQUEST['subject']) : ''), + '$text' => ((x($_REQUEST,'body')) ? escape_tags(htmlspecialchars($_REQUEST['body'])) : ''), '$readonly' => '', '$yourmessage' => t('Your message:'), '$select' => $select, -- cgit v1.2.3 From d9c5d9d2ebf1d0830020e4dc5971cf5bd2227ed5 Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 10 Mar 2012 15:53:36 -0800 Subject: default the text template var on conversations --- mod/message.php | 1 + 1 file changed, 1 insertion(+) (limited to 'mod') diff --git a/mod/message.php b/mod/message.php index dcaaf6975..57d45ee3c 100755 --- a/mod/message.php +++ b/mod/message.php @@ -305,6 +305,7 @@ function message_content(&$a) { '$subjtxt' => template_escape($message['title']), '$readonly' => ' readonly="readonly" style="background: #BBBBBB;" ', '$yourmessage' => t('Your message:'), + '$text' => '', '$select' => $select, '$parent' => $parent, '$upload' => t('Upload photo'), -- cgit v1.2.3