diff --git a/acp/core/dashboard.top.php b/acp/core/dashboard.top.php index 45dd0412..bc14994b 100644 --- a/acp/core/dashboard.top.php +++ b/acp/core/dashboard.top.php @@ -3,6 +3,19 @@ //prohibit unauthorized access require 'core/access.php'; +if(isset($_GET['a'])) { + + if($_GET['a'] == 'delete_cache') { + fc_delete_smarty_cache('all'); + } + if($_GET['a'] == 'update_index') { + fc_update_bulk_page_index(); + } + +} + + + $tpl_file = file_get_contents('templates/dashboard_top.tpl'); /* get latest infos from user database */ @@ -53,10 +66,12 @@ } $user_latest5 .= ''; $user_latest5 .= '
'; - $user_latest5 .= '
'.$user_nick.'
'; + $user_latest5 .= '
'; + $user_latest5 .= '
'.$user_nick.'
'; + $user_latest5 .= ''.$user_name.''; + $user_latest5 .= '
'; $user_latest5 .= ''.$user_registerdate.''; $user_latest5 .= '
'; - $user_latest5 .= ''.$user_name.''; $user_latest5 .= '
'; } @@ -104,13 +119,16 @@ $top5pages .= '
'; $top5pages .= '
'; + $top5pages .= '
'; $top5pages .= '
'.$page_linkname.' '; $top5pages .= '('.$last_edit.')
'; + $top5pages .= ''.$page_title.''; + $top5pages .= '
'; $top5pages .= '
'; $top5pages .= ''; $top5pages .= '
'; $top5pages .= '
'; - $top5pages .= ''.$page_title.''; + $top5pages .= '
'; } @@ -147,13 +165,16 @@ $top5posts .= '
'; $top5posts .= '
'; + $top5posts .= '
'; $top5posts .= '
'.$allPosts[$i]['post_title'].' '; $top5posts .= '('.$last_edit.')
'; + $top5posts .= ''.$post_teaser.''; + $top5posts .= '
'; $top5posts .= '
'; $top5posts .= ''; $top5posts .= '
'; $top5posts .= '
'; - $top5posts .= ''.$post_teaser.''; + $top5posts .= '
'; } @@ -182,14 +203,16 @@ $top5comments .= '
'; $top5comments .= '
'; + $top5comments .= '
'; $top5comments .= '
'.$allComments[$i]['comment_author'].' '; $top5comments .= '('.$last_edit.')
'; + $top5comments .= ''.$comment_text.''; + $top5comments .= '
'; $top5comments .= '
'; $top5comments .= ''; $top5comments .= '
'; $top5comments .= '
'; - $top5comments .= ''.$comment_text.''; - $top5comments .= '
'; + $top5comments .= ''; } @@ -261,6 +284,29 @@ $tpl_file = str_replace('{tab_user}', $lang['tn_usermanagement'], $tpl_file); $tpl_file = str_replace('{tab_user_stats}', $lang['h_status'], $tpl_file); +$btn_page_overview = ''.$icon['sitemap'].''; +$btn_new_page = ''.$icon['plus'].' '.$lang['new_page'].''; +$btn_update_index = ''.$icon['sync_alt'].' Index'; +$btn_delete_cache = ''.$icon['trash_alt'].' Cache'; + +$btn_post_overview = ''.$lang['tn_posts'].''; +$btn_new_post = ''.$icon['plus'].' '.$lang['label_new_post'].''; +$btn_comments_overview = ''.$lang['tn_comments'].''; + +$btn_user_overview = ''.$lang['list_user'].''; +$btn_new_user = ''.$icon['plus'].' '.$lang['new_user'].''; + +$tpl_file = str_replace('{btn_page_overview}', $btn_page_overview, $tpl_file); +$tpl_file = str_replace('{btn_new_page}', $btn_new_page, $tpl_file); +$tpl_file = str_replace('{btn_update_index}', $btn_update_index, $tpl_file); +$tpl_file = str_replace('{btn_delete_cache}', $btn_delete_cache, $tpl_file); + +$tpl_file = str_replace('{btn_post_overview}', $btn_post_overview, $tpl_file); +$tpl_file = str_replace('{btn_new_post}', $btn_new_post, $tpl_file); +$tpl_file = str_replace('{btn_comments_overview}', $btn_comments_overview, $tpl_file); + +$tpl_file = str_replace('{btn_user_overview}', $btn_user_overview, $tpl_file); +$tpl_file = str_replace('{btn_new_user}', $btn_new_user, $tpl_file); echo $tpl_file; diff --git a/acp/core/list.themes.php b/acp/core/list.themes.php index a7299f27..961618aa 100644 --- a/acp/core/list.themes.php +++ b/acp/core/list.themes.php @@ -132,7 +132,7 @@ echo '
'; - + unset($theme_options); if(is_file("../styles/$template/php/options.php")) { include '../styles/'.$template.'/php/options.php'; } diff --git a/acp/core/pages.edit.php b/acp/core/pages.edit.php index c144b46e..66028c86 100755 --- a/acp/core/pages.edit.php +++ b/acp/core/pages.edit.php @@ -81,12 +81,14 @@ ] ]); } else { - $subpages = ''; + $subpages = array(); } - if(count($subpages) > 0) { + $cnt_subpages = count($subpages); + + if($cnt_subpages > 0) { echo '
'; - echo $lang['msg_error_deleting_sub_pages']; + echo $lang['msg_error_deleting_sub_pages'] .' ('.$cnt_subpages.')'; echo '
    '; foreach($subpages as $pages) { echo '
  1. '.$pages['page_title'].'
  2. '; diff --git a/acp/core/pages.shortcodes.php b/acp/core/pages.shortcodes.php index bbc49993..8c897fc2 100644 --- a/acp/core/pages.shortcodes.php +++ b/acp/core/pages.shortcodes.php @@ -6,6 +6,15 @@ /*save or update shortcode */ if(isset($_POST['write_shortcode'])) { + /* labels */ + $arr_labels = $_POST['shortcode_labels']; + if(is_array($arr_labels)) { + sort($arr_labels); + $string_labels = implode(",", $arr_labels); + } else { + $string_labels = ""; + } + if($_POST['shortcode_id'] != '') { $db_mode = 'update'; @@ -20,6 +29,7 @@ $data = $db_content->update("fc_textlib", [ "textlib_content" => $_POST['longcode'], "textlib_shortcode" => $_POST['shortcode'], + "textlib_labels" => $string_labels, "textlib_type" => "shortcode" ],[ "textlib_id" => $shortcode_id @@ -31,6 +41,7 @@ $data = $db_content->insert("fc_textlib", [ "textlib_content" => $_POST['longcode'], "textlib_shortcode" => $_POST['shortcode'], + "textlib_labels" => $string_labels, "textlib_type" => "shortcode" ]); @@ -71,7 +82,7 @@ echo '
    '; -echo '
    '; +echo '
    '; echo ''; @@ -79,6 +90,7 @@ echo ''; echo ''; echo ''; +echo ''; echo ''; echo ''; echo ''; @@ -92,9 +104,33 @@ $btn_delete .= ''; $btn_delete .= ''; + $get_sc_labels = explode(',',$shortcodes[$i]['textlib_labels']); + + + $label = ''; + if($shortcodes[$i]['textlib_labels'] != '') { + foreach($get_sc_labels as $sc_label) { + + foreach($fc_labels as $l) { + if($sc_label == $l['label_id']) { + $label_color = $l['label_color']; + $label_title = $l['label_title']; + } + } + + $label .= ''; + } + } + + $longcode = htmlentities($shortcodes[$i]['textlib_content']); + if(strlen($longcode) > 75) { + $longcode = substr($longcode, 0,75). ' (...)'; + } + echo ''; echo ''; - echo ''; + echo ''; + echo ''; echo ''; echo ''; } @@ -104,7 +140,7 @@ echo ''; -echo '
    '; +echo '
    '; echo '
    '; echo '
    '; @@ -120,6 +156,34 @@ echo '
    '; + +$cnt_labels = count($fc_labels); +$arr_checked_labels = explode(",", $get_shortcode['textlib_labels']); + +for($i=0;$i<$cnt_labels;$i++) { + $label_title = $fc_labels[$i]['label_title']; + $label_id = $fc_labels[$i]['label_id']; + $label_color = $fc_labels[$i]['label_color']; + + if(in_array("$label_id", $arr_checked_labels)) { + $checked_label = "checked"; + } else { + $checked_label = ""; + } + + $checkbox_set_labels .= '
    '; + $checkbox_set_labels .= ''; + $checkbox_set_labels .= ''; + $checkbox_set_labels .= '
    '; +} + +echo '
    '; +echo '

    '.$lang['labels'].'

    '; +echo $checkbox_set_labels; +echo '
    '; + + + echo ''; if($get_shortcode['textlib_id'] != '') { diff --git a/acp/core/pages.snippets.php b/acp/core/pages.snippets.php index 8d5d5f09..808ced0e 100644 --- a/acp/core/pages.snippets.php +++ b/acp/core/pages.snippets.php @@ -210,7 +210,7 @@ } $snippet_label_filter = substr("$snippet_label_filter", 0, -3); // cut the last ' OR' -$filter_string = "WHERE textlib_id IS NOT NULL"; +$filter_string = "WHERE textlib_id IS NOT NULL AND textlib_type NOT IN('shortcode')"; if($_SESSION['type'] == 'all') { $filter_type = ''; diff --git a/acp/core/system.syspref.php b/acp/core/system.syspref.php index 15adf7b7..a066a5a3 100644 --- a/acp/core/system.syspref.php +++ b/acp/core/system.syspref.php @@ -50,6 +50,20 @@ } +/* save date/time settings */ + +if(isset($_POST['save_datetime'])) { + + $data = $db_content->update("fc_preferences", [ + "prefs_timezone" => $prefs_timezone, + "prefs_dateformat" => $prefs_dateformat, + "prefs_timeformat" => $prefs_timeformat + ], [ + "prefs_id" => 1 + ]); + +} + @@ -242,7 +256,105 @@ echo ''; echo ''; +$timezones = DateTimeZone::listIdentifiers(DateTimeZone::ALL); + +/* date and time settings */ +echo '
    '; + +echo '
    '; +echo ''.$lang['label_datetime_settings'].''; +echo '
    '; + +echo '
    '; +echo ''; +echo ''; +echo '
    '; + + +$date_formats = array("Y-m-d","d.m.Y","d/m/Y","m/d/Y"); + +echo '
    '; +echo ''; +echo ''; +echo '
    '; + +$time_formats = array("H:i","g:i a","g:i A"); + +echo '
    '; +echo ''; +echo ''; +echo '
    '; + + + +echo ''; +echo ''; +echo ''; +echo '
    '; /* User Preferences */ echo '
    '; diff --git a/acp/core/upload_addons.php b/acp/core/upload_addons.php index 0362d593..377e10ec 100644 --- a/acp/core/upload_addons.php +++ b/acp/core/upload_addons.php @@ -287,7 +287,7 @@ echo ''.$lang['label_ready_to_install'].''; if(count($all_uploads) < 1) { - echo '

    '.$lang['msg_nothing_to_install'].'

    '; + echo '

    '.$lang['msg_nothing_to_install'].' '.$icon['sync_alt'].' reload

    '; } else { echo '
    ShortcodeLongcodeLabel
    '.$shortcodes[$i]['textlib_shortcode'].''.htmlentities($shortcodes[$i]['textlib_content']).''.$longcode.''.$label.''.$btn_edit.' '.$btn_delete.'
    '; diff --git a/acp/templates/dashboard_top.tpl b/acp/templates/dashboard_top.tpl index 416e9095..3935d785 100644 --- a/acp/templates/dashboard_top.tpl +++ b/acp/templates/dashboard_top.tpl @@ -8,6 +8,7 @@ +
    {pages_list} @@ -18,6 +19,10 @@
    + +
    @@ -27,6 +32,7 @@
    +
    {posts_list} @@ -35,6 +41,10 @@ {comments_list}
    +
    + @@ -45,6 +55,7 @@ +
    {user_list} @@ -55,6 +66,10 @@
    + + diff --git a/acp/versions.php b/acp/versions.php index 1019df85..865e91ee 100755 --- a/acp/versions.php +++ b/acp/versions.php @@ -1,5 +1,5 @@ \ No newline at end of file diff --git a/core/posts-display.php b/core/posts-display.php index 8c54bde6..160020cc 100644 --- a/core/posts-display.php +++ b/core/posts-display.php @@ -7,7 +7,7 @@ $post_images = explode("<->", $post_data['post_images']); -$post_releasedate = date('Y-m-d H:i',$post_data['post_releasedate']); +$post_releasedate = date("$prefs_dateformat $prefs_timeformat",$post_data['post_releasedate']); $post_releasedate_year = date('Y',$post_data['post_releasedate']); $post_releasedate_month = date('m',$post_data['post_releasedate']); $post_releasedate_day = date('d',$post_data['post_releasedate']); diff --git a/core/posts-list.php b/core/posts-list.php index 3473e1b3..9fffd077 100644 --- a/core/posts-list.php +++ b/core/posts-list.php @@ -126,11 +126,11 @@ $posts_list = ''; foreach($get_posts as $k => $post) { - $post_releasedate = date('Y-m-d',$get_posts[$k]['post_releasedate']); + $post_releasedate = date($prefs_dateformat,$get_posts[$k]['post_releasedate']); $post_releasedate_year = date('Y',$get_posts[$k]['post_releasedate']); $post_releasedate_month = date('m',$get_posts[$k]['post_releasedate']); $post_releasedate_day = date('d',$get_posts[$k]['post_releasedate']); - $post_releasedate_time = date('H:i:s',$get_posts[$k]['post_releasedate']); + $post_releasedate_time = date($prefs_timeformat,$get_posts[$k]['post_releasedate']); /* event dates */ @@ -224,7 +224,6 @@ $post_teaser = htmlspecialchars_decode($get_posts[$k]['post_teaser']); $post_text = htmlspecialchars_decode($get_posts[$k]['post_text']); - $post_releasedate = date('d.m.Y',$get_posts[$k]['post_releasedate']); $post_categories = explode('<->',$get_posts[$k]['post_categories']); $cat_str = ''; diff --git a/index.php b/index.php index ef3cd468..876b2972 100644 --- a/index.php +++ b/index.php @@ -194,6 +194,17 @@ $$key = stripslashes($val); } + +if($prefs_dateformat == '') { + $prefs_dateformat = 'Y-m-d'; +} + +if($prefs_timeformat == '') { + $prefs_timeformat = 'H:i:s'; +} + + + if(!empty($page_contents['page_modul'])) { include 'modules/'.$page_contents['page_modul'].'/index.php'; } @@ -221,6 +232,23 @@ } +/* reset of the user-defined theme */ +if(isset($_POST['reset_theme'])) { + unset($_SESSION['prefs_template']); +} + +/* set the theme defined by the user */ +if(isset($_POST['set_theme'])) { + $set_theme = 'styles/'.sanitizeUserInputs($_POST['set_theme']); + if(is_dir($set_theme)) { + $_SESSION['prefs_template'] = sanitizeUserInputs($_POST['set_theme']); + } +} + +if($_SESSION['prefs_template'] != '') { + $prefs_template = $_SESSION['prefs_template']; +} + // default template $fc_template = $prefs_template; $fc_template_layout = $prefs_template_layout; diff --git a/install/contents/fc_preferences.php b/install/contents/fc_preferences.php index 2976e864..6a05ef6e 100644 --- a/install/contents/fc_preferences.php +++ b/install/contents/fc_preferences.php @@ -54,6 +54,12 @@ "prefs_anonymize_ip" => "VARCHAR(20) NOT NULL DEFAULT ''", "prefs_xml_sitemap" => "VARCHAR(20) NOT NULL DEFAULT ''", + /* Date and Time */ + + "prefs_timezone" => "VARCHAR(20) NOT NULL DEFAULT ''", + "prefs_dateformat" => "VARCHAR(100) NOT NULL DEFAULT ''", + "prefs_timeformat" => "VARCHAR(100) NOT NULL DEFAULT ''", + /* E-Mail */ "prefs_mailer_adr" => "VARCHAR(100) NOT NULL DEFAULT ''", diff --git a/lib/lang/de/dict-backend.php b/lib/lang/de/dict-backend.php index c32076c7..fc8fbf5e 100644 --- a/lib/lang/de/dict-backend.php +++ b/lib/lang/de/dict-backend.php @@ -456,6 +456,11 @@ $lang['acp_session_lifetime'] = 'ACP Session Lifetime (Sekunden)'; +$lang['label_datetime_settings'] = 'Datums- und Uhrzeit-Einstellungen'; +$lang['label_datetime_timezone'] = 'Zeitzone'; +$lang['label_datetime_dateformat'] = 'Datumsformat'; +$lang['label_datetime_timeformat'] = 'Zeitformat'; + /* Rights Management */ $lang['drm_description'] = "Der Benutzer darf folgende Aktionen durchführen"; diff --git a/lib/lang/en/dict-backend.php b/lib/lang/en/dict-backend.php index 3b6be252..7ca5c499 100644 --- a/lib/lang/en/dict-backend.php +++ b/lib/lang/en/dict-backend.php @@ -456,6 +456,11 @@ $lang['acp_session_lifetime'] = 'ACP Session Lifetime (Seconds)'; +$lang['label_datetime_settings'] = 'Date and Time Settings'; +$lang['label_datetime_timezone'] = 'Timezone'; +$lang['label_datetime_dateformat'] = 'Dateformat'; +$lang['label_datetime_timeformat'] = 'Timeformat'; + /* rights management */