function SkinBeginHtmlHead(&$params)
 {
     global $Blog;
     global $Blog;
     if ($this->get_coll_setting('shareaholic_enabled', $Blog)) {
         $script = "\n//<![CDATA[\n  (function() {\n    var shr = document.createElement('script');\n    shr.setAttribute('data-cfasync', 'false');\n    shr.src = '//dsms0mj1bbhn4.cloudfront.net/assets/pub/shareaholic.js';\n    shr.type = 'text/javascript'; shr.async = 'true';\n    shr.onload = shr.onreadystatechange = function() {\n      var rs = this.readyState;\n      if (rs && rs != 'complete' && rs != 'loaded') return;\n      var site_id = '" . $this->get_coll_setting('shareaholic_site_id', $Blog) . "';\n      try { Shareaholic.init(site_id); } catch (e) {}\n    };\n    var s = document.getElementsByTagName('script')[0];\n    s.parentNode.insertBefore(shr, s);\n  })();\n//]]>";
         add_js_headline($script);
     }
 }
 function SkinBeginHtmlHead()
 {
     global $plugins_url;
     require_css($plugins_url . 'blog_selector_plugin/rsc/chosen.min.css', true);
     require_css($plugins_url . 'blog_selector_plugin/rsc/blogselector.css', true);
     require_js($plugins_url . 'blog_selector_plugin/rsc/chosen.jquery.min.js', true);
     add_js_headline("\n\t\t\t\$.noConflict();\n\t\t\tjQuery(document).ready(function(\$){\n\t\t\t  \$('select.blog_sel_w').chosen({disable_search_threshold: 6});\n\t\t\t  \$('select.blog_sel_w').bind('change', function () {\n\t\t\t\t  var url = \$(this).find(':selected').data('url')\n\t\t\t\t  if (url) { // require a URL\n\t\t\t\t\t  window.location = url; // redirect\n\t\t\t\t  }\n\t\t\t\t  return false;\n\t\t\t  });\n\t\t\t});\n\t\t");
     //require_js( $plugins_url.'blog_selector_plugin/rsc/blog.select.init.js', true );
 }
Beispiel #3
0
 /**
  * Get ready for displaying the skin.
  *
  * This may register some CSS or JS...
  */
 function display_init()
 {
     // call parent:
     parent::display_init();
     // We pass NO params. This gives up the default Skins API v5 behavior.
     add_js_headline('var touch_skin_switch_confirm_text = "' . TS_('Switch to regular view? \\n \\n You can switch back again in the footer.') . '";');
     $this->require_js('js/core.js');
     require_js('navigation.js', 'blog');
 }
Beispiel #4
0
 /**
  * This function should init the templates - like adding Javascript through the {@link add_headline()} method.
  */
 function init_templates()
 {
     global $Messages, $debug, $Hit, $check_browser_version;
     // This is included before controller specifc require_css() calls:
     require_css('results.css', 'rsc_url');
     // Results/tables styles
     require_js('#jquery#', 'rsc_url');
     require_js('jquery/jquery.raty.min.js', 'rsc_url');
     require_js('#bootstrap#', 'rsc_url');
     require_css('#bootstrap_css#', 'rsc_url');
     // require_css( '#bootstrap_theme_css#', 'rsc_url' );
     require_js('#bootstrap_typeahead#', 'rsc_url');
     // JS to init Bootstrap tooltips (E.g. on badges with title "Admin"):
     add_js_headline('jQuery( function () { jQuery( \'[data-toggle="tooltip"]\' ).tooltip() } )');
     if ($debug) {
         // Use readable CSS:
         // rsc/less/bootstrap-basic_styles.less
         // rsc/less/bootstrap-basic.less
         // rsc/less/bootstrap-evoskins.less
         require_css('bootstrap-backoffice-b2evo_base.bundle.css', 'rsc_url');
         // Concatenation of the above
     } else {
         // Use minified CSS:
         require_css('bootstrap-backoffice-b2evo_base.bmin.css', 'rsc_url');
         // Concatenation + Minifaction of the above
     }
     // Make sure standard CSS is called ahead of custom CSS generated below:
     if ($debug) {
         // Use readable CSS:
         require_css('skins_adm/bootstrap/rsc/css/style.css', 'relative');
         // Relative to <base> tag (current skin folder)
     } else {
         // Use minified CSS:
         require_css('skins_adm/bootstrap/rsc/css/style.min.css', 'relative');
         // Relative to <base> tag (current skin folder)
     }
     // Set bootstrap css classes for messages
     $Messages->set_params(array('class_outerdiv' => 'action_messages container-fluid', 'class_success' => 'alert alert-dismissible alert-success fade in', 'class_warning' => 'alert alert-dismissible alert-warning fade in', 'class_error' => 'alert alert-dismissible alert-danger fade in', 'class_note' => 'alert alert-dismissible alert-info fade in', 'before_message' => '<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span></button>'));
     // Initialize font-awesome icons and use them as a priority over the glyphicons, @see get_icon()
     init_fontawesome_icons('fontawesome-glyphicons');
     if ($check_browser_version && $Hit->get_browser_version() > 0 && $Hit->is_IE(9, '<')) {
         // Display info message if browser IE < 9 version and it is allowed by config var:
         $Messages->add(T_('Your web browser is too old. For this site to work correctly, we recommend you use a more recent browser.'), 'note');
         if ($debug) {
             $Messages->add('User Agent: ' . $Hit->get_user_agent(), 'note');
         }
     }
 }
    /**
     * @see Plugin::SkinBeginHtmlHead()
     */
    function SkinBeginHtmlHead(&$params)
    {
        $relative_to = is_admin_page() ? 'rsc_url' : 'blog';
        require_js('#flowplayer#', $relative_to);
        add_js_headline('flowplayer.conf = { flashfit: true, embed: false }');
        $this->require_skin();
        add_css_headline('.flowplayer_block {
	margin: 1em auto 0;
	background: #000;
}
.flowplayer_block .flowplayer {
	display: block;
	margin: auto;
}
.flowplayer_text {
	font-size: 84%;
	text-align: center;
	margin: 4px 0;
}');
    }
    /**
     * Get ready for displaying the skin.
     */
    function display_init()
    {
        require_js('#jquery#');
        add_headline('<!--[if lte IE 6]> <script type="text/javascript"> isIE6 = true; isIE = true; </script> <![endif]-->
					  <!--[if gte IE 7]> <script type="text/javascript"> isIE = true; </script> <![endif]-->');
        require_js('resources/jquery.mystique.js', true);
        if ($this->get_setting('fancy_helper')) {
            require_js('resources/jquery.custom.fancy.js', true);
            add_headline('<!-- Add Thumbnail helper (this is optional) -->');
            require_css('resources/helpers/jquery.fancybox-thumbs.css', true);
            require_js('resources/helpers/jquery.fancybox-thumbs.js', true);
            require_css('resources/helpers/jquery.fancybox-buttons.css', true);
            require_js('resources/helpers/jquery.fancybox-buttons.js', true);
        }
        /*
        <script language="javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js" type="text/javascript"></script>
        <script language="javascript" src="/tweet/jquery.tweet.js" type="text/javascript"></script> 
        */
        if ($this->get_setting('enable_thumbshots')) {
            // Display thumbshots
            add_js_headline('jQuery(document).ready(function() {
			if( ThumbsLinks = jQuery(".bText a[href^=\'http:\']").not("[href*=\'" + window.location.host + "\']") )
			{
				ThumbshotPopups("thumbshot", ThumbsLinks);
			}
			})');
        }
        add_css_headline(' #page {font-family: ' . $this->get_setting('skin_font') . '}');
        require_css('resources/color-' . $this->get_setting('skin_color') . '.css', true);
        // call parent:
        parent::display_init();
    }
skin_keywords_tag();
?>
	<?php 
skin_opengraph_tags();
?>
	<?php 
robots_tag();
?>
	<?php 
global $htsrv_url;
$js_blog_id = "";
if (!empty($Blog)) {
    // Set global js var "blog_id"
    $js_blog_id = "\r\n\t\tvar blog_id = '" . $Blog->ID . "';";
}
add_js_headline("// Paths used by JS functions:\n\t\tvar htsrv_url = '" . get_samedomain_htsrv_url() . "';" . $js_blog_id);
?>
	<meta name="generator" content="b2evolution <?php 
app_version();
?>
" /> <!-- Please leave this for stats -->
	<?php 
if ($Blog->get_setting('feed_content') != 'none') {
    // auto-discovery urls
    ?>
	<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php 
    $Blog->disp('rss2_url', 'raw');
    ?>
" />
	<link rel="alternate" type="application/atom+xml" title="Atom" href="<?php 
    $Blog->disp('atom_url', 'raw');
Beispiel #8
0
 /**
  * Get ready for displaying the skin.
  *
  * This method may register some CSS or JS. 
  * The default implementation can register a few common things that you may request in the $features param.
  * This is where you'd specify you want to use BOOTSTRAP, etc.
  *
  * If this doesn't do what you need you may add functions like the following to your skin's display_init():
  * require_js() , require_css() , add_js_headline()
  *
  * @param array of possible features you want to include. If empty, will default to {'b2evo_base', 'style', 'colorbox'} for backwards compatibility.
  */
 function display_init($features = array())
 {
     global $debug, $Messages, $disp;
     if (empty($features)) {
         // Fall back to v5 default set of features:
         $features = array('b2evo_base_css', 'style_css', 'colorbox', 'disp_auto');
     }
     // "Temporary" patch to at least have disp_auto unless another disp_xxx was specified. Use 'disp_off' to NOT include anuthing.
     if (!preg_grep('/disp_.*/', $features)) {
         $features[] = 'disp_auto';
     }
     // We're NOT using foreach so that the array can continue to grow during parsing: (see 'disp_auto')
     for ($i = 0; isset($features[$i]); $i++) {
         // Get next feature to include:
         $feature = $features[$i];
         switch ($feature) {
             case 'jquery':
                 // Include jQuery:
                 require_js('#jquery#', 'blog');
                 break;
             case 'font_awesome':
                 // Initialize font-awesome icons and use them as a priority over the glyphicons, @see get_icon()
                 init_fontawesome_icons('fontawesome-glyphicons');
                 break;
             case 'bootstrap':
                 // Include Bootstrap:
                 require_js('#bootstrap#', 'blog');
                 require_css('#bootstrap_css#', 'blog');
                 break;
             case 'bootstrap_theme_css':
                 // Include the Bootstrap Theme CSS:
                 require_css('#bootstrap_theme_css#', 'blog');
                 break;
             case 'bootstrap_evo_css':
                 // Include the bootstrap-b2evo_base CSS (NEW / v6 style) - Use this when you use Bootstrap:
                 if ($debug) {
                     // Use readable CSS:
                     // rsc/less/bootstrap-basic_styles.less
                     // rsc/less/bootstrap-basic.less
                     // rsc/less/bootstrap-blog_base.less
                     // rsc/less/bootstrap-item_base.less
                     // rsc/less/bootstrap-evoskins.less
                     require_css('bootstrap-b2evo_base.bundle.css', 'blog');
                     // CSS concatenation of the above
                 } else {
                     // Use minified CSS:
                     require_css('bootstrap-b2evo_base.bmin.css', 'blog');
                     // Concatenation + Minifaction of the above
                 }
                 break;
             case 'bootstrap_init_tooltips':
                 // JS to init Bootstrap tooltips (E.g. on comment form for allowed file extensions):
                 add_js_headline('jQuery( function () { jQuery( \'[data-toggle="tooltip"]\' ).tooltip() } )');
                 break;
             case 'bootstrap_messages':
                 // Initialize $Messages Class to use Bootstrap styles:
                 $Messages->set_params(array('class_success' => 'alert alert-dismissible alert-success fade in', 'class_warning' => 'alert alert-dismissible alert-warning fade in', 'class_error' => 'alert alert-dismissible alert-danger fade in', 'class_note' => 'alert alert-dismissible alert-info fade in', 'before_message' => '<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span></button>'));
                 break;
             case 'b2evo_base_css':
                 // Include the b2evo_base CSS (OLD / v5 style) - Use this when you DON'T use Bootstrap:
                 if ($debug) {
                     // Use readable CSS:
                     // require_css( 'basic_styles.css', 'blog' ); // the REAL basic styles
                     // require_css( 'basic.css', 'blog' ); // Basic styles
                     // require_css( 'blog_base.css', 'blog' ); // Default styles for the blog navigation
                     // require_css( 'item_base.css', 'blog' ); // Default styles for the post CONTENT
                     // require_css( 'b2evo_base.bundle.css', 'blog' ); // Concatenation of the above
                     require_css('b2evo_base.bundle.css', 'blog');
                     // Concatenation + Minifaction of the above
                 } else {
                     // Use minified CSS:
                     require_css('b2evo_base.bmin.css', 'blog');
                     // Concatenation + Minifaction of the above
                 }
                 break;
             case 'style_css':
                 // Include the default skin style.css:
                 // You should make sure this is called ahead of any custom generated CSS.
                 if ($this->use_min_css == false || $debug || $this->use_min_css == 'check' && !file_exists(dirname(__FILE__) . '/style.min.css')) {
                     // Use readable CSS:
                     require_css('style.css', 'relative');
                     // Relative to <base> tag (current skin folder)
                 } else {
                     // Use minified CSS:
                     require_css('style.min.css', 'relative');
                     // Relative to <base> tag (current skin folder)
                 }
                 break;
             case 'colorbox':
                 // Colorbox (a lightweight Lightbox alternative) allows to zoom on images and do slideshows with groups of images:
                 if ($this->get_setting('colorbox')) {
                     // This can be enabled by a setting in skins where it may be relevant
                     require_js_helper('colorbox', 'blog');
                 }
                 break;
             case 'disp_auto':
                 // Automatically add a disp_xxx for current $disp:
                 $features[] = 'disp_' . $disp;
                 break;
             case 'disp_single':
                 // Specific features for disp=single:
             // Specific features for disp=single:
             case 'disp_page':
                 // Specific features for disp=page:
                 global $Blog;
                 // Used to init functions for AJAX forms to add a comment:
                 init_ajax_forms('blog');
                 // Used to set rating for a new comment:
                 init_ratings_js('blog');
                 // Used to vote on the comments:
                 init_voting_comment_js('blog');
                 // Used to display a tooltip to the right of plugin help icon:
                 init_plugins_js('blog', $this->get_template('tooltip_plugin'));
                 // Used to autocomplete usernames in textarea:
                 init_autocomplete_usernames_js('blog');
                 if ($Blog->get_setting('allow_rating_comment_helpfulness')) {
                     // Load jquery UI to animate background color on change comment status or on vote:
                     require_js('#jqueryUI#', 'blog');
                 }
                 break;
             case 'disp_users':
                 // Specific features for disp=users:
                 // Used to add new search field "Specific criteria":
                 require_js('#jqueryUI#', 'blog');
                 require_css('#jqueryUI_css#', 'blog');
                 // Require results.css to display thread query results in a table:
                 if (!in_array('bootstrap', $features)) {
                     // Only for NON-bootstrap skins
                     require_css('results.css', 'blog');
                     // Results/tables styles
                 }
                 // Require functions.js to show/hide a panel with filters:
                 require_js('functions.js', 'blog');
                 // Include this file to expand/collapse the filters panel when JavaScript is disabled
                 global $inc_path;
                 require_once $inc_path . '_filters.inc.php';
                 break;
             case 'disp_messages':
                 // Specific features for disp=messages:
                 // Used to display a tooltip to the right of plugin help icon:
                 init_plugins_js('blog', $this->get_template('tooltip_plugin'));
                 // Require results.css to display message query results in a table
                 if (!in_array('bootstrap', $features)) {
                     // Only for NON-bootstrap skins
                     require_css('results.css', 'blog');
                     // Results/tables styles
                 }
                 // Require functions.js to show/hide a panel with filters:
                 require_js('functions.js', 'blog');
                 // Include this file to expand/collapse the filters panel when JavaScript is disabled
                 global $inc_path;
                 require_once $inc_path . '_filters.inc.php';
                 break;
             case 'disp_contacts':
                 // Specific features for disp=contacts:
                 // Used for combo box "Add all selected contacts to this group":
                 require_js('form_extensions.js', 'blog');
                 // Require results.css to display contact query results in a table
                 if (!in_array('bootstrap', $features)) {
                     // Only for NON-bootstrap skins
                     require_css('results.css', 'blog');
                     // Results/tables styles
                 }
                 // Require functions.js to show/hide a panel with filters:
                 require_js('functions.js', 'blog');
                 // Include this file to expand/collapse the filters panel when JavaScript is disabled
                 global $inc_path;
                 require_once $inc_path . '_filters.inc.php';
                 break;
             case 'disp_threads':
                 // Specific features for disp=threads:
                 if (in_array(get_param('action'), array('new', 'create', 'preview'))) {
                     // Used to suggest usernames for the field "Recipients":
                     init_tokeninput_js('blog');
                 }
                 // Used to display a tooltip to the right of plugin help icon:
                 init_plugins_js('blog', $this->get_template('tooltip_plugin'));
                 // Require results.css to display thread query results in a table:
                 if (!in_array('bootstrap', $features)) {
                     // Only for NON-bootstrap skins
                     require_css('results.css', 'blog');
                     // Results/tables styles
                 }
                 // Require functions.js to show/hide a panel with filters:
                 require_js('functions.js', 'blog');
                 // Include this file to expand/collapse the filters panel when JavaScript is disabled
                 global $inc_path;
                 require_once $inc_path . '_filters.inc.php';
                 break;
             case 'disp_login':
                 // Specific features for disp=threads:
                 global $Settings, $Plugins;
                 $transmit_hashed_password = (bool) $Settings->get('js_passwd_hashing') && !(bool) $Plugins->trigger_event_first_true('LoginAttemptNeedsRawPassword');
                 if ($transmit_hashed_password) {
                     // Include JS for client-side password hashing:
                     require_js('build/sha1_md5.bmin.js', 'blog');
                 }
                 break;
             case 'disp_profile':
                 // Specific features for disp=profile:
                 // Used to add new user fields:
                 init_userfields_js('blog', $this->get_template('tooltip_plugin'));
                 // Used to crop profile pictures:
                 require_js('#jquery#', 'blog');
                 require_js('#jcrop#', 'blog');
                 require_css('#jcrop_css#', 'blog');
                 break;
             case 'disp_avatar':
                 // Specific features for disp=avatar:
                 // Used to crop profile pictures:
                 require_js('#jquery#', 'blog');
                 require_js('#jcrop#', 'blog');
                 require_css('#jcrop_css#', 'blog');
                 break;
             case 'disp_edit':
                 // Specific features for disp=edit:
                 // Require results.css to display attachments as a result table:
                 require_css('results.css');
                 init_tokeninput_js('blog');
                 // Used to display a date picker for date form fields:
                 init_datepicker_js('blog');
                 // Used to display a tooltip to the right of plugin help icon:
                 init_plugins_js('blog', $this->get_template('tooltip_plugin'));
                 // Used to switch to advanced editing:
                 require_js('backoffice.js', 'blog');
                 // Used to automatically checks the matching extracat when we select a new main cat:
                 require_js('extracats.js', 'blog');
                 // Used to autocomplete usernames in textarea:
                 init_autocomplete_usernames_js('blog');
                 break;
             case 'disp_edit_comment':
                 // Specific features for disp=edit_comment:
                 // Require results.css to display attachments as a result table:
                 require_css('results.css');
                 // Used to set rating for a new comment:
                 init_ratings_js('blog');
                 // Used to display a date picker for date form fields:
                 init_datepicker_js('blog');
                 // Used to display a tooltip to the right of plugin help icon:
                 init_plugins_js('blog', $this->get_template('tooltip_plugin'));
                 // Used to autocomplete usernames in textarea:
                 init_autocomplete_usernames_js('blog');
                 break;
             case 'disp_useritems':
                 // Specific features for disp=useritems:
             // Specific features for disp=useritems:
             case 'disp_usercomments':
                 // Specific features for disp=usercomments:
                 // Require results.css to display item/comment query results in a table
                 require_css('results.css');
                 // Results/tables styles
                 // Require functions.js to show/hide a panel with filters
                 require_js('functions.js', 'blog');
                 // Include this file to expand/collapse the filters panel when JavaScript is disabled
                 global $inc_path;
                 require_once $inc_path . '_filters.inc.php';
                 break;
             default:
                 // We no longer want to do this because of 'disp_auto':
                 // debug_die( 'This skin has requested an unknown feature: \''.$feature.'\'. Maybe this skin requires a more recent version of b2evolution.' );
         }
     }
 }
Beispiel #9
0
    /**
     * Get ready for displaying the skin.
     *
     * This may register some CSS or JS...
     */
    function display_init()
    {
        global $Messages, $debug, $disp;
        // Request some common features that the parent function (Skin::display_init()) knows how to provide:
        parent::display_init(array('jquery', 'font_awesome', 'bootstrap', 'bootstrap_evo_css', 'bootstrap_messages', 'style_css', 'colorbox', 'bootstrap_init_tooltips', 'disp_auto'));
        // Skin specific initializations:
        require_js('js/scripts.js', 'relative');
        // Include Masonry Grind for Posts and Mediaidx disps
        if (in_array($disp, array('posts', 'mediaidx', 'catdir'))) {
            require_js('js/masonry.pkgd.min.js', 'relative');
            require_js('js/imagesloaded.pkgd.min.js', 'relative');
            add_js_headline("\n\t\t\t\tjQuery( document ).ready( function(\$) {\n\t\t\t\t\t\$( '.grid' ).imagesLoaded().done( function( instance ) {\n\t\t\t\t\t\t\$( '.grid' ).masonry(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// options\n\t\t\t\t\t\t\titemSelector: '.grid-item',\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t");
        }
        // Limit images by max height:
        $max_image_height = intval($this->get_setting('max_image_height'));
        if ($max_image_height > 0) {
            add_css_headline('.evo_image_block img { max-height: ' . $max_image_height . 'px; width: auto }');
        }
        // Add custom CSS:
        $custom_css = '';
        /**
         * ============================================================================
         * General Customization
         * ============================================================================
         */
        if ($links_color = $this->get_setting('links_color')) {
            $custom_css .= '.container.main-page-content a,
				#submit_preview_buttons_wrapper .preview, #submit_preview_buttons_wrapper .submit:hover,
				.filter-submit,
				.disp_login .control-buttons input.btn-success, .disp_login .control-buttons a.btn-primary:hover,
				.disp_lostpassword .control-buttons input.btn-primary:hover,
				.disp_register .control-buttons input.btn-primary:hover,
				.disp_user .profile_content .profile_column_left .profile_buttons a button.btn,
				.disp_msgform main .comment-form input.submit:hover,
				.navbar-brand h3 a,
				.disp_access_denied .control-buttons input.btn-success,
				.disp_access_requires_login .control-buttons input.btn-success, .disp_access_requires_login .control-buttons a.btn-primary:hover,
				.disp_threads.detail_msgform main .comment-form .btn-info, .disp_threads.detail_msgform main .comment-form .btn-primary:hover,
				.widget_core_org_members a.user_link:hover,
				.widget_core_coll_subscription .btn:hover
				{ color: ' . $links_color . " }\n";
            $custom_css .= '
				.widget_core_coll_category_list ul li a:hover,
				.evo_post__categories a:hover,
				.evo_post__full .evo_post__full_text .evo_post_more_link a,
				#submit_preview_buttons_wrapper .preview:hover,
				.results .fieldset_title .action_icon:hover,
				.filter-submit:hover, .form_add_contacts .SaveButton,
				.disp_login .control-buttons input.btn-success:hover, .disp_login .control-buttons a.btn-primary,
				.disp_lostpassword .control-buttons input.btn-primary,
				.disp_register .control-buttons input.btn-primary,
				.disp_user .profile_content .profile_column_left .profile_buttons a button.btn:hover,
				.disp_threads.detail_msgform main .comment-form input.submit,
				.disp_access_requires_login .control-buttons input.btn-success:hover, .disp_access_requires_login .control-buttons a.btn-primary,
				.disp_threads.detail_msgform main .comment-form .btn-info:hover, .disp_threads.detail_msgform main .comment-form .btn-primary
				{ border: 1px solid ' . $links_color . " }\n";
            $custom_css .= '
				div.compact_search_form .search_submit,
				.extra-section-btn-wrapper a:hover,
				.navbar-nav.evo_container__menu .ufld_icon_links:hover:before,
				.evo_post__full .evo_post__full_text .evo_post_more_link a:hover,
				.pagination>.active>a, .pagination>.active>a:hover,	.pagination>li>a:hover,	.pagination>.active>span, .pagination>.active>span:hover,
				.back-to-top,
				#submit_preview_buttons_wrapper .submit,
				.evo_comment__meta_info .badge-meta,
				.results .fieldset_title .action_icon:hover,
				.filter-submit:hover,
				.form_add_contacts .SaveButton, .disp_contacts .filter-submit:hover,
				.disp_login .control-buttons a.btn-primary,
				.disp_lostpassword .control-buttons input.btn-primary,
				.disp_access_requires_login .control-buttons a.btn-primary,
				.disp_register .control-buttons input.btn-primary,
				.search_result_score,
				.disp_user .profile_content .profile_column_left .profile_buttons a button.btn:hover,
				.disp_threads.detail_msgform main .comment-form input.submit,
				.header-social-toggle .ufld_icon_links:hover:before,
				.disp_threads.detail_msgform main .comment-form .btn-primary,
				.widget_core_coll_subscription .btn,
				.disp_msgform main .comment-form input.submit
				{ background-color: ' . $links_color . " }\n";
            $custom_css .= '
				div.compact_search_form .search_submit,
				.extra-section-btn-wrapper a,
				p.tag_cloud a:hover,
				.pagination>.active>span, .pagination>.active>span:hover,
				.pagination>.active>a,
				.pagination>li>a:hover,
				#submit_preview_buttons_wrapper .submit,
				.form_add_contacts .SaveButton,
				div.controls input:focus, div.form-control input:focus, textarea.form-control:focus, #login_form input:focus:invalid:focus, #login_form select:focus:invalid:focus, #login_form textarea:focus:invalid:focus,
				.widget_core_coll_subscription .btn
				{ border-color: ' . $links_color . " }\n";
            $custom_css .= '.evo_featured_post { border-left: 5px solid ' . $links_color . " }\n";
            // Fix for Gender colors settings
            if ($this->get_setting('gender_colored') == true) {
                $custom_css .= '.container.main-page-content a.user.man { color: #00F' . " }\n";
                $custom_css .= '.container.main-page-content a.user.woman { color: #e100af' . " }\n";
            }
        }
        if ($site_bg_color = $this->get_setting('site_bg_color')) {
            $custom_css .= '
				.disp_contacts .filter-submit,
				.disp_login .control-buttons input.btn-success, .disp_login .control-buttons a.btn-primary:hover,
				.disp_lostpassword .control-buttons input.btn-primary:hover,
				.disp_access_requires_login .control-buttons input.btn-success, .disp_access_requires_login .control-buttons a.btn-primary:hover,
				.disp_register .control-buttons input.btn-primary:hover,
				.disp_msgform main .comment-form input.submit:hover,
				.navbar-header .ufld_icon_links a, .navbar-nav .ufld_icon_links a,
				.disp_threads.detail_msgform main .comment-form .btn-primary:hover, .disp_threads.detail_msgform main .comment-form .btn-info,
				.widget_core_coll_subscription .btn:hover
				{ background-color: ' . $site_bg_color . " }\n";
            $custom_css .= '
				.extra-section-btn-wrapper a:hover,
				.evo_post__full .evo_post__full_text .evo_post_more_link a:hover,
				.pagination>li>a:hover, .pagination>.active>a, .pagination>.active>a:hover,
				.back-to-top, .back-to-top:hover, .back-to-top:active, .back-to-top:focus, .back-to-top:visited,
				.results .fieldset_title .action_icon:hover, .filter-submit:hover,
				.form_add_contacts .SaveButton,
				.disp_login .control-buttons a.btn-primary,
				.disp_lostpassword .control-buttons input.btn-primary,
				.disp_register .control-buttons input.btn-primary,
				.disp_access_requires_login .control-buttons a.btn-primary,
				.search_result_score,
				.disp_user .profile_content .profile_column_left .profile_buttons a button.btn:hover,
				.disp_msgform main .comment-form input.submit,
				#submit_preview_buttons_wrapper .submit
				{ color: ' . $site_bg_color . " }\n";
        }
        if ($site_borders = $this->get_setting('site_borders')) {
            $custom_css .= '
				nav.navbar,
				.evo_widget h3, .evo_widget h4.panel-title,
				.widget_core_coll_post_list ul li,
				.widget_core_coll_comment_list ul li,
				.widget_core_coll_featured_posts ul li,
				.widget_core_coll_page_list ul li,
				.widget_core_coll_related_post_list ul li,
				.widget_core_coll_item_list ul li, .widget_core_coll_item_list ul li ul li,
				.widget_core_coll_xml_feeds ul li, .widget_core_coll_xml_feeds div.notes,
				.widget_core_content_hierarchy ul li,
				.compact_search_form input.search_field,
				.widget_plugin_evo_Arch ul li, .arcdir_list_wrapper ul li,
				.disp_user .profile_content .profile_column_right fieldset.fieldset legend.panel-title
				{ border-bottom: 1px solid ' . $site_borders . " }\n";
            $custom_css .= 'nav.navbar div.ufld_icon_links a,
				.navbar-nav.evo_container__menu .ufld_icon_links:before,
				.header-search-toggle,
				.navbar-toggle-hamb,
				.header-social-toggle .ufld_icon_links:before
				{ border-left: 1px solid ' . $site_borders . " }\n";
            $custom_css .= '
				.widget_core_coll_category_list ul li a,
				.evo_post header .categories-icon, .evo_featured_post .categories-icon,
				.evo_post__categories a,
				#bCalendarToday,
				p.tag_cloud a,
				.pagination>li>a,
				#submit_preview_buttons_wrapper .preview,
				.evo_comment,
				.special_pager_layout li a,
				.results .fieldset_title .action_icon,
				.filter-submit,
				.disp_login .control-buttons input.btn-success
				{ border: 1px solid ' . $site_borders . " }\n";
            $custom_css .= '
				.widget_plugin_evo_Calr .bCalendarTable th,
				.widget_plugin_evo_Calr .bCalendarTable td,
				.navbar-nav.evo_container__menu .ufld_icon_links a.drop-down-social, .header-social-toggle a
				{ border-right: 1px solid ' . $site_borders . '; border-bottom: 1px solid ' . $site_borders . " }\n";
            $custom_css .= '.widget_plugin_evo_Calr .bCalendarTable { border-left: 1px solid ' . $site_borders . '; border-top: 1px solid ' . $site_borders . " }\n";
            $custom_css .= '#bCalendarToday,
				.special_pager_layout li a:hover,
				.results .fieldset_title .action_icon,
				.filter-submit,
				.disp_user .profile_content .profile_column_left .profile_buttons a button.btn,
				.disp_single .evo_comment__meta_info a:hover
				{ background-color: ' . $site_borders . " }\n";
            $custom_css .= 'blockquote,
				.disp_user .profile_content .profile_column_left .profile_buttons a button.btn,
				.disp_usercomments .results table.table th, .disp_useritems .results table.table th,
				.disp_single .evo_comment__meta_info a,
				.disp_access_requires_login .control-buttons input.btn-success,
				.disp_threads.detail_msgform main .comment-form .btn-info
				{ border-color: ' . $site_borders . " }\n";
            $custom_css .= '.evo_comment_avatar img { border: 3px solid ' . $site_borders . " }\n";
            $custom_css .= '.comment-form--title { border-top: 3px solid ' . $site_borders . " }\n";
            $custom_css .= '.disp_search .widget_core_coll_search_form .extended_search_form .search_field { border-bottom: 2px solid ' . $site_borders . " }\n";
            $custom_css .= '.disp_msgform main .comment-form input.submit { border-color: ' . $links_color . " }\n";
        }
        /**
         * ============================================================================
         * Menu Customization
         * ============================================================================
         */
        if ($menu_bg_color = $this->get_setting('menu_bg_color')) {
            $custom_css .= '.collapse.navbar-collapse,
				.header-main-search-field .search_field,
				.ufld_icon_links a.drop-down-social,
				.navbar,
				.navbar-nav.evo_container__menu .ufld_icon_links a
				{ background-color: ' . $menu_bg_color . " }\n";
        }
        if ($menu_a_color = $this->get_setting('menu_a_color')) {
            $custom_css .= '.evo_container__menu li a, .navbar-nav.evo_container__menu .ufld_icon_links a, .navbar-header .ufld_icon_links a { color: ' . $menu_a_color . " }\n";
            $custom_css .= '.navbar-header span.icon-bar { background-color: ' . $menu_a_color . " }\n";
        }
        if ($nav_social = $this->get_setting('nav_social') == true) {
            $custom_css .= '.menu-social-toggle { position: absolute ' . " }\n";
            if ($nav_search = $this->get_setting('nav_search') == true) {
                $custom_css .= '.menu-social-toggle { right: 54px ' . " }\n";
            } else {
                $custom_css .= '.menu-social-toggle { right: 0 ' . " }\n";
            }
        }
        if ($nav_hamb_menu = $this->get_setting('nav_hamb_menu')) {
            $custom_css .= '@media (max-width: ' . $nav_hamb_menu . "px) {\n\t\t\t\t   .navbar-header {float: none;}.navbar-left,.navbar-right {float: none !important;}.navbar-toggle {display: block;}.navbar-collapse {border-top: 1px solid transparent;box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);}.navbar-fixed-top {top: 0;border-width: 0 0 1px;}.navbar-collapse.collapse {display: none!important}.navbar-nav {float: none!important;margin-top: 7.5px;overflow: hidden;}.navbar-nav>li {float: none;margin-left: 15px;}.navbar-nav>li>a {padding-top: 10px;padding-bottom: 10px;}.collapse.in{display:block !important;}.evo_container__menu .header-search-toggle{display: none}.header-search-toggle{position: relative !important}.menu-social-toggle{display: none}.navbar-collapse{border-top: 1px solid " . $site_borders . "}.navbar-nav.evo_container__menu li:last-child{margin-bottom: 17px;}\n\t\t\t\t}\n";
        }
        /**
         * ============================================================================
         * Single page `
         * ============================================================================
         */
        if ($cover_text = $this->get_setting('cover_text')) {
            $custom_css .= '.spec_cover_image__header { color: ' . $cover_text . " }\n";
            $custom_css .= '.spec_cover_image__header .evo_post__categories a:hover { border: 1px solid ' . $cover_text . " }\n";
        }
        if ($cover_links = $this->get_setting('cover_links')) {
            $custom_css .= '.spec_cover_image__header a { color: ' . $cover_links . " }\n";
        }
        if ($cover_borders = $this->get_setting('cover_borders')) {
            $custom_css .= '
				.spec_cover_image__header .evo_post__categories a,
				.spec_cover_image__header .evo_post__categories .categories-icon
				{ border: 1px solid ' . $cover_borders . " }\n";
        }
        /**
         * ============================================================================
         * Special sitewide footer layout
         * ============================================================================
         */
        if ($this->get_setting('spec_sw_footer') == true) {
            // if special sitewide footer layout is enabled
            $custom_css .= 'footer.sitewide_footer { font-size: 14px; letter-spacing: 0.3px; font-family: "Droid Serif", serif; padding: 10px 0; border: none; box-shadow: none; ' . " }\n";
            if ($sp_sw_f_bg_col = $this->get_setting('sp_sw_f_bg_col')) {
                $custom_css .= 'footer.sitewide_footer { background-color: ' . $sp_sw_f_bg_col . " }\n";
            }
            if ($sp_sw_f_col = $this->get_setting('sp_sw_f_col')) {
                $custom_css .= 'footer.sitewide_footer, footer.sitewide_footer a, footer.sitewide_footer a:hover { color: ' . $sp_sw_f_col . " }\n";
            }
        }
        /**
         * ============================================================================
         * Sidebar widgets margin-top
         * ============================================================================
         */
        if ($this->get_setting('sidebar2_single') == false) {
            // if Sidebar2 is NOT reserved for disp=single only, then:
            $custom_css .= '.evo_container__sidebar .evo_widget:nth-child(1) div > h4 { margin-top: 0 !important;' . " }\n";
        } else {
            $custom_css .= '.evo_container__sidebar .evo_widget:nth-child(1) div > h4, .evo_container__sidebar2 .evo_widget:nth-child(1) div > h4 { margin-top: 0 !important;' . " }\n";
        }
        /**
         * ============================================================================
         * Positioned at the end of the file because of the hover style - preventing 
         * wrong style on non-hover color customization
         * ============================================================================
         */
        if ($links_color = $this->get_setting('links_color')) {
            $custom_css .= '#submit_preview_buttons_wrapper .submit:hover { color: ' . $links_color . " !important }\n";
        }
        if (!empty($custom_css)) {
            // Function for custom_css:
            $custom_css = '<style type="text/css">
<!--
' . $custom_css . '
-->
		</style>';
            add_headline($custom_css);
        }
    }
Beispiel #10
0
    // will have exited
}
if (!$current_User->check_perm('perm_messaging', 'reply')) {
    // Redirect to the blog url for users without messaging permission
    $Messages->add('You are not allowed to view Messages!');
    header_redirect($Blog->gen_blogurl(), 302);
    // will have exited
}
$action = param('action', 'string', 'view');
if ($action == 'new' && check_create_thread_limit(true)) {
    // don't allow to create new thread, because the new thread limit was already reached
    set_param('action', 'view');
}
// var bgxy_expand is used by toggle_filter_area() and toggle_clickopen()
// var htsrv_url is used for AJAX callbacks
add_js_headline("// Paths used by JS functions:\r\n\t\tvar bgxy_expand = '" . get_icon('expand', 'xy') . "';\r\n\t\tvar bgxy_collapse = '" . get_icon('collapse', 'xy') . "';");
// Require results.css to display thread query results in a table
require_css('results.css');
// Results/tables styles
// Load classes
load_class('messaging/model/_thread.class.php', 'Thread');
load_class('messaging/model/_message.class.php', 'Message');
// Get action parameter from request:
$action = param_action('view');
switch ($action) {
    case 'new':
        // Check permission:
        $current_User->check_perm('perm_messaging', 'reply', true);
        $edited_Thread = new Thread();
        $edited_Message = new Message();
        $edited_Message->Thread =& $edited_Thread;
    /**
     * @see Plugin::SkinBeginHtmlHead()
     */
    function SkinBeginHtmlHead(&$params)
    {
        global $Blog;
        $relative_to = is_admin_page() ? 'rsc_url' : 'blog';
        require_css('#mediaelement_css#', $relative_to);
        require_js('#jquery#', 'blog');
        require_js('#mediaelement#', $relative_to);
        $this->require_skin();
        // Set a video size in css style, because option setting cannot sets correct size
        $width = intval($this->get_coll_setting('width', $Blog));
        $width = empty($width) ? '100%' : $width . 'px';
        $height = intval($this->get_coll_setting('height', $Blog));
        add_css_headline('video.html5_mediaelementjs_video{ width: ' . $width . ' !important; height: ' . $height . 'px !important; display: block; margin: auto; }
.mediajs_block {
	margin: 0 auto 1em;
}
.mediajs_block .mediajs_text {
	font-size: 84%;
	text-align: center;
	margin: 4px 0;
}');
        // Initialize a player
        add_js_headline(($width == "100%" ? '' : 'var html5_mediaelementjs_video_width = parseInt( "' . $width . '" );
			if( jQuery( window ).width() < html5_mediaelementjs_video_width )
			{
				html5_mediaelementjs_video_width = jQuery( window ).width();
			}') . '
			jQuery( document ).ready( function() {
				jQuery( "video.html5_mediaelementjs_video" ).mediaelementplayer( {
					defaultVideoWidth: ' . ($width == "100%" ? '"100%"' : 'html5_mediaelementjs_video_width') . ',
					defaultVideoHeight: "' . $height . '",
					videoWidth: ' . ($width == "100%" ? '"100%"' : 'html5_mediaelementjs_video_width') . ',
					videoHeight: "' . $height . '",
				} );
			} );');
        /**
        		 * Plugin options:
        
        			// if the <video width> is not specified, this is the default
        			defaultVideoWidth: 480,
        			// if the <video height> is not specified, this is the default
        			defaultVideoHeight: 270,
        			// if set, overrides <video width>
        			videoWidth: -1,
        			// if set, overrides <video height>
        			videoHeight: -1,
        			// width of audio player
        			audioWidth: 400,
        			// height of audio player
        			audioHeight: 30,
        			// initial volume when the player starts
        			startVolume: 0.8,
        			// useful for <audio> player loops
        			loop: false,
        			// enables Flash and Silverlight to resize to content size
        			enableAutosize: true,
        			// the order of controls you want on the control bar (and other plugins below)
        			features: ['playpause','progress','current','duration','tracks','volume','fullscreen'],
        			// Hide controls when playing and mouse is not over the video
        			alwaysShowControls: false,
        			// force iPad's native controls
        			iPadUseNativeControls: false,
        			// force iPhone's native controls
        			iPhoneUseNativeControls: false,
        			// force Android's native controls
        			AndroidUseNativeControls: false,
        			// forces the hour marker (##:00:00)
        			alwaysShowHours: false,
        			// show framecount in timecode (##:00:00:00)
        			showTimecodeFrameCount: false,
        			// used when showTimecodeFrameCount is set to true
        			framesPerSecond: 25,
        			// turns keyboard support on and off for this instance
        			enableKeyboard: true,
        			// when this player starts, it will pause other players
        			pauseOtherPlayers: true,
        			// array of keyboard commands
        			keyActions: []
        */
    }
Beispiel #12
0
function init_field_editor_js($params = array())
{
    // Make sure we are not missing any param:
    $params = array_merge(array('field_prefix' => 'order-', 'action_url' => '', 'question' => TS_("Do you want discard your changes for this order field?"), 'relative_to' => 'rsc_url'), $params);
    require_js('#jquery#', $params['relative_to']);
    // dependency
    add_js_headline('jQuery( document ).on( "click", "[id^=' . $params['field_prefix'] . ']", function()
{
	if( jQuery( this ).find( "input" ).length > 0 )
	{ // This order field is already editing now
		return false;
	}

	// Get current value and wrapper if value is stored in <span>:
	var value = jQuery( this ).html();
	var wrapper = false;
	if( jQuery( this ).find( "span" ).length > 0 )
	{
		wrapper = jQuery( this ).find( "span" );
		value = wrapper.html();
	}

	// Create <input> to edit order field
	var input = document.createElement( "input" )
	var $input = jQuery( input );
	$input.val( value );
	$input.css( {
		width: jQuery( this ).width(),
		height: jQuery( this ).height(),
		"line-height": jQuery( this ).height() + "px",
		padding: "0",
		"text-align": "center",
		"vertical-align": "bottom",
	} );

	// Save current value
	jQuery( this ).attr( "rel", value );

	// Replace static value with <input>:
	if( wrapper === false )
	{
		jQuery( this ).html( "" );
	}
	else
	{
		wrapper.hide();
	}
	jQuery( this ).append( $input );
	$input.focus();

	// Bind events for <input>
	$input.bind( "keydown", function( e )
	{
		var key = e.keyCode;
		var parent_obj = jQuery( this ).parent();
		if( key == 27 )
		{ // "Esc" key
			if( wrapper === false )
			{
				parent_obj.html( parent_obj.attr( "rel" ) );
			}
			else
			{
				parent_obj.find( "input" ).remove();
				wrapper.show();
			}
		}
		else if( key == 13 )
		{ // "Enter" key
			results_ajax_load( jQuery( this ), "' . $params['action_url'] . '" + parent_obj.attr( "id" ) + "&new_value=" + jQuery( this ).val() );
		}
	} );

	$input.bind( "blur", function()
	{
		var revert_changes = false;

		var parent_obj = jQuery( this ).parent();
		if( parent_obj.attr( "rel" ) != jQuery( this ).val() )
		{ // Value was changed, ask about saving
			if( confirm( "' . $params['question'] . '" ) )
			{
				revert_changes = true;
			}
		}
		else
		{
			revert_changes = true;
		}

		if( revert_changes )
		{ // Revert the changed value
			if( wrapper === false )
			{
				parent_obj.html( parent_obj.attr( "rel" ) );
			}
			else
			{
				parent_obj.find( "input" ).remove();
				wrapper.show();
			}
		}
	} );

	return false;
} );');
}
 /**
  * @see Plugin::SkinBeginHtmlHead()
  */
 function SkinBeginHtmlHead(&$params)
 {
     require_js($this->get_plugin_url(true) . 'flowplayer.min.js', 'relative');
     require_js($this->get_plugin_url(true) . 'flowplayer_init.js', 'relative');
     add_js_headline('flowplayer_url = "' . $this->get_plugin_url(true) . '";');
 }
Beispiel #14
0
     * Display page header, menus & messages:
     */
    $AdminUI->set_coll_list_params('blog_properties', 'edit', array('ctrl' => 'widgets'), T_('All'), '?ctrl=collections&amp;blog=0');
    $AdminUI->set_path('blogs', 'widgets');
    // load the js and css required to make the magic work
    add_js_headline('
	/**
	 * @internal T_ array of translation strings required by the UI
	 */
	var T_arr = new Array();
	T_arr["Changes pending"] = \'' . TS_('Changes pending') . '\';
	T_arr["Saving changes"] = \'' . TS_('Saving changes') . '\';
	T_arr["Widget order unchanged"] = \'' . TS_('Widget order unchanged') . '\';
	T_arr["Update cancelled"] = \'' . TS_('Update cancelled') . '\';
	T_arr["Update Paused"] = \'' . TS_('Update Paused') . '\';

	/**
	 * Image tags for the JavaScript widget UI.
	 *
	 * @internal Tblue> We get the whole img tags here (easier).
	 */
	var enabled_icon_tag = \'' . get_icon('enabled', 'imgtag', array('title' => T_('The widget is enabled.'))) . '\';
	var disabled_icon_tag = \'' . get_icon('disabled', 'imgtag', array('title' => T_('The widget is disabled.'))) . '\';
	var activate_icon_tag = \'' . get_icon('activate', 'imgtag', array('title' => T_('Enable this widget!'))) . '\';
	var deactivate_icon_tag = \'' . get_icon('deactivate', 'imgtag', array('title' => T_('Disable this widget!'))) . '\';

	var b2evo_dispatcher_url = "' . $admin_url . '";');
    require_js('#jqueryUI#');
    // auto requires jQuery
    require_js('communication.js');
    // auto requires jQuery
    require_js('blog_widgets.js');
    /**
     * Include JS/CSS files in HTML head
     *
     * @param boolean|string Is the file's path relative to the base path/url?
     */
    function init_html_head($relative_to)
    {
        global $Blog;
        if (!isset($Blog) || $this->get_coll_setting('coll_apply_rendering', $Blog) == 'never' && $this->get_coll_setting('coll_apply_comment_rendering', $Blog) == 'never') {
            // Don't load css/js files when plugin is not enabled
            return;
        }
        require_css($this->get_plugin_url(true) . 'infodots.css', $relative_to);
        // Bubbletip
        require_js('#jquery#', $relative_to);
        require_js('jquery/jquery.bubbletip.min.js', $relative_to);
        require_css('jquery/jquery.bubbletip.css', $relative_to);
        add_js_headline('jQuery( document ).ready( function()
{
	jQuery( ".infodots_dot" ).each( function()
	{ // Check what dot we can show on the page
		if( jQuery( "#" + jQuery( this ).attr( "rel" ) ).length )
		{ // Display dot if a content exists
			jQuery( this ).show();
		}
		else
		{ // Remove dot from the page, probably this dot appears after <more> separator
			jQuery( this ).remove();
		}
	} );

	jQuery( ".infodots_dot" ).mouseover( function()
	{
		var tooltip_obj = jQuery( "#" + jQuery( this ).attr( "rel" ) );
		if( tooltip_obj.length )
		{ // Init bubbletip for point once
			if( typeof( infodots_bubbletip_wrapperContainer ) == "undefined" ||
			    jQuery( infodots_bubbletip_wrapperContainer ).length == 0 )
			{ // Check for correct container
				infodots_bubbletip_wrapperContainer = "body";
			}

			jQuery( this ).bubbletip( tooltip_obj,
			{
				showOnInit: true,
				deltaShift: -5,
				wrapperContainer: infodots_bubbletip_wrapperContainer,
			} );
		}
		jQuery( this ).addClass( "hovered" );
	} )
	.bind( "click", function()
	{ // Duplicate this event for "touch" devices
		jQuery( this ).mouseover();
	} );
} );');
    }
	<?php 
skin_keywords_tag();
?>
	<?php 
skin_opengraph_tags();
?>
	<?php 
robots_tag();
?>
	<?php 
$js_blog_id = "";
if (!empty($Blog)) {
    // Set global js var "blog_id"
    $js_blog_id = "\r\n\t\tvar blog_id = '" . $Blog->ID . "';";
}
add_js_headline("// Paths used by JS functions:\n\t\tvar htsrv_url = '" . get_htsrv_url() . "';\n\t\tvar restapi_url = '" . get_restapi_url() . "';" . $js_blog_id);
?>
	<meta name="generator" content="b2evolution <?php 
app_version();
?>
" /> <!-- Please leave this for stats -->
	<?php 
if ($Blog->get_setting('feed_content') != 'none') {
    // auto-discovery urls
    ?>
	<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php 
    $Blog->disp('rss2_url', 'raw');
    ?>
" />
	<link rel="alternate" type="application/atom+xml" title="Atom" href="<?php 
    $Blog->disp('atom_url', 'raw');
Beispiel #17
0
    // We should activate toolbar menu items for this controller and mode
    $activate_collection_toolbar = true;
    // load the js and css required to make the magic work
    add_js_headline('
	/**
	 * @internal T_ array of translation strings required by the UI
	 */
	var T_arr = new Array();
	T_arr["Changes pending"] = \'' . TS_('Changes pending') . '\';
	T_arr["Saving changes"] = \'' . TS_('Saving changes') . '\';
	T_arr["Widget order unchanged"] = \'' . TS_('Widget order unchanged') . '\';
	T_arr["Update cancelled"] = \'' . TS_('Update cancelled') . '\';
	T_arr["Update Paused"] = \'' . TS_('Update Paused') . '\';

	/**
	 * Image tags for the JavaScript widget UI.
	 *
	 * @internal Tblue> We get the whole img tags here (easier).
	 */
	var enabled_icon_tag = \'' . get_icon('bullet_green', 'imgtag', array('title' => T_('The widget is enabled.'))) . '\';
	var disabled_icon_tag = \'' . get_icon('bullet_empty_grey', 'imgtag', array('title' => T_('The widget is disabled.'))) . '\';
	var activate_icon_tag = \'' . get_icon('activate', 'imgtag', array('title' => T_('Enable this widget!'))) . '\';
	var deactivate_icon_tag = \'' . get_icon('deactivate', 'imgtag', array('title' => T_('Disable this widget!'))) . '\';
	var cache_enabled_icon_tag = \'' . get_icon('block_cache_on', 'imgtag', array('title' => T_('Caching is enabled. Click to disable.'))) . '\';
	var cache_disabled_icon_tag = \'' . get_icon('block_cache_off', 'imgtag', array('title' => T_('Caching is disabled. Click to enable.'))) . '\';
	var cache_disallowed_icon_tag = \'' . get_icon('block_cache_disabled', 'imgtag', array('title' => T_('This widget cannot be cached.'))) . '\';
	var cache_denied_icon_tag = \'' . get_icon('block_cache_denied', 'imgtag', array('title' => T_('This widget could be cached but the block cache is OFF. Click to enable.'))) . '\';

	var b2evo_dispatcher_url = "' . $admin_url . '";');
    require_js('#jqueryUI#');
    // auto requires jQuery
    require_js('communication.js');
Beispiel #18
0
/**
 * Registers headlines required to autocomplete the user logins
 *
 * @param string alias, url or filename (relative to rsc/css, rsc/js) for JS/CSS files
 */
function init_autocomplete_login_js($relative_to = 'rsc_url')
{
    require_js('#jquery#', $relative_to);
    // dependency
    // Use hintbox plugin of jQuery
    // Add jQuery hintbox (autocompletion).
    // Form 'username' field requires the following JS and CSS.
    // fp> TODO: think about a way to bundle this with other JS on the page -- maybe always load hintbox in the backoffice
    //     dh> Handle it via http://www.appelsiini.net/projects/lazyload ?
    // dh> TODO: should probably also get ported to use jquery.ui.autocomplete (or its successor)
    require_css('jquery/jquery.hintbox.css', $relative_to);
    require_js('jquery/jquery.hintbox.min.js', $relative_to);
    add_js_headline('jQuery( document ).ready( function()
	{
		jQuery( "input.autocomplete_login" ).hintbox(
		{
			url: "' . get_secure_htsrv_url() . 'async.php?action=get_login_list",
			matchHint: true,
			autoDimentions: true
		} );
	} );');
}
    /**
     * Get ready for displaying the skin.
     *
     * This may register some CSS or JS...
     */
    function display_init()
    {
        global $Messages, $debug, $disp;
        // Request some common features that the parent function (Skin::display_init()) knows how to provide:
        parent::display_init(array('jquery', 'font_awesome', 'bootstrap', 'bootstrap_evo_css', 'bootstrap_messages', 'style_css', 'colorbox', 'bootstrap_init_tooltips', 'disp_auto'));
        //Include script and styles for Sticky Menu
        require_js('assets/js/jquery.sticky.js', 'relative');
        if ($disp == 'mediadix' || $this->get_setting('layout_posts') == 'masonry') {
            require_js('assets/js/masonry.pkgd.min.js', 'relative');
            require_js('assets/js/imagesloaded.pkgd.min.js', 'relative');
        }
        // Include Masonry Grind for MediaIdx
        if ($disp == 'mediaidx') {
            add_js_headline("\n\t\t\t\tjQuery( document ).ready( function(\$) {\n\t\t\t\t\t\$('.evo_image_index').imagesLoaded().done( function( instance ) {\n\t\t\t\t\t\t\$('.evo_image_index').masonry({\n\t\t\t\t\t\t\t// options\n\t\t\t\t\t\t\titemSelector: '.grid-item',\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t");
        }
        require_js('assets/js/scripts.js', 'relative');
        // Skin specific initializations:
        // Add Custome CSS
        $custom_css = '';
        /**
         * ============================================================================
         * This is Title
         * ============================================================================
         */
        if ($bg_color = $this->get_setting('background_disp')) {
            $custom_css .= '
			html, body
			{ background-color: ' . $bg_color . ' }
			';
        }
        /**
         * ============================================================================
         * General Settings
         * ============================================================================
         */
        if ($color = $this->get_setting('color_schemes')) {
            // Disp Posts
            $custom_css .= '
			a, a:hover, a:focus, a:active,
			#main-header .primary-nav .nav a:hover, #main-header .primary-nav .nav a:active, #main-header .primary-nav .nav a:focus,
			#main-header .primary-nav .nav > li.active a,
			#main-content .evo_post_title h1 a:hover, #mini-blog .evo_post_title h1 a:hover, #main-content .evo_post_title h2 a:hover, #mini-blog .evo_post_title h2 a:hover, #main-content .evo_post_title h3 a:hover, #mini-blog .evo_post_title h3 a:hover, #main-content .evo_post_title h1 a:active, #mini-blog .evo_post_title h1 a:active, #main-content .evo_post_title h2 a:active, #mini-blog .evo_post_title h2 a:active, #main-content .evo_post_title h3 a:active, #mini-blog .evo_post_title h3 a:active, #main-content .evo_post_title h1 a:focus, #mini-blog .evo_post_title h1 a:focus, #main-content .evo_post_title h2 a:focus, #mini-blog .evo_post_title h2 a:focus, #main-content .evo_post_title h3 a:focus, #mini-blog .evo_post_title h3 a:focus,
			#main-content .evo_post .small.text-muted a:hover, #mini-blog .evo_post .small.text-muted a:hover, #main-content .evo_post .small.text-muted a .glyphicon:hover, #mini-blog .evo_post .small.text-muted a .glyphicon:hover,
			.pagination li a,

			#main-sidebar .evo_widget a:hover, #main-sidebar .evo_widget a:active, #main-sidebar .evo_widget a:focus,
			#main-sidebar .widget_plugin_evo_Calr .bCalendarTable td a,

			#main-footer .widget_footer .evo_widget a:hover, #main-footer .widget_footer .evo_widget a:active, #main-footer .widget_footer .evo_widget a:focus,
			#main-footer .widget_footer .widget_plugin_evo_Calr .bCalendarTable tbody a, #main-footer .widget_footer .widget_plugin_evo_Calr tfoot a,

			.disp_catdir #main-content .widget_core_coll_category_list a:hover, .disp_catdir #main-content .widget_core_coll_category_list a:active, .disp_catdir #main-content .widget_core_coll_category_list a:focus,
			.disp_arcdir #main-content .widget_plugin_achive a:hover, .disp_arcdir #main-content .widget_plugin_achive a:focus, .disp_arcdir #main-content .widget_plugin_achive a:active,
			.disp_postidx #main-content .widget_core_coll_post_list a:hover, .disp_postidx #main-content .widget_core_coll_post_list a:focus, .disp_postidx #main-content .widget_core_coll_post_list a:active,

			.disp_sitemap .content_sitemap .evo_widget a:hover, .disp_sitemap .content_sitemap .evo_widget a:active, .disp_sitemap .content_sitemap .evo_widget a:focus,

			.disp_posts .evo_featured_post header .small.text-muted a:hover, .disp_posts .evo_featured_post header .small.text-muted a:active, .disp_posts .evo_featured_post header .small.text-muted a:focus,
			.widget_core_coll_comment_list ul li:hover a::after
			{ color: ' . $color . ' }

			#main-header .primary-nav .nav a::after,
			.disp_posts .evo_intro_post,
			.disp_posts #main-content .posts_date,
			.disp_posts #main-content .timeline,
			#main-content .evo_post .evo_image_block a::before, #mini-blog .evo_post .evo_image_block a::before, #main-content .evo_post .evo_post_gallery__image a::before, #mini-blog .evo_post .evo_post_gallery__image a::before,
			#main-content .evo_post .evo_post__full_text .evo_post_more_link a:hover, #mini-blog .evo_post .evo_post__full_text .evo_post_more_link a:hover, #main-content .evo_post .evo_post__excerpt_text .evo_post_more_link a:hover, #mini-blog .evo_post .evo_post__excerpt_text .evo_post_more_link a:hover,
			.pagination .active span, .pagination .active span:hover,
			.pagination li a:hover, .pagination li span:hover, .pagination li a:focus, .pagination li span:focus,
			#main-content .evo_post .evo_post__excerpt_text .evo_post__excerpt_more_link a:hover, #mini-blog .evo_post .evo_post__excerpt_text .evo_post__excerpt_more_link a:hover, #main-content .evo_post .evo_post__excerpt_text .evo_post__excerpt_more_link a:active, #mini-blog .evo_post .evo_post__excerpt_text .evo_post__excerpt_more_link a:active, #main-content .evo_post .evo_post__excerpt_text .evo_post__excerpt_more_link a:focus, #mini-blog .evo_post .evo_post__excerpt_text .evo_post__excerpt_more_link a:focus,

			#main-sidebar .widget_core_coll_search_form .compact_search_form .search_submit,
			#main-sidebar .widget_core_coll_media_index .widget_flow_blocks > div a::before,
			#main-sidebar .widget_core_coll_tag_cloud .tag_cloud a:hover, #main-sidebar .widget_core_coll_tag_cloud .tag_cloud a:active, #main-sidebar .widget_core_coll_tag_cloud .tag_cloud a:focus,
			#main-sidebar .widget_plugin_evo_Calr .bCalendarTable #bCalendarToday,

			#main-footer .widget_footer .widget_core_coll_tag_cloud .tag_cloud a:hover, #main-footer .widget_footer .widget_core_coll_tag_cloud .tag_cloud a:active, #main-footer .widget_footer .widget_core_coll_tag_cloud .tag_cloud a:focus,
			#main-footer .widget_footer .widget_plugin_evo_Calr .bCalendarTable #bCalendarToday,
			.widget_core_coll_search_form .compact_search_form .search_submit,

			.widget_core_coll_media_index .widget_flow_blocks > div a::before,

			.close-menu, .cd-top,

			.disp_tags #main-content .tag_cloud a:hover, .disp_tags #main-content .tag_cloud a:active, .disp_tags #main-content .tag_cloud a:focus,
			.disp_sitemap .content_sitemap .title_widgets::after,

			.posts_mini_layout #mini-blog .msg_nothing,

			.disp_front #main-content .widget_core_coll_featured_intro .jumbotron,
			.disp_posts .evo_featured_post .evo_post__excerpt_text .evo_post__excerpt_more_link a:hover, .disp_posts .evo_featured_post .evo_post__excerpt_text .evo_post__excerpt_more_link a:active, .disp_posts .evo_featured_post .evo_post__excerpt_text .evo_post__excerpt_more_link a:focus,

			#main-content .post_tags a:hover, #mini-blog .post_tags a:hover, #main-content .post_tags a:active, #mini-blog .post_tags a:active, #main-content .post_tags a:focus, #mini-blog .post_tags a:focus,

			.disp_mediaidx #main-mediaidx .widget_core_coll_media_index .evo_image_index li figure.box.title.title_overlay .note,
			.disp_mediaidx #main-mediaidx .widget_core_coll_media_index .evo_image_index .title_overlay .note,

			.disp_posts .evo_featured_post,
			.posts_mini_layout #mini-blog .evo_featured_post .post_tags a:hover,
			.posts_mini_layout #mini-blog .evo_featured_post .evo_post__excerpt_text .evo_post__excerpt_more_link a:hover,

			.pagination>.active>a, .pagination>.active>a:focus, .pagination>.active>a:hover, .pagination>.active>span, .pagination>.active>span:focus, .pagination>.active>span:hover, .evo_form__thread .control-buttons .btn-primary,

			.skin-form .panel-heading, .evo_panel__login .btn.btn-success, .evo_panel__lostpass .btn.btn-success, .evo_panel__register .btn.btn-success, .evo_panel__activation .btn.btn-success,
			.evo_form .submit, .detail_threads .results .panel-heading, .detail_messages .evo_private_messages_list .panel .panel-heading, .detail_messages .evo_private_messages_list .panel .SaveButton.btn-primary, .detail_contacts .results .panel-heading, .detail_contacts .form_send_contacts .btn-default:hover, .detail_contacts .form_send_contacts .btn-default:active, .detail_contacts .form_send_contacts .btn-default:focus, .detail_contacts .form_add_contacts .SaveButton
			{ background-color: ' . $color . '; }

			.pagination .active span, .pagination .active span:hover,
			.pagination li a:hover, .pagination li span:hover, .pagination li a:focus, .pagination li span:focus,
			.posts_mini_layout #mini-blog .pagination li a, .posts_mini_layout #mini-blog .pagination li span,
			#main-content .evo_post .evo_post__excerpt_text .evo_post__excerpt_more_link a:hover, #mini-blog .evo_post .evo_post__excerpt_text .evo_post__excerpt_more_link a:hover, #main-content .evo_post .evo_post__excerpt_text .evo_post__excerpt_more_link a:active, #mini-blog .evo_post .evo_post__excerpt_text .evo_post__excerpt_more_link a:active, #main-content .evo_post .evo_post__excerpt_text .evo_post__excerpt_more_link a:focus, #mini-blog .evo_post .evo_post__excerpt_text .evo_post__excerpt_more_link a:focus,

			#main-sidebar .widget_core_coll_search_form .compact_search_form .search_submit,
			#main-sidebar .widget_core_coll_search_form .compact_search_form .search_field,
			#main-sidebar .widget_core_coll_tag_cloud .tag_cloud a:hover, #main-sidebar .widget_core_coll_tag_cloud .tag_cloud a:active, #main-sidebar .widget_core_coll_tag_cloud .tag_cloud a:focus,

			#main-footer .widget_footer .widget_plugin_evo_Calr .bCalendarTable #bCalendarToday,
			.widget_core_coll_search_form .compact_search_form .search_submit,
			#main-sidebar input[type="email"]:focus, #main-sidebar input[type="number"]:focus, #main-sidebar input[type="password"]:focus, #main-sidebar input[type="tel"]:focus, #main-sidebar input[type="url"]:focus, #main-sidebar input[type="text"]:focus,

			.disp_tags #main-content .tag_cloud a:hover, .disp_tags #main-content .tag_cloud a:active, .disp_tags #main-content .tag_cloud a:focus,

			.disp_posts .evo_featured_post .evo_post__excerpt_text .evo_post__excerpt_more_link a:hover, .disp_posts .evo_featured_post .evo_post__excerpt_text .evo_post__excerpt_more_link a:active, .disp_posts .evo_featured_post .evo_post__excerpt_text .evo_post__excerpt_more_link a:focus,

			#main-content .post_tags a:hover, #mini-blog .post_tags a:hover, #main-content .post_tags a:active, #mini-blog .post_tags a:active, #main-content .post_tags a:focus, #mini-blog .post_tags a:focus,

			.pagination>.active>a, .pagination>.active>a:focus, .pagination>.active>a:hover, .pagination>.active>span, .pagination>.active>span:focus, .pagination>.active>span:hover,
			.skin-form, .evo_panel__login .form_text_input, .evo_panel__lostpass .form_text_input, .evo_panel__register .form_text_input, .evo_panel__activation .form_text_input, .evo_panel__login .btn.btn-success, .evo_panel__lostpass .btn.btn-success, .evo_panel__register .btn.btn-success, .evo_panel__activation .btn.btn-success,
			#login_form input:focus:invalid:focus, #login_form select:focus:invalid:focus, #login_form textarea:focus:invalid:focus,
			.evo_panel__login .form_text_input:focus, .evo_panel__lostpass .form_text_input:focus, .evo_panel__register .form_text_input:focus, .evo_panel__activation .form_text_input:focus,
			.evo_form__thread .control-buttons .btn-primary, .evo_form__thread:hover,

			.evo_form .form_text_input:hover, .evo_form .form_textarea_input:hover, .evo_form .form_text_input:active, .evo_form .form_textarea_input:active, .evo_form .form_text_input:focus, .evo_form .form_textarea_input:focus,
			.evo_form .submit,
			.evo_form__thread .form-control:hover, .evo_form__thread .token-input-list-facebook:hover, .evo_form__thread .form-control:focus, .evo_form__thread .token-input-list-facebook:focus, .evo_form__thread .form-control:active, .evo_form__thread .token-input-list-facebook:active, .detail_threads .results,
			.detail_threads .results .form_text_input:hover, .detail_threads .results .form_text_input:active, .detail_threads .results .form_text_input:focus, .detail_messages .evo_private_messages_list .panel, .detail_messages .evo_private_messages_list .panel .SaveButton.btn-primary, .detail_messages .evo_private_messages_list .results .form_text_input:focus, .detail_messages .evo_private_messages_list .results .form_text_input:hover, .detail_messages .evo_private_messages_list .results .form_text_input:active, .detail_contacts .results, .detail_contacts .results .form_text_input:hover, .detail_contacts .results .form_text_input:active, .detail_contacts .results .form_text_input:focus, .detail_contacts .form_send_contacts .btn-default, .detail_contacts .form_add_contacts .input-sm, .detail_contacts .form_add_contacts .SaveButton
			{ border-color: ' . $color . '; }

			.page_title,
			.disp_sitemap .content_sitemap .title_widgets
			{ border-bottom-color: ' . $color . '; }
			';
            // Disp Single
            $custom_css .= '
			.disp_single #main-content .pager .previous a:hover, .disp_page #main-content .pager .previous a:hover, .disp_single #main-content .pager .next a:hover, .disp_page #main-content .pager .next a:hover, .disp_single #main-content .pager .previous a:active, .disp_page #main-content .pager .previous a:active, .disp_single #main-content .pager .next a:active, .disp_page #main-content .pager .next a:active, .disp_single #main-content .pager .previous a:focus, .disp_page #main-content .pager .previous a:focus, .disp_single #main-content .pager .next a:focus, .disp_page #main-content .pager .next a:focus,
			.disp_single #main-content .evo_post .single_tags a:hover, .disp_page #main-content .evo_post .single_tags a:hover, .disp_single #main-content .evo_post .single_tags a:active, .disp_page #main-content .evo_post .single_tags a:active, .disp_single #main-content .evo_post .single_tags a:focus, .disp_page #main-content .evo_post .single_tags a:focus,
			.disp_single #main-content .evo_post #feedbacks .evo_comment .panel-heading .evo_comment_title a, .disp_page #main-content .evo_post #feedbacks .evo_comment .panel-heading .evo_comment_title a,
			.disp_single #main-content .evo_post .evo_post_comment_notification a:hover, .disp_page #main-content .evo_post .evo_post_comment_notification a:hover, .disp_single #main-content .evo_post .evo_post_comment_notification a:active, .disp_page #main-content .evo_post .evo_post_comment_notification a:active, .disp_single #main-content .evo_post .evo_post_comment_notification a:focus, .disp_page #main-content .evo_post .evo_post_comment_notification a:focus,
			.disp_single #main-content .evo_post .evo_comment .panel-heading .evo_comment_title a, .disp_page #main-content .evo_post .evo_comment .panel-heading .evo_comment_title a, .disp_single #main-content .evo_post .evo_comment__preview .panel-heading .evo_comment_title a, .disp_page #main-content .evo_post .evo_comment__preview .panel-heading .evo_comment_title a
			{ color: ' . $color . '; }

			.disp_single #main-content .evo_post .evo_image_block a::before, .disp_page #main-content .evo_post .evo_image_block a::before, .disp_single #main-content .evo_post .evo_post_gallery__image a::before, .disp_page #main-content .evo_post .evo_post_gallery__image a::before,
			.disp_single #main-content .evo_post #feedbacks .evo_comment__meta_info a:hover, .disp_page #main-content .evo_post #feedbacks .evo_comment__meta_info a:hover, .disp_single #main-content .evo_post #feedbacks .evo_comment__meta_info a:focus, .disp_page #main-content .evo_post #feedbacks .evo_comment__meta_info a:focus, .disp_single #main-content .evo_post #feedbacks .evo_comment__meta_info a:active, .disp_page #main-content .evo_post #feedbacks .evo_comment__meta_info a:active,
			.disp_single #main-content .evo_post .evo_form .submit, .disp_page #main-content .evo_post .evo_form .submit,
			.disp_single #main-content .evo_post .evo_form .submit:hover, .disp_page #main-content .evo_post .evo_form .submit:hover, .disp_single #main-content .evo_post .evo_form .submit:focus, .disp_page #main-content .evo_post .evo_form .submit:focus, .disp_single #main-content .evo_post .evo_form .submit:active, .disp_page #main-content .evo_post .evo_form .submit:active,
			.disp_single #main-content .evo_post #feedbacks .evo_comment .evo_comment_footer .permalink_right, .disp_page #main-content .evo_post #feedbacks .evo_comment .evo_comment_footer .permalink_right,
			.disp_single #main-content .evo_post .evo_post_comment_notification a.btn:hover, .disp_page #main-content .evo_post .evo_post_comment_notification a.btn:hover, .disp_single #main-content .evo_post .evo_post_comment_notification a.btn:active, .disp_page #main-content .evo_post .evo_post_comment_notification a.btn:active, .disp_single #main-content .evo_post .evo_post_comment_notification a.btn:focus, .disp_page #main-content .evo_post .evo_post_comment_notification a.btn:focus, .profile_content .panel .panel-heading,

			.disp_profile .main_content .profile_tabs li.active a, .disp_avatar .main_content .profile_tabs li.active a, .disp_pwdchange .main_content .profile_tabs li.active a, .disp_userprefs .main_content .profile_tabs li.active a, .disp_subs .main_content .profile_tabs li.active a,
			.disp_profile .main_content .profile_tabs li a:hover, .disp_avatar .main_content .profile_tabs li a:hover, .disp_pwdchange .main_content .profile_tabs li a:hover, .disp_userprefs .main_content .profile_tabs li a:hover, .disp_subs .main_content .profile_tabs li a:hover, .disp_profile .main_content .profile_tabs li a:active, .disp_avatar .main_content .profile_tabs li a:active, .disp_pwdchange .main_content .profile_tabs li a:active, .disp_userprefs .main_content .profile_tabs li a:active, .disp_subs .main_content .profile_tabs li a:active, .disp_profile .main_content .profile_tabs li a:focus, .disp_avatar .main_content .profile_tabs li a:focus, .disp_pwdchange .main_content .profile_tabs li a:focus, .disp_userprefs .main_content .profile_tabs li a:focus, .disp_subs .main_content .profile_tabs li a:focus,
			.disp_profile .main_content .panel-heading, .disp_avatar .main_content .panel-heading, .disp_pwdchange .main_content .panel-heading, .disp_userprefs .main_content .panel-heading, .disp_subs .main_content .panel-heading, .disp_profile .main_content .btn-primary, .disp_avatar .main_content .btn-primary, .disp_pwdchange .main_content .btn-primary, .disp_userprefs .main_content .btn-primary, .disp_subs .main_content .btn-primary, .disp_profile .main_content #ffield_edited_user_email .help-inline .btn, .disp_avatar .main_content #ffield_edited_user_email .help-inline .btn, .disp_pwdchange .main_content #ffield_edited_user_email .help-inline .btn, .disp_userprefs .main_content #ffield_edited_user_email .help-inline .btn, .disp_subs .main_content #ffield_edited_user_email .help-inline .btn
			{ background-color: ' . $color . '; }

			.disp_single #main-content .evo_post #feedbacks .evo_comment__meta_info a:hover, .disp_page #main-content .evo_post #feedbacks .evo_comment__meta_info a:hover, .disp_single #main-content .evo_post #feedbacks .evo_comment__meta_info a:focus, .disp_page #main-content .evo_post #feedbacks .evo_comment__meta_info a:focus, .disp_single #main-content .evo_post #feedbacks .evo_comment__meta_info a:active, .disp_page #main-content .evo_post #feedbacks .evo_comment__meta_info a:active,
			.disp_single #main-content .evo_post .evo_form .submit, .disp_page #main-content .evo_post .evo_form .submit,
			.disp_single #main-content .evo_post .evo_form .submit:hover, .disp_page #main-content .evo_post .evo_form .submit:hover, .disp_single #main-content .evo_post .evo_form .submit:focus, .disp_page #main-content .evo_post .evo_form .submit:focus, .disp_single #main-content .evo_post .evo_form .submit:active, .disp_page #main-content .evo_post .evo_form .submit:active,
			.disp_single #main-content .evo_post .evo_form .form_textarea_input:hover, .disp_page #main-content .evo_post .evo_form .form_textarea_input:hover, .disp_single #main-content .evo_post .evo_form .form_textarea_input:focus, .disp_page #main-content .evo_post .evo_form .form_textarea_input:focus, .disp_single #main-content .evo_post .evo_form .form_textarea_input:active, .disp_page #main-content .evo_post .evo_form .form_textarea_input:active,
			.disp_single #main-content .evo_post .evo_post_comment_notification a.btn:hover, .disp_page #main-content .evo_post .evo_post_comment_notification a.btn:hover, .disp_single #main-content .evo_post .evo_post_comment_notification a.btn:active, .disp_page #main-content .evo_post .evo_post_comment_notification a.btn:active, .disp_single #main-content .evo_post .evo_post_comment_notification a.btn:focus, .disp_page #main-content .evo_post .evo_post_comment_notification a.btn:focus,

			.disp_single #main-content .evo_post .evo_form .form_text_input:hover, .disp_page #main-content .evo_post .evo_form .form_text_input:hover, .disp_single #main-content .evo_post .evo_form .form_textarea_input:hover, .disp_page #main-content .evo_post .evo_form .form_textarea_input:hover, .disp_single #main-content .evo_post .evo_form .form_text_input:focus, .disp_page #main-content .evo_post .evo_form .form_text_input:focus, .disp_single #main-content .evo_post .evo_form .form_textarea_input:focus, .disp_page #main-content .evo_post .evo_form .form_textarea_input:focus, .disp_single #main-content .evo_post .evo_form .form_text_input:active, .disp_page #main-content .evo_post .evo_form .form_text_input:active, .disp_single #main-content .evo_post .evo_form .form_textarea_input:active, .disp_page #main-content .evo_post .evo_form .form_textarea_input:active, .profile_content .panel,

			.disp_profile .main_content .profile_tabs li.active a, .disp_avatar .main_content .profile_tabs li.active a, .disp_pwdchange .main_content .profile_tabs li.active a, .disp_userprefs .main_content .profile_tabs li.active a, .disp_subs .main_content .profile_tabs li.active a,
			.disp_profile .main_content .profile_tabs li a:hover, .disp_avatar .main_content .profile_tabs li a:hover, .disp_pwdchange .main_content .profile_tabs li a:hover, .disp_userprefs .main_content .profile_tabs li a:hover, .disp_subs .main_content .profile_tabs li a:hover, .disp_profile .main_content .profile_tabs li a:active, .disp_avatar .main_content .profile_tabs li a:active, .disp_pwdchange .main_content .profile_tabs li a:active, .disp_userprefs .main_content .profile_tabs li a:active, .disp_subs .main_content .profile_tabs li a:active, .disp_profile .main_content .profile_tabs li a:focus, .disp_avatar .main_content .profile_tabs li a:focus, .disp_pwdchange .main_content .profile_tabs li a:focus, .disp_userprefs .main_content .profile_tabs li a:focus, .disp_subs .main_content .profile_tabs li a:focus,
			.disp_profile .main_content .panel, .disp_avatar .main_content .panel, .disp_pwdchange .main_content .panel, .disp_userprefs .main_content .panel, .disp_subs .main_content .panel, .disp_profile .main_content .btn-primary, .disp_avatar .main_content .btn-primary, .disp_pwdchange .main_content .btn-primary, .disp_userprefs .main_content .btn-primary, .disp_subs .main_content .btn-primary, .disp_profile .main_content #ffield_edited_user_email .help-inline .btn, .disp_avatar .main_content #ffield_edited_user_email .help-inline .btn, .disp_pwdchange .main_content #ffield_edited_user_email .help-inline .btn, .disp_userprefs .main_content #ffield_edited_user_email .help-inline .btn, .disp_subs .main_content #ffield_edited_user_email .help-inline .btn
			{ border-color: ' . $color . '; }

			.disp_single #main-content .evo_post > header .cat-links a, .disp_page #main-content .evo_post > header .cat-links a,
			.disp_single #main-content .evo_post .single_tags a, .disp_page #main-content .evo_post .single_tags a,

			.disp_mediaidx #main-mediaidx .title_mediaidx,
			.disp_profile .main_content .profile_tabs, .disp_avatar .main_content .profile_tabs, .disp_pwdchange .main_content .profile_tabs, .disp_userprefs .main_content .profile_tabs, .disp_subs .main_content .profile_tabs
			{ border-bottom-color: ' . $color . '; }

			#main-content .evo_post .evo_post__full_text blockquote, .disp_page #main-content .evo_post .evo_post__full_text blockquote, blockquote
			{ border-left-color: ' . $color . '; }
			';
            // Disp Search
            $custom_css .= '
			.disp_search .search_result .search_content_wrap .search_title a:hover, .disp_search .search_result .search_content_wrap .search_title a:active, .disp_search .search_result .search_content_wrap .search_title a:focus,
			.disp_search .search_result .search_content_wrap .search_info a:hover, .disp_search .search_result .search_content_wrap .search_info a:active, .disp_search .search_result .search_content_wrap .search_info a:focus
			{ color: ' . $color . '; }

			.disp_search .search-box .widget_core_coll_search_form .compact_search_form .search_submit,
			.disp_search .search_result .search_result_score.dimmed,
			.disp_search .widget_core_coll_search_form .compact_search_form .search_submit,
			.disp_search .search_result .search_result_score.dimmed
			{ background-color: ' . $color . '; }

			.disp_search .search-box .widget_core_coll_search_form .compact_search_form .search_field, .disp_search .search-box .widget_core_coll_search_form .compact_search_form .search_submit,
			.disp_search .search-box .widget_core_coll_search_form .compact_search_form .search_field:focus, .disp_search .search-box .widget_core_coll_search_form .compact_search_form .search_field:active,
			.disp_search .widget_core_coll_search_form .compact_search_form .search_field, .disp_search .widget_core_coll_search_form .compact_search_form .search_submit,
			.disp_search .widget_core_coll_search_form .compact_search_form .search_field:focus, .disp_search .widget_core_coll_search_form .compact_search_form .search_field:active
			{ border-color: ' . $color . '; }

			.disp_search .search_result .search_content_wrap .search_info a
			{ border-bottom-color: ' . $color . '; }
			';
            // Disp Front
            $custom_css .= '
			.disp_front .evo_container__front_page_primary .evo_widget a:hover, .disp_front .evo_container__front_page_primary .evo_widget a:active, .disp_front .evo_container__front_page_primary .evo_widget a:focus,
			.disp_front .evo_container__front_page_primary .evo_widget.widget_plugin_evo_Calr .bCalendarTable td a
			{ color: ' . $color . '; }

			.disp_front .evo_container__front_page_primary .evo_widget h3::before,
			.disp_front .evo_container__front_page_primary .evo_widget.widget_core_coll_tag_cloud .tag_cloud a:hover, .disp_front .evo_container__front_page_primary .evo_widget.widget_core_coll_tag_cloud .tag_cloud a:active, .disp_front .evo_container__front_page_primary .evo_widget.widget_core_coll_tag_cloud .tag_cloud a:focus,
			.disp_front .evo_container__front_page_primary .evo_widget.widget_plugin_evo_Calr .bCalendarTable #bCalendarToday
			{ background-color: ' . $color . '; }

			.evo_container__front_page_primary .widget_core_coll_search_form .compact_search_form .search_field,
			.disp_front .evo_container__front_page_primary .evo_widget.widget_core_coll_tag_cloud .tag_cloud a:hover, .disp_front .evo_container__front_page_primary .evo_widget.widget_core_coll_tag_cloud .tag_cloud a:active, .disp_front .evo_container__front_page_primary .evo_widget.widget_core_coll_tag_cloud .tag_cloud a:focus,
			.disp_front .evo_container__front_page_primary .evo_widget.widget_core_user_login .input_text:focus, .disp_front .evo_container__front_page_primary .evo_widget.widget_core_user_register .input_text:focus
			{ border-color: ' . $color . '; }
			';
            // Disp Comments
            $custom_css .= '
			.disp_comments .page_title
			{ border-bottom-color: ' . $color . '; }

			.disp_comments .evo_comment .panel-heading .evo_comment_title a, .disp_comments .evo_comment .panel-heading .panel-title a,
			.disp_comments .evo_comment a
			{ color: ' . $color . '; }

			.disp_comments .evo_comment .evo_comment_info a:hover
			{ background-color: ' . $color . '; }
			';
        }
        /**
         * ============================================================================
         * Color Content
         * ============================================================================
         */
        if ($color = $this->get_setting('color_content')) {
            $custom_css .= '
			#main-content .evo_post_title h1 a, #mini-blog .evo_post_title h1 a, #main-content .evo_post_title h2 a, #mini-blog .evo_post_title h2 a, #main-content .evo_post_title h3 a, #mini-blog .evo_post_title h3 a,
			#main-content .evo_post_title h3 a,
			.evo_post__full_text, .evo_post__full_text a, .evo_post__excerpt_text, .evo_post__excerpt_text a,
			.disp_single #main-content .evo_post #feedbacks .evo_comment .evo_comment_text, .disp_page #main-content .evo_post #feedbacks .evo_comment,
			#main-content .post_tags h3, #mini-blog .post_tags h3, .evo_comment_text, .disp_posts .evo_intro_post a,
			.disp_comments .evo_comment .evo_comment_text,
			.disp_catdir #main-content .widget_core_coll_category_list a,
			.disp_front .evo_container__front_page_primary .evo_widget a,
			.disp_arcdir #main-content .widget_plugin_achive a,

			.evo_post__excerpt_text .evo_post__excerpt_more_link a,
			.disp_comments .evo_comment .panel-heading .evo_comment_title, .disp_comments .evo_comment .panel-heading .panel-title,
			.disp_postidx #main-content .widget_core_coll_post_list a,
			.disp_sitemap .content_sitemap .evo_widget a,

			#main-content .evo_post .evo_post__full_text blockquote, #mini-blog .evo_post .evo_post__full_text blockquote,
			#main-content .evo_post .evo_post__full_text pre, #mini-blog .evo_post .evo_post__full_text pre,
			.disp_single #main-content .evo_post .panel .panel-heading .panel-title, .disp_page #main-content .evo_post .panel .panel-heading .panel-title,
			.evo_comment_text pre, blockquote, .disp_single #main-content .evo_post #feedbacks .evo_comment .evo_comment_footer small, .disp_page #main-content .evo_post #feedbacks .evo_comment .evo_comment_footer small,

			.disp_single #main-content .pager .previous a, .disp_page #main-content .pager .previous a, .disp_single #main-content .pager .next a, .disp_page #main-content .pager .next a, .btn-default,

			.disp_search .search_result .search_content_wrap .search_title,
			.disp_search .search_result .search_content_wrap .search_title a,
			.disp_search .search_result .search_content_wrap .search_info a
			{ color: ' . $color . ' }';
            $custom_css .= 'body, main{ color: ' . $color . ' !important }';
        }
        /**
         * ============================================================================
         * Typograpy
         * ============================================================================
         */
        $font_size = $this->get_setting('typograpy_fz');
        switch ($font_size) {
            case 'normal':
                // When regular layout is chosen, nothing happens, since regular is default
                $custom_css .= 'html, body
			{ font-size: 11.42855px; }

			@media screen and (max-width: 480px) {
				html, body { font-size: 10.5px; }
			}';
                break;
            case 'large':
                $custom_css .= 'html, body
			{ font-size: 12.85715px; }

			@media screen and (max-width: 480px) {
				html, body { font-size: 11px; }
			}';
                break;
        }
        /**
         * ============================================================================
         * Tags Layout
         * ============================================================================
         */
        if ($color = $this->get_setting('tags_color')) {
            $custom_css .= "#main-content .post_tags a, #mini-blog .post_tags a, .widget_core_coll_tag_cloud .tag_cloud a { color: {$color}; }\n";
        }
        if ($bg_color = $this->get_setting('tags_bg_color')) {
            $custom_css .= "#main-content .post_tags a, #mini-blog .post_tags a, .widget_core_coll_tag_cloud .tag_cloud a { background-color: {$bg_color}; }\n";
        }
        if ($bdr_color = $this->get_setting('tags_bdr_color')) {
            $custom_css .= "#main-content .post_tags a, #mini-blog .post_tags a, .widget_core_coll_tag_cloud .tag_cloud a { border-color: {$bdr_color}; }\n";
        }
        /**
         * ============================================================================
         * Special cover image position on intro posts
         * ============================================================================
         */
        /*if( $color = $this->get_setting( 'bgimg_text_color' ) )
        		{	// Custom text color on background image:
        			$custom_css .= '.widget_core_coll_featured_intro div.jumbotron.evo_hasbgimg { color: '.$color." }\n";
        		}
        		if( $color = $this->get_setting( 'bgimg_link_color' ) )
        		{	// Custom link color on background image:
        			$custom_css .= '.widget_core_coll_featured_intro div.jumbotron.evo_hasbgimg a { color: '.$color." }\n";
        		}
        		if( $color = $this->get_setting( 'bgimg_hover_link_color' ) )
        		{	// Custom link hover color on background image:
        			$custom_css .= '.widget_core_coll_featured_intro div.jumbotron.evo_hasbgimg a:hover { color: '.$color." !important }\n";
        		}*/
        /**
         * ============================================================================
         * Header Custom Style
         * ============================================================================
         */
        if ($color = $this->get_setting('header_top_color')) {
            $custom_css .= '#header-top .header-contact-info, #header-top .widget_core_user_links .ufld_icon_links a { color: ' . $color . ';}';
        }
        if ($bg_color = $this->get_setting('header_top_bg')) {
            $custom_css .= '#header-top{ background-color: ' . $bg_color . '; }';
        }
        if ($this->get_setting('header_sticky') == 0) {
            $custom_css .= '#main-header{ position: relative !important;} body.loggedin #main-header{ top: 0 !important; }';
        }
        if ($color = $this->get_setting('site_tite_color')) {
            $custom_css .= '#main-header .widget_core_coll_title h1 a, #main-header .widget_core_coll_logo h1 a,
         .page_title
         { color: ' . $color . ' }
         ';
        }
        if ($color = $this->get_setting('menu_link_color')) {
            $custom_css .= '#main-header .primary-nav .nav a { color: ' . $color . ';}';
        }
        if ($bg_color = $this->get_setting('main_header_bg')) {
            $custom_css .= '#main-header{ background-color: ' . $bg_color . '; }';
        }
        /**
         * ============================================================================
         * Posts Custome Style
         * ============================================================================
         */
        if ($bg_color = $this->get_setting('regular_post_bg')) {
            $custom_css .= '
         .post_regular,
         .post_regular #main-sidebar .widget_plugin_evo_Calr .bCalendarTable caption a
         { background-color: ' . $bg_color . '; }
         ';
        }
        if ($bg_color = $this->get_setting('mini_blog_bg')) {
            $custom_css .= '.posts_mini_layout{ background-color: ' . $bg_color . '; }';
        }
        if ($color = $this->get_setting('post_info_color')) {
            $custom_css .= '#main-content .evo_post .small.text-muted, #mini-blog .evo_post .small.text-muted
         { color: ' . $color . ' };
         ';
        }
        if ($color = $this->get_setting('post_info_link')) {
            $custom_css .= '.disp_single #main-content .evo_post > header .cat-links a, .disp_page #main-content .evo_post > header .cat-links a
         { color: ' . $color . ' }
         ';
        }
        /**
         * ============================================================================
         * Single and Page Disp Custom Style
         * ============================================================================
         */
        if ($bg_color = $this->get_setting('single_bg')) {
            $custom_css .= '
         .disp_single, .disp_page,
         .disp_single .pager li>a, .disp_single .pager li>span,
         .disp_single .evo_post .panel-default,
         .disp_single #main-content .evo_post .panel .panel-heading .panel-title, .disp_page #main-content .evo_post .panel .panel-heading .panel-title,
         .disp_single #main-content .evo_post #feedbacks .evo_comment .panel-heading, .disp_page #main-content .evo_post #feedbacks .evo_comment .panel-heading,
         .disp_single #main-content .evo_post .panel .panel-heading, .disp_page #main-content .evo_post .panel .panel-heading
         { background-color: ' . $bg_color . '; }
         ';
        }
        /**
         * ============================================================================
         * Sidebar Custom Style
         * ============================================================================
         */
        if ($border = $this->get_setting('sidebar_border_widget')) {
            $custom_css .= '
         .widget_core_coll_category_list ul > li, .widget_core_content_hierarchy ul > li, .widget_core_coll_common_links ul > li, .widget_core_coll_post_list ul > li, .widget_core_coll_page_list ul > li, .widget_core_coll_related_post_list ul > li, .widget_plugin_evo_Arch ul > li, .widget_core_linkblog ul > li, .widget_core_coll_item_list.evo_noexcerpt ul > li, .widget_core_coll_comment_list ul > li, .widget_core_coll_xml_feeds ul > li, .widget_core_colls_list_public ul > li, .widget_core_user_tools ul > li
         { border-color: ' . $border . '; }
         ';
            $custom_css .= '
         #main-sidebar .panel-heading::after
         { background-color: ' . $border . '; }
         ';
        }
        if ($color = $this->get_setting('sidebar_title_widget')) {
            $custom_css .= '
         #main-sidebar .panel-heading .panel-title,
         .disp_front .evo_container__front_page_primary .evo_widget h3,
		 .disp_front .evo_container__front_page_primary .evo_widget.widget_core_coll_post_list.evo_withexcerpt .item_title, .disp_front .evo_container__front_page_primary .evo_widget.widget_core_coll_related_post_list.evo_withexcerpt .item_title, .disp_front .evo_container__front_page_primary .evo_widget.widget_core_coll_item_list.evo_withexcerpt .item_title
         { color: ' . $color . '; }
         ';
        }
        if ($color = $this->get_setting('sidebar_color_content')) {
            $custom_css .= '
         #main-sidebar .evo_widget
         { color: ' . $color . '; }
         ';
        }
        if ($color = $this->get_setting('sidebar_color_link')) {
            $custom_css .= '
         #main-sidebar .evo_widget a,
         #main-sidebar .evo_widget ul li strong a
         { color: ' . $color . '; }
         ';
        }
        /**
         * ============================================================================
         * Front Disp Custom Style
         * ============================================================================
         */
        if ($bg_color = $this->get_setting('front_bg')) {
            $custom_css .= '
         .disp_front,
         .disp_front .evo_container__front_page_primary .widget_core_user_login
         { background-color: ' . $bg_color . '; }
         ';
        }
        /**
         * ============================================================================
         * Comments Disp Custom Style
         * ============================================================================
         */
        if ($bg_color = $this->get_setting('comments_bg')) {
            $custom_css .= '
         .disp_comments
         { background-color: ' . $bg_color . '; }
         ';
        }
        /**
         * ============================================================================
         * Mediaidx Custom Style
         * ============================================================================
         */
        if ($padding = $this->get_setting('padding_column')) {
            $custom_css .= '.disp_mediaidx #main-mediaidx .widget_core_coll_media_index .evo_image_index li{ padding: ' . $padding . 'px }';
            $custom_css .= '.disp_mediaidx #main-mediaidx .title_mediaidx { margin-left: ' . $padding . 'px; margin-right: ' . $padding . 'px; }';
        }
        if ($color = $this->get_setting('mediaidx_bg')) {
            $custom_css .= '.disp_mediaidx, .disp_mediaidx #main-mediaidx .widget_core_coll_media_index .evo_image_index .note {
            background-color: ' . $color . '; }';
        }
        if ($color = $this->get_setting('mediaidx_bg_content')) {
            $custom_css .= '.disp_mediaidx #main-mediaidx .widget_core_coll_media_index .evo_image_index li figure.box,
         .disp_mediaidx #main-mediaidx .widget_core_coll_media_index .evo_image_index li figure.box .note {
            background-color: ' . $color . ';}';
        }
        if ($color = $this->get_setting('mediaidx_title_color')) {
            $custom_css .= '.disp_mediaidx #main-mediaidx .widget_core_coll_media_index .evo_image_index .note {
            color: ' . $color . ';}';
        }
        if ($bg_color = $this->get_setting('mediaidx_title_color')) {
            $custom_css .= '.disp_mediaidx #main-mediaidx .widget_core_coll_media_index .evo_image_index li figure.box.title a::after {
            background-color: ' . $color . ';}';
        }
        /**
         * ============================================================================
         * Disp Search Custome Style
         * ============================================================================
         */
        if ($color = $this->get_setting('search_text_info')) {
            $custom_css .= '.disp_search .search_result .search_content_wrap .search_info
         { color: ' . $color . ' }';
        }
        if ($bg_color = $this->get_setting('search_bg')) {
            $custom_css .= '.disp_search { background-color: ' . $bg_color . '; }';
        }
        /**
         * ============================================================================
         * Disp Archir Custome Style
         * ============================================================================
         */
        if ($bg_color = $this->get_setting('arcdir_bg')) {
            $custom_css .= '.disp_arcdir { background-color: ' . $bg_color . '; }';
        }
        /**
         * ============================================================================
         * Disp Catdir Custome Style
         * ============================================================================
         */
        if ($bg_color = $this->get_setting('catdir_bg')) {
            $custom_css .= '.disp_catdir { background-color: ' . $bg_color . '; }';
        }
        /**
         * ============================================================================
         * Disp Postidx Custome Style
         * ============================================================================
         */
        if ($bg_color = $this->get_setting('postidx_bg')) {
            $custom_css .= '.disp_postidx { background-color: ' . $bg_color . '; }';
        }
        /**
         * ============================================================================
         * Disp Tags Custome Style
         * ============================================================================
         */
        if ($bg_color = $this->get_setting('tags_bg')) {
            $custom_css .= '.disp_tags { background-color: ' . $bg_color . '; }';
        }
        /**
         * ============================================================================
         * Footer Custome Style
         * ============================================================================
         */
        if ($bg_color = $this->get_setting('footer_bg')) {
            $custom_css .= '
         #main-footer, #main-footer .widget_footer .widget_plugin_evo_Calr .bCalendarTable caption a
         { background-color: ' . $bg_color . '; }
         ';
        }
        if ($border = $this->get_setting('footer_border_widget')) {
            $custom_css .= '#main-footer .widget_footer .widget_core_coll_category_list ul > li, #main-footer .widget_footer .widget_core_content_hierarchy ul > li, #main-footer .widget_footer .widget_core_coll_common_links ul > li, #main-footer .widget_footer .widget_core_coll_post_list ul > li, #main-footer .widget_footer .widget_core_coll_page_list ul > li, #main-footer .widget_footer .widget_core_coll_related_post_list ul > li, #main-footer .widget_footer .widget_plugin_evo_Arch ul > li, #main-footer .widget_footer .widget_core_linkblog ul > li, #main-footer .widget_footer .widget_core_coll_item_list.evo_noexcerpt ul > li, #main-footer .widget_footer .widget_core_coll_comment_list ul > li, #main-footer .widget_footer .widget_core_coll_xml_feeds ul > li, #main-footer .widget_footer .widget_core_colls_list_public ul > li, #main-footer .widget_footer .widget_core_user_tools ul > li
         { border-color: ' . $border . '; }';
            $custom_css .= '#main-footer .copyright { border-top-color: ' . $border . ' }';
            $custom_css .= '#main-footer .widget_footer .widget_core_coll_category_list ul > li, #main-footer .widget_footer .widget_core_content_hierarchy ul > li, #main-footer .widget_footer .widget_core_coll_common_links ul > li, #main-footer .widget_footer .widget_core_coll_post_list ul > li, #main-footer .widget_footer .widget_core_coll_page_list ul > li, #main-footer .widget_footer .widget_core_coll_related_post_list ul > li, #main-footer .widget_footer .widget_plugin_evo_Arch ul > li, #main-footer .widget_footer .widget_core_linkblog ul > li, #main-footer .widget_footer .widget_core_coll_item_list.evo_noexcerpt ul > li, #main-footer .widget_footer .widget_core_coll_comment_list ul > li, #main-footer .widget_footer .widget_core_coll_xml_feeds ul > li, #main-footer .widget_footer .widget_core_colls_list_public ul > li, #main-footer .widget_footer .widget_core_user_tools ul > li, #main-footer .widget_footer .widget_core_coll_link_list ul > li, #main-footer .widget_footer .widget_core_colls_list_owner ul > li
         { border-bottom-color: ' . $border . ' }';
        }
        if ($color = $this->get_setting('footer_title_color')) {
            $custom_css .= '#main-footer .widget_footer .evo_widget .widget_title { color: ' . $color . ' }';
        }
        if ($color = $this->get_setting('footer_text_content')) {
            $custom_css .= '#main-footer { color: ' . $color . '; }';
        }
        if ($color = $this->get_setting('footer_link_color')) {
            $custom_css .= '#main-footer a, #main-footer .widget_footer .evo_widget a,
         #main-footer .copyright a
         { color: ' . $color . ' }';
        }
        if ($color = $this->get_setting('copyright_color')) {
            $custom_css .= '#main-footer .copyright p{ color: ' . $color . ' }';
        }
        if ($disp == 'posts') {
            $custom_css .= ".disp_posts .well { padding: 0; }\n";
            $custom_css .= ".disp_posts .well header, .disp_posts .well section, .disp_posts .well footer { padding: 0 30px; }\n";
            $custom_css .= ".disp_posts .well footer { padding-bottom: 20px; }\n";
        }
        if ($this->get_setting('ht_show') == 1) {
            $custom_css .= ".sitewide_header { margin-bottom: 0 !important; }";
        }
        // Custom CSS Output
        if (!empty($custom_css)) {
            add_css_headline($custom_css);
        }
        // Limit images by max height:
        $max_image_height = intval($this->get_setting('max_image_height'));
        if ($max_image_height > 0) {
            add_css_headline('.evo_image_block img { max-height: ' . $max_image_height . 'px; width: auto; }');
        }
    }
\t\t\t\t\t}
\t\t\t\t}
\t\t\t}
\t\t\t//-->
\t\t</script>
JS;
    add_headline($initcheckall_script);
}
// Add event to the item title field to update document title and init it (important when switching tabs/blogs):
global $js_doc_title_prefix;
if (isset($js_doc_title_prefix)) {
    // dynamic document.title handling:
    $base_title = preg_quote(trim($js_doc_title_prefix));
    add_js_headline('jQuery(function(){
			var generateTitle = function()
			{
				currentPostTitle = jQuery(\'#post_title\').val()
				document.title = document.title.replace(/(' . $base_title . ').*$/, \'$1 \'+currentPostTitle)
			}
			generateTitle()
			jQuery(\'#post_title\').keyup(generateTitle)
		})');
}
// CALL PLUGINS NOW:
global $Plugins;
$Plugins->trigger_event('AdminEndHtmlHead', array());
include_headlines();
// Add javascript and css files included by plugins and skin
?>
</head>
    /**
     * @see Plugin::SkinBeginHtmlHead()
     */
    function SkinBeginHtmlHead(&$params)
    {
        require_css($this->get_plugin_url() . 'rsc/mediaelementplayer.min.css', 'relative');
        require_js('#jquery#', 'blog');
        require_js($this->get_plugin_url() . 'rsc/mediaelement-and-player.min.js', 'relative');
        $this->require_skin();
        // Set a video size in css style, because option setting cannot sets correct size
        $width = (int) $this->Settings->get('width');
        $height = (int) $this->Settings->get('height');
        add_css_headline('video.html5_mediaelementjs_video{ width: ' . $width . 'px !important; height: ' . $height . 'px !important; }');
        // Initialize a player
        add_js_headline('jQuery( document ).ready( function() {
				jQuery( "video.html5_mediaelementjs_video" ).mediaelementplayer( {
					defaultVideoWidth: "' . $width . '",
					defaultVideoHeight: "' . $height . '",
					videoWidth: "' . $width . '",
					videoHeight: "' . $height . '",
				} );
			} );');
        /**
        		 * Plugin options:
        
        			// if the <video width> is not specified, this is the default
        			defaultVideoWidth: 480,
        			// if the <video height> is not specified, this is the default
        			defaultVideoHeight: 270,
        			// if set, overrides <video width>
        			videoWidth: -1,
        			// if set, overrides <video height>
        			videoHeight: -1,
        			// width of audio player
        			audioWidth: 400,
        			// height of audio player
        			audioHeight: 30,
        			// initial volume when the player starts
        			startVolume: 0.8,
        			// useful for <audio> player loops
        			loop: false,
        			// enables Flash and Silverlight to resize to content size
        			enableAutosize: true,
        			// the order of controls you want on the control bar (and other plugins below)
        			features: ['playpause','progress','current','duration','tracks','volume','fullscreen'],
        			// Hide controls when playing and mouse is not over the video
        			alwaysShowControls: false,
        			// force iPad's native controls
        			iPadUseNativeControls: false,
        			// force iPhone's native controls
        			iPhoneUseNativeControls: false,
        			// force Android's native controls
        			AndroidUseNativeControls: false,
        			// forces the hour marker (##:00:00)
        			alwaysShowHours: false,
        			// show framecount in timecode (##:00:00:00)
        			showTimecodeFrameCount: false,
        			// used when showTimecodeFrameCount is set to true
        			framesPerSecond: 25,
        			// turns keyboard support on and off for this instance
        			enableKeyboard: true,
        			// when this player starts, it will pause other players
        			pauseOtherPlayers: true,
        			// array of keyboard commands
        			keyActions: []
        */
    }
Beispiel #22
0
/**
 * Initialize internal states for the most common skin displays.
 *
 * For more specific skins, this function may not be called and
 * equivalent code may be customized within the skin.
 *
 * @param string What are we going to display. Most of the time the global $disp should be passed.
 */
function skin_init($disp)
{
    /**
     * @var Blog
     */
    global $Blog;
    /**
     * @var Item
     */
    global $Item;
    /**
     * @var Skin
     */
    global $Skin;
    global $robots_index;
    global $seo_page_type;
    global $redir, $ReqURL, $ReqURI, $m, $w, $preview;
    global $Chapter;
    global $Debuglog;
    /**
     * @var ItemList2
     */
    global $MainList;
    /**
     * This will give more detail when $disp == 'posts'; otherwise it will have the same content as $disp
     * @var string
     */
    global $disp_detail, $Settings;
    global $Timer;
    global $Messages, $PageCache;
    global $Session, $current_User;
    $Timer->resume('skin_init');
    if (empty($disp_detail)) {
        $disp_detail = $disp;
    }
    $Debuglog->add('skin_init: $disp=' . $disp, 'skins');
    // This is the main template; it may be used to display very different things.
    // Do inits depending on current $disp:
    switch ($disp) {
        case 'front':
        case 'posts':
        case 'single':
        case 'page':
        case 'terms':
        case 'download':
        case 'feedback-popup':
            // We need to load posts for this display:
            if ($disp == 'terms') {
                // Initialize the redirect param to know what page redirect after accepting of terms:
                param('redirect_to', 'url', '');
            }
            // Note: even if we request the same post as $Item above, the following will do more restrictions (dates, etc.)
            // Init the MainList object:
            init_MainList($Blog->get_setting('posts_per_page'));
            // Init post navigation
            $post_navigation = $Skin->get_post_navigation();
            if (empty($post_navigation)) {
                $post_navigation = $Blog->get_setting('post_navigation');
            }
            if (!empty($MainList) && $MainList->single_post && ($single_Item =& mainlist_get_item())) {
                // If we are currently viewing a single post
                // We assume the current user will have read the entire post and all its current comments:
                $single_Item->update_read_timestamps(true, true);
                // Restart the items list:
                $MainList->restart();
            }
            break;
        case 'search':
            // Searching post, comments and categories
            load_funcs('collections/_search.funcs.php');
            // Check previous search keywords so it can be displayed in the search input box
            param('s', 'string', '', true);
            break;
    }
    // SEO stuff & redirects if necessary:
    $seo_page_type = NULL;
    switch ($disp) {
        // CONTENT PAGES:
        case 'single':
        case 'page':
        case 'terms':
            if ($disp == 'terms' && !$Item) {
                // Wrong post ID for terms page:
                global $disp;
                $disp = '404';
                $Messages->add(sprintf(T_('Terms not found. (post ID #%s)'), get_param('p')), 'error');
                break;
            }
            if (!$preview && empty($Item)) {
                // No Item, incorrect request and incorrect state of the application, a 404 redirect should have already happened
                //debug_die( 'Invalid page URL!' );
            }
            if ($disp == 'single') {
                $seo_page_type = 'Single post page';
            } else {
                $seo_page_type = '"Page" page';
            }
            if (!$preview) {
                // Check if item has a goal to insert a hit into DB
                $Item->check_goal();
            }
            // Check if the post has 'redirected' status:
            if (!$preview && $Item->status == 'redirected' && $redir == 'yes') {
                // $redir=no here allows to force a 'single post' URL for commenting
                // Redirect to the URL specified in the post:
                $Debuglog->add('Redirecting to post URL [' . $Item->url . '].');
                header_redirect($Item->url, true, true);
            }
            // Check if we want to redirect to a canonical URL for the post
            // Please document encountered problems.
            if (!$preview && ($Blog->get_setting('canonical_item_urls') && $redir == 'yes' || $Blog->get_setting('relcanonical_item_urls'))) {
                // We want to redirect to the Item's canonical URL:
                $canonical_url = $Item->get_permanent_url('', '', '&');
                if (preg_match('|[&?](page=\\d+)|', $ReqURI, $page_param)) {
                    // A certain post page has been requested, keep only this param and discard all others:
                    $canonical_url = url_add_param($canonical_url, $page_param[1], '&');
                }
                if (preg_match('|[&?](mode=quote&[qcp]+=\\d+)|', $ReqURI, $page_param)) {
                    // A quote of comment/post, keep only these params and discard all others:
                    $canonical_url = url_add_param($canonical_url, $page_param[1], '&');
                }
                if (!is_same_url($ReqURL, $canonical_url)) {
                    // The requested URL does not look like the canonical URL for this post...
                    // url difference was resolved
                    $url_resolved = false;
                    // Check if the difference is because of an allowed post navigation param
                    if (preg_match('|[&?]cat=(\\d+)|', $ReqURI, $cat_param)) {
                        // A category post navigation param is set
                        $extended_url = '';
                        if ($post_navigation == 'same_category' && isset($cat_param[1])) {
                            // navigatie through posts from the same category
                            $category_ids = postcats_get_byID($Item->ID);
                            if (in_array($cat_param[1], $category_ids)) {
                                // cat param is one of this Item categories
                                $extended_url = $Item->add_navigation_param($canonical_url, $post_navigation, $cat_param[1], '&');
                                // Set MainList navigation target to the requested category
                                $MainList->nav_target = $cat_param[1];
                            }
                        }
                        $url_resolved = is_same_url($ReqURL, $extended_url);
                    }
                    if (preg_match('|[&?]tag=([^&A-Z]+)|', $ReqURI, $tag_param)) {
                        // A tag post navigation param is set
                        $extended_url = '';
                        if ($post_navigation == 'same_tag' && isset($tag_param[1])) {
                            // navigatie through posts from the same tag
                            $tag_names = $Item->get_tags();
                            if (in_array($tag_param[1], $tag_names)) {
                                // tag param is one of this Item tags
                                $extended_url = $Item->add_navigation_param($canonical_url, $post_navigation, $tag_param[1], '&');
                                // Set MainList navigation target to the requested tag
                                $MainList->nav_target = $tag_param[1];
                            }
                        }
                        $url_resolved = is_same_url($ReqURL, $extended_url);
                    }
                    if (!$url_resolved && $Blog->get_setting('canonical_item_urls') && $redir == 'yes' && !$Item->check_cross_post_nav('auto', $Blog->ID)) {
                        // REDIRECT TO THE CANONICAL URL:
                        $Debuglog->add('Redirecting to canonical URL [' . $canonical_url . '].');
                        header_redirect($canonical_url, true);
                    } else {
                        // Use rel="canoncial":
                        add_headline('<link rel="canonical" href="' . $canonical_url . '" />');
                    }
                    // EXITED.
                }
            }
            if (!$MainList->result_num_rows) {
                // There is nothing to display for this page, don't index it!
                $robots_index = false;
            }
            break;
        case 'download':
            if (empty($Item)) {
                // No Item, incorrect request and incorrect state of the application, a 404 redirect should have already happened
                debug_die('Invalid page URL!');
            }
            $download_link_ID = param('download', 'integer', 0);
            // Check if we can allow to download the selected file
            $LinkCache =& get_LinkCache();
            if (!(($download_Link =& $LinkCache->get_by_ID($download_link_ID, false, false)) && ($LinkItem =& $download_Link->get_LinkOwner()) && ($LinkItem->Item && $LinkItem->Item->ID == $Item->ID) && ($download_File =& $download_Link->get_File()) && $download_File->exists())) {
                // Bad request, Redirect to Item permanent url
                $Messages->add(T_('The requested file is not available for download.'), 'error');
                $canonical_url = $Item->get_permanent_url('', '', '&');
                $Debuglog->add('Redirecting to canonical URL [' . $canonical_url . '].');
                header_redirect($canonical_url, true);
            }
            // Save the downloading Link to the global vars
            $GLOBALS['download_Link'] =& $download_Link;
            // Save global $Item to $download_Item, because $Item can be rewritten by function get_featured_Item() in some skins
            $GLOBALS['download_Item'] =& $Item;
            init_ajax_forms('blog');
            // auto requires jQuery
            // Initialize JavaScript to download file after X seconds
            add_js_headline('
jQuery( document ).ready( function ()
{
	jQuery( "#download_timer_js" ).show();
} );

var b2evo_download_timer = ' . intval($Blog->get_setting('download_delay')) . ';
var downloadInterval = setInterval( function()
{
	jQuery( "#download_timer" ).html( b2evo_download_timer );
	if( b2evo_download_timer == 0 )
	{ // Stop timer and download a file
		clearInterval( downloadInterval );
		jQuery( "#download_help_url" ).show();
	}
	b2evo_download_timer--;
}, 1000 );');
            // Use meta tag to download file when JavaScript is NOT enabled
            add_headline('<meta http-equiv="refresh" content="' . intval($Blog->get_setting('download_delay')) . '; url=' . $download_Link->get_download_url(array('type' => 'action')) . '" />');
            $seo_page_type = 'Download page';
            if ($Blog->get_setting($disp . '_noindex')) {
                // We prefer robots not to index these pages:
                $robots_index = false;
            }
            break;
        case 'posts':
            init_ajax_forms('blog');
            // auto requires jQuery
            // fp> if we add this here, we have to exetnd the inner if()
            // init_ratings_js( 'blog' );
            // Get list of active filters:
            $active_filters = $MainList->get_active_filters();
            if (!empty($active_filters)) {
                // The current page is being filtered...
                if (array_diff($active_filters, array('page')) == array()) {
                    // This is just a follow "paged" page
                    $disp_detail = 'posts-next';
                    $seo_page_type = 'Next page';
                    if ($Blog->get_setting('paged_noindex')) {
                        // We prefer robots not to index category pages:
                        $robots_index = false;
                    }
                } elseif (array_diff($active_filters, array('cat_array', 'cat_modifier', 'cat_focus', 'posts', 'page')) == array()) {
                    // This is a category page
                    $disp_detail = 'posts-cat';
                    $seo_page_type = 'Category page';
                    if ($Blog->get_setting('chapter_noindex')) {
                        // We prefer robots not to index category pages:
                        $robots_index = false;
                    }
                    global $cat, $catsel;
                    if (empty($catsel) && preg_match('~^[0-9]+$~', $cat)) {
                        // We are on a single cat page:
                        // NOTE: we must have selected EXACTLY ONE CATEGORY through the cat parameter
                        // BUT: - this can resolve to including children
                        //      - selecting exactly one cat through catsel[] is NOT OK since not equivalent (will exclude children)
                        // echo 'SINGLE CAT PAGE';
                        if ($Blog->get_setting('canonical_cat_urls') && $redir == 'yes' || $Blog->get_setting('relcanonical_cat_urls')) {
                            // Check if the URL was canonical:
                            if (!isset($Chapter)) {
                                $ChapterCache =& get_ChapterCache();
                                /**
                                 * @var Chapter
                                 */
                                $Chapter =& $ChapterCache->get_by_ID($MainList->filters['cat_array'][0], false);
                            }
                            if ($Chapter) {
                                if ($Chapter->parent_ID) {
                                    // This is a sub-category page (i-e: not a level 1 category)
                                    $disp_detail = 'posts-subcat';
                                }
                                $canonical_url = $Chapter->get_permanent_url(NULL, NULL, $MainList->get_active_filter('page'), NULL, '&');
                                if (!is_same_url($ReqURL, $canonical_url)) {
                                    // fp> TODO: we're going to lose the additional params, it would be better to keep them...
                                    // fp> what additional params actually?
                                    if ($Blog->get_setting('canonical_cat_urls') && $redir == 'yes') {
                                        // REDIRECT TO THE CANONICAL URL:
                                        header_redirect($canonical_url, true);
                                    } else {
                                        // Use rel="canonical":
                                        add_headline('<link rel="canonical" href="' . $canonical_url . '" />');
                                    }
                                }
                            } else {
                                // If the requested chapter was not found display 404 page
                                $Messages->add(T_('The requested chapter was not found'));
                                global $disp;
                                $disp = '404';
                                break;
                            }
                        }
                        if ($post_navigation == 'same_category') {
                            // Category is set and post navigation should go through the same category, set navigation target param
                            $MainList->nav_target = $cat;
                        }
                    }
                } elseif (array_diff($active_filters, array('tags', 'posts', 'page')) == array()) {
                    // This is a tag page
                    $disp_detail = 'posts-tag';
                    $seo_page_type = 'Tag page';
                    if ($Blog->get_setting('tag_noindex')) {
                        // We prefer robots not to index tag pages:
                        $robots_index = false;
                    }
                    if ($Blog->get_setting('canonical_tag_urls') && $redir == 'yes' || $Blog->get_setting('relcanonical_tag_urls')) {
                        // Check if the URL was canonical:
                        $canonical_url = $Blog->gen_tag_url($MainList->get_active_filter('tags'), $MainList->get_active_filter('page'), '&');
                        if (!is_same_url($ReqURL, $canonical_url)) {
                            if ($Blog->get_setting('canonical_tag_urls') && $redir == 'yes') {
                                // REDIRECT TO THE CANONICAL URL:
                                header_redirect($canonical_url, true);
                            } else {
                                // Use rel="canoncial":
                                add_headline('<link rel="canonical" href="' . $canonical_url . '" />');
                            }
                        }
                    }
                    $tag = $MainList->get_active_filter('tags');
                    if ($post_navigation == 'same_tag' && !empty($tag)) {
                        // Tag is set and post navigation should go through the same tag, set navigation target param
                        $MainList->nav_target = $tag;
                    }
                } elseif (array_diff($active_filters, array('ymdhms', 'week', 'posts', 'page')) == array()) {
                    // This is an archive page
                    // echo 'archive page';
                    $disp_detail = 'posts-date';
                    $seo_page_type = 'Date archive page';
                    if ($Blog->get_setting('canonical_archive_urls') && $redir == 'yes' || $Blog->get_setting('relcanonical_archive_urls')) {
                        // Check if the URL was canonical:
                        $canonical_url = $Blog->gen_archive_url(substr($m, 0, 4), substr($m, 4, 2), substr($m, 6, 2), $w, '&', $MainList->get_active_filter('page'));
                        if (!is_same_url($ReqURL, $canonical_url)) {
                            if ($Blog->get_setting('canonical_archive_urls') && $redir == 'yes') {
                                // REDIRECT TO THE CANONICAL URL:
                                header_redirect($canonical_url, true);
                            } else {
                                // Use rel="canoncial":
                                add_headline('<link rel="canonical" href="' . $canonical_url . '" />');
                            }
                        }
                    }
                    if ($Blog->get_setting('archive_noindex')) {
                        // We prefer robots not to index archive pages:
                        $robots_index = false;
                    }
                } else {
                    // Other filtered pages:
                    // pre_dump( $active_filters );
                    $disp_detail = 'posts-filtered';
                    $seo_page_type = 'Other filtered page';
                    if ($Blog->get_setting('filtered_noindex')) {
                        // We prefer robots not to index other filtered pages:
                        $robots_index = false;
                    }
                }
            } elseif ($Blog->get_setting('front_disp') == 'posts') {
                // This is the default blog page only if the 'front_disp' is set to 'posts'
                $disp_detail = 'posts-default';
                $seo_page_type = 'Default page';
                if ($Blog->get_setting('default_noindex')) {
                    // We prefer robots not to index archive pages:
                    $robots_index = false;
                }
            }
            break;
        case 'search':
            $seo_page_type = 'Search page';
            if ($Blog->get_setting('filtered_noindex')) {
                // We prefer robots not to index these pages:
                $robots_index = false;
            }
            break;
            // SPECIAL FEATURE PAGES:
        // SPECIAL FEATURE PAGES:
        case 'feedback-popup':
            $seo_page_type = 'Comment popup';
            if ($Blog->get_setting($disp . '_noindex')) {
                // We prefer robots not to index these pages:
                $robots_index = false;
            }
            break;
        case 'arcdir':
            $seo_page_type = 'Date archive directory';
            if ($Blog->get_setting($disp . '_noindex')) {
                // We prefer robots not to index these pages:
                $robots_index = false;
            }
            break;
        case 'catdir':
            $seo_page_type = 'Category directory';
            if ($Blog->get_setting($disp . '_noindex')) {
                // We prefer robots not to index these pages:
                $robots_index = false;
            }
            break;
        case 'msgform':
            global $disp;
            // get expected message form type
            $msg_type = param('msg_type', 'string', '');
            // initialize
            $recipient_User = NULL;
            $Comment = NULL;
            $allow_msgform = NULL;
            // get possible params
            $recipient_id = param('recipient_id', 'integer', 0, true);
            $comment_id = param('comment_id', 'integer', 0, true);
            $post_id = param('post_id', 'integer', 0, true);
            $subject = param('subject', 'string', '');
            // try to init recipient_User
            if (!empty($recipient_id)) {
                $UserCache =& get_UserCache();
                $recipient_User =& $UserCache->get_by_ID($recipient_id);
            } elseif (!empty($comment_id)) {
                // comment id is set, try to get comment author user
                $CommentCache =& get_CommentCache();
                $Comment = $CommentCache->get_by_ID($comment_id, false);
                if ($Comment = $CommentCache->get_by_ID($comment_id, false)) {
                    $recipient_User =& $Comment->get_author_User();
                    if (empty($recipient_User) && $Comment->allow_msgform && is_email($Comment->get_author_email())) {
                        // set allow message form to email because comment author (not registered) accepts email
                        $allow_msgform = 'email';
                        param('recipient_address', 'string', $Comment->get_author_email());
                        param('recipient_name', 'string', $Comment->get_author_name());
                    }
                }
            } else {
                // Recipient was not defined, try set the blog owner as recipient
                global $Blog;
                if (empty($Blog)) {
                    // Blog is not set, this is an invalid request
                    debug_die('Invalid send message request!');
                }
                $recipient_User = $Blog->get_owner_User();
            }
            if ($recipient_User) {
                // recipient User is set
                // get_msgform_possibility returns NULL (false), only if there is no messaging option between current_User and recipient user
                $allow_msgform = $recipient_User->get_msgform_possibility();
                if ($msg_type == 'email' && $recipient_User->get_msgform_possibility(NULL, 'email') != 'email') {
                    // User doesn't want to receive email messages, Restrict if this was requested by wrong url:
                    $msg_type = '';
                }
                if ($allow_msgform == 'login') {
                    // user must login first to be able to send a message to this User
                    $disp = 'login';
                    param('action', 'string', 'req_login');
                    // override redirect to param
                    param('redirect_to', 'url', regenerate_url(), true, true);
                    if (($msg_Blog =& get_setting_Blog('msg_blog_ID')) && $Blog->ID != $msg_Blog->ID) {
                        // Redirect to special blog for messaging actions if it is defined in general settings
                        header_redirect(url_add_param($msg_Blog->get('msgformurl', array('glue' => '&')), 'redirect_to=' . rawurlencode($redirect_to), '&'));
                    }
                    $Messages->add(T_('You must log in before you can contact this user'));
                } elseif ($allow_msgform == 'PM' && check_user_status('can_be_validated')) {
                    // user is not activated
                    if ($recipient_User->accepts_email()) {
                        // recipient User accepts email allow to send email
                        $allow_msgform = 'email';
                        $msg_type = 'email';
                        $activateinfo_link = 'href="' . get_activate_info_url(NULL, '&amp;') . '"';
                        $Messages->add(sprintf(T_('You must activate your account before you can send a private message to %s. However you can send them an email if you\'d like. <a %s>More info &raquo;</a>'), $recipient_User->get('login'), $activateinfo_link), 'warning');
                    } else {
                        // Redirect to the activate info page for not activated users
                        $Messages->add(T_('You must activate your account before you can contact a user. <b>See below:</b>'));
                        header_redirect(get_activate_info_url(), 302);
                        // will have exited
                    }
                } elseif ($msg_type == 'PM' && $allow_msgform == 'email') {
                    // only email is allowed but user expect private message form
                    if (!empty($current_User) && $recipient_id == $current_User->ID) {
                        $Messages->add(T_('You cannot send a private message to yourself. However you can send yourself an email if you\'d like.'), 'warning');
                    } else {
                        $Messages->add(sprintf(T_('You cannot send a private message to %s. However you can send them an email if you\'d like.'), $recipient_User->get('login')), 'warning');
                    }
                } elseif ($msg_type != 'email' && $allow_msgform == 'PM') {
                    // private message form should be displayed, change display to create new individual thread with the given recipient user
                    // check if creating new PM is allowed
                    if (check_create_thread_limit(true)) {
                        // thread limit reached
                        header_redirect();
                        // exited here
                    }
                    global $edited_Thread, $edited_Message, $recipients_selected;
                    // Load classes
                    load_class('messaging/model/_thread.class.php', 'Thread');
                    load_class('messaging/model/_message.class.php', 'Message');
                    // Set global variable to auto define the FB autocomplete plugin field
                    $recipients_selected = array(array('id' => $recipient_User->ID, 'title' => $recipient_User->login));
                    init_tokeninput_js('blog');
                    $disp = 'threads';
                    $edited_Thread = new Thread();
                    $edited_Message = new Message();
                    $edited_Message->Thread =& $edited_Thread;
                    $edited_Thread->recipients = $recipient_User->login;
                    param('action', 'string', 'new', true);
                    param('thrdtype', 'string', 'individual', true);
                }
                if ($allow_msgform == 'email') {
                    // set recippient user param
                    set_param('recipient_id', $recipient_User->ID);
                }
            }
            if ($allow_msgform == NULL) {
                // should be Prevented by UI
                if (!empty($recipient_User)) {
                    $Messages->add(sprintf(T_('The user "%s" does not want to be contacted through the message form.'), $recipient_User->get('login')), 'error');
                } elseif (!empty($Comment)) {
                    $Messages->add(T_('This commentator does not want to get contacted through the message form.'), 'error');
                }
                $blogurl = $Blog->gen_blogurl();
                // If it was a front page request or the front page is set to 'msgform' then we must not redirect to the front page because it is forbidden for the current User
                $redirect_to = is_front_page() || $Blog->get_setting('front_disp') == 'msgform' ? url_add_param($blogurl, 'disp=403', '&') : $blogurl;
                header_redirect($redirect_to, 302);
                // exited here
            }
            if ($allow_msgform == 'PM' || $allow_msgform == 'email') {
                // Some message form is available
                // Get the suggested subject for the email:
                if (empty($subject)) {
                    // no subject provided by param:
                    global $DB;
                    if (!empty($comment_id)) {
                        // fp>TODO there should be NO SQL in this file. Make a $ItemCache->get_by_comment_ID().
                        $row = $DB->get_row('
							SELECT post_title
								FROM T_items__item, T_comments
							 WHERE comment_ID = ' . $DB->quote($comment_id) . '
								 AND post_ID = comment_item_ID');
                        if ($row) {
                            $subject = T_('Re:') . ' ' . sprintf(T_('Comment on %s'), $row->post_title);
                        }
                    }
                    if (empty($subject) && !empty($post_id)) {
                        // fp>TODO there should be NO SQL in this file. Use $ItemCache->get_by_ID.
                        $row = $DB->get_row('
								SELECT post_title
									FROM T_items__item
								 WHERE post_ID = ' . $post_id);
                        if ($row) {
                            $subject = T_('Re:') . ' ' . $row->post_title;
                        }
                    }
                }
                if ($allow_msgform == 'PM' && isset($edited_Thread)) {
                    $edited_Thread->title = $subject;
                } else {
                    param('subject', 'string', $subject, true);
                }
            }
            if (($msg_Blog =& get_setting_Blog('msg_blog_ID')) && $Blog->ID != $msg_Blog->ID) {
                // Redirect to special blog for messaging actions if it is defined in general settings
                header_redirect($msg_Blog->get('msgformurl', array('glue' => '&')));
            }
            $seo_page_type = 'Contact form';
            if ($Blog->get_setting($disp . '_noindex')) {
                // We prefer robots not to index these pages:
                $robots_index = false;
            }
            break;
        case 'messages':
        case 'contacts':
        case 'threads':
            switch ($disp) {
                case 'messages':
                    // Actions ONLY for disp=messages
                    // fp> The correct place to get thrd_ID is here, because we want it in redirect_to in case we need to ask for login.
                    $thrd_ID = param('thrd_ID', 'integer', '', true);
                    if (!is_logged_in()) {
                        // Redirect to the login page for anonymous users
                        $Messages->add(T_('You must log in to read your messages.'));
                        header_redirect(get_login_url('cannot see messages'), 302);
                        // will have exited
                    }
                    // check if user status allow to view messages
                    if (!$current_User->check_status('can_view_messages')) {
                        // user status does not allow to view messages
                        if ($current_User->check_status('can_be_validated')) {
                            // user is logged in but his/her account is not activate yet
                            $Messages->add(T_('You must activate your account before you can read & send messages. <b>See below:</b>'));
                            header_redirect(get_activate_info_url(), 302);
                            // will have exited
                        }
                        $Messages->add('You are not allowed to view Messages!');
                        header_redirect($Blog->gen_blogurl(), 302);
                        // will have exited
                    }
                    // check if user permissions allow to view messages
                    if (!$current_User->check_perm('perm_messaging', 'reply')) {
                        // Redirect to the blog url for users without messaging permission
                        $Messages->add('You are not allowed to view Messages!');
                        header_redirect($Blog->gen_blogurl(), 302);
                        // will have exited
                    }
                    if (!empty($thrd_ID)) {
                        // if this thread exists and current user is part of this thread update status because won't be any unread messages on this conversation
                        // we need to mark this early to make sure the unread message count will be correct in the evobar
                        mark_as_read_by_user($thrd_ID, $current_User->ID);
                    }
                    if (($unsaved_message_params = get_message_params_from_session()) !== NULL) {
                        // set Message and Thread saved params from Session
                        global $edited_Message, $action;
                        load_class('messaging/model/_message.class.php', 'Message');
                        $edited_Message = new Message();
                        $edited_Message->text = $unsaved_message_params['message'];
                        $edited_Message->original_text = $unsaved_message_params['message_original'];
                        $edited_Message->set_renderers($unsaved_message_params['renderers']);
                        $edited_Message->thread_ID = $thrd_ID;
                        $action = $unsaved_message_params['action'];
                    }
                    break;
                case 'contacts':
                    // Actions ONLY for disp=contacts
                    if (!is_logged_in()) {
                        // Redirect to the login page for anonymous users
                        $Messages->add(T_('You must log in to manage your contacts.'));
                        header_redirect(get_login_url('cannot see contacts'), 302);
                        // will have exited
                    }
                    if (!$current_User->check_status('can_view_contacts')) {
                        // user is logged in, but his status doesn't allow to view contacts
                        if ($current_User->check_status('can_be_validated')) {
                            // user is logged in but his/her account was not activated yet
                            // Redirect to the account activation page
                            $Messages->add(T_('You must activate your account before you can manage your contacts. <b>See below:</b>'));
                            header_redirect(get_activate_info_url(), 302);
                            // will have exited
                        }
                        // Redirect to the blog url for users without messaging permission
                        $Messages->add('You are not allowed to view Contacts!');
                        $blogurl = $Blog->gen_blogurl();
                        // If it was a front page request or the front page is set to display 'contacts' then we must not redirect to the front page because it is forbidden for the current User
                        $redirect_to = is_front_page() || $Blog->get_setting('front_disp') == 'contacts' ? url_add_param($blogurl, 'disp=403', '&') : $blogurl;
                        header_redirect($redirect_to, 302);
                    }
                    if (has_cross_country_restriction('any') && empty($current_User->ctry_ID)) {
                        // User may browse/contact other users only from the same country
                        $Messages->add(T_('Please specify your country before attempting to contact other users.'));
                        header_redirect(get_user_profile_url());
                    }
                    // Get action parameter from request:
                    $action = param_action();
                    if (!$current_User->check_perm('perm_messaging', 'reply')) {
                        // Redirect to the blog url for users without messaging permission
                        $Messages->add('You are not allowed to view Contacts!');
                        $blogurl = $Blog->gen_blogurl();
                        // If it was a front page request or the front page is set to display 'contacts' then we must not redirect to the front page because it is forbidden for the current User
                        $redirect_to = is_front_page() || $Blog->get_setting('front_disp') == 'contacts' ? url_add_param($blogurl, 'disp=403', '&') : $blogurl;
                        header_redirect($redirect_to, 302);
                        // will have exited
                    }
                    switch ($action) {
                        case 'add_user':
                            // Add user to contacts list
                            // Check that this action request is not a CSRF hacked request:
                            $Session->assert_received_crumb('messaging_contacts');
                            $user_ID = param('user_ID', 'integer', 0);
                            if ($user_ID > 0) {
                                // Add user to contacts
                                if (create_contacts_user($user_ID)) {
                                    // Add user to the group
                                    $group_ID = param('group_ID', 'string', '');
                                    if ($result = create_contacts_group_users($group_ID, $user_ID, 'group_ID_combo')) {
                                        // User has been added to the group
                                        $Messages->add(sprintf(T_('User has been added to the &laquo;%s&raquo; group.'), $result['group_name']), 'success');
                                    } else {
                                        // User has been added ONLY to the contacts list
                                        $Messages->add('User has been added to your contacts.', 'success');
                                    }
                                }
                                header_redirect($Blog->get('userurl', array('url_suffix' => 'user_ID=' . $user_ID, 'glue' => '&')));
                            }
                            break;
                        case 'unblock':
                            // Unblock user
                            // Check that this action request is not a CSRF hacked request:
                            $Session->assert_received_crumb('messaging_contacts');
                            $user_ID = param('user_ID', 'integer', 0);
                            if ($user_ID > 0) {
                                set_contact_blocked($user_ID, 0);
                                $Messages->add(T_('Contact was unblocked.'), 'success');
                            }
                            break;
                        case 'remove_user':
                            // Remove user from contacts group
                            // Check that this action request is not a CSRF hacked request:
                            $Session->assert_received_crumb('messaging_contacts');
                            $view = param('view', 'string', 'profile');
                            $user_ID = param('user_ID', 'integer', 0);
                            $group_ID = param('group_ID', 'integer', 0);
                            if ($user_ID > 0 && $group_ID > 0) {
                                // Remove user from selected group
                                if (remove_contacts_group_user($group_ID, $user_ID)) {
                                    // User has been removed from the group
                                    if ($view == 'contacts') {
                                        // Redirect to the contacts list
                                        header_redirect($Blog->get('contactsurl', array('glue' => '&')));
                                    } else {
                                        // Redirect to the user profile page
                                        header_redirect($Blog->get('userurl', array('url_suffix' => 'user_ID=' . $user_ID, 'glue' => '&')));
                                    }
                                }
                            }
                            break;
                        case 'add_group':
                            // Add users to the group
                            // Check that this action request is not a CSRF hacked request:
                            $Session->assert_received_crumb('messaging_contacts');
                            $group = param('group', 'string', '');
                            $users = param('users', 'string', '');
                            if ($result = create_contacts_group_users($group, $users)) {
                                // Users have been added to the group
                                $Messages->add(sprintf(T_('%d contacts have been added to the &laquo;%s&raquo; group.'), $result['count_users'], $result['group_name']), 'success');
                                $redirect_to = $Blog->get('contactsurl', array('glue' => '&'));
                                $item_ID = param('item_ID', 'integer', 0);
                                if ($item_ID > 0) {
                                    $redirect_to = url_add_param($redirect_to, 'item_ID=' . $item_ID, '&');
                                }
                                header_redirect($redirect_to);
                            }
                            break;
                        case 'rename_group':
                            // Rename the group
                            // Check that this action request is not a CSRF hacked request:
                            $Session->assert_received_crumb('messaging_contacts');
                            $group_ID = param('group_ID', 'integer', true);
                            if (rename_contacts_group($group_ID)) {
                                $item_ID = param('item_ID', 'integer', 0);
                                $redirect_to = url_add_param($Blog->get('contactsurl', array('glue' => '&')), 'g=' . $group_ID, '&');
                                if ($item_ID > 0) {
                                    $redirect_to = url_add_param($redirect_to, 'item_ID=' . $item_ID, '&');
                                }
                                $Messages->add(T_('The group has been renamed.'), 'success');
                                header_redirect($redirect_to);
                            }
                            break;
                        case 'delete_group':
                            // Delete the group
                            // Check that this action request is not a CSRF hacked request:
                            $Session->assert_received_crumb('messaging_contacts');
                            $group_ID = param('group_ID', 'integer', true);
                            if (delete_contacts_group($group_ID)) {
                                $item_ID = param('item_ID', 'integer', 0);
                                $redirect_to = $Blog->get('contactsurl', array('glue' => '&'));
                                if ($item_ID > 0) {
                                    $redirect_to = url_add_param($redirect_to, 'item_ID=' . $item_ID, '&');
                                }
                                $Messages->add(T_('The group has been deleted.'), 'success');
                                header_redirect($redirect_to);
                            }
                            break;
                    }
                    modules_call_method('switch_contacts_actions', array('action' => $action));
                    break;
                case 'threads':
                    // Actions ONLY for disp=threads
                    if (!is_logged_in()) {
                        // Redirect to the login page for anonymous users
                        $Messages->add(T_('You must log in to read your messages.'));
                        header_redirect(get_login_url('cannot see messages'), 302);
                        // will have exited
                    }
                    if (!$current_User->check_status('can_view_threads')) {
                        // user status does not allow to view threads
                        if ($current_User->check_status('can_be_validated')) {
                            // user is logged in but his/her account is not activate yet
                            $Messages->add(T_('You must activate your account before you can read & send messages. <b>See below:</b>'));
                            header_redirect(get_activate_info_url(), 302);
                            // will have exited
                        }
                        $Messages->add('You are not allowed to view Messages!');
                        $blogurl = $Blog->gen_blogurl();
                        // If it was a front page request or the front page is set to display 'threads' then we must not redirect to the front page because it is forbidden for the current User
                        $redirect_to = is_front_page() || $Blog->get_setting('front_disp') == 'threads' ? url_add_param($blogurl, 'disp=404', '&') : $blogurl;
                        header_redirect($redirect_to, 302);
                        // will have exited
                    }
                    if (!$current_User->check_perm('perm_messaging', 'reply')) {
                        // Redirect to the blog url for users without messaging permission
                        $Messages->add('You are not allowed to view Messages!');
                        $blogurl = $Blog->gen_blogurl();
                        // If it was a front page request or the front page is set to display 'threads' then we must not redirect to the front page because it is forbidden for the current User
                        $redirect_to = is_front_page() || $Blog->get_setting('front_disp') == 'threads' ? url_add_param($blogurl, 'disp=403', '&') : $blogurl;
                        header_redirect($redirect_to, 302);
                        // will have exited
                    }
                    $action = param('action', 'string', 'view');
                    if ($action == 'new') {
                        // Before new message form is displayed ...
                        if (has_cross_country_restriction('contact') && empty($current_User->ctry_ID)) {
                            // Cross country contact restriction is enabled, but user country is not set yet
                            $Messages->add(T_('Please specify your country before attempting to contact other users.'));
                            header_redirect(get_user_profile_url());
                        } elseif (check_create_thread_limit(true)) {
                            // don't allow to create new thread, because the new thread limit was already reached
                            set_param('action', 'view');
                        }
                    }
                    // Load classes
                    load_class('messaging/model/_thread.class.php', 'Thread');
                    load_class('messaging/model/_message.class.php', 'Message');
                    // Get action parameter from request:
                    $action = param_action('view');
                    switch ($action) {
                        case 'new':
                            // Check permission:
                            $current_User->check_perm('perm_messaging', 'reply', true);
                            global $edited_Thread, $edited_Message;
                            $edited_Thread = new Thread();
                            $edited_Message = new Message();
                            $edited_Message->Thread =& $edited_Thread;
                            modules_call_method('update_new_thread', array('Thread' => &$edited_Thread));
                            if (($unsaved_message_params = get_message_params_from_session()) !== NULL) {
                                // set Message and Thread saved params from Session
                                $edited_Message->text = $unsaved_message_params['message'];
                                $edited_Message->original_text = $unsaved_message_params['message_original'];
                                $edited_Message->set_renderers($unsaved_message_params['renderers']);
                                $edited_Thread->title = $unsaved_message_params['subject'];
                                $edited_Thread->recipients = $unsaved_message_params['thrd_recipients'];
                                $edited_Message->Thread = $edited_Thread;
                                global $thrd_recipients_array, $thrdtype, $action, $creating_success;
                                $thrd_recipients_array = $unsaved_message_params['thrd_recipients_array'];
                                $thrdtype = $unsaved_message_params['thrdtype'];
                                $action = $unsaved_message_params['action'];
                                $creating_success = !empty($unsaved_message_params['creating_success']) ? $unsaved_message_params['creating_success'] : false;
                            } else {
                                if (empty($edited_Thread->recipients)) {
                                    $edited_Thread->recipients = param('thrd_recipients', 'string', '');
                                }
                                if (empty($edited_Thread->title)) {
                                    $edited_Thread->title = param('subject', 'string', '');
                                }
                            }
                            break;
                        default:
                            // Check permission:
                            $current_User->check_perm('perm_messaging', 'reply', true);
                            break;
                    }
                    break;
            }
            // Actions for disp = messages, contacts, threads:
            if (($msg_Blog =& get_setting_Blog('msg_blog_ID')) && $Blog->ID != $msg_Blog->ID) {
                // Redirect to special blog for messaging actions if it is defined in general settings
                $blog_url_params = array('glue' => '&');
                if (!empty($thrd_ID)) {
                    // Don't forget the important param on redirect
                    $blog_url_params['url_suffix'] = 'thrd_ID=' . $thrd_ID;
                }
                header_redirect($msg_Blog->get($disp . 'url', $blog_url_params));
            }
            // just in case some robot would be logged in:
            $seo_page_type = 'Messaging module';
            $robots_index = false;
            // Display messages depending on user email status
            display_user_email_status_message();
            break;
        case 'login':
            global $Plugins, $transmit_hashed_password;
            if (is_logged_in()) {
                // User is already logged in
                if ($current_User->check_status('can_be_validated')) {
                    // account is not active yet, redirect to the account activation page
                    $Messages->add(T_('You are logged in but your account is not activated. You will find instructions about activating your account below:'));
                    header_redirect(get_activate_info_url(), 302);
                    // will have exited
                }
                // User is already logged in, redirect to "redirect_to" page
                $Messages->add(T_('You are already logged in.'), 'note');
                $redirect_to = param('redirect_to', 'url', NULL);
                if (empty($redirect_to)) {
                    // If empty redirect to referer page
                    $redirect_to = '';
                }
                header_redirect($redirect_to, 302);
                // will have exited
            }
            if (($login_Blog =& get_setting_Blog('login_blog_ID')) && $Blog->ID != $login_Blog->ID) {
                // Redirect to special blog for login/register actions if it is defined in general settings
                header_redirect($login_Blog->get('loginurl', array('glue' => '&')));
            }
            $seo_page_type = 'Login form';
            $robots_index = false;
            break;
        case 'register':
            if (is_logged_in()) {
                // If user is logged in the register form should not be displayed. In this case redirect to the blog home page.
                $Messages->add(T_('You are already logged in.'), 'note');
                header_redirect($Blog->gen_blogurl(), false);
            }
            if (($login_Blog =& get_setting_Blog('login_blog_ID')) && $Blog->ID != $login_Blog->ID) {
                // Redirect to special blog for login/register actions if it is defined in general settings
                header_redirect($login_Blog->get('registerurl', array('glue' => '&')));
            }
            $seo_page_type = 'Register form';
            $robots_index = false;
            // Check invitation code if it exists and registration is enabled
            global $display_invitation;
            $display_invitation = check_invitation_code();
            break;
        case 'lostpassword':
            if (is_logged_in()) {
                // If user is logged in the lost password form should not be displayed. In this case redirect to the blog home page.
                $Messages->add(T_('You are already logged in.'), 'note');
                header_redirect($Blog->gen_blogurl(), false);
            }
            if (($login_Blog =& get_setting_Blog('login_blog_ID')) && $Blog->ID != $login_Blog->ID) {
                // Redirect to special blog for login/register actions if it is defined in general settings
                header_redirect($login_Blog->get('lostpasswordurl', array('glue' => '&')));
            }
            $seo_page_type = 'Lost password form';
            $robots_index = false;
            break;
        case 'activateinfo':
            if (!is_logged_in()) {
                // Redirect to the login page for anonymous users
                $Messages->add(T_('You must log in before you can activate your account.'));
                header_redirect(get_login_url('cannot see messages'), 302);
                // will have exited
            }
            if (!$current_User->check_status('can_be_validated')) {
                // don't display activateinfo screen
                $after_email_validation = $Settings->get('after_email_validation');
                if ($after_email_validation == 'return_to_original') {
                    // we want to return to original page after account activation
                    // check if Session 'validatemail.redirect_to' param is still set
                    $redirect_to = $Session->get('core.validatemail.redirect_to');
                    if (empty($redirect_to)) {
                        // Session param is empty try to get general redirect_to param
                        $redirect_to = param('redirect_to', 'url', '');
                    } else {
                        // cleanup validateemail.redirect_to param from session
                        $Session->delete('core.validatemail.redirect_to');
                    }
                } else {
                    // go to after email validation url which is set in the user general settings form
                    $redirect_to = $after_email_validation;
                }
                if (empty($redirect_to) || preg_match('#disp=activateinfo#', $redirect_to)) {
                    // redirect_to is pointing to the activate info display or is empty
                    // redirect to referer page
                    $redirect_to = '';
                }
                if ($current_User->check_status('is_validated')) {
                    $Messages->add(T_('Your account has already been activated.'));
                }
                header_redirect($redirect_to, 302);
                // will have exited
            }
            if (($login_Blog =& get_setting_Blog('login_blog_ID')) && $Blog->ID != $login_Blog->ID) {
                // Redirect to special blog for login/register actions if it is defined in general settings
                header_redirect($login_Blog->get('activateinfourl', array('glue' => '&')));
            }
            break;
        case 'profile':
        case 'avatar':
            $action = param_action();
            if ($action == 'crop' && is_logged_in()) {
                // Check data for crop action:
                global $current_User, $cropped_File;
                $file_ID = param('file_ID', 'integer');
                if (!($cropped_File = $current_User->get_File_by_ID($file_ID, $error_code))) {
                    // Current user cannot crop this file
                    set_param('action', '');
                }
            }
        case 'pwdchange':
        case 'userprefs':
        case 'subs':
            $seo_page_type = 'Special feature page';
            if ($Blog->get_setting('special_noindex')) {
                // We prefer robots not to index these pages:
                $robots_index = false;
            }
            // Display messages depending on user email status
            display_user_email_status_message();
            break;
        case 'users':
            if (!is_logged_in() && !$Settings->get('allow_anonymous_user_list')) {
                // Redirect to the login page if not logged in and allow anonymous user setting is OFF
                $Messages->add(T_('You must log in to view the user directory.'));
                header_redirect(get_login_url('cannot see user'), 302);
                // will have exited
            }
            if (is_logged_in() && !check_user_status('can_view_users')) {
                // user status doesn't permit to view users list
                if (check_user_status('can_be_validated')) {
                    // user is logged in but his/her account is not active yet
                    // Redirect to the account activation page
                    $Messages->add(T_('You must activate your account before you can view the user directory. <b>See below:</b>'));
                    header_redirect(get_activate_info_url(), 302);
                    // will have exited
                }
                // set where to redirect
                $error_redirect_to = empty($Blog) ? $baseurl : $Blog->gen_blogurl();
                $Messages->add(T_('Your account status currently does not permit to view the user directory.'));
                header_redirect($error_redirect_to, 302);
                // will have exited
            }
            if (has_cross_country_restriction('users', 'list') && empty($current_User->ctry_ID)) {
                // User may browse other users only from the same country
                $Messages->add(T_('Please specify your country before attempting to contact other users.'));
                header_redirect(get_user_profile_url());
            }
            $seo_page_type = 'Users list';
            $robots_index = false;
            break;
        case 'user':
            // get user_ID because we want it in redirect_to in case we need to ask for login.
            $user_ID = param('user_ID', 'integer', '', true);
            // set where to redirect in case of error
            $error_redirect_to = empty($Blog) ? $baseurl : $Blog->gen_blogurl();
            if (!is_logged_in()) {
                // Redirect to the login page if not logged in and allow anonymous user setting is OFF
                $user_available_by_group_level = true;
                if (!empty($user_ID)) {
                    $UserCache =& get_UserCache();
                    if ($User =& $UserCache->get_by_ID($user_ID, false)) {
                        // If user exists we can check if the anonymous users have an access to view the user by group level limitation
                        $User->get_Group();
                        $user_available_by_group_level = $User->Group->level >= $Settings->get('allow_anonymous_user_level_min') && $User->Group->level <= $Settings->get('allow_anonymous_user_level_max');
                    }
                }
                if (!$Settings->get('allow_anonymous_user_profiles') || !$user_available_by_group_level || empty($user_ID)) {
                    // If this user is not available for anonymous users
                    $Messages->add(T_('You must log in to view this user profile.'));
                    header_redirect(get_login_url('cannot see user'), 302);
                    // will have exited
                }
            }
            if (is_logged_in() && !check_user_status('can_view_user', $user_ID)) {
                // user is logged in, but his/her status doesn't permit to view user profile
                if (check_user_status('can_be_validated')) {
                    // user is logged in but his/her account is not active yet
                    // Redirect to the account activation page
                    $Messages->add(T_('You must activate your account before you can view this user profile. <b>See below:</b>'));
                    header_redirect(get_activate_info_url(), 302);
                    // will have exited
                }
                $Messages->add(T_('Your account status currently does not permit to view this user profile.'));
                header_redirect($error_redirect_to, 302);
                // will have exited
            }
            if (!empty($user_ID)) {
                $UserCache =& get_UserCache();
                $User =& $UserCache->get_by_ID($user_ID, false);
                if (empty($User)) {
                    $Messages->add(T_('The requested user does not exist!'));
                    header_redirect($error_redirect_to);
                    // will have exited
                }
                if ($User->check_status('is_closed')) {
                    $Messages->add(T_('The requested user account is closed!'));
                    header_redirect($error_redirect_to);
                    // will have exited
                }
                if (has_cross_country_restriction('any')) {
                    if (empty($current_User->ctry_ID)) {
                        // Current User country is not set
                        $Messages->add(T_('Please specify your country before attempting to contact other users.'));
                        header_redirect(get_user_profile_url());
                        // will have exited
                    }
                    if (has_cross_country_restriction('users', 'profile') && $current_User->ctry_ID !== $User->ctry_ID) {
                        // Current user country is different then edited user country and cross country user browsing is not enabled.
                        $Messages->add(T_('You don\'t have permission to view this user profile.'));
                        header_redirect(url_add_param($error_redirect_to, 'disp=403', '&'));
                        // will have exited
                    }
                }
            }
            // Initialize users list from session cache in order to display prev/next links:
            // It is used to navigate between users
            load_class('users/model/_userlist.class.php', 'UserList');
            global $UserList;
            $UserList = new UserList();
            $UserList->memorize = false;
            $UserList->load_from_Request();
            $seo_page_type = 'User display';
            break;
        case 'edit':
            global $current_User, $post_ID;
            // Post ID, go from $_GET when we edit a post from Front-office
            //          or from $_POST when we switch from Back-office
            $post_ID = param('p', 'integer', empty($post_ID) ? 0 : $post_ID, true);
            if (!is_logged_in()) {
                // Redirect to the login page if not logged in and allow anonymous user setting is OFF
                $redirect_to = url_add_param($Blog->gen_blogurl(), 'disp=edit');
                $Messages->add(T_('You must log in to create & edit posts.'));
                header_redirect(get_login_url('cannot edit posts', $redirect_to), 302);
                // will have exited
            }
            if (!$current_User->check_status('can_edit_post')) {
                if ($current_User->check_status('can_be_validated')) {
                    // user is logged in but his/her account was not activated yet
                    // Redirect to the account activation page
                    $Messages->add(T_('You must activate your account before you can create & edit posts. <b>See below:</b>'));
                    header_redirect(get_activate_info_url(), 302);
                    // will have exited
                }
                // Redirect to the blog url for users without messaging permission
                $Messages->add(T_('You are not allowed to create & edit posts!'));
                header_redirect($Blog->gen_blogurl(), 302);
            }
            // user logged in and the account was activated
            check_item_perm_edit($post_ID);
            if (!blog_has_cats($Blog->ID)) {
                // No categories are in this blog
                $error_message = T_('Since this blog has no categories, you cannot post into it.');
                if ($current_User->check_perm('blog_cats', 'edit', false, $Blog->ID)) {
                    // If current user has a permission to create a category
                    global $admin_url;
                    $error_message .= ' ' . sprintf(T_('You must <a %s>create categories</a> first.'), 'href="' . $admin_url . '?ctrl=chapters&amp;blog=' . $Blog->ID . '"');
                }
                $Messages->add($error_message, 'error');
                header_redirect($Blog->gen_blogurl(), 302);
            }
            // Prepare the 'In-skin editing':
            init_inskin_editing();
            break;
        case 'edit_comment':
            global $current_User, $edited_Comment, $comment_Item, $Item, $comment_title, $comment_content, $display_params;
            // comment ID
            $comment_ID = param('c', 'integer', 0, true);
            if (!is_logged_in()) {
                // Redirect to the login page if not logged in and allow anonymous user setting is OFF
                $redirect_to = url_add_param($Blog->gen_blogurl(), 'disp=edit_comment');
                $Messages->add(T_('You must log in to edit comments.'));
                header_redirect(get_login_url('cannot edit comments', $redirect_to), 302);
                // will have exited
            }
            if (!$current_User->check_status('can_edit_comment')) {
                if ($current_User->check_status('can_be_validated')) {
                    // user is logged in but his/her account was not activated yet
                    // Redirect to the account activation page
                    $Messages->add(T_('You must activate your account before you can edit comments. <b>See below:</b>'));
                    header_redirect(get_activate_info_url(), 302);
                    // will have exited
                }
                // Redirect to the blog url for users without messaging permission
                $Messages->add('You are not allowed to edit comments!');
                header_redirect($Blog->gen_blogurl(), 302);
            }
            if (empty($comment_ID)) {
                // Can't edit a not exisiting comment
                $Messages->add('Invalid comment edit URL!');
                global $disp;
                $disp = 404;
                break;
            }
            $CommentCache =& get_CommentCache();
            $edited_Comment = $CommentCache->get_by_ID($comment_ID);
            $comment_Item = $edited_Comment->get_Item();
            if (!$current_User->check_perm('comment!CURSTATUS', 'edit', false, $edited_Comment)) {
                // If User has no permission to edit comments with this comment status:
                $Messages->add('You are not allowed to edit the previously selected comment!');
                header_redirect($Blog->gen_blogurl(), 302);
            }
            $comment_title = '';
            $comment_content = htmlspecialchars_decode($edited_Comment->content);
            // Format content for editing, if we were not already in editing...
            $Plugins_admin =& get_Plugins_admin();
            $comment_Item->load_Blog();
            $params = array('object_type' => 'Comment', 'object_Blog' => &$comment_Item->Blog);
            $Plugins_admin->unfilter_contents($comment_title, $comment_content, $edited_Comment->get_renderers_validated(), $params);
            $Item = $comment_Item;
            $display_params = array();
            break;
        case 'useritems':
        case 'usercomments':
            global $display_params, $viewed_User;
            // get user_ID because we want it in redirect_to in case we need to ask for login.
            $user_ID = param('user_ID', 'integer', true, true);
            if (empty($user_ID)) {
                bad_request_die(sprintf(T_('Parameter &laquo;%s&raquo; is required!'), 'user_ID'));
            }
            // set where to redirect in case of error
            $error_redirect_to = empty($Blog) ? $baseurl : $Blog->gen_blogurl();
            if (!is_logged_in()) {
                // Redirect to the login page if not logged in and allow anonymous user setting is OFF
                $Messages->add(T_('You must log in to view this user profile.'));
                header_redirect(get_login_url('cannot see user'), 302);
                // will have exited
            }
            if (is_logged_in() && !check_user_status('can_view_user', $user_ID)) {
                // user is logged in, but his/her status doesn't permit to view user profile
                if (check_user_status('can_be_validated')) {
                    // user is logged in but his/her account is not active yet
                    // Redirect to the account activation page
                    $Messages->add(T_('You must activate your account before you can view this user profile. <b>See below:</b>'));
                    header_redirect(get_activate_info_url(), 302);
                    // will have exited
                }
                $Messages->add(T_('Your account status currently does not permit to view this user profile.'));
                header_redirect($error_redirect_to, 302);
                // will have exited
            }
            if (!empty($user_ID)) {
                $UserCache =& get_UserCache();
                $viewed_User = $UserCache->get_by_ID($user_ID, false);
                if (empty($viewed_User)) {
                    $Messages->add(T_('The requested user does not exist!'));
                    header_redirect($error_redirect_to);
                    // will have exited
                }
                if ($viewed_User->check_status('is_closed')) {
                    $Messages->add(T_('The requested user account is closed!'));
                    header_redirect($error_redirect_to);
                    // will have exited
                }
            }
            $display_params = !empty($Skin) ? $Skin->get_template('Results') : NULL;
            if ($disp == 'useritems') {
                // Init items list
                global $user_ItemList;
                $useritems_Blog = NULL;
                $user_ItemList = new ItemList2($useritems_Blog, NULL, NULL, NULL, 'ItemCache', 'useritems_');
                $user_ItemList->load_from_Request();
                $user_ItemList->set_filters(array('authors' => $user_ID), true, true);
                $user_ItemList->query();
            } else {
                // Init comments list
                global $user_CommentList;
                $user_CommentList = new CommentList2(NULL, NULL, 'CommentCache', 'usercmts_');
                $user_CommentList->load_from_Request();
                $user_CommentList->set_filters(array('author_IDs' => $user_ID), true, true);
                $user_CommentList->query();
            }
            break;
        case 'comments':
            if (!$Blog->get_setting('comments_latest')) {
                // If latest comments page is disabled - Display 404 page with error message
                $Messages->add(T_('This feature is disabled.'), 'error');
                global $disp;
                $disp = '404';
            }
            break;
        case 'closeaccount':
            global $current_User;
            if (!$Settings->get('account_close_enabled') || is_logged_in() && $current_User->check_perm('users', 'edit', false) || !is_logged_in() && !$Session->get('account_closing_success')) {
                // If an account closing page is disabled - Display 404 page with error message
                // Don't allow admins close own accounts from front office
                // Don't display this message for not logged in users, except of one case to display a bye message after account closing
                global $disp;
                $disp = '404';
            } elseif ($Session->get('account_closing_success')) {
                // User has closed the account
                global $account_closing_success;
                $account_closing_success = $Session->get('account_closing_success');
                // Unset this temp session var to don't display the message twice
                $Session->delete('account_closing_success');
                if (is_logged_in()) {
                    // log out current User
                    logout();
                }
            }
            break;
        case 'tags':
            $seo_page_type = 'Tags';
            if ($Blog->get_setting($disp . '_noindex')) {
                // We prefer robots not to index these pages:
                $robots_index = false;
            }
            break;
    }
    $Debuglog->add('skin_init: $disp=' . $disp . ' / $disp_detail=' . $disp_detail . ' / $seo_page_type=' . $seo_page_type, 'skins');
    // Make this switch block special only for 404 page
    switch ($disp) {
        case '404':
            // We have a 404 unresolved content error
            // How do we want do deal with it?
            skin_404_header();
            // This MAY or MAY not have exited -- will exit on 30x redirect, otherwise will return here.
            // Just in case some dumb robot needs extra directives on this:
            $robots_index = false;
            break;
    }
    global $Hit, $check_browser_version;
    if ($check_browser_version && $Hit->get_browser_version() > 0 && $Hit->is_IE(9, '<')) {
        // Display info message if browser IE < 9 version and it is allowed by config var:
        global $debug;
        $Messages->add(T_('Your web browser is too old. For this site to work correctly, we recommend you use a more recent browser.'), 'note');
        if ($debug) {
            $Messages->add('User Agent: ' . $Hit->get_user_agent(), 'note');
        }
    }
    // dummy var for backward compatibility with versions < 2.4.1 -- prevents "Undefined variable"
    global $global_Cache, $credit_links;
    $credit_links = $global_Cache->get('creds');
    $Timer->pause('skin_init');
    // Check if user is logged in with a not active account, and display an error message if required
    check_allow_disp($disp);
    // initialize Blog enabled widgets, before displaying anything
    init_blog_widgets($Blog->ID);
    // Initialize displaying....
    $Timer->start('Skin:display_init');
    $Skin->display_init();
    $Timer->pause('Skin:display_init');
    // Send default headers:
    // See comments inside of this function:
    headers_content_mightcache('text/html');
    // In most situations, you do NOT want to cache dynamic content!
    // Never allow Messages to be cached!
    if ($Messages->count() && !empty($PageCache)) {
        // Abort PageCache collect
        $PageCache->abort_collect();
    }
}
    /**
     * Get ready for displaying the skin.
     *
     * This may register some CSS or JS...
     */
    function display_init()
    {
        global $Messages, $debug, $disp;
        // Request some common features that the parent function (Skin::display_init()) knows how to provide:
        parent::display_init(array('jquery', 'font_awesome', 'bootstrap', 'bootstrap_evo_css', 'bootstrap_messages', 'style_css', 'colorbox', 'bootstrap_init_tooltips', 'disp_auto'));
        // Include Masonry Grind for MediaIdx
        if ($disp == 'mediaidx' || $disp == 'posts') {
            require_js('assets/js/masonry.pkgd.min.js', 'relative');
            require_js('assets/js/imagesloaded.pkgd.min.js', 'relative');
        }
        if ($disp == 'posts') {
            add_js_headline("\n\t\t\tjQuery( document ).ready( function(\$) {\n\t\t\t\t\$('.main_item_posts').imagesLoaded().done( function( instance ) {\n\t\t\t\t\t\$('.main_item_posts').masonry({\n\t\t\t\t\t\t// options\n\t\t\t\t\t\titemSelector: '.item_posts',\n\t\t\t\t\t\tpercentPosition: true,\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t\t");
        }
        if ($disp == 'mediaidx') {
            add_js_headline("\n\t\t\tjQuery( document ).ready( function(\$) {\n\t\t\t\t\$('.evo_image_index').imagesLoaded().done( function( instance ) {\n\t\t\t\t\t\$('.evo_image_index').masonry({\n\t\t\t\t\t\t// options\n\t\t\t\t\t\titemSelector: '.grid-item',\n\t\t\t\t\t\tpercentPosition: true,\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t\t");
        }
        require_js('assets/js/script.js', 'relative');
        // Skin specific initializations:
        // Limit images by max height:
        $max_image_height = intval($this->get_setting('max_image_height'));
        if ($max_image_height > 0) {
            add_css_headline('.evo_image_block img { max-height: ' . $max_image_height . 'px; width: auto; }');
        }
        // Skin specific initializations:
        // Add custom CSS:
        $custom_css = '';
        /**
         * ============================================================================
         * General Settings Output
         * ============================================================================
         */
        if ($color = $this->get_setting('color_schemes')) {
            // General
            $custom_css .= '
			a, a:hover, a:active, a:focus,
			.disp_search #main-content .search_result .search_content_wrap .search_title a:hover, .disp_search #main-content .search_result .search_content_wrap .search_title a:active, .disp_search #main-content .search_result .search_content_wrap .search_title a:focus,
			.widget_plugin_evo_Calr .bCalendarTable tfoot a:hover, #main-content .evo_post .small.text-muted a:hover span, #main-content .evo_featured_post .small.text-muted a:hover span
			{ color: ' . $color . '; }

			/* Header */
			.navbar-collapse .nav.nav-tabs li a::after, .navbar-collapse ul li.active a
			{ background-color: ' . $color . '; }

			/* Posts */
			#content .evo_post_title h2 a:hover,
			#main-content .evo_post .small.text-muted a:hover, #main-content .evo_featured_post .small.text-muted a:hover,
			.disp_search #main-content .search_result .search_result_score.dimmed
			{ color: ' . $color . '; }

			#main-content .evo_intro_post, #main-content .featurepost,
			.pagination > .active > span, .pagination > .active > span:hover, .pagination > li > a:hover,
			#main-content .post_tags a:hover, #main-content .post_tags a:active, #main-content .post_tags a:focus,
			#main-content .evo_post .evo_post__full .evo_post_more_link a:hover, #main-content .evo_featured_post .evo_post__full .evo_post_more_link a:hover, #main-content .evo_post .evo_post__excerpt .evo_post_more_link a:hover, #main-content .evo_featured_post .evo_post__excerpt .evo_post_more_link a:hover, #main-content .evo_post .evo_post__full .evo_post__excerpt_more_link a:hover, #main-content .evo_featured_post .evo_post__full .evo_post__excerpt_more_link a:hover, #main-content .evo_post .evo_post__excerpt .evo_post__excerpt_more_link a:hover, #main-content .evo_featured_post .evo_post__excerpt .evo_post__excerpt_more_link a:hover, #main-content .evo_post .evo_post__full .evo_post_more_link a:active, #main-content .evo_featured_post .evo_post__full .evo_post_more_link a:active, #main-content .evo_post .evo_post__excerpt .evo_post_more_link a:active, #main-content .evo_featured_post .evo_post__excerpt .evo_post_more_link a:active, #main-content .evo_post .evo_post__full .evo_post__excerpt_more_link a:active, #main-content .evo_featured_post .evo_post__full .evo_post__excerpt_more_link a:active, #main-content .evo_post .evo_post__excerpt .evo_post__excerpt_more_link a:active, #main-content .evo_featured_post .evo_post__excerpt .evo_post__excerpt_more_link a:active, #main-content .evo_post .evo_post__full .evo_post_more_link a:focus, #main-content .evo_featured_post .evo_post__full .evo_post_more_link a:focus, #main-content .evo_post .evo_post__excerpt .evo_post_more_link a:focus, #main-content .evo_featured_post .evo_post__excerpt .evo_post_more_link a:focus, #main-content .evo_post .evo_post__full .evo_post__excerpt_more_link a:focus, #main-content .evo_featured_post .evo_post__full .evo_post__excerpt_more_link a:focus, #main-content .evo_post .evo_post__excerpt .evo_post__excerpt_more_link a:focus, #main-content .evo_featured_post .evo_post__excerpt .evo_post__excerpt_more_link a:focus,
			.disp_front #main-content .widget_core_coll_featured_intro .jumbotron,
			.disp_front #main-content .widget_core_poll .btn-default.active, .disp_front #main-content .widget_core_poll .btn-default.focus, .disp_front #main-content .widget_core_poll .btn-default:active, .disp_front #main-content .widget_core_poll .btn-default:focus, .disp_front #main-content .widget_core_poll .btn-default:hover, .disp_front #main-content .widget_core_poll .open > .dropdown-toggle.btn-default,
			.disp_search #main-content .search_result .search_result_score.dimmed::after,
			.disp_threads #main-content .SaveButton.btn-primary, .disp_messages #main-content .SaveButton.btn-primary, .disp_contacts #main-content .SaveButton.btn-primary,
			.disp_contacts .form_send_contacts .btn-default:hover, .disp_contacts .form_send_contacts .btn-default:active, .disp_contacts .form_send_contacts .btn-default:focus,
			.filters .btn-info,
			.disp_threads #main-content .results .action_icon.btn-primary, .disp_messages #main-content .results .action_icon.btn-primary, .disp_contacts #main-content .results .action_icon.btn-primary,
			.btn-success, .pagination li.active a:hover, .pagination li.active span:hover, .pagination li.active a:active, .pagination li.active span:active, .pagination li.active a:focus, .pagination li.active span:focus, .pagination li.active a, .pagination li.active span, .pagination li a:hover, .pagination li span:hover, .pagination li a:active, .pagination li span:active, .pagination li a:focus, .pagination li span:focus,
			.disp_profile #main-content .profile_tabs li.active a, .disp_avatar #main-content .profile_tabs li.active a, .disp_pwdchange #main-content .profile_tabs li.active a, .disp_userprefs #main-content .profile_tabs li.active a, .disp_subs #main-content .profile_tabs li.active a,
			.disp_profile #main-content .profile_tabs a:hover, .disp_avatar #main-content .profile_tabs a:hover, .disp_pwdchange #main-content .profile_tabs a:hover, .disp_userprefs #main-content .profile_tabs a:hover, .disp_subs #main-content .profile_tabs a:hover, .disp_profile #main-content .profile_tabs a:active, .disp_avatar #main-content .profile_tabs a:active, .disp_pwdchange #main-content .profile_tabs a:active, .disp_userprefs #main-content .profile_tabs a:active, .disp_subs #main-content .profile_tabs a:active, .disp_profile #main-content .profile_tabs a:focus, .disp_avatar #main-content .profile_tabs a:focus, .disp_pwdchange #main-content .profile_tabs a:focus, .disp_userprefs #main-content .profile_tabs a:focus, .disp_subs #main-content .profile_tabs a:focus,
			.disp_profile #main-content .evo_form .panel-heading, .disp_avatar #main-content .evo_form .panel-heading, .disp_pwdchange #main-content .evo_form .panel-heading, .disp_userprefs #main-content .evo_form .panel-heading, .disp_subs #main-content .evo_form .panel-heading,
			.evo_panel__login .btn.btn-success, .evo_panel__lostpass .btn.btn-success, .evo_panel__register .btn.btn-success, .evo_panel__activation .btn.btn-success,
			.disp_edit #item_checkchanges .panel .panel-heading
			{ background-color: ' . $color . '; }

			.disp_front #main-content .widget_core_poll .btn-default.active, .disp_front #main-content .widget_core_poll .btn-default.focus, .disp_front #main-content .widget_core_poll .btn-default:active, .disp_front #main-content .widget_core_poll .btn-default:focus, .disp_front #main-content .widget_core_poll .btn-default:hover, .disp_front #main-content .widget_core_poll .open > .dropdown-toggle.btn-default,
			.disp_search #main-content .search_result .search_result_score.dimmed,
			.disp_threads #main-content .SaveButton.btn-primary, .disp_messages #main-content .SaveButton.btn-primary, .disp_contacts #main-content .SaveButton.btn-primary,
			.disp_contacts .form_send_contacts .btn-default:hover, .disp_contacts .form_send_contacts .btn-default:active, .disp_contacts .form_send_contacts .btn-default:focus,
			.filters .btn-info,
			.disp_threads #main-content .results .action_icon.btn-primary, .disp_messages #main-content .results .action_icon.btn-primary, .disp_contacts #main-content .results .action_icon.btn-primary,
			.disp_threads #main-content .evo_form__thread input:focus, .disp_messages #main-content .evo_form__thread input:focus, .disp_contacts #main-content .evo_form__thread input:focus, .disp_threads #main-content .evo_form__thread textarea:focus, .disp_messages #main-content .evo_form__thread textarea:focus, .disp_contacts #main-content .evo_form__thread textarea:focus,
			.btn-success, .pagination li.active a:hover, .pagination li.active span:hover, .pagination li.active a:active, .pagination li.active span:active, .pagination li.active a:focus, .pagination li.active span:focus, .disp_msgform #main-content .form_text_input:hover, .disp_msgform #main-content .form_textarea_input:hover, .disp_msgform #main-content .form_text_input:active, .disp_msgform #main-content .form_textarea_input:active, .disp_msgform #main-content .form_text_input:focus, .disp_msgform #main-content .form_textarea_input:focus,

			.disp_profile #main-content .evo_form .panel-body .form-control:hover, .disp_avatar #main-content .evo_form .panel-body .form-control:hover, .disp_pwdchange #main-content .evo_form .panel-body .form-control:hover, .disp_userprefs #main-content .evo_form .panel-body .form-control:hover, .disp_subs #main-content .evo_form .panel-body .form-control:hover, .disp_profile #main-content .evo_form .panel-body .form-control:active, .disp_avatar #main-content .evo_form .panel-body .form-control:active, .disp_pwdchange #main-content .evo_form .panel-body .form-control:active, .disp_userprefs #main-content .evo_form .panel-body .form-control:active, .disp_subs #main-content .evo_form .panel-body .form-control:active, .disp_profile #main-content .evo_form .panel-body .form-control:focus, .disp_avatar #main-content .evo_form .panel-body .form-control:focus, .disp_pwdchange #main-content .evo_form .panel-body .form-control:focus, .disp_userprefs #main-content .evo_form .panel-body .form-control:focus, .disp_subs #main-content .evo_form .panel-body .form-control:focus,

			#login_form input:focus:invalid:focus, #login_form select:focus:invalid:focus, #login_form textarea:focus:invalid:focus, .evo_panel__login .btn.btn-success, .evo_panel__lostpass .btn.btn-success, .evo_panel__register .btn.btn-success, .evo_panel__activation .btn.btn-success, .form-control:focus,

			.disp_edit #item_checkchanges .panel
			{ border-color: ' . $color . '; }

			.disp_posts #content .evo_featured_post
			{ border-left-color: ' . $color . '; }

			/* Sidebar - Widget - Single */
			.evo_widget a:hover, .evo_widget a:active, .evo_widget a:focus,
			#main-footer .main_widget a:hover, #main-footer .main_widget a:active, #main-footer .main_widget a:focus,
			.evo_comment .evo_comment_info .delete_link:hover, .evo_comment__preview .evo_comment_info .delete_link:hover, .evo_comment .evo_comment_info .edit_link:hover, .evo_comment__preview .evo_comment_info .edit_link:hover, .evo_comment .evo_comment_info .delete_link:active, .evo_comment__preview .evo_comment_info .delete_link:active, .evo_comment .evo_comment_info .edit_link:active, .evo_comment__preview .evo_comment_info .edit_link:active, .evo_comment .evo_comment_info .delete_link:focus, .evo_comment__preview .evo_comment_info .delete_link:focus, .evo_comment .evo_comment_info .edit_link:focus, .evo_comment__preview .evo_comment_info .edit_link:focus,
			.disp_comments #main-content .evo_comment .evo_comment_title.first a,
			.evo_comment .evo_comment_title a:hover, .evo_comment__preview .evo_comment_title a:hover
			{ color: ' . $color . '; }

			.widget_core_coll_search_form .search .search_submit,
			.tag_cloud a:hover, .tag_cloud a:active, .tag_cloud a:focus,
			.widget_plugin_evo_Calr .bCalendarTable #bCalendarToday,
			#main-footer .main_widget .widget_core_coll_tag_cloud .tag_cloud a:hover, #main-footer .main_widget .widget_core_coll_tag_cloud .tag_cloud a:active, #main-footer .main_widget .widget_core_coll_tag_cloud .tag_cloud a:focus,
			.bt-top:hover, .bt-top:focus, .bt-top:active,
			.disp_single #feedbacks .evo_comment__meta_info a:hover, .disp_page #feedbacks .evo_comment__meta_info a:hover,
			#comment_form .evo_form .submit,
			#comment_form .evo_form .preview:hover, #comment_form .evo_form .preview:focus, #comment_form .evo_form .preview:active,
			.widget_core_user_login .submit:hover, .widget_core_user_register .submit:hover,
			.disp_single #main-content .pager .previous a::before, .disp_page #main-content .pager .previous a::before, .disp_single #main-content .pager .next a::before, .disp_page #main-content .pager .next a::before,
			.evo_post_comment_notification .btn:hover, .evo_post_comment_notification .btn:active, .evo_post_comment_notification .btn:focus,
			.disp_threads #main-content .submit, .disp_messages #main-content .submit, .disp_contacts #main-content .submit, .disp_msgform #main-content .submit,
			.disp_user #main-content .pager a:hover, .disp_user #main-content .pager a:focus, .disp_user #main-content .pager a:active
			{ background-color: ' . $color . '; }

			.widget_core_coll_search_form .search .search_field,
			.widget_core_coll_search_form .search .search_submit,
			.bt-top:hover, .bt-top:focus, .bt-top:active,
			.disp_single #feedbacks .evo_comment__meta_info a:hover, .disp_page #feedbacks .evo_comment__meta_info a:hover,
			#comment_form .evo_form .form_text_input:focus, #comment_form .evo_form .form_textarea_input:focus,
			#comment_form .evo_form .submit,
			#comment_form .evo_form .preview:hover, #comment_form .evo_form .preview:focus, #comment_form .evo_form .preview:active,
			.widget_core_user_login .submit:hover, .widget_core_user_register .submit:hover,
			.disp_single #main-content .pager .previous a:hover, .disp_page #main-content .pager .previous a:hover, .disp_single #main-content .pager .next a:hover, .disp_page #main-content .pager .next a:hover,
			.evo_post_comment_notification .btn:hover, .evo_post_comment_notification .btn:active, .evo_post_comment_notification .btn:focus,
			.disp_threads #main-content .submit, .disp_messages #main-content .submit, .disp_contacts #main-content .submit, .disp_msgform #main-content .submit
			{ border-color: ' . $color . '; }
			';
        }
        // Site Background
        if ($this->get_setting('background_type') == 'color') {
            $color = $this->get_setting('site_background_color');
            $custom_css .= 'body {background-color: ' . $color . ';}';
        }
        $bg_image = $this->get_setting('bg_image');
        if ($this->get_setting('background_type') == 'images' && $bg_image) {
            if ($bg_image == "none") {
                $custom_css .= "body { background: transparent; }";
            } else {
                $custom_css .= "body { background-image: url('" . $bg_image . "');}";
            }
        }
        // User custom bg images setting
        $bg_image_custom = $this->get_setting('bg_image_custom');
        if ($this->get_setting('background_type') == 'custom_images' && $bg_image_custom) {
            if ($bg_image_custom == "none") {
                $custom_css .= "body { background: transparent; }";
            } else {
                $custom_css .= "body { background-image: url('" . $bg_image_custom . "');}";
            }
        }
        $bg_image_custom_attach = $this->get_setting('bg_image_custom_attach');
        if ($this->get_setting('background_type') == 'custom_images' && $bg_image_custom_attach) {
            if ($bg_image_custom_attach == 'initial') {
                $custom_css .= "body { background-attachment: initial; }";
            } else {
                $custom_css .= "body { background-attachment: fixed; }";
            }
        }
        $bg_image_custom_size = $this->get_setting('bg_image_custom_size');
        if ($this->get_setting('background_type') == 'custom_images' && $bg_image_custom_size) {
            if ($bg_image_custom_size == 'auto') {
                $custom_css .= "body { background-size: auto; }";
            } else {
                if ($bg_image_custom_size == 'contain') {
                    $custom_css .= "body { background-size: contain; }";
                } else {
                    $custom_css .= "body { background-size: cover; }";
                }
            }
        }
        if ($bg = $this->get_setting('bg_wrap_content')) {
            $custom_css .= '#main-content .evo_post, #main-content .evo_featured_post, .disp_posts #main-content .evo_featured_post, div.error_404, .msg_nothing, #main-content .title_head_post, #main-sidebar .evo_widget, #content .evo_widget, .disp_comments #main-content .evo_comment, .disp_user #main-content .profile_content, .disp_threads #main-content, .disp_messages #main-content, .disp_contacts #main-content, .disp_msgform #main-content, .disp_threads #main-content .title_head_post, .disp_messages #main-content .title_head_post, .disp_contacts #main-content .title_head_post, .disp_msgform #main-content .title_head_post, .disp_help #main-content, .disp_users .results .filters, .disp_users .results .table_scroll, .disp_access_requires_login #main-content, .disp_lostpassword #main-content, .disp_login #main-content, .disp_register #main-content, .disp_search #main-content, .disp_search #main-content .title_head_post, .disp_search #main-content .search_result, .disp_404 #main-content, .disp_front #main-content .evo_widget, .disp_sitemap #main-content h3, .disp_messages #main-content, .disp_messages #main-content .title_head_post, .disp_profile #main-content .evo_form .panel-body, .disp_avatar #main-content .evo_form .panel-body, .disp_pwdchange #main-content .evo_form .panel-body, .disp_userprefs #main-content .evo_form .panel-body, .disp_subs #main-content .evo_form .panel-body, .disp_mediaidx #main-content .evo_image_index .note
			{ background-color: ' . $bg . '; }';
            $custom_css .= '.disp_mediaidx #main-content .evo_image_index .item{ border-color: ' . $bg . ' }';
        }
        /**
         * ============================================================================
         * Page Setting
         * ============================================================================
         */
        if ($font = $this->get_setting('page_font_size')) {
            $custom_css .= 'body{ font-size: ' . $font . 'px }';
        }
        if ($color = $this->get_setting('page_info_color')) {
            $custom_css .= '.disp_posts #main-content .evo_post .small.text-muted, .disp_posts #main-content .evo_featured_post .small.text-muted, .disp_page #main-content .evo_post .small.text-muted, .disp_page #main-content .evo_featured_post .small.text-muted, .disp_single #main-content .evo_post .small.text-muted, .disp_single #main-content .evo_featured_post .small.text-muted { color: ' . $color . ' }';
        }
        if ($color = $this->get_setting('page_info_link')) {
            $custom_css .= '.disp_posts #main-content .evo_post .small.text-muted span, .disp_posts #main-content .evo_featured_post .small.text-muted span, #main-content .evo_post .small.text-muted a, .disp_posts #main-content .evo_featured_post .small.text-muted a, .disp_page #main-content .evo_post .small.text-muted span, .disp_page #main-content .evo_featured_post .small.text-muted span, #main-content .evo_post .small.text-muted a, .disp_page #main-content .evo_featured_post .small.text-muted a, .disp_single #main-content .evo_post .small.text-muted span, .disp_single #main-content .evo_featured_post .small.text-muted span, #main-content .evo_post .small.text-muted a, .disp_single #main-content .evo_featured_post .small.text-muted a { color: ' . $color . ' }';
        }
        if ($color = $this->get_setting('page_content_color')) {
            $custom_css .= 'html, body, .disp_single #feedbacks, .disp_page #feedbacks, #content .evo_widget, .disp_posts #main-content .evo_post__full_text, .disp_posts #main-content .evo_post__excerpt_text, .disp_page #main-content .evo_post__full_text, .disp_page #main-content .evo_post__excerpt_text, .disp_single #main-content .evo_post__full_text, .disp_single #main-content .evo_post__excerpt_text, .disp_comments #main-content .evo_comment .evo_comment_text, .disp_search #main-content .msg_nothing, .disp_search #main-content .search_result .search_content_wrap .result_content
			{ color: ' . $color . ' !important}';
        }
        if ($color = $this->get_setting('page_heading_color')) {
            $custom_css .= 'h1, h2, h3, h4, h5, h6,
			.disp_front #main-content .evo_widget .title_widget, .disp_mediaidx #main-content .evo_image_index .note, .disp_404 .error_404 .fa-warning, div.error_404 .fa-warning, .disp_search #main-content .search_result .search_content_wrap .search_title, .disp_search #main-content .search_result .search_content_wrap .search_title a
			{ color: ' . $color . ' }';
            $custom_css .= '.disp_front #main-content .evo_widget .title_widget::after { background-color: ' . $color . ' }';
        }
        /**
         * ============================================================================
         * Header Settings Output
         * ============================================================================
         */
        if ($width = $this->get_setting('head_center_mode')) {
            $custom_css .= '
			@media only screen and ( max-width: ' . $width . 'px )
			and ( min-width: 768px ) {
				#main-header .col-md-4,
				#main-header .col-md-8 {
					width: 100%;
					text-align: center;
					margin: 0 auto;
				}

				#main-header {
					padding-bottom: 2rem;
				}

				#main-header .col-md-4{
					margin-bottom: 15px;
				}

				.navbar-collapse .nav.nav-tabs {
					display: inline-block;
					text-align: center;
					margin: 0 auto;
					float: none;
				}
			}
			';
        }
        if ($color = $this->get_setting('header_bg_color')) {
            $custom_css .= 'body #main-header { background-color: ' . $color . ' }';
        }
        if ($color = $this->get_setting('nav_color_link')) {
            $custom_css .= '.navbar-collapse .nav.nav-tabs li a{ color: ' . $color . ' }';
        }
        if ($color = $this->get_setting('nav_color_hovlink')) {
            $custom_css .= '.navbar-collapse .nav.nav-tabs li a:hover { color: ' . $color . ' }';
        }
        if ($color = $this->get_setting('head_tagline_bg_color')) {
            $custom_css .= 'body #head_tagline { background-color: ' . $color . " }\n";
        }
        /**
         * ============================================================================
         * Posts
         * ============================================================================
         */
        if ($color = $this->get_setting('posts_title_color')) {
            $custom_css .= '
			.disp_posts #main-content .evo_post_title h1 a, .disp_posts #main-content .evo_post_title h2 a, .disp_posts #main-content .evo_post_title h3 a,
			.disp_posts #main-content .evo_post .evo_post__full h1, .disp_posts #main-content .evo_featured_post .evo_post__full h1, .disp_posts #main-content .evo_post .evo_post__excerpt h1, .disp_posts #main-content .evo_featured_post .evo_post__excerpt h1, .disp_posts #main-content .evo_post .evo_post__full h2, .disp_posts #main-content .evo_featured_post .evo_post__full h2, .disp_posts #main-content .evo_post .evo_post__excerpt h2, .disp_posts #main-content .evo_featured_post .evo_post__excerpt h2, .disp_posts #main-content .evo_post .evo_post__full h3, .disp_posts #main-content .evo_featured_post .evo_post__full h3, .disp_posts #main-content .evo_post .evo_post__excerpt h3, .disp_posts #main-content .evo_featured_post .evo_post__excerpt h3, .disp_posts #main-content .evo_post .evo_post__full h4, .disp_posts #main-content .evo_featured_post .evo_post__full h4, .disp_posts #main-content .evo_post .evo_post__excerpt h4, .disp_posts #main-content .evo_featured_post .evo_post__excerpt h4, .disp_posts #main-content .evo_post .evo_post__full h5, .disp_posts #main-content .evo_featured_post .evo_post__full h5, .disp_posts #main-content .evo_post .evo_post__excerpt h5, .disp_posts #main-content .evo_featured_post .evo_post__excerpt h5, .disp_posts #main-content .evo_post .evo_post__full h6, .disp_posts #main-content .evo_featured_post .evo_post__full h6, .disp_posts #main-content .evo_post .evo_post__excerpt h6, .disp_posts #main-content .evo_featured_post .evo_post__excerpt h6,
			.disp_posts #main-content .post_tags h3
			{ color: ' . $color . ' }
			';
        }
        // if ( $color = $this->get_setting( 'posts_info_color' ) ) {
        // 	$custom_css .= '.disp_posts #main-content .evo_post .small.text-muted, .disp_posts #main-content .evo_featured_post .small.text-muted { color: '.$color.' }';
        // }
        //
        // if ( $color =$this->get_setting( 'posts_info_link' ) ) {
        // 	$custom_css .= '.disp_posts #main-content .evo_post .small.text-muted span, .disp_posts #main-content .evo_featured_post .small.text-muted span, #main-content .evo_post .small.text-muted a, .disp_posts #main-content .evo_featured_post .small.text-muted a { color: '.$color.' }';
        // }
        //
        // if ( $color = $this->get_setting( 'posts_content_color' ) ) {
        // 	$custom_css .= '.disp_posts #main-content .evo_post__full_text, .disp_posts #main-content .evo_post__excerpt_text { color: '.$color.' }';
        // }
        /**
         * ============================================================================
         * Tags
         * ============================================================================
         */
        if ($color = $this->get_setting('tags_color')) {
            $custom_css .= '#main-content .post_tags a, .tag_cloud a, #main-content .post_tags a::before { color: ' . $color . ' }';
        }
        if ($bg = $this->get_setting('tags_bg')) {
            $custom_css .= '#main-content .post_tags a, .tag_cloud a { background-color: ' . $bg . ' }';
        }
        if ($this->get_setting('tags_icon') == 0) {
            $custom_css .= '#main-content .post_tags a::before, .tag_cloud a::before { content: \'\'; display: none }';
        }
        /**
         * ============================================================================
         * Sidebar Widget Options
         * ============================================================================
         */
        // if ( $bg = $this->get_setting( 'side_bg_wrap' ) ) {
        // 	$custom_css .= '#main-sidebar .evo_widget { background-color: '. $bg .' }';
        // }
        if ($color = $this->get_setting('side_widget_title')) {
            $custom_css .= '#main-sidebar .evo_widget .panel-title { color: ' . $color . ' }';
            $custom_css .= '#main-sidebar .evo_widget .panel-title::after { background-color: ' . $color . ' }';
        }
        if ($color = $this->get_setting('side_widget_content')) {
            $custom_css .= '
			#main-sidebar .evo_widget,
			#main-sidebar .widget_core_user_login .user_group,
			#main-sidebar .widget_core_user_login .user_level
			{ color: ' . $color . ' }';
        }
        if ($border = $this->get_setting('side_border')) {
            $custom_css .= '
			#content .evo_widget ul li,
			#content .evo_widget ul > ul > li:last-child,
			.widget_core_linkblog ul ul, .widget_core_content_hierarchy ul ul,
			.widget_core_coll_xml_feeds .notes
			{ border-color: ' . $border . ' }';
        }
        if ($color = $this->get_setting('side_widget_link')) {
            $custom_css .= '#main-sidebar .evo_widget a { color: ' . $color . ' }';
        }
        /**
         * ============================================================================
         * UIL Widget Settings
         * ============================================================================
         */
        if ($this->get_setting('uil_widget_readmore') == 0) {
            $custom_css .= 'div.widget_core_coll_item_list.evo_noexcerpt.evo_withteaser div.item_content > a, div.widget_core_coll_featured_posts.evo_noexcerpt.evo_withteaser div.item_content > a, div.widget_core_coll_post_list.evo_noexcerpt.evo_withteaser div.item_content > a, div.widget_core_coll_page_list.evo_noexcerpt.evo_withteaser div.item_content > a, div.widget_core_coll_related_post_list.evo_noexcerpt.evo_withteaser div.item_content > a, div.widget_core_coll_item_list.evo_withexcerpt.evo_withteaser div.item_content > a, div.widget_core_coll_featured_posts.evo_withexcerpt.evo_withteaser div.item_content > a, div.widget_core_coll_post_list.evo_withexcerpt.evo_withteaser div.item_content > a, div.widget_core_coll_page_list.evo_withexcerpt.evo_withteaser div.item_content > a, div.widget_core_coll_related_post_list.evo_withexcerpt.evo_withteaser div.item_content > a, div.widget_core_coll_item_list.evo_withexcerpt.evo_noteaser div.item_content > a, div.widget_core_coll_featured_posts.evo_withexcerpt.evo_noteaser div.item_content > a, div.widget_core_coll_post_list.evo_withexcerpt.evo_noteaser div.item_content > a, div.widget_core_coll_page_list.evo_withexcerpt.evo_noteaser div.item_content > a, div.widget_core_coll_related_post_list.evo_withexcerpt.evo_noteaser div.item_content > a, div.widget_core_coll_item_list.evo_noexcerpt.evo_withteaser div.item_excerpt > a, div.widget_core_coll_featured_posts.evo_noexcerpt.evo_withteaser div.item_excerpt > a, div.widget_core_coll_post_list.evo_noexcerpt.evo_withteaser div.item_excerpt > a, div.widget_core_coll_page_list.evo_noexcerpt.evo_withteaser div.item_excerpt > a, div.widget_core_coll_related_post_list.evo_noexcerpt.evo_withteaser div.item_excerpt > a, div.widget_core_coll_item_list.evo_withexcerpt.evo_withteaser div.item_excerpt > a, div.widget_core_coll_featured_posts.evo_withexcerpt.evo_withteaser div.item_excerpt > a, div.widget_core_coll_post_list.evo_withexcerpt.evo_withteaser div.item_excerpt > a, div.widget_core_coll_page_list.evo_withexcerpt.evo_withteaser div.item_excerpt > a, div.widget_core_coll_related_post_list.evo_withexcerpt.evo_withteaser div.item_excerpt > a, div.widget_core_coll_item_list.evo_withexcerpt.evo_noteaser div.item_excerpt > a, div.widget_core_coll_featured_posts.evo_withexcerpt.evo_noteaser div.item_excerpt > a, div.widget_core_coll_post_list.evo_withexcerpt.evo_noteaser div.item_excerpt > a, div.widget_core_coll_page_list.evo_withexcerpt.evo_noteaser div.item_excerpt > a, div.widget_core_coll_related_post_list.evo_withexcerpt.evo_noteaser div.item_excerpt > a { display: none }';
        }
        /**
         * ============================================================================
         * Footer Settings Output
         * ============================================================================
         */
        if ($bg_color = $this->get_setting('footer_bg_color')) {
            $custom_css .= 'body #main-footer { background-color: ' . $bg_color . " }\n";
        }
        if ($color = $this->get_setting('footer_widget_title')) {
            $custom_css .= '#main-footer .main_widget .title_widget,
			#main-footer .main_widget .widget_core_org_members .user_link h3 { color: ' . $color . ' }';
            $custom_css .= '#main-footer .main_widget .title_widget::before { background-color: ' . $color . ' }';
        }
        if ($color = $this->get_setting('footer_sm_color')) {
            $custom_css .= '#main-footer .footer_social_media .ufld_icon_links a span, #main-footer .footer_social_media .ufld_icon_links a .fa { color: ' . $color . ' }';
            $custom_css .= '#main-footer .footer_social_media .ufld_icon_links a:hover span, #main-footer .footer_social_media .ufld_icon_links a:hover .fa { color: #FFFFFF }';
        }
        if ($bg_color = $this->get_setting('footer_sm_bgcolor')) {
            $custom_css .= '#main-footer .footer_social_media{ background-color: ' . $bg_color . ' }';
        }
        if ($color = $this->get_setting('footer_widget_content')) {
            $custom_css .= '#main-footer .main_widget { color: ' . $color . ' }';
        }
        if ($link = $this->get_setting('footer_widget_link')) {
            $custom_css .= '#main-footer .main_widget a { color: ' . $link . ' }';
        }
        if ($border_color = $this->get_setting('footer_border_color')) {
            $custom_css .= '#main-footer .main_widget ul li, #main-footer .main_widget ul > ul > li:last-child { border-color: ' . $border_color . '; }';
            $custom_css .= '#main-footer .footer_social_media, #main-footer .copyright,
			#main-footer .main_widget .widget_core_coll_xml_feeds .notes,
			#main-footer #content .evo_widget ul li, #main-footer #content .evo_widget ul > ul > li:last-child, #main-footer .widget_core_linkblog ul ul, #main-footer .widget_core_content_hierarchy ul ul, #main-footer .widget_core_coll_xml_feeds .notes
			{ border-color: ' . $border_color . '; }';
        }
        if ($bg_color = $this->get_setting('footer_tags_bg')) {
            $custom_css .= '#main-footer .evo_widget .tag_cloud a { background-color: ' . $bg_color . '; }';
        }
        if ($color = $this->get_setting('footer_copyright_content')) {
            $custom_css .= '#main-footer .copyright .copyright_text { color: ' . $color . ' }';
        }
        if ($link = $this->get_setting('footer_copyright_link')) {
            $custom_css .= '#main-footer .copyright .copyright_text a { color: ' . $link . ' }';
        }
        /**
         * ============================================================================
         * Mediaidx Custom Style
         * ============================================================================
         */
        if ($padding = $this->get_setting('padding_column')) {
            $custom_css .= '.disp_mediaidx #main-content .evo_image_index .grid-item { padding: ' . $padding . 'px; }';
            $custom_css .= '.disp_mediaidx #main-content .evo_image_index { margin-left: -' . $padding . 'px; margin-right: -' . $padding . 'px; }';
        }
        /**
         * ============================================================================
         * Output CSS
         * ============================================================================
         */
        if (!empty($custom_css)) {
            // Function for custom_css:
            $custom_css = '<style type="text/css">
			<!--
			' . $custom_css . '
			-->
			</style>';
            add_headline($custom_css);
        }
    }