aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorHaakon Meland Eriksen <haakon.eriksen@far.no>2015-11-20 06:27:46 +0100
committerHaakon Meland Eriksen <haakon.eriksen@far.no>2015-11-20 06:27:46 +0100
commit22f6687f44c4fc6bc1938ea434a5c7a665a53127 (patch)
treeff02d6830e37c1082afc8b957e0099dc56da9f19 /mod
parent059886a1e493451dffddb0fd863cb002930eae9b (diff)
parente56633d5b0009fd5430a15fd09633e8f43bdb7dd (diff)
downloadvolse-hubzilla-22f6687f44c4fc6bc1938ea434a5c7a665a53127.tar.gz
volse-hubzilla-22f6687f44c4fc6bc1938ea434a5c7a665a53127.tar.bz2
volse-hubzilla-22f6687f44c4fc6bc1938ea434a5c7a665a53127.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'mod')
-rw-r--r--mod/admin.php5
-rw-r--r--mod/dirsearch.php12
-rw-r--r--mod/invite.php2
-rw-r--r--mod/item.php20
-rwxr-xr-xmod/subthread.php12
5 files changed, 42 insertions, 9 deletions
diff --git a/mod/admin.php b/mod/admin.php
index 3f1a69ca6..4b7cb3cd9 100644
--- a/mod/admin.php
+++ b/mod/admin.php
@@ -395,9 +395,10 @@ function admin_page_site(&$a) {
}
/* Banner */
+
$banner = get_config('system', 'banner');
- if($banner == false)
- $banner = 'red';
+ if($banner === false)
+ $banner = get_config('system','sitename');
$banner = htmlspecialchars($banner);
diff --git a/mod/dirsearch.php b/mod/dirsearch.php
index 937564a79..548acbd08 100644
--- a/mod/dirsearch.php
+++ b/mod/dirsearch.php
@@ -124,8 +124,6 @@ function dirsearch_content(&$a) {
if($keywords)
$sql_extra .= dir_query_build($joiner,'xprof_keywords',$keywords);
- if($forums)
- $safesql .= dir_flag_build(' AND ','xchan_flags',XCHAN_FLAGS_PUBFORUM, $forums);
// we only support an age range currently. You must set both agege
// (greater than or equal) and agele (less than or equal)
@@ -173,6 +171,9 @@ function dirsearch_content(&$a) {
if($safe < 0)
$safesql = " and ( xchan_censored = 1 OR xchan_selfcensored = 1 ) ";
+ if($forums)
+ $safesql .= " and xchan_pubforum = " . ((intval($forums)) ? '1 ' : '0 ');
+
if($limit)
$qlimit = " LIMIT $limit ";
else {
@@ -185,7 +186,6 @@ function dirsearch_content(&$a) {
}
}
-
if($sort_order == 'normal') {
$order = " order by xchan_name asc ";
@@ -202,6 +202,7 @@ function dirsearch_content(&$a) {
else
$order = " order by xchan_name_date desc ";
+
if($sync) {
$spkt = array('transactions' => array());
$r = q("select * from updates where ud_date >= '%s' and ud_guid != '' order by ud_date desc",
@@ -245,15 +246,20 @@ function dirsearch_content(&$a) {
json_return_and_die($spkt);
}
else {
+
$r = q("SELECT xchan.*, xprof.* from xchan left join xprof on xchan_hash = xprof_hash
where ( $logic $sql_extra ) $hub_query and xchan_network = 'zot' and xchan_hidden = 0 and xchan_orphan = 0 and xchan_deleted = 0
$safesql $order $qlimit "
);
+
+
+
$ret['page'] = $page + 1;
$ret['records'] = count($r);
}
+
if($r) {
$entries = array();
diff --git a/mod/invite.php b/mod/invite.php
index 46fa7b413..bda808142 100644
--- a/mod/invite.php
+++ b/mod/invite.php
@@ -143,4 +143,4 @@ function invite_content(&$a) {
));
return $o;
-} \ No newline at end of file
+}
diff --git a/mod/item.php b/mod/item.php
index b66d71797..1e39ca9c9 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -703,6 +703,10 @@ function item_post(&$a) {
$plink = z_root() . '/channel/' . $channel['channel_address'] . '/?f=&mid=' . $mid;
}
+
+
+
+
$datarray['aid'] = $channel['channel_account_id'];
$datarray['uid'] = $profile_uid;
@@ -781,6 +785,22 @@ function item_post(&$a) {
if($orig_post)
$datarray['edit'] = true;
+
+
+ if(feature_enabled($profile_uid,'suppress_duplicates')) {
+
+ $z = q("select created from item where uid = %d and body = '%s'",
+ intval($profile_uid),
+ dbesc($body)
+ );
+
+ if($z && $z[0]['created'] > datetime_convert('UTC','UTC', 'now - 2 minutes')) {
+ $datarray['cancel'] = 1;
+ notice( t('Duplicate post suppressed.') . EOL);
+ logger('Duplicate post. Faking plugin cancel.');
+ }
+ }
+
call_hooks('post_local',$datarray);
if(x($datarray,'cancel')) {
diff --git a/mod/subthread.php b/mod/subthread.php
index 162545a2f..74d742b6a 100755
--- a/mod/subthread.php
+++ b/mod/subthread.php
@@ -11,18 +11,24 @@ function subthread_content(&$a) {
return;
}
+ $item_id = ((argc() > 2) ? notags(trim(argv(2))) : 0);
+
if(argv(1) === 'sub')
$activity = ACTIVITY_FOLLOW;
elseif(argv(1) === 'unsub')
$activity = ACTIVITY_UNFOLLOW;
- $item_id = ((argc() > 2) ? notags(trim(argv(2))) : 0);
- $r = q("SELECT * FROM `item` WHERE `parent` = '%s' OR `parent_mid` = '%s' and parent = id LIMIT 1",
- dbesc($item_id),
+ $r = q("SELECT parent FROM item WHERE id = '%s'",
dbesc($item_id)
);
+ if($r) {
+ $r = q("select * from item where id = parent and id = %d limit 1",
+ dbesc($r[0]['parent'])
+ );
+ }
+
if((! $item_id) || (! $r)) {
logger('subthread: no item ' . $item_id);
return;