Skip to content

Commit da988e0

Browse files
committed
We can remove mentions of UTC from language now
1 parent 4f3e81b commit da988e0

7 files changed

Lines changed: 13 additions & 12 deletions

File tree

adm/style/manage_ads.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,10 @@ <h1>{{ lang('ACP_MANAGE_ADS_TITLE') }}</h1>
203203
<tr{% if ad.S_EXPIRED %} title="{{ lang('AD_EXPIRED_EXPLAIN') }}"{% endif %}>
204204
<td><strong>{{ ad.NAME }}</strong></td>
205205
<td>{{ ad.PRIORITY }}</td>
206-
<td>{{ ad.START_DATE ? ad.START_DATE|date(constant('\\phpbb\\ads\\ext::DATE_FORMAT'), 'UTC') ~ ' (' ~ lang('UTC') ~ ')' }}</td>
206+
<td>{{ ad.START_DATE ? ad.START_DATE|date(constant('\\phpbb\\ads\\ext::DATE_FORMAT'), 'UTC') }}</td>
207207
<td>
208208
{% if ad.END_DATE < NOW %}<strong class="error">{% endif %}
209-
{{ ad.END_DATE ? ad.END_DATE|date(constant('\\phpbb\\ads\\ext::DATE_FORMAT'), 'UTC') ~ ' (' ~ lang('UTC') ~ ')' }}
209+
{{ ad.END_DATE ? ad.END_DATE|date(constant('\\phpbb\\ads\\ext::DATE_FORMAT'), 'UTC') }}
210210
{% if ad.END_DATE < NOW %}</strong>{% endif %}
211211
</td>
212212
{% if S_VIEWS_ENABLED %}

language/en/acp.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@
5757
'AD_CLICKS_LIMIT' => 'Clicks Limit',
5858
'AD_CLICKS_LIMIT_EXPLAIN' => 'Set the maximum number of times the advertisement will be clicked, after which the advertisement will no longer be displayed. Set 0 for unlimited clicks.',
5959
'AD_START_DATE' => 'Start Date',
60-
'AD_START_DATE_EXPLAIN' => 'Specify the date (UTC) when this advertisement will automatically be enabled. If no date is set, the advertisement will only become active when manually enabled.',
60+
'AD_START_DATE_EXPLAIN' => 'Specify the date when this advertisement will automatically be enabled. If no date is set, the advertisement will only become active when manually enabled.',
6161
'AD_END_DATE' => 'End Date',
62-
'AD_END_DATE_EXPLAIN' => 'Specify the date (UTC) when this advertisement will automatically be disabled. If no date is set, the advertisement will not expire automatically.',
62+
'AD_END_DATE_EXPLAIN' => 'Specify the date when this advertisement will automatically be disabled. If no date is set, the advertisement will not expire automatically.',
6363
'AD_CENTERING' => 'Center this advertisement automatically',
6464
'AD_CENTERING_EXPLAIN' => 'Set to yes to let this extension center your advertisement automatically. If this leads to undesired results, use CSS directly in the code to center your advertisement accordingly.',
6565

styles/prosilver/template/ucp_ads_stats.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ <h2>{{ lang('UCP_PHPBB_ADS_STATS') }}</h2>
3131
{% for ad in list.loop %}
3232
<tr class="{% if loop.index0 is even %}bg2{% else %}bg1{% endif %}">
3333
<td>{{ ad.NAME }}</td>
34-
<td class="center">{{ ad.START_DATE ? ad.START_DATE|date(constant('\\phpbb\\ads\\ext::DATE_FORMAT'), 'UTC') ~ ' (' ~ lang('UTC') ~ ')' }}</td>
34+
<td class="center">{{ ad.START_DATE ? ad.START_DATE|date(constant('\\phpbb\\ads\\ext::DATE_FORMAT'), 'UTC') }}</td>
3535
<td class="center">
3636
{% if ad.END_DATE < NOW %}<strong class="error">{% endif %}
37-
{{ ad.END_DATE ? ad.END_DATE|date(constant('\\phpbb\\ads\\ext::DATE_FORMAT'), 'UTC') ~ ' (' ~ lang('UTC') ~ ')' }}
37+
{{ ad.END_DATE ? ad.END_DATE|date(constant('\\phpbb\\ads\\ext::DATE_FORMAT'), 'UTC') }}
3838
{% if ad.END_DATE < NOW %}</strong>{% endif %}
3939
</td>
4040
{% if S_VIEWS_ENABLED %}

styles/scaffoldBB/template/ucp_ads_stats.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ <h2 class="fs-5">{{ lang('UCP_PHPBB_ADS_STATS') }}</h2>
3131
{% for ad in list.loop %}
3232
<tr class="{% if loop.index0 is even %}bg2 bg-secondary bg-opacity-25{% else %}bg1 bg-secondary bg-opacity-10{% endif %}">
3333
<td>{{ ad.NAME }}</td>
34-
<td class="center text-center">{{ ad.START_DATE ? ad.START_DATE|date(constant('\\phpbb\\ads\\ext::DATE_FORMAT'), 'UTC') ~ ' (' ~ lang('UTC') ~ ')' }}</td>
34+
<td class="center text-center">{{ ad.START_DATE ? ad.START_DATE|date(constant('\\phpbb\\ads\\ext::DATE_FORMAT'), 'UTC') }}</td>
3535
<td class="center text-center">
3636
{% if ad.END_DATE < NOW %}<strong class="error text-danger">{% endif %}
37-
{{ ad.END_DATE ? ad.END_DATE|date(constant('\\phpbb\\ads\\ext::DATE_FORMAT'), 'UTC') ~ ' (' ~ lang('UTC') ~ ')' }}
37+
{{ ad.END_DATE ? ad.END_DATE|date(constant('\\phpbb\\ads\\ext::DATE_FORMAT'), 'UTC') }}
3838
{% if ad.END_DATE < NOW %}</strong>{% endif %}
3939
</td>
4040
{% if S_VIEWS_ENABLED %}

tests/ad/get_ads_by_timezone_test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ public function test_timezone_boundary_behavior()
2828
private function create_test_ad($start_timestamp)
2929
{
3030
$ad_data = [
31-
'ad_id' => 99,
3231
'ad_name' => 'Test',
3332
'ad_note' => 'Test',
3433
'ad_code' => 'Test Ad',
@@ -38,7 +37,8 @@ private function create_test_ad($start_timestamp)
3837
'ad_priority' => 5,
3938
];
4039
$this->db->sql_query('INSERT INTO ' . $this->ads_table . ' ' . $this->db->sql_build_array('INSERT', $ad_data));
41-
$this->db->sql_query('INSERT INTO ' . $this->ad_locations_table . ' ' . $this->db->sql_build_array('INSERT', ['ad_id' => 99, 'location_id' => 'test_location']));
40+
$ad_id = $this->db->sql_last_inserted_id();
41+
$this->db->sql_query('INSERT INTO ' . $this->ad_locations_table . ' ' . $this->db->sql_build_array('INSERT', ['ad_id' => $ad_id, 'location_id' => 'test_location']));
4242
}
4343

4444
private function assert_user_sees_ad($timezone, $datetime, $should_see)

tests/event/main_listener_base.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ protected function setUp(): void
8080
{
8181
parent::setUp();
8282

83-
global $user, $phpbb_path_helper, $phpbb_root_path, $phpEx, $phpbb_dispatcher;
83+
global $config, $user, $phpbb_path_helper, $phpbb_root_path, $phpEx, $phpbb_dispatcher;
8484

8585
$phpbb_path_helper = $this->getMockBuilder('\phpbb\path_helper')
8686
->disableOriginalConstructor()
@@ -92,7 +92,7 @@ protected function setUp(): void
9292
$request = $this->getMockBuilder('\phpbb\request\request')
9393
->disableOriginalConstructor()
9494
->getMock();
95-
$config = new \phpbb\config\config(array());
95+
$config = new \phpbb\config\config(['board_timezone' => '']);
9696
$template = $this->getMockBuilder('\phpbb\template\template')
9797
->disableOriginalConstructor()
9898
->getMock();

tests/event/setup_ads_test.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public function test_setup_ads()
2020
$this->user->data['user_id'] = 1;
2121
$this->user->page['page_name'] = 'viewtopic';
2222
$this->user->page['page_dir'] = '';
23+
$this->user->data['user_timezone'] = '';
2324
$user_groups = $this->manager->load_memberships($this->user->data['user_id']);
2425
$location_ids = $this->location_manager->get_all_location_ids();
2526
$ads = $this->manager->get_ads($location_ids, $user_groups, false);

0 commit comments

Comments
 (0)