aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorTobias Hößl <tobias@hoessl.eu>2012-03-09 10:00:12 +0000
committerTobias Hößl <tobias@hoessl.eu>2012-03-09 10:00:12 +0000
commit635958e11da2f5a0d587b66968453064c2d41f13 (patch)
tree9e9b21d45551772a4aac8a54e3bafa382681ed70 /mod
parent02a9fd5dc1d1d9e848e2f406f2e13c4cf0ce228b (diff)
parent2ce78253aeda8672e12f18f0963f52cd4a35e546 (diff)
downloadvolse-hubzilla-635958e11da2f5a0d587b66968453064c2d41f13.tar.gz
volse-hubzilla-635958e11da2f5a0d587b66968453064c2d41f13.tar.bz2
volse-hubzilla-635958e11da2f5a0d587b66968453064c2d41f13.zip
Merge branch 'master' of git://github.com/friendica/friendica
Diffstat (limited to 'mod')
-rwxr-xr-xmod/admin.php55
-rw-r--r--mod/dfrn_confirm.php12
-rwxr-xr-xmod/display.php10
-rwxr-xr-xmod/group.php81
-rwxr-xr-xmod/message.php6
-rwxr-xr-xmod/network.php34
-rw-r--r--mod/notify.php6
-rw-r--r--mod/ping.php23
-rwxr-xr-xmod/profile.php2
-rwxr-xr-xmod/search.php2
-rwxr-xr-xmod/share.php18
11 files changed, 149 insertions, 100 deletions
diff --git a/mod/admin.php b/mod/admin.php
index 0f600e312..93714bb5f 100755
--- a/mod/admin.php
+++ b/mod/admin.php
@@ -145,9 +145,10 @@ function admin_page_summary(&$a) {
Array( t('Automatic Friend Account'), 0)
);
$users=0;
- foreach ($r as $u){ $accounts[$u['page-flags']][1] = $u['count']; $users+=$u['count']; }
+ foreach ($r as $u){ $accounts[$u['page-flags']][1] = $u['count']; $users+= $u['count']; }
+
+ logger('accounts: ' . print_r($accounts,true));
-
$r = q("SELECT COUNT(id) as `count` FROM `register`");
$pending = $r[0]['count'];
@@ -320,32 +321,32 @@ function admin_page_site(&$a) {
'$sitename' => array('sitename', t("Site name"), htmlentities($a->config['sitename'], ENT_QUOTES), ""),
'$banner' => array('banner', t("Banner/Logo"), $banner, ""),
'$language' => array('language', t("System language"), get_config('system','language'), "", $lang_choices),
- '$theme' => array('theme', t("System theme"), get_config('system','theme'), "Default system theme (which may be over-ridden by user profiles)", $theme_choices),
+ '$theme' => array('theme', t("System theme"), get_config('system','theme'), t("Default system theme - may be over-ridden by user profiles"), $theme_choices),
- '$maximagesize' => array('maximagesize', t("Maximum image size"), get_config('system','maximagesize'), "Maximum size in bytes of uploaded images. Default is 0, which means no limits."),
+ '$maximagesize' => array('maximagesize', t("Maximum image size"), get_config('system','maximagesize'), t("Maximum size in bytes of uploaded images. Default is 0, which means no limits.")),
'$register_policy' => array('register_policy', t("Register policy"), $a->config['register_policy'], "", $register_choices),
- '$register_text' => array('register_text', t("Register text"), htmlentities($a->config['register_text'], ENT_QUOTES), "Will be displayed prominently on the registration page."),
+ '$register_text' => array('register_text', t("Register text"), htmlentities($a->config['register_text'], ENT_QUOTES), t("Will be displayed prominently on the registration page.")),
'$abandon_days' => array('abandon_days', t('Accounts abandoned after x days'), get_config('system','account_abandon_days'), t('Will not waste system resources polling external sites for abandonded accounts. Enter 0 for no time limit.')),
- '$allowed_sites' => array('allowed_sites', t("Allowed friend domains"), get_config('system','allowed_sites'), "Comma separated list of domains which are allowed to establish friendships with this site. Wildcards are accepted. Empty to allow any domains"),
- '$allowed_email' => array('allowed_email', t("Allowed email domains"), get_config('system','allowed_email'), "Comma separated list of domains which are allowed in email addresses for registrations to this site. Wildcards are accepted. Empty to allow any domains"),
- '$block_public' => array('block_public', t("Block public"), get_config('system','block_public'), "Check to block public access to all otherwise public personal pages on this site unless you are currently logged in."),
- '$force_publish' => array('publish_all', t("Force publish"), get_config('system','publish_all'), "Check to force all profiles on this site to be listed in the site directory."),
- '$global_directory' => array('directory_submit_url', t("Global directory update URL"), get_config('system','directory_submit_url'), "URL to update the global directory. If this is not set, the global directory is completely unavailable to the application."),
+ '$allowed_sites' => array('allowed_sites', t("Allowed friend domains"), get_config('system','allowed_sites'), t("Comma separated list of domains which are allowed to establish friendships with this site. Wildcards are accepted. Empty to allow any domains")),
+ '$allowed_email' => array('allowed_email', t("Allowed email domains"), get_config('system','allowed_email'), t("Comma separated list of domains which are allowed in email addresses for registrations to this site. Wildcards are accepted. Empty to allow any domains")),
+ '$block_public' => array('block_public', t("Block public"), get_config('system','block_public'), t("Check to block public access to all otherwise public personal pages on this site unless you are currently logged in.")),
+ '$force_publish' => array('publish_all', t("Force publish"), get_config('system','publish_all'), t("Check to force all profiles on this site to be listed in the site directory.")),
+ '$global_directory' => array('directory_submit_url', t("Global directory update URL"), get_config('system','directory_submit_url'), t("URL to update the global directory. If this is not set, the global directory is completely unavailable to the application.")),
- '$no_multi_reg' => array('no_multi_reg', t("Block multiple registrations"), get_config('system','block_extended_register'), "Disallow users to register additional accounts for use as pages."),
- '$no_openid' => array('no_openid', t("OpenID support"), !get_config('system','no_openid'), "OpenID support for registration and logins."),
- '$no_gravatar' => array('no_gravatar', t("Gravatar support"), !get_config('system','no_gravatar'), "Search new user's photo on Gravatar."),
- '$no_regfullname' => array('no_regfullname', t("Fullname check"), !get_config('system','no_regfullname'), "Force users to register with a space between firstname and lastname in Full name, as an antispam measure"),
- '$no_utf' => array('no_utf', t("UTF-8 Regular expressions"), !get_config('system','no_utf'), "Use PHP UTF8 regular expressions"),
- '$no_community_page' => array('no_community_page', t("Show Community Page"), !get_config('system','no_community_page'), "Display a Community page showing all recent public postings on this site."),
- '$ostatus_disabled' => array('ostatus_disabled', t("Enable OStatus support"), !get_config('system','ostatus_disable'), "Provide built-in OStatus \x28identi.ca, status.net, etc.\x29 compatibility. All communications in OStatus are public, so privacy warnings will be occasionally displayed."),
- '$diaspora_enabled' => array('diaspora_enabled', t("Enable Diaspora support"), get_config('system','diaspora_enabled'), "Provide built-in Diaspora network compatibility."),
- '$dfrn_only' => array('dfrn_only', t('Only allow Friendica contacts'), get_config('system','dfrn_only'), "All contacts must use Friendica protocols. All other built-in communication protocols disabled."),
- '$verifyssl' => array('verifyssl', t("Verify SSL"), get_config('system','verifyssl'), "If you wish, you can turn on strict certificate checking. This will mean you cannot connect (at all) to self-signed SSL sites."),
+ '$no_multi_reg' => array('no_multi_reg', t("Block multiple registrations"), get_config('system','block_extended_register'), t("Disallow users to register additional accounts for use as pages.")),
+ '$no_openid' => array('no_openid', t("OpenID support"), !get_config('system','no_openid'), t("OpenID support for registration and logins.")),
+ '$no_gravatar' => array('no_gravatar', t("Gravatar support"), !get_config('system','no_gravatar'), t("Search new user's photo on Gravatar.")),
+ '$no_regfullname' => array('no_regfullname', t("Fullname check"), !get_config('system','no_regfullname'), t("Force users to register with a space between firstname and lastname in Full name, as an antispam measure")),
+ '$no_utf' => array('no_utf', t("UTF-8 Regular expressions"), !get_config('system','no_utf'), t("Use PHP UTF8 regular expressions")),
+ '$no_community_page' => array('no_community_page', t("Show Community Page"), !get_config('system','no_community_page'), t("Display a Community page showing all recent public postings on this site.")),
+ '$ostatus_disabled' => array('ostatus_disabled', t("Enable OStatus support"), !get_config('system','ostatus_disable'), t("Provide built-in OStatus \x28identi.ca, status.net, etc.\x29 compatibility. All communications in OStatus are public, so privacy warnings will be occasionally displayed.")),
+ '$diaspora_enabled' => array('diaspora_enabled', t("Enable Diaspora support"), get_config('system','diaspora_enabled'), t("Provide built-in Diaspora network compatibility.")),
+ '$dfrn_only' => array('dfrn_only', t('Only allow Friendica contacts'), get_config('system','dfrn_only'), t("All contacts must use Friendica protocols. All other built-in communication protocols disabled.")),
+ '$verifyssl' => array('verifyssl', t("Verify SSL"), get_config('system','verifyssl'), t("If you wish, you can turn on strict certificate checking. This will mean you cannot connect (at all) to self-signed SSL sites.")),
'$proxyuser' => array('proxyuser', t("Proxy user"), get_config('system','proxyuser'), ""),
'$proxy' => array('proxy', t("Proxy URL"), get_config('system','proxy'), ""),
- '$timeout' => array('timeout', t("Network timeout"), (x(get_config('system','curl_timeout'))?get_config('system','curl_timeout'):60), "Value is in seconds. Set to 0 for unlimited (not recommended)."),
+ '$timeout' => array('timeout', t("Network timeout"), (x(get_config('system','curl_timeout'))?get_config('system','curl_timeout'):60), t("Value is in seconds. Set to 0 for unlimited (not recommended).")),
));
@@ -366,7 +367,7 @@ function admin_page_users_post(&$a){
intval( $uid )
);
}
- notice( sprintf( tt("%s user blocked", "%s users blocked/unblocked", count($users)), count($users)) );
+ notice( sprintf( tt("%s user blocked/unblocked", "%s users blocked/unblocked", count($users)), count($users)) );
}
if (x($_POST,'page_users_delete')){
require_once("include/Contact.php");
@@ -428,6 +429,7 @@ function admin_page_users(&$a){
LEFT JOIN `contact` ON `register`.`uid` = `contact`.`uid`
LEFT JOIN `user` ON `register`.`uid` = `user`.`uid`;");
+
/* get users */
$total = q("SELECT count(*) as total FROM `user` where 1");
@@ -435,7 +437,8 @@ function admin_page_users(&$a){
$a->set_pager_total($total[0]['total']);
$a->set_pager_itemspage(100);
}
-
+
+
$users = q("SELECT `user` . * , `contact`.`name` , `contact`.`url` , `contact`.`micro`, `lastitem`.`lastitem_date`
FROM
(SELECT MAX(`item`.`changed`) as `lastitem_date`, `item`.`uid`
@@ -469,6 +472,7 @@ function admin_page_users(&$a){
}
$users = array_map("_setup_users", $users);
+
$t = get_markup_template("admin_users.tpl");
$o = replace_macros($t, array(
// strings //
@@ -571,6 +575,8 @@ function admin_page_plugins(&$a){
'$status' => $status,
'$action' => $action,
'$info' => get_plugin_info($plugin),
+ '$str_author' => t('Author: '),
+ '$str_maintainer' => t('Maintainer: '),
'$admin_form' => $admin_form,
'$function' => 'plugins',
@@ -744,7 +750,8 @@ function admin_page_themes(&$a){
'$info' => get_theme_info($theme),
'$function' => 'themes',
'$admin_form' => $admin_form,
-
+ '$str_author' => t('Author: '),
+ '$str_maintainer' => t('Maintainer: '),
'$readme' => $readme
));
}
diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php
index 5a24f0089..0bc3ea7df 100644
--- a/mod/dfrn_confirm.php
+++ b/mod/dfrn_confirm.php
@@ -107,7 +107,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
*
*/
- $r = q("SELECT * FROM `contact` WHERE ( ( `issued-id` != '' AND `issued-id` = '%s' ) OR ( `id` = %d AND `id` != 0 ) ) AND `uid` = %d LIMIT 1",
+ $r = q("SELECT * FROM `contact` WHERE ( ( `issued-id` != '' AND `issued-id` = '%s' ) OR ( `id` = %d AND `id` != 0 ) ) AND `uid` = %d AND `duplex` = 0 LIMIT 1",
dbesc($dfrn_id),
intval($cid),
intval($uid)
@@ -116,6 +116,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
if(! count($r)) {
logger('dfrn_confirm: Contact not found in DB.');
notice( t('Contact not found.') . EOL );
+ notice( t('This may occasionally happen if contact was requested by both persons and it has already been approved.') . EOL );
return;
}
@@ -631,6 +632,15 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
xml_status(3,$message);
}
+ // It's possible that the other person also requested friendship.
+ // If it is a duplex relationship, ditch the issued-id if one exists.
+
+ if($duplex) {
+ $r = q("UPDATE `contact` SET `issued-id` = '' WHERE `id` = %d LIMIT 1",
+ intval($dfrn_record)
+ );
+ }
+
// We're good but now we have to scrape the profile photo and send notifications.
diff --git a/mod/display.php b/mod/display.php
index d96be4333..f428149e8 100755
--- a/mod/display.php
+++ b/mod/display.php
@@ -74,18 +74,18 @@ function display_content(&$a) {
$x = array(
'is_owner' => true,
'allow_location' => $a->user['allow_location'],
- 'default_location' => $a->user['default_location'],
+ 'default_location' => $a->user['default-location'],
'nickname' => $a->user['nickname'],
- 'lockstate' => ((($group) || (is_array($a->user) && ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid']))))) ? 'lock' : 'unlock'),
- 'acl' => populate_acl((($group || $cid) ? $def_acl : $a->user), $celeb),
- 'bang' => (($group || $cid) ? '!' : ''),
+ 'lockstate' => ( (is_array($a->user)) && ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid']))) ? 'lock' : 'unlock'),
+ 'acl' => populate_acl($a->user, $celeb),
+ 'bang' => '',
'visitor' => 'block',
'profile_uid' => local_user()
);
$o .= status_editor($a,$x,0,true);
- $sql_extra = permissions_sql($a->profile['uid'],$remote_contact,$groups);
+ $sql_extra = item_permissions_sql($a->profile['uid'],$remote_contact,$groups);
$r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
diff --git a/mod/group.php b/mod/group.php
index c896362ca..13401ef0d 100755
--- a/mod/group.php
+++ b/mod/group.php
@@ -76,14 +76,18 @@ function group_content(&$a) {
if($switchtotext === false)
$switchtotext = 400;
+ $tpl = get_markup_template('group_edit.tpl');
+ $context = array('$submit' => t('Submit'));
+
if(($a->argc == 2) && ($a->argv[1] === 'new')) {
- $tpl = get_markup_template('group_new.tpl');
- $o .= replace_macros($tpl,array(
- '$desc' => t('Create a group of contacts/friends.'),
- '$name' => t('Group Name: '),
- '$submit' => t('Submit')
- ));
- return $o;
+
+ return replace_macros($tpl, $context + array(
+ '$title' => t('Create a group of contacts/friends.'),
+ '$gname' => array('groupname',t('Group Name: '),$group['name'], ''),
+ '$gid' => 'new',
+ ));
+
+
}
if(($a->argc == 3) && ($a->argv[1] === 'drop')) {
@@ -156,66 +160,61 @@ function group_content(&$a) {
$celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false);
- $tpl = get_markup_template('group_edit.tpl');
- $o .= replace_macros($tpl, array(
+
+ $context = $context + array(
+ '$title' => t('Group Editor'),
+ '$gname' => array('groupname',t('Group Name: '),$group['name'], ''),
'$gid' => $group['id'],
- '$name' => $group['name'],
'$drop' => $drop_txt,
- '$desc' => t('Click on a contact to add or remove.'),
- '$title' => t('Group Editor'),
- '$gname' => t('Group Name: '),
- '$submit' => t('Submit')
- ));
+ );
}
if(! isset($group))
return;
- $o .= '<div id="group-update-wrapper">';
- if($change)
- $o = '';
+ $groupeditor = array(
+ 'label_members' => t('Members'),
+ 'members' => array(),
+ 'label_contacts' => t('All Contacts'),
+ 'contacts' => arraY(),
+ );
+
- $o .= '<h3>' . t('Members') . '</h3>';
- $o .= '<div id="group-members">';
$textmode = (($switchtotext && (count($members) > $switchtotext)) ? true : false);
foreach($members as $member) {
if($member['url']) {
$member['click'] = 'groupChangeMember(' . $group['id'] . ',' . $member['id'] . '); return true;';
- $o .= micropro($member,true,'mpgroup', $textmode);
+ $groupeditor['members'][] = micropro($member,true,'mpgroup', $textmode);
}
else
group_rmv_member(local_user(),$group['name'],$member['id']);
}
- $o .= '</div><div id="group-members-end"></div>';
- $o .= '<hr id="group-separator" />';
-
- $o .= '<h3>' . t('All Contacts') . '</h3>';
- $o .= '<div id="group-all-contacts">';
+ $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `blocked` = 0 and `pending` = 0 and `self` = 0 ORDER BY `name` ASC",
+ intval(local_user())
+ );
- $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `blocked` = 0 and `pending` = 0 and `self` = 0 ORDER BY `name` ASC",
- intval(local_user())
- );
-
- if(count($r)) {
- $textmode = (($switchtotext && (count($r) > $switchtotext)) ? true : false);
- foreach($r as $member) {
- if(! in_array($member['id'],$preselected)) {
- $member['click'] = 'groupChangeMember(' . $group['id'] . ',' . $member['id'] . '); return true;';
- $o .= micropro($member,true,'mpall', $textmode);
- }
+ if(count($r)) {
+ $textmode = (($switchtotext && (count($r) > $switchtotext)) ? true : false);
+ foreach($r as $member) {
+ if(! in_array($member['id'],$preselected)) {
+ $member['click'] = 'groupChangeMember(' . $group['id'] . ',' . $member['id'] . '); return true;';
+ $groupeditor['contacts'][] = micropro($member,true,'mpall', $textmode);
}
}
+ }
- $o .= '</div><div id="group-all-contacts-end"></div>';
+ $context['$groupeditor'] = $groupeditor;
+ $context['$desc'] = t('Click on a contact to add or remove.');
if($change) {
- echo $o;
+ $tpl = get_markup_template('groupeditor.tpl');
+ echo replace_macros($tpl, $context);
killme();
}
- $o .= '</div>';
- return $o;
+
+ return replace_macros($tpl, $context);
}
diff --git a/mod/message.php b/mod/message.php
index e293d62d9..9226a68fb 100755
--- a/mod/message.php
+++ b/mod/message.php
@@ -129,10 +129,16 @@ function message_content(&$a) {
$o .= $header;
+ $plaintext = false;
+ if(intval(get_pconfig(local_user(),'system','plaintext')))
+ $plaintext = true;
+
+
$tpl = get_markup_template('msg-header.tpl');
$a->page['htmlhead'] .= replace_macros($tpl, array(
'$baseurl' => $a->get_baseurl(),
+ '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'),
'$nickname' => $a->user['nickname'],
'$linkurl' => t('Please enter a link URL:')
));
diff --git a/mod/network.php b/mod/network.php
index 26265f5a0..e65180222 100755
--- a/mod/network.php
+++ b/mod/network.php
@@ -51,14 +51,14 @@ function network_init(&$a) {
function saved_searches($search) {
- $srchurl = '/network'
- . ((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'] : '');
+ $srchurl = '/network?f='
+ . ((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'] : '');
$o = '';
@@ -164,33 +164,33 @@ function network_content(&$a, $update = 0) {
$tabs = array(
array(
'label' => t('Commented Order'),
- 'url'=>$a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '?cid=' . $_GET['cid'] : ''),
+ 'url'=>$a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '?f=&cid=' . $_GET['cid'] : ''),
'sel'=>$all_active,
),
array(
'label' => t('Posted Order'),
- 'url'=>$a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . '?order=post' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : ''),
+ 'url'=>$a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . '?f=&order=post' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : ''),
'sel'=>$postord_active,
),
array(
'label' => t('Personal'),
- 'url' => $a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '/?cid=' . $_GET['cid'] : '') . '&conv=1',
+ 'url' => $a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '') . '&conv=1',
'sel' => $conv_active,
),
array(
'label' => t('New'),
- 'url' => $a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . '/new' . ((x($_GET,'cid')) ? '/?cid=' . $_GET['cid'] : ''),
+ 'url' => $a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . '/new' . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : ''),
'sel' => $new_active,
),
array(
'label' => t('Starred'),
- 'url'=>$a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '/?cid=' . $_GET['cid'] : '') . '&star=1',
+ 'url'=>$a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '') . '&star=1',
'sel'=>$starred_active,
),
array(
'label' => t('Bookmarks'),
- 'url'=>$a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '/?cid=' . $_GET['cid'] : '') . '&bmark=1',
+ 'url'=>$a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '') . '&bmark=1',
'sel'=>$bookmarked_active,
),
// array(
@@ -256,14 +256,12 @@ function network_content(&$a, $update = 0) {
nav_set_selected('network');
- $_SESSION['return_url'] = $a->query_string;
-
$celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false);
$x = array(
'is_owner' => true,
'allow_location' => $a->user['allow_location'],
- 'default_location' => $a->user['default_location'],
+ 'default_location' => $a->user['default-location'],
'nickname' => $a->user['nickname'],
'lockstate' => ((($group) || (is_array($a->user) && ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid']))))) ? 'lock' : 'unlock'),
'acl' => populate_acl((($group || $cid) ? $def_acl : $a->user), $celeb),
@@ -472,7 +470,7 @@ function network_content(&$a, $update = 0) {
if(count($r)) {
foreach($r as $rr)
- if(! array_key_exists($rr['item_id'],$parents_arr))
+ if(! in_array($rr['item_id'],$parents_arr))
$parents_arr[] = $rr['item_id'];
$parents_str = implode(', ', $parents_arr);
diff --git a/mod/notify.php b/mod/notify.php
index e6a7a8859..a572b1534 100644
--- a/mod/notify.php
+++ b/mod/notify.php
@@ -11,8 +11,10 @@ function notify_init(&$a) {
intval(local_user())
);
if(count($r)) {
- q("update notify set seen = 1 where id = %d and uid = %d limit 1",
- intval($a->argv[2]),
+ q("update notify set seen = 1 where ( link = '%s' or ( parent != 0 and parent = %d and otype = '%s' )) and uid = %d",
+ dbesc($r[0]['link']),
+ intval($r[0]['parent']),
+ dbesc($r[0]['otype']),
intval(local_user())
);
goaway($r[0]['link']);
diff --git a/mod/ping.php b/mod/ping.php
index 7380ff7d0..1562254b1 100644
--- a/mod/ping.php
+++ b/mod/ping.php
@@ -14,10 +14,29 @@ function ping_init(&$a) {
$firehose = intval(get_pconfig(local_user(),'system','notify_full'));
- $z = q("select * from notify where uid = %d
- order by seen asc, date desc limit 0, 50",
+ $t = q("select count(*) as total from notify where uid = %d and seen = 0",
intval(local_user())
);
+ if($t && intval($t[0]['total']) > 49) {
+ $z = q("select * from notify where uid = %d
+ and seen = 0 order by date desc limit 0, 50",
+ intval(local_user())
+ );
+ }
+ else {
+ $z1 = q("select * from notify where uid = %d
+ and seen = 0 order by date desc limit 0, 50",
+ intval(local_user())
+ );
+
+ $z2 = q("select * from notify where uid = %d
+ and seen = 1 order by date desc limit 0, %d",
+ intval(local_user()),
+ intval(50 - intval($t[0]['total']))
+ );
+ $z = array_merge($z1,$z2);
+ }
+
$tags = array();
diff --git a/mod/profile.php b/mod/profile.php
index 74e1a2302..1a701f407 100755
--- a/mod/profile.php
+++ b/mod/profile.php
@@ -159,7 +159,7 @@ function profile_content(&$a, $update = 0) {
* Get permissions SQL - if $remote_contact is true, our remote user has been pre-verified and we already have fetched his/her groups
*/
- $sql_extra = permissions_sql($a->profile['profile_uid'],$remote_contact,$groups);
+ $sql_extra = item_permissions_sql($a->profile['profile_uid'],$remote_contact,$groups);
if($update) {
diff --git a/mod/search.php b/mod/search.php
index fe09b671f..386592ea1 100755
--- a/mod/search.php
+++ b/mod/search.php
@@ -127,7 +127,7 @@ function search_content(&$a) {
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
LEFT JOIN `user` ON `user`.`uid` = `item`.`uid`
WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0
- AND (( `wall` = 1 AND `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' AND `user`.`hidewall` = 0 )
+ AND (( `wall` = 1 AND `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' AND `item`.`private` = 0 AND `user`.`hidewall` = 0 )
OR `item`.`uid` = %d )
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
$search_alg
diff --git a/mod/share.php b/mod/share.php
index bba527342..f6c025e3c 100755
--- a/mod/share.php
+++ b/mod/share.php
@@ -16,10 +16,18 @@ function share_init(&$a) {
$o = '';
- $o .= '&#x2672; <a href="' . $r[0]['author-link'] . '">' . $r[0]['author-name'] . '</a><br />';
- if($r[0]['title'])
- $o .= '<strong>' . $r[0]['title'] . '</strong><br />';
- $o .= bbcode($r[0]['body'], true);
- echo $o . '<br />';
+ if(local_user() && intval(get_pconfig(local_user(),'system','plaintext'))) {
+ $o .= '&#x2672; [url=' . $r[0]['author-link'] . ']' . $r[0]['author-name'] . '[/url]';
+ if($r[0]['title'])
+ $o .= '[b]' . $r[0]['title'] . '[/b]' . "\n";
+ $o .= $r[0]['body'] . "\n";
+ }
+ else {
+ $o .= '&#x2672; <a href="' . $r[0]['author-link'] . '">' . $r[0]['author-name'] . '</a><br />';
+ if($r[0]['title'])
+ $o .= '<strong>' . $r[0]['title'] . '</strong><br />';
+ $o .= bbcode($r[0]['body'], true) . '<br />';
+ }
+ echo $o;
killme();
}