Skip to content

Commit

Permalink
Merge pull request #88 from ggoffy/master
Browse files Browse the repository at this point in the history
various bug fixes
  • Loading branch information
ggoffy authored Mar 9, 2023
2 parents 8e06a94 + 08b14e3 commit ba285e6
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 9 deletions.
3 changes: 3 additions & 0 deletions admin/account.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@
redirect_header('account.php', 3, _MA_WGEVENTS_INVALID_PARAM);
} else {
$accountObj = $helper->getHandler('Account')->get($accId);
if (!\is_object($accountObj)) {
redirect_header('account.php', 3, _MA_WGEVENTS_INVALID_PARAM);
}
}

$account_server_in = $accountObj->getVar('server_in');
Expand Down
5 changes: 4 additions & 1 deletion blocks/event.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function b_wgevents_event_show($options)
$typeBlock = $options[0];
$limit = (int)$options[1];
$lengthTitle = (int)$options[2];
$blockType = (string)$options[3];
$blockType = '0' === (string)$options[3] ? 'simple' : (string)$options[3] ;
\array_shift($options);
\array_shift($options);
\array_shift($options);
Expand All @@ -67,18 +67,21 @@ function b_wgevents_event_show($options)
case 'last':
default:
// For the block: events last
$dateFrom = 0;
$sortBy = 'datecreated';
$orderBy = 'DESC';
break;
case 'new':
// For the block: events new
// new since last week: 7 * 24 * 60 * 60 = 604800
$dateCreated = \time() - 604800;
$dateFrom = 0;
$sortBy = 'datecreated';
$orderBy = 'ASC';
break;
case 'random':
// For the block: events random
$dateFrom = 0;
$sortBy = 'RAND()';
$orderBy = '';
break;
Expand Down
5 changes: 5 additions & 0 deletions docs/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
==============================================================
1.0.6 Stable [2023/03/09]
==============================================================
- fixed bugs in block (goffy)

==============================================================
1.0.5 Stable [2023/02/28]
==============================================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
<div class="row">
<div class="col-xs-12 col-sm-3 col-lg-2"><{$smarty.const._MA_WGEVENTS_EVENT_GALLERY}>: </div>
<div class="col-xs-12 col-sm-9 col-lg-10">
<a class='btn btn-primary wge-btn' href='<{$event.gallery_link}>' target="_blank" title='<{$event.gallery_name}>'><{$event.gallery_name}></a>
<a class='btn btn-primary wge-btn' href='<{$event.gallery_link|default:''}>' target="_blank" title='<{$event.gallery_name|default:''}>'><{$event.gallery_name|default:''}></a>
</div>
</div>
<{/if}>
Expand Down
5 changes: 5 additions & 0 deletions language/english/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,13 @@
\define('_MB_WGEVENTS_TITLE_LENGTH', 'Title Length');
\define('_MB_WGEVENTS_CATTODISPLAY', 'Category to Display');
\define('_MB_WGEVENTS_ALLCAT', 'All Category');
\define('_MB_WGEVENTS_EVENTS_TO_DISPLAY', 'Events to Display');
\define('_MB_WGEVENTS_ALL_EVENTS', 'All events');
// Event
\define('_MB_WGEVENTS_EVENT_SHOWMORE', 'Show more events');
\define('_MB_WGEVENTS_EVENT_NAME', 'Event name');
\define('_MB_WGEVENTS_EVENT_LOGO', 'Event logo');
\define('_MB_WGEVENTS_EVENT_GOTO', 'Goto Event');
\define('_MB_WGEVENTS_BLOCKTYPE', 'Block type');
\define('_MB_WGEVENTS_BLOCKTYPE_TABLE', 'Table');
\define('_MB_WGEVENTS_BLOCKTYPE_SIMPLE', 'Simple');
Expand Down
5 changes: 5 additions & 0 deletions language/german/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,13 @@
\define('_MB_WGEVENTS_TITLE_LENGTH', 'Titellänge');
\define('_MB_WGEVENTS_CATTODISPLAY', 'Anzuzeigende Kategorien');
\define('_MB_WGEVENTS_ALLCAT', 'Alle Kategorien');
\define('_MB_WGEVENTS_EVENTS_TO_DISPLAY', 'Anzuzeigende Veranstaltungen');
\define('_MB_WGEVENTS_ALL_EVENTS', 'Alle Veranstaltungen');
// Event
\define('_MB_WGEVENTS_EVENT_SHOWMORE', 'Weitere Veranstaltungen anzeigen');
\define('_MB_WGEVENTS_EVENT_NAME', 'Veranstaltung Name');
\define('_MB_WGEVENTS_EVENT_LOGO', 'Veranstaltung logo');
\define('_MB_WGEVENTS_EVENT_GOTO', 'Gehe zur Veranstaltung');
\define('_MB_WGEVENTS_BLOCKTYPE', 'Blocktyp');
\define('_MB_WGEVENTS_BLOCKTYPE_TABLE', 'Tabelle');
\define('_MB_WGEVENTS_BLOCKTYPE_SIMPLE', 'Einfach');
Expand Down
4 changes: 2 additions & 2 deletions templates/blocks/wgevents_block_events_spotlight.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<thead>
<tr class='head'>
<th>&nbsp;</th>
<th class='center'><{$smarty.const._MB_WGEVENTS_EV_NAME}></th>
<th class='center'><{$smarty.const._MB_WGEVENTS_EV_LOGO}></th>
<th class='center'><{$smarty.const._MB_WGEVENTS_EVENT_NAME}></th>
<th class='center'><{$smarty.const._MB_WGEVENTS_EVENT_LOGO}></th>
</tr>
</thead>
<{if count($block)}>
Expand Down
2 changes: 1 addition & 1 deletion templates/wgevents_event_item_details.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
<div class="row">
<div class="col-xs-12 col-sm-3 col-lg-2"><{$smarty.const._MA_WGEVENTS_EVENT_GALLERY}>: </div>
<div class="col-xs-12 col-sm-9 col-lg-10">
<a class='btn btn-primary wge-btn' href='<{$event.gallery_link}>' target="_blank" title='<{$event.gallery_name}>'><{$event.gallery_name}></a>
<a class='btn btn-primary wge-btn' href='<{$event.gallery_link|default:''}>' target="_blank" title='<{$event.gallery_name|default:''}>'><{$event.gallery_name|default:''}></a>
</div>
</div>
<{/if}>
Expand Down
8 changes: 4 additions & 4 deletions xoops_version.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
// ------------------- Information ------------------- //
$modversion = [
'name' => \_MI_WGEVENTS_NAME,
'version' => '1.0.5',
'version' => '1.0.6',
'module_status' => 'Stable',
'description' => \_MI_WGEVENTS_DESC,
'author' => 'Goffy - Wedega',
'author_mail' => '[email protected]',
Expand Down Expand Up @@ -65,7 +66,6 @@
'module_website_url' => 'www.xoops.org',
'module_website_name' => 'XOOPS Project',
'release' => '28.02.2023',
'module_status' => 'Stable',
'system_menu' => 1,
'hasAdmin' => 1,
'hasMain' => 1,
Expand Down Expand Up @@ -224,7 +224,7 @@
'show_func' => 'b_wgevents_event_show',
'edit_func' => 'b_wgevents_event_edit',
'template' => 'wgevents_block_events.tpl',
'options' => 'last|5|25|0',
'options' => 'last|5|25|simple',
];
// Event new
$modversion['blocks'][] = [
Expand All @@ -234,7 +234,7 @@
'show_func' => 'b_wgevents_event_show',
'edit_func' => 'b_wgevents_event_edit',
'template' => 'wgevents_block_events.tpl',
'options' => 'new|5|25|0',
'options' => 'new|5|25|simple',
];
/*
Expand Down

0 comments on commit ba285e6

Please sign in to comment.