Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Haakon Meland Eriksen 2015-11-20 06:27:46 +01:00
commit 22f6687f44
13 changed files with 65 additions and 13 deletions

View file

@ -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'
);

5
doc/nl/TermsOfService.md Normal file
View file

@ -0,0 +1,5 @@
Gebruikersvoorwaarden
================
#include doc/SiteTOS.md;

View file

@ -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,

View file

@ -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),
),

View file

@ -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);
/**

View file

@ -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);

View file

@ -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();

View file

@ -143,4 +143,4 @@ function invite_content(&$a) {
));
return $o;
}
}

View file

@ -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')) {

View file

@ -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;

View file

@ -1 +1 @@
2015-11-18.1221
2015-11-19.1221

View file

@ -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;

View file

@ -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>