- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
<?php
$t1 = microtime();
define('CMS_LOAD', TRUE);
require_once('./inc/config.inc.php');
require_once('./inc/main_fnc.inc.php');
cms_MysqlConnect();
unset($cms); // попутно используемые данные скрипта
unset($vars); // $_POST, $_COOKIE, $_GET данные
cms_RegVars();
$cms['page'] = !empty($vars['page']) ? $vars['page'] : 'main';
$cms['md_page'] = !empty($vars['md_page']) ? $vars['md_page'] : '';
$cms['ESTRING'] = !get_magic_quotes_gpc() ? TRUE : FALSE;
$cms['strpos'] = strpos($cms['page'], '_');
$cms['q_page'] = mysql_query("SELECT name, ptext FROM ".CMS_PREFIX."_pages WHERE page='".cms_MysqlEStr($cms['page'])."' LIMIT 1");
$cms['is_page'] = mysql_num_rows($cms['q_page']);
// если в _pages нет такой страницы, перемещаем на главную
if($cms['is_page'] > 0)
{
list($cms['page_name'], $cms['page_text']) = mysql_fetch_row($cms['q_page']);
}
else
{
header("Location: /");
}
mysql_free_result($cms['q_page']);
if($cms['strpos'] > 0 && !empty($cms['md_page']))
{
$cms['q_md_product1'] = mysql_query("SELECT name, descript2, cost FROM ".CMS_PREFIX."_productions WHERE id=".intval($cms['md_page'])." LIMIT 1");
if(mysql_num_rows($cms['q_md_product1']) > 0)
{
list($cms['page_name'], $cms['md_prod_descr2'], $cms['md_prod_cost']) = mysql_fetch_row($cms['q_md_product1']);
}
else
{
header("Location: /");
}
mysql_free_result($cms['q_md_product1']);
}
//edited by DEMIS [[email protected]]
$cms['page_text_header'] = $cms['page_name'];
Index.php в самописной CMS улыбает. И это только начало +)