Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

Commit

Permalink
fix - preview is now working correctly again
Browse files Browse the repository at this point in the history
  • Loading branch information
patkon committed Dec 28, 2020
1 parent afcc2e0 commit fe5c147
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
25 changes: 14 additions & 11 deletions acp/core/pages.edit.php
Expand Up @@ -156,9 +156,11 @@

if($page_position == "portal") {
$page_sort = "portal";
} elseif ($page_position == "mainpage") {
}
if($page_position == "mainpage") {
$page_sort = (int) $page_order;
} elseif ($page_position == "null") {
}
if($page_position == "null") {
$page_sort = "";
}

Expand Down Expand Up @@ -571,9 +573,7 @@


/* delete older entries from fc_pages_cache */
$interval = time() - 86400; // now - 24h
//$count = $dbh->exec("DELETE FROM fc_pages_cache WHERE page_cache_type = 'preview' AND page_lastedit < '$interval'");

$interval = time() - 86400; // now - 24h
$db_content->delete("fc_pages_cache", [
"AND" => [
"page_cache_type" => "preview",
Expand All @@ -598,22 +598,25 @@
fc_get_hook('page_updated',$_POST);
fc_delete_smarty_cache(md5($_POST['page_permalink']));

if($_POST['page_sort'] == 'ghost' OR $_POST['page_status'] == 'public') {
if($_POST['page_status'] == 'ghost' OR $_POST['page_status'] == 'public') {
fc_update_or_insert_index($_POST['page_permalink']);
}


}




/* get the data to fill the form (again) */
if(is_numeric($editpage)) {


if($modus == "preview") {
$page_data = $db_content->get("fc_pages_cache","*",[ "page_id_original" => $editpage ],["ORDER" => ["page_id" => "DESC"]]);
if($modus == "preview") {
$page_data = $db_content->get("fc_pages_cache","*",[
"AND" => [
"page_id_original" => $editpage
],
"ORDER" => ["page_id" => "DESC"]
]);

} else {
$page_data = $db_content->get("fc_pages","*",[ "page_id" => $editpage ]);
}
Expand Down
8 changes: 3 additions & 5 deletions core/functions/func_get_content.php
Expand Up @@ -46,11 +46,9 @@ function get_content($page, $mode = 'p') {
"AND" => [
"page_id_original" => "$page",
"page_language" => "$languagePack"
],
[
"ORDER" => "page_id"
]
]);
],
"ORDER" => ["page_id" => "DESC"]
]);

} else {

Expand Down

0 comments on commit fe5c147

Please sign in to comment.