aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-10-19 16:12:05 -0700
committerfriendica <info@friendica.com>2014-10-19 16:12:05 -0700
commitbae3029c639bf6f9469dd93bfedc3dce0d8510d7 (patch)
treef892b4bb5bc96c96ebd9df5d6b593b02def2c759 /mod
parent6d3619c8b15afdbf228cc0ca71de68efc0557fb1 (diff)
downloadvolse-hubzilla-bae3029c639bf6f9469dd93bfedc3dce0d8510d7.tar.gz
volse-hubzilla-bae3029c639bf6f9469dd93bfedc3dce0d8510d7.tar.bz2
volse-hubzilla-bae3029c639bf6f9469dd93bfedc3dce0d8510d7.zip
merge madness
Diffstat (limited to 'mod')
-rwxr-xr-xmod/events.php31
-rw-r--r--mod/photos.php4
-rw-r--r--mod/profiles.php32
3 files changed, 10 insertions, 57 deletions
diff --git a/mod/events.php b/mod/events.php
index d24f84d44..86a2286b2 100755
--- a/mod/events.php
+++ b/mod/events.php
@@ -18,18 +18,6 @@ function events_post(&$a) {
$start_text = escape_tags($_REQUEST['start_text']);
$finish_text = escape_tags($_REQUEST['finish_text']);
- $startyear = intval($_POST['startyear']);
- $startmonth = intval($_POST['startmonth']);
- $startday = intval($_POST['startday']);
- $starthour = intval($_POST['starthour']);
- $startminute = intval($_POST['startminute']);
-
- $finishyear = intval($_POST['finishyear']);
- $finishmonth = intval($_POST['finishmonth']);
- $finishday = intval($_POST['finishday']);
- $finishhour = intval($_POST['finishhour']);
- $finishminute = intval($_POST['finishminute']);
-
$adjust = intval($_POST['adjust']);
$nofinish = intval($_POST['nofinish']);
@@ -79,8 +67,10 @@ function events_post(&$a) {
// and we'll waste a bunch of time responding to it. Time that
// could've been spent doing something else.
- if(strcmp($finish,$start) < 0)
- $finish = $start;
+ if(strcmp($finish,$start) < 0) {
+ notice( t('Event can not end before it has started.') . EOL);
+ goaway($a->get_baseurl() . '/events/new');
+ }
$summary = escape_tags(trim($_POST['summary']));
$desc = escape_tags(trim($_POST['desc']));
@@ -530,11 +520,6 @@ function events_content(&$a) {
}
}
-
-
- $dateformat = datesel_format($f);
- $timeformat = t('hour:minute');
-
require_once('include/acl_selectors.php');
$perm_defaults = array(
@@ -554,24 +539,20 @@ function events_content(&$a) {
'$mid' => $mid,
'$title' => t('Event details'),
- '$format_desc' => sprintf( t('Format is %s %s.'),$dateformat,$timeformat),
'$desc' => t('Starting date and Title are required.'),
'$catsenabled' => $catsenabled,
'$placeholdercategory' => t('Categories (comma-separated list)'),
'$category' => $category,
'$s_text' => t('Event Starts:') . ' <span class="required" title="' . t('Required') . '">*</span>',
- '$bootstrap' => 1,
'$stext' => $stext,
'$ftext' => $ftext,
'$ModalCANCEL' => t('Cancel'),
'$ModalOK' => t('OK'),
- '$s_dsel' => datesel($f,'start',$syear+5,$syear,false,$syear,$smonth,$sday),
- '$s_tsel' => timesel('start',$shour,$sminute),
+ '$s_dsel' => datetimesel($f,mktime(),mktime(0,0,0,0,0,$syear+5),mktime(),'start_text'),
'$n_text' => t('Finish date/time is not known or not relevant'),
'$n_checked' => $n_checked,
'$f_text' => t('Event Finishes:'),
- '$f_dsel' => datesel($f,'finish',$fyear+5,$fyear,false,$fyear,$fmonth,$fday),
- '$f_tsel' => timesel('finish',$fhour,$fminute),
+ '$f_dsel' => datetimesel($f,mktime(),mktime(0,0,0,0,0,$fyear+5),mktime(),'finish_text',true,true,'start_text'),
'$a_text' => t('Adjust for viewer timezone'),
'$a_checked' => $a_checked,
'$d_text' => t('Description:'),
diff --git a/mod/photos.php b/mod/photos.php
index 2b859b7f1..4c52c7ef7 100644
--- a/mod/photos.php
+++ b/mod/photos.php
@@ -956,7 +956,7 @@ function photos_content(&$a) {
$edit = array(
'edit' => t('Edit photo'),
- 'id' => $ph[0]['id'],
+ 'id' => $link_item['id'], //$ph[0]['id'],
'rotatecw' => t('Rotate CW (right)'),
'rotateccw' => t('Rotate CCW (left)'),
'albums' => $albums['albums'],
@@ -1114,7 +1114,7 @@ function photos_content(&$a) {
$photo_tpl = get_markup_template('photo_view.tpl');
$o .= replace_macros($photo_tpl, array(
- '$id' => $ph[0]['id'],
+ '$id' => $link_item['id'], //$ph[0]['id'],
'$album' => $album_e,
'$tools' => $tools,
'$lock' => $lock,
diff --git a/mod/profiles.php b/mod/profiles.php
index 5d0416e9a..14f24c5cf 100644
--- a/mod/profiles.php
+++ b/mod/profiles.php
@@ -233,41 +233,13 @@ function profiles_post(&$a) {
return;
}
- if($_POST['dob']) {
- $year = substr($_POST['dob'],0,4);
- $month = substr($_POST['dob'],5,2);
- $day = substr($_POST['dob'],8,2);
- }
-
- $year = intval($_POST['year']);
- if($year < 1900 || $year > 2100 || $year < 0)
- $year = 0;
- $month = intval($_POST['month']);
- if(($month > 12) || ($month < 0))
- $month = 0;
- $mtab = array(0,31,29,31,30,31,30,31,31,30,31,30,31);
- $day = intval($_POST['day']);
- if(($day > $mtab[$month]) || ($day < 0))
- $day = 0;
-
-// if($year && (! ($month && $day))) {
-// $month = 1; $day = 1;
-// }
-
-
- $dob = '0000-00-00';
- $dob = sprintf('%04d-%02d-%02d',$year,$month,$day);
-
+ $dob = $_POST['dob'] ? escape_tags(trim($_POST['dob'])) : '0000-00-00'; // FIXME: Needs to be validated?
$name = escape_tags(trim($_POST['name']));
if($orig[0]['name'] != $name)
$namechanged = true;
-
-
-
-
$pdesc = escape_tags(trim($_POST['pdesc']));
$gender = escape_tags(trim($_POST['gender']));
$address = escape_tags(trim($_POST['address']));
@@ -654,7 +626,7 @@ logger('extra_fields: ' . print_r($extra_fields,true));
'$lbl_fullname' => t('Your Full Name:'),
'$lbl_title' => t('Title/Description:'),
'$lbl_gender' => t('Your Gender:'),
- '$lbl_bd' => sprintf( t("Birthday \x28%s\x29:"),datesel_format($f)),
+ '$lbl_bd' => t("Birthday :"),
'$lbl_address' => t('Street Address:'),
'$lbl_city' => t('Locality/City:'),
'$lbl_zip' => t('Postal/Zip Code:'),