<commit_before><?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) PHP-Fusion Inc
| https://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: debonair/theme.php
| Author: HappyTunes (Russia)
| Co-Author: <NAME> (Hien)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/

if (!defined("IN_FUSION")) {
	die("Access Denied");
}
define("THEME_BULLET", "<span class='bullet'>&middot;</span>");
require_once INCLUDES."theme_functions_include.php";
include "functions.php";
function render_page($license = FALSE) {
	global $userdata, $settings, $locale, $data, $db_prefix, $lookup, $msg_count, $aidlink;
	include THEME."/locale/".LOCALESET."locale.php";

	add_to_head('
	<!--[if lt IE 7]>
	<script type="text/javascript" src="'.THEME.'js/ie-png.js"></script>
	<script type="text/javascript" src="'.THEME.'js/supersleight.js"></script>
	<link rel="stylesheet" type="text/css" href="'.THEME.'css/lt7.css" />
	<![endif]-->
	<!--[if IE]>
	<link rel="stylesheet" type="text/css" href="'.THEME.'css/ie.css" />
	<![endif]-->
	<!--[if IE 7]>
	<link rel="stylesheet" type="text/css" href="'.THEME.'css/ie7.css" />
	<![endif]-->
	<script type="text/javascript" src="'.THEME.'js/jquery.cycle.all.min.js"></script>
	<script type="text/javascript" src="'.THEME.'js/cufon-yui.js"></script>
	<script type="text/javascript" src="'.THEME.'js/Debonair-Calibri.js"></script>
	<script type="text/javascript" src="'.THEME.'js/Cufon-Settings.js"></script>
	<script type="text/javascript" src="'.THEME.'js/slider-settings.js"></script>
	<script type="text/javascript" src="'.THEME.'js/subnavie6.js"></script>
	');
	add_to_head("<link rel='stylesheet' href='".THEME."css/bootstrap_rewrite.css' type='text/css'/>");
	include THEME."theme_db.php";
	$theme_settings = get_theme_settings("debonair");

	echo "<div id='wrapper'>\n";
	echo "<div class='container'>\n";
	echo "<div class='body-wrap'>\n";
	echo "<div class='body-inner-wrap'>\n";
	// start header ----
	$banner_path = fusion_get_settings("sitebanner");
	echo "<header class='clearfix m-t-10'>
		<a class='logo' href='".BASEDIR."index.php'><img src='".($banner_path !== "" ? BASEDIR.$banner_path : IMAGES."php-fusion-logo.png")."' alt='".fusion_get_settings("sitename")."'/></a>
		<div class='tagline'>Super Clean Web 2.0 Business Template</div>\n";
	echo "<div class='call-tag'>\n";
	if (iADMIN) {
		echo "<span class='display-inline-block m-r-10'><a href='".ADMIN.$aidlink."'>".$locale['global_123']."</a></span>\n";
	}
	echo $locale['global_ML102']."\n";
	foreach (fusion_get_enabled_languages() as $lang => $lang_name) {
		echo "<a href='".clean_request("lang=".$lang, array(), FALSE)."'>".$lang_name."</a>\n";
	}
	echo "<i id='theme_search' class='fa fa-search fa-fw'></i>";
	echo "</div>\n</header>\n";
	// end header ----
	// start nav ---
	echo showsublinks();
	// end nav --

	// Header Banner
	$banner_inclusion_url = explode(",", $theme_settings['main_banner_url']);
	if (in_array(START_PAGE, $banner_inclusion_url)) {
		// get the results of the banner
		$result = dbquery("SELECT * FROM ".DB_DEBONAIR." where banner_language='".LANGUAGE."' order by banner_order ASC");
		// show banner
		echo "<aside class='banner'>\n";
		echo "<div id='slider-container'>\n";
		echo "<ul id='slider-box'>\n";
		if (dbrows($result)) {
			while ($data = dbarray($result)) {
				echo "<!--Slide ".$data['banner_id']."-->\n";
				echo "<li>\n";
				echo "<div class='inner-banner'>\n";
				echo "<div class='slider-corner'></div>\n";
				if ($data['banner_image']) {
					echo "<div class='screen'><img src='".THEME."upload/".$data['banner_image']."' alt='".$data['banner_subject']."'/></div>\n";
				}
				if ($data['banner_description'] !== "") {
					echo "<h2>".$data['banner_subject']."</h2>\n";
					echo "<p>".parseubb(parsesmileys($data['banner_description']))."</p>\n";
				} else {
					echo "<h1>".$data['banner_subject']."</h1>\n";
				}
				if ($data['banner_link'] !=="") {
					echo "<div class='button-position'>\n";
					echo "<div class='btn-group'><a class='btn btn-success btn-sm' href='".BASEDIR.$data['banner_link']."'>Learn more</a></div>\n";
					echo "</div>\n";
				}
				echo "</div>\n</li>\n";
				echo "<!--End slide ".$data['banner_id']."-->\n";
			}
		} else {
			 echo "<!--Slide Welcome-->
			 <li>
			 <div class='welcome-banner'><div class='slider-corner'></div>
			 <h1>".$locale['debonair_0500']."</h1>
			 <h2>".$locale['debonair_0501']."</h2>
			 </div>
			 </li>
			 <!-- End Slide Welcome-->
		 	";
			echo "<!--Slide Customize-->
			 <li>
			 <div class='welcome-banner-2'><div class='slider-corner'></div>
			 <h1>".$locale['debonair_0502']."</h1>
			 <h2>".$locale['debonair_0502a']."</h2>
			 <div class='button-position'>
			 <p>".$locale['debonair_0502c']."</p>
			 </div></div>
			 </li>
			 <!-- End Slide Customize-->
		 	";
		}
		echo "</ul>\n";
		echo "<!-- Start Slider Nav-->\n<div class='slide-pager-container'>\n<div id='slide-pager'></div>\n</div>\n<!-- End Slider Nav-->\n</div>\n";
		echo "</aside>\n";
		// upperbanner
		echo "<div class='lower-banner'>\n<div class='row holder'>\n";
		// 3 columns
		for($i=1; $i<=3; $i++) {
			echo "<div class='col-xs-12 col-sm-4 col'>\n";
			if ($theme_settings['ubanner_col_'.$i] !=="") {
				$data = uncomposeSelection($theme_settings['ubanner_col_'.$i]);
				if (!empty($data['selected']) && multilang_table("NS") ? !empty($data['options'][LANGUAGE]) : "") {
					switch($data['selected']) {
						case "news":
							if (db_exists(DB_NEWS)) {
								$result = dbquery("select * from ".DB_NEWS."
											".(multilang_table("NS") ? "WHERE news_language='".LANGUAGE."' AND" : "WHERE")." ".groupaccess('news_visibility')."
											AND (news_start='0'||news_start<=".time().")
											AND (news_end='0'||news_end>=".time().") AND news_draft='0'
											AND news_id='".$data['options'][LANGUAGE]."'
											");
								if (dbrows($result)>0) {
									$data = dbarray($result);
									echo "<h2 class='icon1'>".$data['news_subject']."</h2>\n";
									echo "<p>".fusion_first_words(html_entity_decode(stripslashes($data['news_news'])), 50)."</p>\n";
									echo "<div class='link-holder'><a href='".INFUSIONS."news/news.php?readmore=".$data['news_id']."' class='more'>".$locale['debonair_0504']."</a></div>\n";
								} else {
									echo "<p>".$locale['debonair_0600']."</p>\n";
								}
							} else {
								echo "<p>".$locale['debonair_0408']."</p>\n";
							}
							break;
						case "blog":
							if (db_exists(DB_BLOG)) {
								$result = dbquery("select * from ".DB_BLOG."
											".(multilang_table("BL") ? "WHERE blog_language='".LANGUAGE."' AND" : "WHERE")." ".groupaccess('blog_visibility')."
											AND (blog_start='0'||blog_start<=".time().")
											AND (blog_end='0'||blog_end>=".time().") AND blog_draft='0'
											AND blog_id='".$data['options'][LANGUAGE]."'
											");
								if (dbrows($result)>0) {
									$data = dbarray($result);
									echo "<h2 class='icon2'>".$data['blog_subject']."</h2>\n";
									echo "<p>".fusion_first_words(html_entity_decode(stripslashes($data['blog_blog'])), 50)."</p>\n";
									echo "<div class='link-holder'><a href='".INFUSIONS."blog/blog.php?readmore=".$data['blog_id']."' class='more'>".$locale['debonair_0504']."</a></div>\n";
								} else {
									echo "<p>".$locale['debonair_0600']."</p>\n";
								}
							} else {
								echo "<p>".$locale['debonair_0405']."</p>\n";
							}
							break;
						case "articles":
							if (db_exists(DB_ARTICLES)) {
								$result = dbquery("SELECT ta.article_subject, ta.article_article,
											FROM ".DB_ARTICLES." ta
											INNER JOIN ".DB_ARTICLE_CATS." tac ON ta.article_cat=tac.article_cat_id
											".(multilang_table("AR") ?  "WHERE tac.article_cat_language='".LANGUAGE."' AND" : "WHERE")." ".groupaccess('article_visibility')."
											AND article_id='".$data['options'][LANGUAGE]."'");
								if (dbrows($result)>0) {
									$data = dbarray($result);
									echo "<h2 class='icon2'>".$data['blog_subject']."</h2>\n";
									echo "<p>".fusion_first_words(html_entity_decode(stripslashes($data['article_subject'])), 50)."</p>\n";
									echo "<div class='link-holder'><a href='".INFUSIONS."articles/articles.php?article_id=".$data['article_id']."' class='more'>".$locale['debonair_0504']."</a></div>\n";
								} else {
									echo "<p>".$locale['debonair_0600']."</p>\n";
								}
							} else {
								echo "<p>".$locale['debonair_0415']."</p>\n";
							}
							break;<commit_msg>Not sure will fix #204<commit_after><?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) PHP-Fusion Inc
| https://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: debonair/theme.php
| Author: HappyTunes (Russia)
| Co-Author: <NAME> (Hien)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/

if (!defined("IN_FUSION")) {
	die("Access Denied");
}
define("THEME_BULLET", "<span class='bullet'>&middot;</span>");
require_once INCLUDES."theme_functions_include.php";
include "functions.php";
function render_page($license = FALSE) {
	global $userdata, $settings, $locale, $data, $db_prefix, $lookup, $msg_count, $aidlink;
	include THEME."/locale/".LOCALESET."locale.php";

	add_to_head('
	<!--[if lt IE 7]>
	<script type="text/javascript" src="'.THEME.'js/ie-png.js"></script>
	<script type="text/javascript" src="'.THEME.'js/supersleight.js"></script>
	<link rel="stylesheet" type="text/css" href="'.THEME.'css/lt7.css" />
	<![endif]-->
	<!--[if IE]>
	<link rel="stylesheet" type="text/css" href="'.THEME.'css/ie.css" />
	<![endif]-->
	<!--[if IE 7]>
	<link rel="stylesheet" type="text/css" href="'.THEME.'css/ie7.css" />
	<![endif]-->
	<script type="text/javascript" src="'.THEME.'js/jquery.cycle.all.min.js"></script>
	<script type="text/javascript" src="'.THEME.'js/cufon-yui.js"></script>
	<script type="text/javascript" src="'.THEME.'js/Debonair-Calibri.js"></script>
	<script type="text/javascript" src="'.THEME.'js/Cufon-Settings.js"></script>
	<script type="text/javascript" src="'.THEME.'js/slider-settings.js"></script>
	<script type="text/javascript" src="'.THEME.'js/subnavie6.js"></script>
	');
	add_to_head("<link rel='stylesheet' href='".THEME."css/bootstrap_rewrite.css' type='text/css'/>");
	include THEME."theme_db.php";
	$theme_settings = get_theme_settings("debonair");

	echo "<div id='wrapper'>\n";
	echo "<div class='container'>\n";
	echo "<div class='body-wrap'>\n";
	echo "<div class='body-inner-wrap'>\n";
	// start header ----
	$banner_path = fusion_get_settings("sitebanner");
	echo "<header class='clearfix m-t-10'>
		<a class='logo' href='".BASEDIR."index.php'><img src='".($banner_path !== "" ? BASEDIR.$banner_path : IMAGES."php-fusion-logo.png")."' alt='".fusion_get_settings("sitename")."'/></a>
		<div class='tagline'>Super Clean Web 2.0 Business Template</div>\n";
	echo "<div class='call-tag'>\n";
	if (iADMIN) {
		echo "<span class='display-inline-block m-r-10'><a href='".ADMIN.$aidlink."'>".$locale['global_123']."</a></span>\n";
	}
	echo $locale['global_ML102']."\n";
	foreach (fusion_get_enabled_languages() as $lang => $lang_name) {
		echo "<a href='".clean_request("lang=".$lang, array(), FALSE)."'>".$lang_name."</a>\n";
	}
	echo "<i id='theme_search' class='fa fa-search fa-fw'></i>";
	echo "</div>\n</header>\n";
	// end header ----
	// start nav ---
	echo showsublinks();
	// end nav --

	// Header Banner
	$banner_inclusion_url = explode(",", $theme_settings['main_banner_url']);
	if (in_array(START_PAGE, $banner_inclusion_url)) {
		// get the results of the banner
		$result = dbquery("SELECT * FROM ".DB_DEBONAIR." where banner_language='".LANGUAGE."' order by banner_order ASC");
		// show banner
		echo "<aside class='banner'>\n";
		echo "<div id='slider-container'>\n";
		echo "<ul id='slider-box'>\n";
		if (dbrows($result)) {
			while ($data = dbarray($result)) {
				echo "<!--Slide ".$data['banner_id']."-->\n";
				echo "<li>\n";
				echo "<div class='inner-banner'>\n";
				echo "<div class='slider-corner'></div>\n";
				if ($data['banner_image']) {
					echo "<div class='screen'><img src='".THEME."upload/".$data['banner_image']."' alt='".$data['banner_subject']."'/></div>\n";
				}
				if ($data['banner_description'] !== "") {
					echo "<h2>".$data['banner_subject']."</h2>\n";
					echo "<p>".parseubb(parsesmileys($data['banner_description']))."</p>\n";
				} else {
					echo "<h1>".$data['banner_subject']."</h1>\n";
				}
				if ($data['banner_link'] !=="") {
					echo "<div class='button-position'>\n";
					echo "<div class='btn-group'><a class='btn btn-success btn-sm' href='".BASEDIR.$data['banner_link']."'>Learn more</a></div>\n";
					echo "</div>\n";
				}
				echo "</div>\n</li>\n";
				echo "<!--End slide ".$data['banner_id']."-->\n";
			}
		} else {
			 echo "<!--Slide Welcome-->
			 <li>
			 <div class='welcome-banner'><div class='slider-corner'></div>
			 <h1>".$locale['debonair_0500']."</h1>
			 <h2>".$locale['debonair_0501']."</h2>
			 </div>
			 </li>
			 <!-- End Slide Welcome-->
		 	";
			echo "<!--Slide Customize-->
			 <li>
			 <div class='welcome-banner-2'><div class='slider-corner'></div>
			 <h1>".$locale['debonair_0502']."</h1>
			 <h2>".$locale['debonair_0502a']."</h2>
			 <div class='button-position'>
			 <p>".$locale['debonair_0502c']."</p>
			 </div></div>
			 </li>
			 <!-- End Slide Customize-->
		 	";
		}
		echo "</ul>\n";
		echo "<!-- Start Slider Nav-->\n<div class='slide-pager-container'>\n<div id='slide-pager'></div>\n</div>\n<!-- End Slider Nav-->\n</div>\n";
		echo "</aside>\n";
		// upperbanner
		echo "<div class='lower-banner'>\n<div class='row holder'>\n";
		// 3 columns
		for($i=1; $i<=3; $i++) {
			echo "<div class='col-xs-12 col-sm-4 col'>\n";
			if ($theme_settings['ubanner_col_'.$i] !=="") {
				$data = uncomposeSelection($theme_settings['ubanner_col_'.$i]);
				if (!empty($data['selected']) && multilang_table("NS") ? !empty($data['options'][LANGUAGE]) : "") {
					switch($data['selected']) {
						case "news":
							if (db_exists(DB_NEWS) && isset($data['options'][LANGUAGE])) {
								$result = dbquery("select * from ".DB_NEWS."
											".(multilang_table("NS") ? "WHERE news_language='".LANGUAGE."' AND" : "WHERE")." ".groupaccess('news_visibility')."
											AND (news_start='0'||news_start<=".time().")
											AND (news_end='0'||news_end>=".time().") AND news_draft='0'
											AND news_id='".$data['options'][LANGUAGE]."'
											");
								if (dbrows($result)>0) {
									$data = dbarray($result);
									echo "<h2 class='icon1'>".$data['news_subject']."</h2>\n";
									echo "<p>".fusion_first_words(html_entity_decode(stripslashes($data['news_news'])), 50)."</p>\n";
									echo "<div class='link-holder'><a href='".INFUSIONS."news/news.php?readmore=".$data['news_id']."' class='more'>".$locale['debonair_0504']."</a></div>\n";
								} else {
									echo "<p>".$locale['debonair_0600']."</p>\n";
								}
							} else {
								echo "<p>".$locale['debonair_0408']."</p>\n";
							}
							break;
						case "blog":
							if (db_exists(DB_BLOG) && isset($data['options'][LANGUAGE])) {
								$result = dbquery("select * from ".DB_BLOG."
											".(multilang_table("BL") ? "WHERE blog_language='".LANGUAGE."' AND" : "WHERE")." ".groupaccess('blog_visibility')."
											AND (blog_start='0'||blog_start<=".time().")
											AND (blog_end='0'||blog_end>=".time().") AND blog_draft='0'
											AND blog_id='".$data['options'][LANGUAGE]."'
											");
								if (dbrows($result)>0) {
									$data = dbarray($result);
									echo "<h2 class='icon2'>".$data['blog_subject']."</h2>\n";
									echo "<p>".fusion_first_words(html_entity_decode(stripslashes($data['blog_blog'])), 50)."</p>\n";
									echo "<div class='link-holder'><a href='".INFUSIONS."blog/blog.php?readmore=".$data['blog_id']."' class='more'>".$locale['debonair_0504']."</a></div>\n";
								} else {
									echo "<p>".$locale['debonair_0600']."</p>\n";
								}
							} else {
								echo "<p>".$locale['debonair_0405']."</p>\n";
							}
							break;
						case "articles":
							if (db_exists(DB_ARTICLES) && isset($data['options'][LANGUAGE])) {
								$result = dbquery("SELECT ta.article_subject, ta.article_article,
											FROM ".DB_ARTICLES." ta
											INNER JOIN ".DB_ARTICLE_CATS." tac ON ta.article_cat = tac.article_cat_id
											".(multilang_table("AR") ?  "WHERE tac.article_cat_language='".LANGUAGE."' AND " : "WHERE ")." ".groupaccess('article_visibility')."
											AND article_id='".$data['options'][LANGUAGE]."'");
								if (dbrows($result)>0) {
									$data = dbarray($result);
									echo "<h2 class='icon2'>".$data['blog_subject']."</h2>\n";
									echo "<p>".fusion_first_words(html_entity_decode(stripslashes($data['article_subject'])), 50)."</p>\n";
									echo "<div class='link-holder'><a href='".INFUSIONS."articles/articles.php?article_id=".$data['article_id']."' class='more'>".$locale['debonair_0504']."</a></div>\n";
								} else {
									echo "<p>".$locale['debonair_0600']."</p>\n";
								}
							} else {
								echo "<p>".$locale['debonair_0415']."</p>\n";
							}
							break;
{'fraction_non_alphanumeric': 0.26037321624588367, 'fraction_numerical': 0.012897914379802415, 'mean_word_length': 3.2227114716106606, 'pattern_counts': {'":': 6, '<': 315, '<?xml version=': 0, '>': 319, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5493388', 'n_tokens_mistral': 7846, 'n_tokens_neox': 6462, 'n_words': 1043}