Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- include ('configuration/config.php');
- if ($_REQUEST['page_1'] == 'download' and isset($_REQUEST['page_2']) )
- {
- @$connect = mysql_connect(HOST, DB_LOG, DB_PASS) or die( include('inc/body/error_connect.html') );
- mysql_select_db(DB_NAME) or die( $this->error_print('<span style="font-weight:bold">Błąd połączenia z bazą danych</span>') );
- mysql_query('SET CHARACTER SET LATIN2') or die ( $this->sql_error('SET CHARACTER SET UTF8') );
- $result = mysql_query('select * from pages_img where src LIKE "'.$_REQUEST['page_2'].'%"');
- $row = mysql_fetch_assoc($result);
- if (file_exists('images/original/'.$row['src'])) {
- $file = 'images/original/'.$row['src'];
- $filename = $row['description'];
- header("Content-Type: application/octet-stream");
- header("Content-Size: ".filesize($file));
- header("Content-Disposition: attachment; filename=\"".$filename."\"");
- header("Content-Length: ".filesize($file));
- header("Content-transfer-encoding: binary");
- @readfile($file);
- exit;
- }
- }
- list($usec, $sec) = explode(' ', microtime());
- $_SESSION['start_time'] = ((float) $usec + (float) $sec);
- $_SESSION['lang'] = isset($_SESSION['lang']) ? $_SESSION['lang']:'pl';
- $_REQUEST['page_1'] = isset($_REQUEST['page_1']) ? $_REQUEST['page_1']:'';
- $_SESSION['dostep'] = 1;
- if ( isset($_REQUEST['page_1']) and $_REQUEST['page_1'] == '3w')
- {
- $_SESSION['dostep'] = 1;
- ?>
- <script type="text/javascript">
- javascript:location.replace('<?php echo ROOT?>')
- </script>
- <?php
- }
- if ( $_REQUEST['page_1'] == 'zamowienia' or (!isset($_SESSION['dostep']) and $_SERVER['REMOTE_ADDR'] <> '127.0.0.1') )
- {
- include('inc/underconstruction.html');
- die();
- }
- function __autoload($class_name)
- {
- if( file_exists('library/' . $class_name . '.class.php') )
- {
- include ('library/' . $class_name . '.class.php');
- }
- elseif( file_exists('function/' . $class_name . '.class.php') )
- {
- include ('function/' . $class_name . '.class.php');
- }
- elseif( file_exists('cms/function/' . $class_name . '.class.php') )
- {
- include ('cms/function/' . $class_name . '.class.php');
- }
- else
- {
- die(words::error_print('<span style="font-weight:bold">Nie można załadować klasy '.$class_name.'</span><br />Brak pliku '.$class_name.'.class.php'));
- }
- if ( !class_exists($class_name) )
- {
- die(words::error_print('<span style="font-weight:bold">Brak klasy:</span> ' . $class_name));
- }
- }
- $main = new main;
- $main->stats();
- $main->set_define();
- $menu_id = $main->get_menu_id();
- $main->get_meta($menu_id);
- $main->menu_build($menu_id);
- include ('inc/head.html');
- include ('inc/top.html');
- include ('inc/body.php');
- $main->menu_footer_build($menu_id);
- include ('inc/footer.html');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement