////////////////////////////////////////////////////////////////////////////////
// JohnCMS                             Content Management System              //
//    :      http://johncms.com                     //
//   :      http://gazenwagen.com                  //
////////////////////////////////////////////////////////////////////////////////
// JohnCMS core team:                                                         //
//   aka john77          john77@gazenwagen.com                  //
//   aka AlkatraZ          alkatraz@gazenwagen.com                //
//                                                                            //
//   JohnCMS                                              //
////////////////////////////////////////////////////////////////////////////////   

        ,      .  
                                     JohnCMS
1.1.  .  
   ,   :
1)  PHP   5.1
         
2) MySQL    4.1
3)  .htaccess


 
       "www"  "public_html"    , ..
1)  
2)      ,   .
3)    777:
   /incfiles
   /gallery/foto
   /gallery/temp
   /library/files/
   /library/temp/
   /pratt/
   /forum/files/
   /forum/temtemp/
   /download/arctemp/
   /download/files/
   /download/graftemp/
   /download/screen/
   /download/mp3temp/
   /download/upl/
4)    666:
   /flood.dat
   /panel/filebase.dat
   /library/java/textfile.txt
   /library/java/META-INF/MANIFEST.MF
5)     http://_/install
6)   .
    -    ,   
     .      
    PHP  ,  -   .
   ,      .htaccess
      ,   ""
7)      MySQL
    ,      MySQL,  
        "localhost",    
     ,  "mysql.myhost.com"
      ""
8)        ""
9)     ,    
     MySQL,   ,  .

       ,
  :
   -   /install
   -    755   /incfiles
   -    644   /incfiles/db.php
    ,   . 

2.  ,   ? 
  ,     , ,  . 
    ,     ,     . 
       .  

3.    
1.        ""  
   ""      . 
     
 
- 
 


 >>>  
1.1.   
  -    ,   , ..  . 
- -   ,        . 
  -    ,    ,  . 
 -       .       ,   ... 
 -       ,     .  
 >>>    ,     ,    . 

2.    . 
    ,    .      . 
        .

  : 0
 : 0
: 0

-

 (/)



  IP
 


   ,  . 

2.1. 
  : 0
 : 0
: 0 
     ,    ,   ,     ,  ,     .  

2.2.  
  ,     ,   ,    ID 

2.3. -  
- ,      . 

2.4.  (/)
   , . 

 
 
 
 
 
   
      ,   ,  ,  . 
 
 2.5.   
        .   ""  :  ,  , 
   ,     ,       . 
 
 2.6.  
   ,  :     .      : ,        ,    .   . 
    .     ,     ,      .         . 
 
 2.7.   IP 
    ,     . 
 :
   
 
 

2.8.   
          . 
 : 

 "" , ,      . 

 
         .
   ,   . 
 
 
   ""    ,        .  

2.9.  
  ,       . 
 ,   : 
GZIP  
. 
. 
   
  .

        JohnCMS,     .    

      ,   F.A.Q.  

1.    JohnCMS? 
      http://johncms.com ,     ,   .  

2.       JohnCMS?  
    ,       " "   2 ,   . 
  ,     head.php ,   !!! 

3.   ? 
     incfiles/end.php 
  end.php   : 
//       60     
echo '<div class="end"><a href="http://johncms.com">JohnCMS 2.0.0</a><br />';  
   : echo '<div class="end"><a href="http://johncms.com">JohnCMS 2.0.0</a><br />'; 

4.    ,   ? 
   ,      // 
 : //  JohnCMS -   . 

5.     ? 
    "sm"    "sm"   3  "adm" "cat"  "prost" 
   .     ,      . 
   ,      . 

6.     ? 
     mainmenu.php.     ,  
  pages/mainmenu.php 
 mainmenu.php   ,     . 
       ,    :  
echo '<div class="bmenu"><a href="http:// .ru"> </a></div>'; 

   ,      ,    : 
echo '<div class="menu"><a href="   /"></a></div>';  
  . 

7.      JohnCMS? 
   : 
<?php

define('_IN_JOHNCMS', 1);
$textl = ' ';
require_once ("../incfiles/core.php");
require_once ("../incfiles/head.php");
header("Content-type:text/html; charset=utf-8");


echo' ,  ';


echo $file;
require_once ("../incfiles/end.php");

?>
 .

8.     ? 
      end.php 
  end.php  : 
// ,   ,   
    //     
    echo '';  
     echo ' ';  . 
 . ,        . 
  ,       ,  . 
,   ,   
    //    ,  
    echo ''; 
     echo ' '; 
,       . 

9.       ? 
    ,   : 
      images,     . 
      default\images 
     ,    ,          . 
  ,   . 

10.      ? 
  . 
  mainmenu.php     ,  ,    . 
$headnews = false; //   false.    ,  true //  . 
    ,   false  true     : 
$headnews = true;      . 

11.       ? 
  mainmenu.php,   $nw = mysql_query("select * from `news` order by time desc LIMIT 2;"); 
  2  1. .. 
$nw = mysql_query("select * from `news` order by time desc LIMIT 1;"); 
      . 

12.    ? 
        
<?php

define('_IN_JOHNCMS', 1);
$textl = ' ';
require_once ("../incfiles/core.php");
require_once ("../incfiles/head.php");
header("Content-type:text/html; charset=utf-8");


echo' ,  ';


echo $file;
require_once ("../incfiles/end.php");

?>  


13.   ?  
<?php
/*
         -:
-
-
-

.
 ,          
      url,   
(   CURL      ,  file_get_contents()
  implode('',file(..))   ,     .
     .
*/

function data($path,$host)
{
/*
$path    ,     
$host   (, sasisa.ru)
*/
$fp = fsockopen($host, 80);
if (!$fp)
{
die('');
}
else
{
$out = "GET $path HTTP/1.0\r\n";
$out .= "Accept: image/gif, application/xhtml+xml, */*\r\n";
$out .= "Accept-Language: ru\r\n";
$out .= "Host: $host\r\n";

// -
$out .= "User-Agent: Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1716; ru; U; ssr)\r\n";

$out .= "Cache-Control: no-cache\r\n";
$out .= "Connection: Close\r\n\r\n";

fwrite($fp, $out);
$headers = "";

while ($str = trim(fgets($fp)))
$headers .= "$str\n";

$body = "";

while (!feof($fp))
$body .= fgets($fp);
fclose($fp);
}
// 
return $body;
}

/*
,     ,      ,  
 ,   
*/

/*
function process($s)
{
   - ,  ""    
  ,    ""   

return $s;
}
*/

/*
         $path,    

  http://wen.ru/forum/index.php
  ,    " "  (  )
     
*/

//  
$host='wen.ru';

if (empty($_SERVER['QUERY_STRING']))
{
// 
$path='/forum/index.php';
}
else
{
// 
$path='/forum/?'.$_SERVER['QUERY_STRING'];
}

/*
          
    
<a href="/forum/?p=1&amp;f=1&amp;w=htm"></a>
      
<a href="index.php?p=1&amp;f=1&amp;w=htm"></a>
     process
*/


/*function process($s)
{
$s=str_replace('<a href="/forum/','<a href="index.php',$s);
return $s;
}*/

//    :) ( )
$s=data($path,$host);

// ( )
$s=process($s);

//  ( )
/*
      ,    , 
       
*/
header('Content-type:text/html;charset=utf-8');
echo $s;

/*
 ,   ,    ,
         :)
*/

function process($s)
{
$s=str_replace('<a href="/forum/','<a href="'.$_SERVER['SCRIPT_NAME'],$s);

//
$s=str_replace('<img src="','<img src="http://wen.ru/',$s);

//
$s=str_replace('</body>','<div>(c)snippets</div></body>',$s);

return $s;
}

/*
,         ,   
POST ,      -   
  .
*/

?>  


14.   ? 
    ,    ""    " " 
 ,    ,    .   . 

15.  ,   .  ? 
     ,  ,    ,       "" 
   ""   . 

16.     " " ? 
     end.php. 
!!!   - ,   .    ,   . 

17.      ? 
  ,    ,     . 
         : 
http://mchost.ru  http://1gb.ru 
   ,   .

18.   ,     ,  ? 
   ,       settings  nickadmina   . 

19.     Adm  ? 
     ,   ,   . 
    ,    " "   . 
 Adm ,      . !!!     ,      . 

