-
Notifications
You must be signed in to change notification settings - Fork 61
/
page.php
88 lines (88 loc) · 3.21 KB
/
page.php
1
2
3
4
5
6
7
8
9
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?php
if ( !defined( "CASINOENGINE" ) )
{
exit( "Íåò äîñòóïà!<script>location.href='/';</script>" );
}
$page = $_GET['ppage'];
if ( !isset( $page ) || $page == "" )
{
$page = "index";
}
$page_filter = preg_match( "/^[A-Za-z0-9_=]{2,20}\$/", $page );
$header = file_get_contents( TEMPLATE_DIR."/header.tpl" );
$news = intval( $_GET['news'] );
$news_query = @mysql_fetch_array( @mysql_query( "SELECT date,title,full_story,descr,keywords FROM casino_news WHERE id='{$news}' LIMIT 1" ) );
if ( $news_query != "" && $page == "news" )
{
$header = str_replace( "{title}", $news_query['title'], $header );
$header = str_replace( "{description}", $news_query['descr'], $header );
$header = str_replace( "{keywords}", $news_query['keywords'], $header );
$header = str_replace( "{theme}", "/templates/".$template."/".$_SESSION['language'], $header );
echo $header;
}
else
{
require_once( ENGINE_DIR."config/title.php" );
$header = str_replace( "{title}", $title, $header );
$header = str_replace( "{description}", $title, $header );
$header = str_replace( "{keywords}", $title, $header );
$header = str_replace( "{theme}", "/templates/".$template."/".$_SESSION['language'], $header );
echo $header;
}
if ( $page_filter == true )
{
$inc = ENGINE_DIR."/templates/page.".$page.".php";
if ( file_exists( $inc ) )
{
if ( $_SESSION['login'] != "" )
{
$id_session = "CASINOSOFT".$_SERVER['HTTP_USER_AGENT'].$_SERVER['HTTP_ACCEPT_CHARSET'];
$id_session = md5( $id_session.session_id( ) );
if ( $_SESSION['sid'] == $id_session )
{
$user_status_query = mysql_fetch_array( mysql_query( "select status from clients where login='".$_SESSION['login']."'" ) );
if ( $user_status_query['status'] != 0 )
{
include_once( ENGINE_DIR."/templates/header_nomain.php" );
include_once( ENGINE_DIR."/templates/page.".$page.".php" );
include_once( ENGINE_DIR."/templates/footer_nomain.php" );
}
else
{
include_once( ROOT_DIR."/templates/block.php" );
session_destroy( );
exit( );
}
}
else
{
$_SESSION['sid'] = "";
$_SESSION['login'] = "";
if ( DEBUG )
{
echo "Ñåññèÿ ïîñëå âõîäà èçìåíåíà <script>location.href=\"/\";</script>";
}
}
}
else
{
include_once( ENGINE_DIR."/templates/header_nomain.php" );
include_once( ENGINE_DIR."/templates/page.".$page.".php" );
include_once( ENGINE_DIR."/templates/footer_nomain.php" );
}
}
else
{
include_once( ROOT_DIR."/templates/404.php" );
exit( );
}
}
else
{
include_once( ROOT_DIR."/templates/404.php" );
exit( );
}
$footer = file_get_contents( TEMPLATE_DIR."/footer.tpl" );
$footer = str_replace( "{THEME}", "/templates/".$template."/".$language, $footer );
echo $footer;
?>