Skip to content

Commit

Permalink
v1.4.0-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
3D-I committed May 28, 2018
1 parent 21f894d commit 048d444
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 38 deletions.
4 changes: 2 additions & 2 deletions controller/controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public function handle($topic_id)
case 'withdrawing':
$opt_sql = 'UPDATE ' . $this->dtst_slots . ' SET active = 0, inactive = 1, post_time = ' . time() . '
WHERE user_id = ' . (int) $this->user->data['user_id'] . '
AND topic_id = ' . $topic_id;
AND topic_id = ' . (int) $topic_id;

$message = $this->lang->lang('DTST_OPTED_OUT');
$button_text = $this->lang->lang('DTST_OPT_REATTEND');
Expand All @@ -133,7 +133,7 @@ public function handle($topic_id)
case 'reattending':
$opt_sql = 'UPDATE ' . $this->dtst_slots . ' SET active = 1, inactive = 0, post_time = ' . time() . '
WHERE user_id = ' . (int) $this->user->data['user_id'] . '
AND topic_id = ' . $topic_id;
AND topic_id = ' . (int) $topic_id;

$message = $this->lang->lang('DTST_OPTED_IN');
$button_text = $this->lang->lang('DTST_OPT_WITHDRAW');
Expand Down
8 changes: 4 additions & 4 deletions event/main_listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -766,11 +766,11 @@ public function dtst_viewforum_apply_filters($event)

$sql_ary = $event['sql_ary'];

$sql_ary['WHERE'] .= !empty($age_min) ? ' AND t.dtst_age_min >= ' . $age_min . ' AND t.dtst_age_max <= ' . $age_max : '';
$sql_ary['WHERE'] .= !empty($age_max) && empty($age_min) && $age_max !== 99 ? ' AND t.dtst_age_max <= ' . $age_max : '';
$sql_ary['WHERE'] .= !empty($age_min) ? ' AND t.dtst_age_min >= ' . (int) $age_min . ' AND t.dtst_age_max <= ' . (int) $age_max : '';
$sql_ary['WHERE'] .= !empty($age_max) && empty($age_min) && (int) $age_max !== 99 ? ' AND t.dtst_age_max <= ' . (int) $age_max : '';

$sql_ary['WHERE'] .= !empty($participants_min) ? ' AND t.dtst_participants >= ' . $participants_min . ' AND t.dtst_participants <= ' . $participants_max: '';
$sql_ary['WHERE'] .= !empty($participants_max) && empty($participants_min) && $participants_max !== 999 ? ' AND t.dtst_participants <= ' . $participants_max : '';
$sql_ary['WHERE'] .= !empty($participants_min) ? ' AND t.dtst_participants >= ' . (int) $participants_min . ' AND t.dtst_participants <= ' . (int) $participants_max: '';
$sql_ary['WHERE'] .= !empty($participants_max) && empty($participants_min) && (int) $participants_max !== 999 ? ' AND t.dtst_participants <= ' . (int) $participants_max : '';
$sql_ary['WHERE'] .= $participants_unl ? ' AND t.dtst_participants = 0' : '';

$sql_ary['WHERE'] .= !empty($date_after) ? ' AND str_to_date(t.dtst_date, "%d-%m-%Y") > "' . $this->db->sql_escape($date_after) . '"' : '';
Expand Down
64 changes: 32 additions & 32 deletions migrations/install_configs.php
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
<?php
/**
*
* Date Topic Event Calendar. An extension for the phpBB Forum Software package.
*
* @copyright (c) 2018, phpBB Studio, https://www.phpbbstudio.com
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/

namespace phpbbstudio\dtst\migrations;

class install_configs extends \phpbb\db\migration\migration
{
static public function depends_on()
{
return array('\phpbb\db\migration\data\v32x\v322');
}

public function update_data()
{
return array(
array('config.add', array('dtst_locked_withdrawal', 1)),
array('config.add', array('dtst_utc', 'd m Y - H:i')),

array('config.add', array('dtst_string_1', '')), // string_1
array('config.add', array('dtst_bool_1', 0)), // bool_1
array('config.add', array('dtst_string_2', '')), // string_2
array('config.add', array('dtst_bool_2', 0)), // bool_2
);
}
}
<?php
/**
*
* Date Topic Event Calendar. An extension for the phpBB Forum Software package.
*
* @copyright (c) 2018, phpBB Studio, https://www.phpbbstudio.com
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/

namespace phpbbstudio\dtst\migrations;

class install_configs extends \phpbb\db\migration\migration
{
static public function depends_on()
{
return array('\phpbb\db\migration\data\v32x\v322');
}

public function update_data()
{
return array(
array('config.add', array('dtst_locked_withdrawal', 1)),
array('config.add', array('dtst_utc', 'd m Y - H:i')),

array('config.add', array('dtst_string_1', '')), // string_1
array('config.add', array('dtst_bool_1', 0)), // bool_1
array('config.add', array('dtst_string_2', '')), // string_2
array('config.add', array('dtst_bool_2', 0)), // bool_2
);
}
}

0 comments on commit 048d444

Please sign in to comment.