MuCMS PHP Cross Reference Content Management Systems

Source: /theme2.php - 121 lines - 3727 bytes - Summary - Text - Print

   1  <?php
   2              $self         = $_SERVER["PHP_SELF"];
   3              $from         = $_SERVER["HTTP_REFERER"];
   4              $userIP     = $_SERVER["REMOTE_ADDR"];
   5              $userHOST     = $_SERVER["REMOTE_HOST"];
   6              $query        = $_SERVER["QUERY_STRING"];
   7              $browser     = $_SERVER["HTTP_USER_AGENT"];
   8              $port        = $_SERVER["REMOTE_PORT"];
   9              $reqURI        = $_SERVER["REQUEST_URI"];
  10              $script     = $_SERVER["SCRIPT_NAME"];
  11              $day        = time();
  12  
  13              // Check to see if someone is trying to inject remote code by 

  14              // verifiying that the script called matches the script running

  15              // Use Redirection

  16              if ($self != $script) { 
  17                  // Include the display class
  18                  include_once ('code/class.theme.php');
  19  
  20                  // Create the object for the display class
  21                  $index = new Formatter;    
  22  
  23                  // Increment the Page Counter on Every Hit

  24                  $index->IncPageCount('stats/theme2.inc');
  25  
  26                  // Log Hits

  27                  $index->HitStats('stats/theme2.php',$day, $self, $from, $userIP, $userHOST, $query, $browser, $port, $reqURI, $day);
  28              
  29                  /* Redirect to a different page in the current directory that was requested */

  30                  // Get the current Host information
  31                  $host  = $_SERVER['HTTP_HOST'];
  32  
  33                  // Where to direct too

  34                  $extra = 'mismatch.php';
  35  
  36                  // Send the HTTP redirector
  37                  header("Location: http://$host/$extra");
  38                  exit; // Do not run any further code

  39              } 
  40  
  41              // A nothing on this site should be passing queery information

  42              // Generate an error on queery

  43              if ($query != '' || $query != null)  { 
  44                  // Include the display class
  45                  include_once ('code/class.theme.php');
  46  
  47                  // Create the object for the display class
  48                  $index = new Formatter;    
  49  
  50                  // Increment the Page Counter on Every Hit

  51                  $index->IncPageCount('stats/theme2.inc');
  52  
  53                  // Log Hits

  54                  $index->HitStats('stats/theme2.php',$day, $self, $from, $userIP, $userHOST, $query, $browser, $port, $reqURI, $day);
  55              
  56                  /* Redirect to a different page in the current directory that was requested */

  57  
  58                  // Get the Host name    
  59                  $host  = $_SERVER['HTTP_HOST'];
  60  
  61                  // Where to redirect bad user

  62                  $extra = 'query.php';
  63  
  64                  // Send the HTTP header redirect

  65                  header("Location: http://$host/$extra");
  66  
  67                  exit; 
  68              }     
  69  
  70              if (file_exists('tmp/theme2.cache')) {
  71                  $Cached = false;
  72                  $CatchTime = filemtime('tmp/theme2.cache') + 120;
  73                  $CurrentTime = time();
  74                  if ( $CurrentTime >= $CatchTime ) {
  75                      $Cached = false;
  76                  }  else {
  77                      $Cached = true;
  78                  }
  79              }    
  80              
  81              // Includes

  82              include_once ('code/class.theme.php');
  83              $index = new Formatter;    
  84                  $index->GetPageCount('stats/theme2.inc');
  85              if ($Cached) {
  86                      require_once('tmp/theme2.cache');
  87                  } else {
  88                      ob_start();
  89              
  90                      // Meta

  91                      include_once ('meta/theme2.php');
  92                      // Content

  93                      include_once ('content/theme2.php');
  94                      // MD5

  95                      include_once ('md5/theme2.md5');
  96                  
  97                      // Security Check 

  98                      $Check = md5($content);
  99              
 100                      // Set the Meta Information for the page

 101                      $index->SetPage($title,$description,$keywords,$custom1,$custom2,$custom3,$custom4);
 102                      
 103                      // Set the content and check agianst md5

 104                      $index->SetContent( $content , $Validation , $Check );
 105                      
 106                      // Draw all the Information on the page

 107                      $index->CreatePage($theme);
 108                      
 109                      // Catch all the content information

 110                      $out = ob_get_clean();
 111                      // Save it in cache

 112                      $filehandle = fopen('tmp/theme2.cache','wb');
 113                      fwrite($filehandle, $out);
 114                      fclose($filehandle);
 115                      // Echo the information

 116                      echo $out;
 117                  }
 118              // Increment the Page Counter on Every Hit

 119              $index->IncPageCount('stats/theme2.inc');
 120              $index->HitStats('stats/theme2.php',$day, $self, $from, $userIP, $userHOST, $query, $browser, $port, $reqURI, $day);
 121              ?>

title

Description

title

Description

title

Description

title

title

Body