Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nur Einträge mit Status 1 oder 0 ausgeben #64

Merged
merged 3 commits into from
Mar 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions boot.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
}

if (rex_addon::get('yform')->isAvailable() && !rex::isSafeMode()) {

rex_yform_manager_dataset::setModelClass(
'rex_neues_entry',
neues_entry::class,
Expand All @@ -22,7 +21,6 @@
'rex_neues_entry_lang',
neues_entry_lang::class,
);

}

if (rex::isBackend() && 'neues/entry' == rex_be_controller::getCurrentPage() || 'yform/manager/data_edit' == rex_be_controller::getCurrentPage()) {
Expand Down
3 changes: 0 additions & 3 deletions install.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
}

if (!rex_media::get('neues_entry_fallback_image.png')) {

rex_file::copy(rex_path::addon('neues', '/install/neues_entry_fallback_image.png'), rex_path::media('neues_entry_fallback_image.png'));
$data = [];
$data['title'] = 'Aktuelles - Fallback-Image';
Expand All @@ -30,9 +29,7 @@

/* URL-Profile installieren */
if (rex_addon::get('url') && rex_addon::get('url')->isAvailable()) {

if (false === rex_config::get('neues', 'url_profile', false)) {

$rex_neues_category = array_filter(rex_sql::factory()->getArray("SELECT * FROM rex_url_generator_profile WHERE `table_name` = '1_xxx_rex_neues_category'"));
if (!$rex_neues_category) {
$query = rex_file::get(rex_path::addon('neues', 'install/rex_url_profile_neues_category.sql'));
Expand Down
5 changes: 4 additions & 1 deletion lib/neues.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ class neues
*/
public static function getList(int $rowsPerPage = 10, string $pageCursor = 'page'): string
{
$query = neues_entry::query()->orderBy('publishdate', 'desc');
$query = neues_entry::query()
->where('status', 1, '>=')
->where('publishdate', rex_sql::datetime(), '<=')
->orderBy('publishdate', 'desc');
$pager = new rex_pager($rowsPerPage, $pageCursor);
$posts = $query->paginate($pager);

Expand Down
1 change: 0 additions & 1 deletion lib/rex_cronjob_neues_publish.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ class rex_cronjob_neues_publish extends rex_cronjob
{
public function execute()
{

/* Collection von Neues-Einträgen, die noch nicht veröffentlicht sind, aber es sein sollten. (geplant) */
$neues_entry_to_publish = neues_entry::query()->where('status', 0)->where('publishdate', date('Y-m-d'), '<')->find();
$neues_entry_to_publish->setValue('status', 1);
Expand Down
Loading