aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorAlexander Kampmann <programmer@nurfuerspam.de>2012-03-14 12:57:35 +0100
committerAlexander Kampmann <programmer@nurfuerspam.de>2012-03-14 12:57:35 +0100
commit70709a882594250684c954a21d186877ea6f983c (patch)
treeee2f364e513f8fd9fa1e12da8f5cd39c36d9b403 /mod
parent509ed2604fe6860b83e02984f8b4a280496a22a8 (diff)
parent42462cc1f00cd0d2e637ff3ddb62b30ae4a645c6 (diff)
downloadvolse-hubzilla-70709a882594250684c954a21d186877ea6f983c.tar.gz
volse-hubzilla-70709a882594250684c954a21d186877ea6f983c.tar.bz2
volse-hubzilla-70709a882594250684c954a21d186877ea6f983c.zip
Merge branch 'master' of git://github.com/friendica/friendica
Conflicts: view/de/strings.php
Diffstat (limited to 'mod')
-rwxr-xr-xmod/hcard.php2
-rwxr-xr-xmod/message.php21
-rwxr-xr-xmod/network.php24
-rwxr-xr-xmod/profile.php2
-rwxr-xr-xmod/settings.php9
5 files changed, 43 insertions, 15 deletions
diff --git a/mod/hcard.php b/mod/hcard.php
index 19e649dcb..6d2d9e2eb 100755
--- a/mod/hcard.php
+++ b/mod/hcard.php
@@ -21,7 +21,7 @@ function hcard_init(&$a) {
profile_load($a,$which,$profile);
if((x($a->profile,'page-flags')) && ($a->profile['page-flags'] == PAGE_COMMUNITY)) {
- $a->page['htmlhead'] .= '<meta name="friendika.community" content="true" />';
+ $a->page['htmlhead'] .= '<meta name="friendica.community" content="true" />';
}
if(x($a->profile,'openidserver'))
$a->page['htmlhead'] .= '<link rel="openid.server" href="' . $a->profile['openidserver'] . '" />' . "\r\n";
diff --git a/mod/message.php b/mod/message.php
index 91db5baef..57d45ee3c 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,
@@ -295,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'),
diff --git a/mod/network.php b/mod/network.php
index 27c6e315b..861b5ab73 100755
--- a/mod/network.php
+++ b/mod/network.php
@@ -52,13 +52,15 @@ function network_init(&$a) {
function saved_searches($search) {
$srchurl = '/network?f='
- . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '')
- . ((x($_GET,'star')) ? '&star=' . $_GET['star'] : '')
+ . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '')
+ . ((x($_GET,'star')) ? '&star=' . $_GET['star'] : '')
. ((x($_GET,'bmark')) ? '&bmark=' . $_GET['bmark'] : '')
- . ((x($_GET,'conv')) ? '&conv=' . $_GET['conv'] : '')
- . ((x($_GET,'nets')) ? '&nets=' . $_GET['nets'] : '')
- . ((x($_GET,'cmin')) ? '&cmin=' . $_GET['cmin'] : '')
- . ((x($_GET,'cmax')) ? '&cmax=' . $_GET['cmax'] : '');
+ . ((x($_GET,'conv')) ? '&conv=' . $_GET['conv'] : '')
+ . ((x($_GET,'nets')) ? '&nets=' . $_GET['nets'] : '')
+ . ((x($_GET,'cmin')) ? '&cmin=' . $_GET['cmin'] : '')
+ . ((x($_GET,'cmax')) ? '&cmax=' . $_GET['cmax'] : '')
+ . ((x($_GET,'file')) ? '&file=' . $_GET['file'] : '');
+ ;
$o = '';
@@ -226,6 +228,7 @@ function network_content(&$a, $update = 0) {
$nets = ((x($_GET,'nets')) ? $_GET['nets'] : '');
$cmin = ((x($_GET,'cmin')) ? intval($_GET['cmin']) : 0);
$cmax = ((x($_GET,'cmax')) ? intval($_GET['cmax']) : 99);
+ $file = ((x($_GET,'file')) ? $_GET['file'] : '');
if(($a->argc > 2) && $a->argv[2] === 'new')
$nouveau = true;
@@ -239,7 +242,7 @@ function network_content(&$a, $update = 0) {
}
}
- if(x($_GET,'search'))
+ if(x($_GET,'search') || x($_GET,'file'))
$nouveau = true;
if($cid)
$def_acl = array('allow_cid' => '<' . intval($cid) . '>');
@@ -358,6 +361,7 @@ function network_content(&$a, $update = 0) {
. ((x($_GET,'nets')) ? '&nets=' . $_GET['nets'] : '')
. ((x($_GET,'cmin')) ? '&cmin=' . $_GET['cmin'] : '')
. ((x($_GET,'cmax')) ? '&cmax=' . $_GET['cmax'] : '')
+ . ((x($_GET,'file')) ? '&file=' . $_GET['file'] : '')
. "'; var profile_page = " . $a->pager['page'] . "; </script>\r\n";
}
@@ -371,6 +375,9 @@ function network_content(&$a, $update = 0) {
dbesc('\\]' . preg_quote($search) . '\\[')
);
}
+ if(strlen($file)) {
+ $sql_extra .= file_tag_file_query('item',$file);
+ }
if($conv) {
$myurl = $a->get_baseurl() . '/profile/'. $a->user['nickname'];
@@ -403,7 +410,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/profile.php b/mod/profile.php
index 1a701f407..428679ffc 100755
--- a/mod/profile.php
+++ b/mod/profile.php
@@ -27,7 +27,7 @@ function profile_init(&$a) {
profile_load($a,$which,$profile);
if((x($a->profile,'page-flags')) && ($a->profile['page-flags'] == PAGE_COMMUNITY)) {
- $a->page['htmlhead'] .= '<meta name="friendika.community" content="true" />';
+ $a->page['htmlhead'] .= '<meta name="friendica.community" content="true" />';
}
if(x($a->profile,'openidserver'))
$a->page['htmlhead'] .= '<link rel="openid.server" href="' . $a->profile['openidserver'] . '" />' . "\r\n";
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'),