Skip to content

Commit

Permalink
Add fixes and start to complited independently product? 1.25.6-rc1
Browse files Browse the repository at this point in the history
This is independently product?!
  • Loading branch information
killserver committed Sep 30, 2015
1 parent f179534 commit b1e3ed5
Show file tree
Hide file tree
Showing 9 changed files with 119 additions and 22 deletions.
25 changes: 25 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Обозначения
~~~~~~~~~~~
[!] Нововведение или важное изменение/New features or important change
[+] Добавлено/New functions
[~] Изменено/Changed functions
[%] Исправление-багфикс/Bugfixes
[@] Эта информация будет интересна только админам и/или разработчикам
This information is only for administrators and/or developers

Cardinal Engine Release 1
~~~~~~~~~~~~~~~~~~~~~~~~~~~
[!] ВНИМАНИЕ! Требуется версия PHP >= 5.3.2

2015-09-30 13:06:10 1.25.6-rc1
[+] Добавлен changelog для собственной навигации по-изменениям, а так-же для тех, кто хочет следить за развитием данного проекта
[+] Добавлена SEO-оптимизация для главной страницы
[+] Добавление авторского права в некоторые файлы, а со временем - указание такового во всех остальных

[@] Добавлена возможность подключать css-стили и/или js-скрипты из модулей как при помощи подключения файла, так и при помощи кода
[@] Добавлена возможность задачи необходимого количества страниц в "пагинаторе"
[@] Улучшение для большей гибкости системы SEO-оптимизации

[!] Добавлена константа {THEME} для подключаемых файлов

[%] Исправлена ошибка, не позволяющая подключить язык в модулях, которые загружаются сразу путём отключения подгрузки из базы данных
16 changes: 11 additions & 5 deletions core/class/system/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,22 @@ public static function get_lg() {
return self::$lang;
}

public static function init_lang() {
public static function init_lang($db = true) {
global $manifest;
$lang=array();
if(isset($manifest['lang']['main']) && file_Exists(ROOT_PATH."core/lang/".self::$lang."/".$manifest['lang']['main'].".php")) {
include(ROOT_PATH."core/lang/".self::$lang."/".$manifest['lang']['main'].".php");
return array_merge($lang, self::lang_db());
if($db) {
if(isset($manifest['lang']['main']) && file_Exists(ROOT_PATH."core/lang/".self::$lang."/".$manifest['lang']['main'].".php")) {
include(ROOT_PATH."core/lang/".self::$lang."/".$manifest['lang']['main'].".php");
return array_merge($lang, self::lang_db());
}
}
if(file_exists(ROOT_PATH."core/lang/".self::$lang."/main.php")) {
include(ROOT_PATH."core/lang/".self::$lang."/main.php");
$db_lang = self::lang_db();
if($db) {
$db_lang = self::lang_db();
} else {
$db_lang = array();
}
if(file_exists(ROOT_PATH."core/media/config.lang.php")) {
include(ROOT_PATH."core/media/config.lang.php");
}
Expand Down
6 changes: 3 additions & 3 deletions core/class/system/pager.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ final class pager {
private $pages = array();
private $limits = array();

function __construct($rpp, $count_all, $on_page, $url_page, $p_page = "/page/") {
function __construct($rpp, $count_all, $on_page, $url_page, $p_page = "/page/", $max_view = 10) {
$this->limits = array(ceil($rpp*$on_page), $on_page);
$c_link = 1;
if($count_all>$on_page) {
$rpp = $rpp*$on_page;
$enpages_count = @ceil($count_all/$on_page);
$rpp = ($rpp/$on_page) + 1;
if($enpages_count<=10) {
if($enpages_count<=$max_view) {
for($j=1;$j<=$enpages_count;$j++) {
if($j!=$rpp) {
if($j == 1) {
Expand All @@ -50,7 +50,7 @@ function __construct($rpp, $count_all, $on_page, $url_page, $p_page = "/page/")
}
} else {
$start = 1;
$end = 10;
$end = $max_view;
$nav_prefix = "...";
if($rpp>0) {
if($rpp>6) {
Expand Down
1 change: 1 addition & 0 deletions core/class/system/templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,7 @@ private static function comp_datas($tpl, $file="null", $test = false) {
$tpl = preg_replace_callback("#\{S_([a-zA-Z0-9\-_]+)\}#", ("templates::systems"), $tpl);
$tpl = preg_replace_callback("#\\[module_(.+?)\\](.+?)\\[/module_(.+?)\\]#i", ("templates::is"), $tpl);
$tpl = preg_replace_callback("#\\[module_(.+?)\\](.+?)\\[/module_(.+?)\\]#i", ("templates::is"), $tpl);
$tpl = str_replace("{THEME}", "/".self::$dir_skins."/".self::$skins, $tpl);
if(strpos($tpl, "[clear]") !== false) {
foreach($array_use as $name => $val) {
unset(self::$blocks[$name]);
Expand Down
61 changes: 50 additions & 11 deletions core/functions/templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
*
* 21.1
* add var for js detected system time in unix format
* 22.1
* add css and rebuild js data to template
*
*/
if(!defined("IS_CORE")) {
Expand Down Expand Up @@ -33,10 +35,11 @@ function meta($array=array()) {
}

function create_js($clear = false) {
global $user, $config;
if(!$config["js_min"]) {
global $user;
$css = $js = array();
$sRet = "";
if(!config::Select("js_min")) {
if(!$clear) {
$js = array();
if(isset($user) && isset($user['id']) && $user['id']==1) {
$js[] = 'http://ie.microsoft.com/testdrive/HTML5/CompatInspector/inspector.js';
}
Expand All @@ -53,27 +56,58 @@ function create_js($clear = false) {
for($i=0;$i<sizeof($dirs);$i++) {
include_once(ROOT_PATH."core/modules/js/".$dirs[$i]);
}
$sRet = "";
for($i=0;$i<sizeof($js);$i++) {
$sRet .= "<script type=\"text/javascript\" src=\"".$js[$i]."\"></script>\n";
}
$dirs = read_dir(ROOT_PATH."core/modules/css/", ".php");
sort($dirs);
for($i=0;$i<sizeof($dirs);$i++) {
include_once(ROOT_PATH."core/modules/css/".$dirs[$i]);
}
for($i=0;$i<sizeof($css);$i++) {
$sRet .= "<link href=\"".$css[$i]."\" rel=\"stylesheet\" />\n";
}
} else {
$js = modules::manifest_get(array("create_js", "mini"));
if($js) {
$js = implode(",", $js);
}
$sRet = "<script type=\"text/javascript\" src=\"{C_default_http_host}js/require.js?".time()."\"></script>\n<script type=\"text/javascript\" src=\"{C_default_http_host}js/config.js?".time()."\"></script>";
}
$all = modules::manifest_get(array("create_js", "full"));
if(is_array($all)) {
$all = array_values($all);
if($all) {
for($i=0;$i<sizeof($all);$i++) {
$sRet .= "<script type=\"text/javascript\" src=\"".$all[$i]."\"></script>\n";
}
}
}
$all = modules::manifest_get(array("create_js", "js"));
if($all) {
for($i=0;$i<sizeof($all);$i++) {
$sRet .= "<script type=\"text/javascript\">".$all[$i]."</script>\n";
if(is_array($all)) {
$all = array_values($all);
if($all) {
for($i=0;$i<sizeof($all);$i++) {
$sRet .= "<script type=\"text/javascript\">".$all[$i]."</script>\n";
}
}
}
$all = modules::manifest_get(array("create_js", "full"));
if($all) {
for($i=0;$i<sizeof($all);$i++) {
$sRet .= "<script type=\"text/javascript\" src=\"".$all[$i]."\"></script>\n";
$all = modules::manifest_get(array("create_css", "full"));
if(is_array($all)) {
$all = array_values($all);
if($all) {
for($i=0;$i<sizeof($all);$i++) {
$sRet .= "<link href=\"".$all[$i]."\" rel=\"stylesheet\" />\n";
}
}
}
$all = modules::manifest_get(array("create_css", "css"));
if(is_array($all)) {
$all = array_values($all);
if($all) {
for($i=0;$i<sizeof($all);$i++) {
$sRet .= "<style type=\"text/css\">".$all[$i]."</style>\n";
}
}
}
unset($all, $js, $user);
Expand Down Expand Up @@ -149,6 +183,11 @@ function headers($array = array(), $clear = false) {
$header .= "<meta property=\"".$name."\" content=\"".$val."\" />\n";
}
}
if(isset($array['meta']['link']) && is_array($array['meta']['link'])) {
foreach($array['meta']['link'] as $name => $val) {
$header .= "<link rel=\"".$name."\" href=\"".$val."\" />\n";
}
}
if(isset($array['meta'])) {
foreach($array['meta'] as $name => $val) {
if(is_array($val)) continue;
Expand Down
2 changes: 1 addition & 1 deletion core/media/config.global.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
define("ERROR_FILE", 0);
define("ERROR_DB", 1);

define("VERSION", "1.25.6a1");
define("VERSION", "1.25.6-rc1");
define("LEVEL_MODER", 2);
define("LEVEL_USER", 1);
define("LEVEL_GUEST", 0);
Expand Down
Empty file added core/modules/css/index.html
Empty file.
28 changes: 27 additions & 1 deletion core/pages/main.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
<?php
/*
*
* @version 2015-09-30 13:30:44 1.25.6-rc1
* @copyright 2014-2015 KilleR for Cardinal Engine
*
* Version Engine: 1.25.6-rc1
* Version File: 1
*
* 1.1
* add seo optimization
*
*/
if(!defined("IS_CORE")) {
echo "403 ERROR";
exit();
Expand All @@ -8,7 +20,21 @@ class page {

function __construct() {
$tmp = templates::complited_assing_vars("index");
templates::complited($tmp);
templates::complited($tmp, array("title" => lang::get_lang('sitename'), "meta" => array(
"ogpr" => array(
"og:image" => "{C_default_http_host}logo.jpg?1",
"og:site_name" => "{L_sitename}",
"og:url" => "{C_default_http_host}",
"og:title" => "{L_sitename}",
"og:description" => "{L_s_description}",
"og:type" => "website",
),
"link" => array(
"image_src" => "{C_default_http_host}logo.jpg?1",
),
"keywords" => "{L_s_keywords}",
"description" => "{L_s_description}",
)));
templates::display();
}

Expand Down
2 changes: 1 addition & 1 deletion version/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.25.6a1
1.25.6-rc1

0 comments on commit b1e3ed5

Please sign in to comment.