Advertisement
androidmaker155

Untitled

Aug 26th, 2014
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /**
  3.  * SENAYAN application bootstrap files
  4.  *
  5.  * Copyright (C) 2007,2008  Arie Nugraha (dicarve@yahoo.com)
  6.  * Some modifications & patches by Hendro Wicaksono (hendrowicaksono@yahoo.com)
  7.  *
  8.  * This program is free software; you can redistribute it and/or modify
  9.  * it under the terms of the GNU General Public License as published by
  10.  * the Free Software Foundation; either version 3 of the License, or
  11.  * (at your option) any later version.
  12.  *
  13.  * This program is distributed in the hope that it will be useful,
  14.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.  * GNU General Public License for more details.
  17.  *
  18.  * You should have received a copy of the GNU General Public License
  19.  * along with this program; if not, write to the Free Software
  20.  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  21.  *
  22.  */
  23.  
  24. // key to authenticate
  25. define('INDEX_AUTH', '1');
  26.  
  27. // required file
  28. require 'sysconfig.inc.php';
  29. // IP based access limitation
  30. require LIB.'ip_based_access.inc.php';
  31. do_checkIP('opac');
  32. // member session params
  33. require LIB.'member_session.inc.php';
  34. // start session
  35. session_start();
  36. if ($sysconf['template']['base'] == 'html') {
  37.   require SIMBIO.'simbio_GUI/template_parser/simbio_template_parser.inc.php';
  38. }
  39.  
  40. // page title
  41. $page_title = $sysconf['library_name'].' | '.$sysconf['library_subname'].' E-Library Politeknik Aceh';
  42. // default library info
  43. $info = __('Politeknik Aceh Public Access Catalog ');
  44. // total opac result page
  45. $total_pages = 1;
  46. // default header info
  47. $header_info = '';
  48. // HTML metadata
  49. $metadata = '';
  50. // searched words for javascript highlight
  51. $searched_words_js_array = '';
  52.  
  53. // member login information
  54. if (utility::isMemberLogin()) {
  55.   $header_info .= '<div id="memberLoginInfo">'.__('You are currently Logged on as member').': <strong>'.$_SESSION['m_name'].' (<em>'.$_SESSION['m_email'].'</em>)</strong> <a id="memberLogout" href="index.php?p=member&logout=1">'.__('LOGOUT').'</a></div>';
  56. }
  57.  
  58. // start the output buffering for main content
  59. ob_start();
  60. require LIB.'contents/common.inc.php';
  61. if (isset($_GET['p'])) {
  62.     $path = utility::filterData('p', 'get', false, true, true);
  63.     // some extra checking
  64.     $path = preg_replace('@^(http|https|ftp|sftp|file|smb):@i', '', $path);
  65.     $path = preg_replace('@\/@i','',$path);
  66.     // check if the file exists
  67.     if (file_exists(LIB.'contents/'.$path.'.inc.php')) {
  68.         include LIB.'contents/'.$path.'.inc.php';
  69.         if ($path != 'show_detail') {
  70.           $metadata = '<meta name="robots" content="noindex, follow">';
  71.         }
  72.     } else {
  73.         // get content data from database
  74.         $metadata = '<meta name="robots" content="index, follow">';
  75.         include LIB.'content.inc.php';
  76.         $content = new content();
  77.         $content_data = $content->get($dbs, $path);
  78.         if ($content_data) {
  79.           $page_title = $content_data['Title'];
  80.           echo $content_data['Content'];
  81.           unset($content_data);
  82.         } else {
  83.           header ("location:index.php");
  84.         }
  85.     }
  86. } else {
  87.     $metadata = '<meta name="robots" content="index, follow">';
  88.     // homepage header info
  89.     if (!isset($_GET['p'])) {
  90.         if ((!isset($_GET['keywords'])) AND (!isset($_GET['page'])) AND (!isset($_GET['title'])) AND (!isset($_GET['author'])) AND (!isset($_GET['subject'])) AND (!isset($_GET['location']))) {
  91.             // get content data from database
  92.             include LIB.'content.inc.php';
  93.             $content = new content();
  94.             $content_data = $content->get($dbs, 'headerinfo');
  95.             if ($content_data) {
  96.                 //$header_info .= '<div id="headerInfo">'.$content_data['Content'].'</div>';
  97.                 unset($content_data);
  98.             }
  99.         }
  100.     }
  101.     include LIB.'contents/default.inc.php';
  102. }
  103. // main content grab
  104. $main_content = ob_get_clean();
  105.  
  106. // template output
  107. require $sysconf['template']['dir'].'/'.$sysconf['template']['theme'].'/index_template.inc.php';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement