diff options
author | Haakon Meland Eriksen <haakon.eriksen@far.no> | 2015-11-20 06:27:46 +0100 |
---|---|---|
committer | Haakon Meland Eriksen <haakon.eriksen@far.no> | 2015-11-20 06:27:46 +0100 |
commit | 22f6687f44c4fc6bc1938ea434a5c7a665a53127 (patch) | |
tree | ff02d6830e37c1082afc8b957e0099dc56da9f19 | |
parent | 059886a1e493451dffddb0fd863cb002930eae9b (diff) | |
parent | e56633d5b0009fd5430a15fd09633e8f43bdb7dd (diff) | |
download | volse-hubzilla-22f6687f44c4fc6bc1938ea434a5c7a665a53127.tar.gz volse-hubzilla-22f6687f44c4fc6bc1938ea434a5c7a665a53127.tar.bz2 volse-hubzilla-22f6687f44c4fc6bc1938ea434a5c7a665a53127.zip |
Merge remote-tracking branch 'upstream/master'
-rwxr-xr-x | boot.php | 1 | ||||
-rw-r--r-- | doc/nl/TermsOfService.md | 5 | ||||
-rw-r--r-- | include/conversation.php | 2 | ||||
-rw-r--r-- | include/features.php | 1 | ||||
-rwxr-xr-x | index.php | 6 | ||||
-rw-r--r-- | mod/admin.php | 5 | ||||
-rw-r--r-- | mod/dirsearch.php | 12 | ||||
-rw-r--r-- | mod/invite.php | 2 | ||||
-rw-r--r-- | mod/item.php | 20 | ||||
-rwxr-xr-x | mod/subthread.php | 12 | ||||
-rw-r--r-- | version.inc | 2 | ||||
-rw-r--r-- | view/theme/redbasic/schema/bluegrid.css | 8 | ||||
-rwxr-xr-x | view/tpl/invite.tpl | 2 |
13 files changed, 65 insertions, 13 deletions
@@ -83,6 +83,7 @@ $DIRECTORY_FALLBACK_SERVERS = array( 'https://hubzilla.site', 'https://red.zottel.red', 'https://gravizot.de', + 'https://blablanet.com', 'https://my.federated.social' ); diff --git a/doc/nl/TermsOfService.md b/doc/nl/TermsOfService.md new file mode 100644 index 000000000..c4cc4648c --- /dev/null +++ b/doc/nl/TermsOfService.md @@ -0,0 +1,5 @@ +Gebruikersvoorwaarden +================ + +#include doc/SiteTOS.md; + diff --git a/include/conversation.php b/include/conversation.php index 57dc9d2a2..6cdbb878f 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -944,7 +944,7 @@ function item_photo_menu($item){ $menu = Array( t("View Source") => $vsrc_link, t("Follow Thread") => $sub_link, - t("Stop Following") => $unsub_link, + t("Unfollow Thread") => $unsub_link, t("View Status") => $status_link, t("View Profile") => $profile_link, t("View Photos") => $photos_link, diff --git a/include/features.php b/include/features.php index 74ae7b3d7..4e962b00e 100644 --- a/include/features.php +++ b/include/features.php @@ -60,6 +60,7 @@ function get_features() { array('content_encrypt', t('Even More Encryption'), t('Allow optional encryption of content end-to-end with a shared secret key'),false), array('consensus_tools', t('Enable Voting Tools'), t('Provide a class of post which others can vote on'),false), array('delayed_posting', t('Delayed Posting'), t('Allow posts to be published at a later date'),false), + array('suppress_duplicates', t('Suppress Duplicate Posts/Comments'), t('Prevent posts with identical content to be published with less than two minutes in between submissions.'),true), ), @@ -36,6 +36,12 @@ require_once('include/dba/dba_driver.php'); if(! $a->install) { $db = dba_factory($db_host, $db_port, $db_user, $db_pass, $db_data, $db_type, $a->install); + if(! $db->connected){ + header('HTTP/1.0 520 Unknown Error'); + // TODO: much friendlier error message + die("Database error, contact admin."); + } + unset($db_host, $db_port, $db_user, $db_pass, $db_data, $db_type); /** 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; diff --git a/version.inc b/version.inc index 369ed3cb7..d6100d73a 100644 --- a/version.inc +++ b/version.inc @@ -1 +1 @@ -2015-11-18.1221 +2015-11-19.1221 diff --git a/view/theme/redbasic/schema/bluegrid.css b/view/theme/redbasic/schema/bluegrid.css index d9dbc9f15..8545f3f74 100644 --- a/view/theme/redbasic/schema/bluegrid.css +++ b/view/theme/redbasic/schema/bluegrid.css @@ -188,6 +188,10 @@ nav .badge:hover, nav .badge:focus { box-shadow: 0px 6px 12px rgba(45,48,92,.176); } +.tags a { + color: inherit; +} + #profile-photo-wrapper { border: none; } @@ -337,7 +341,7 @@ input { background-color: #FFF; } -.btn-primary, input#event-submit, input#rmagic-submit-button, input#lostpass-submit-button, input#side-follow-submit, .profile-edit-submit-wrapper > input.profile-edit-submit-button, input#profile-photo-submit, form#chat-form > input, div#adminpage > form > div.submit > input, input.sources-submit, input.contact-edit-submit, input#dbtn-submit, input#newchannel-submit-button { +.btn-primary, input#event-submit, input#rmagic-submit-button, input#lostpass-submit-button, input#side-follow-submit, .profile-edit-submit-wrapper > input.profile-edit-submit-button, input#profile-photo-submit, form#chat-form > input, div#adminpage > form > div.submit > input, input.sources-submit, input.contact-edit-submit, input#dbtn-submit, input#newchannel-submit-button, input#contacts-search-submit { background-color: #FFF; color: #43488A; border-radius: 0px; @@ -346,7 +350,7 @@ input { transition: all .3s ease-in-out; } -.btn-primary:hover, .btn-primary:focus, input#event-submit:hover, input#event-submit:focus, input#rmagic-submit-button:hover, input#rmagic-submit-button:focus, input#lostpass-submit-button:hover, input#lostpass-submit-button:focus, input#side-follow-submit:hover, input#side-follow-submit:focus, .profile-edit-submit-wrapper > input.profile-edit-submit-button:hover, .profile-edit-submit-wrapper > input.profile-edit-submit-button:focus, input#profile-photo-submit:hover, input#profile-photo-submit:focus, form#chat-form > input:hover, form#chat-form > input:focus, div#adminpage > form > div.submit > input:hover, div#adminpage > form > div.submit > input:focus, input.sources-submit:hover, input.sources-submit:focus, input.contact-edit-submit:focus, input.contact-edit-submit:hover, input#dbtn-submit:hover, input#dbtn-submit:focus, input#newchannel-submit-button:hover, input#newchannel-submit-button:focus { +.btn-primary:hover, .btn-primary:focus, input#event-submit:hover, input#event-submit:focus, input#rmagic-submit-button:hover, input#rmagic-submit-button:focus, input#lostpass-submit-button:hover, input#lostpass-submit-button:focus, input#side-follow-submit:hover, input#side-follow-submit:focus, .profile-edit-submit-wrapper > input.profile-edit-submit-button:hover, .profile-edit-submit-wrapper > input.profile-edit-submit-button:focus, input#profile-photo-submit:hover, input#profile-photo-submit:focus, form#chat-form > input:hover, form#chat-form > input:focus, div#adminpage > form > div.submit > input:hover, div#adminpage > form > div.submit > input:focus, input.sources-submit:hover, input.sources-submit:focus, input.contact-edit-submit:focus, input.contact-edit-submit:hover, input#dbtn-submit:hover, input#dbtn-submit:focus, input#newchannel-submit-button:hover, input#newchannel-submit-button:focus, input#contacts-search-submit:hover, input#contacts-search-submit:focus { border-color: #FFF; background-color: #43488A; color: #FFF; diff --git a/view/tpl/invite.tpl b/view/tpl/invite.tpl index 2b7ab9cfb..c39e044bc 100755 --- a/view/tpl/invite.tpl +++ b/view/tpl/invite.tpl @@ -1,3 +1,4 @@ +<div class="generic-content-wrapper-styled"> <form action="invite" method="post" id="invite-form" > <input type='hidden' name='form_security_token' value='{{$form_security_token}}'> @@ -28,3 +29,4 @@ </div> </form> +</div> |