aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/datetime.php48
-rw-r--r--include/event.php23
-rw-r--r--include/main.js24
-rw-r--r--include/notifier.php10
-rw-r--r--include/queue.php8
5 files changed, 84 insertions, 29 deletions
diff --git a/include/datetime.php b/include/datetime.php
index f7be5bdb1..a5b388e76 100644
--- a/include/datetime.php
+++ b/include/datetime.php
@@ -108,20 +108,28 @@ function datesel($pre,$ymin,$ymax,$allow_blank,$y,$m,$d) {
$o .= "<option value=\"0000\" $sel ></option>";
}
- for($x = $ymax; $x >= $ymin; $x --) {
- $sel = (($x == $y) ? " selected=\"selected\" " : "");
- $o .= "<option value=\"$x\" $sel>$x</option>";
+ if($ymax > $ymin) {
+ for($x = $ymax; $x >= $ymin; $x --) {
+ $sel = (($x == $y) ? " selected=\"selected\" " : "");
+ $o .= "<option value=\"$x\" $sel>$x</option>";
+ }
+ }
+ else {
+ for($x = $ymax; $x <= $ymin; $x ++) {
+ $sel = (($x == $y) ? " selected=\"selected\" " : "");
+ $o .= "<option value=\"$x\" $sel>$x</option>";
+ }
}
$o .= "</select> <select name=\"{$pre}month\" class=\"{$pre}month\" size=\"1\">";
- for($x = 0; $x <= 12; $x ++) {
+ for($x = (($allow_blank) ? 0 : 1); $x <= 12; $x ++) {
$sel = (($x == $m) ? " selected=\"selected\" " : "");
$y = (($x) ? $x : '');
$o .= "<option value=\"$x\" $sel>$y</option>";
}
$o .= "</select> <select name=\"{$pre}day\" class=\"{$pre}day\" size=\"1\">";
- for($x = 0; $x <= 31; $x ++) {
+ for($x = (($allow_blank) ? 0 : 1); $x <= 31; $x ++) {
$sel = (($x == $d) ? " selected=\"selected\" " : "");
$y = (($x) ? $x : '');
$o .= "<option value=\"$x\" $sel>$y</option>";
@@ -131,6 +139,32 @@ function datesel($pre,$ymin,$ymax,$allow_blank,$y,$m,$d) {
return $o;
}}
+if(! function_exists('timesel')) {
+function timesel($pre,$h,$m) {
+
+ $o = '';
+ $o .= "<select name=\"{$pre}hour\" class=\"{$pre}hour\" size=\"1\">";
+ for($x = 0; $x < 24; $x ++) {
+ $sel = (($x == $h) ? " selected=\"selected\" " : "");
+ $o .= "<option value=\"$x\" $sel>$x</option>";
+ }
+ $o .= "</select> : <select name=\"{$pre}minute\" class=\"{$pre}minute\" size=\"1\">";
+ for($x = 0; $x < 60; $x ++) {
+ $sel = (($x == $m) ? " selected=\"selected\" " : "");
+ $o .= "<option value=\"$x\" $sel>$x</option>";
+ }
+
+ $o .= "</select>";
+ return $o;
+}}
+
+
+
+
+
+
+
+
// implements "3 seconds ago" etc.
// based on $posted_date, (UTC).
// Results relative to current timezone
@@ -242,7 +276,7 @@ function get_first_dim($y,$m) {
if(! function_exists('cal')) {
-function cal($y = 0,$m = 0, $links = false) {
+function cal($y = 0,$m = 0, $links = false, $class='') {
// month table - start at 1 to match human usage.
@@ -272,7 +306,7 @@ function cal($y = 0,$m = 0, $links = false) {
$tddate = intval(datetime_convert('UTC',date_default_timezone_get(),'now','j'));
$str_month = day_translate($mtab[$m]);
- $o = '<table class="calendar">';
+ $o = '<table class="calendar' . $class . '">';
$o .= "<caption>$str_month $y</caption><tr>";
for($a = 0; $a < 7; $a ++)
$o .= '<th>' . mb_substr(day_translate($dn[$a]),0,3,'UTF-8') . '</th>';
diff --git a/include/event.php b/include/event.php
index 06239b2ab..38ab83316 100644
--- a/include/event.php
+++ b/include/event.php
@@ -3,32 +3,41 @@
function format_event_html($ev) {
+ require_once('include/bbcode.php');
+
if(! ((is_array($ev)) && count($ev)))
return '';
$o = '<div class="vevent">';
- $o .= '<p class="description">' . $ev['desc'] . '</p>';
+ $o .= '<p class="description">' . bbcode($ev['desc']) . '</p>';
$o .= '<p>' . t('Starts: ') . '<abbr class="dtstart" title="'
. datetime_convert('UTC','UTC',$ev['start'], ATOM_TIME)
. '" >'
- . datetime_convert('UTC', date_default_timezone_get(),
- $ev['start'] /*, format */ )
+ . (($ev['adjust']) ? datetime_convert('UTC', date_default_timezone_get(),
+ $ev['start'] /*, format */ )
+ : datetime_convert('UTC', 'UTC',
+ $ev['start'] /*, format */ ))
. '</abbr></p>';
$o .= '<p>' . t('Ends: ') . '<abbr class="dtend" title="'
. datetime_convert('UTC','UTC',$ev['finish'], ATOM_TIME)
. '" >'
- . datetime_convert('UTC', date_default_timezone_get(),
- $ev['finish'] /*, format */ )
+ . (($ev['adjust']) ? datetime_convert('UTC', date_default_timezone_get(),
+ $ev['finish'] /*, format */ )
+ : datetime_convert('UTC', 'UTC',
+ $ev['finish'] /*, format */ ))
. '</abbr></p>';
$o .= '<p> ' . t('Location:') . '<span class="location">'
- . $ev['location']
+ . bbcode($ev['location'])
. '</span></p>';
$o .= '</div>';
return $o;
-} \ No newline at end of file
+}
+
+
+
diff --git a/include/main.js b/include/main.js
index 0d68c2b2b..34045f57f 100644
--- a/include/main.js
+++ b/include/main.js
@@ -47,18 +47,18 @@
$('#pause').html('');
}
}
- // F8 - show/hide language selector
- if(event.keyCode == '119') {
- if(langSelect) {
- langSelect = false;
- $('#language-selector').hide();
- }
- else {
- langSelect = true;
- $('#language-selector').show();
- }
- }
-
+// // F8 - show/hide language selector
+// if(event.keyCode == '119') {
+// if(langSelect) {
+// langSelect = false;
+// $('#language-selector').hide();
+// }
+// else {
+// langSelect = true;
+// $('#language-selector').show();
+// }
+// }
+//
// this is shift-home on FF, but $ on IE, disabling until I figure out why the diff.
// update: incompatible usage of onKeyDown vs onKeyPress
// if(event.keyCode == '36' && event.shiftKey == true) {
diff --git a/include/notifier.php b/include/notifier.php
index db2542849..98e38fb11 100644
--- a/include/notifier.php
+++ b/include/notifier.php
@@ -27,6 +27,8 @@ function notifier_run($argv, $argc){
$a->set_baseurl(get_config('system','url'));
+ $prv = get_config('system','strict_privacy');
+
logger('notifier: invoked: ' . print_r($argv,true));
$cmd = $argv[1];
@@ -329,6 +331,10 @@ function notifier_run($argv, $argc){
}
break;
case 'stat':
+
+ if($prv)
+ break;
+
if($followup && $contact['notify']) {
logger('notifier: slapdelivery: ' . $contact['name']);
$deliver_status = slapper($owner,$contact['notify'],$slap);
@@ -373,7 +379,7 @@ function notifier_run($argv, $argc){
}
break;
case 'mail':
-
+
// WARNING: does not currently convert to RFC2047 header encodings, etc.
$addr = $contact['addr'];
@@ -459,7 +465,7 @@ function notifier_run($argv, $argc){
if($slap && count($url_recipients) && $followup && $notify_hub && (! $expire)) {
foreach($url_recipients as $url) {
- if($url) {
+ if($url && (! $prv)) {
logger('notifier: urldelivery: ' . $url);
$deliver_status = slapper($owner,$url,$slap);
// TODO: redeliver/queue these items on failure, though there is no contact record
diff --git a/include/queue.php b/include/queue.php
index cc36b2f62..cbda196da 100644
--- a/include/queue.php
+++ b/include/queue.php
@@ -24,6 +24,8 @@ function queue_run($argv, $argc){
$a->set_baseurl(get_config('system','url'));
+ load_hooks();
+
$deadguys = array();
logger('queue: start');
@@ -53,7 +55,11 @@ function queue_run($argv, $argc){
require_once('include/salmon.php');
foreach($r as $q_item) {
- $qi = q("SELECT * FROM `queue` WHERE `id` = %d LIMIT 1",
+
+ // queue_predeliver hooks may have changed the queue db details,
+ // so check again if this entry still needs processing
+
+ $qi = q("SELECT * FROM `queue` WHERE `id` = %d AND `last` < UTC_TIMESTAMP() - INTERVAL 15 MINUTE ",
intval($q_item['id'])
);
if(! count($qi))