Create this Page (Only the Administrator sees this)";
}
}
else
{
if(file_exists("pages/".$page.".page")){
$file1 = @fopen("pages/".$page.".page","r");
$file = fread($file1,filesize("pages/".$page.".page"));
fclose($file1);
//Check login and append create page link if logged in.
if(Get::check_login()){
$file = $file + "Create this Page (Only the Administrator sees this) ";
}
}else{
$file = 'Error 404 Page Has not been Found ';
//Check login and append create page link if logged in.
if(Get::check_login()){
$file = $file + "Create this Page (Only the Administrator sees this) ";
}
}
}
if(Get::check_comments($page)){
//$file = $file.Get::fetch_comments($page);
}
}else{
$file = $_SESSION['plugin_print'];
}
return $file;
}
////////////////////////
// function menu($page)
// by Kevin Bluett
// June 2009
// Parameters: $n - Must equal "li" or "a".
//
// "li" Returns menu in list format.
// "a" Returns menu in a list of links separated by two spaces
// Returns the CMS menu content
///////////////////////
function menu($n,$page){
if($n=="li"){
if($page==""){
$page="page1";
}else if($page=="1"){
$page = "page1";
}
$page = "?page=".$page;
$menu = explode("{li}",open_file("inc/menu.inc"));
$menu1 = explode("{li}",open_file("inc/menu_links.inc"));
for($i = 0;$i < count($menu);$i++){
if($menu1[$i]=="?page="||$menu1[$i]=="?page=1"){
$menu1[$i] = "?page=page1";
}
if($i==0){
if($page==$menu1[$i]){
print "".$menu[$i]." ";
}else{
print "".$menu[$i]." ";
}
}else{
if($page==$menu1[$i]){
print "".$menu[$i]." ";
}else if($menu1[$i]=="?page=download"){
print "".$menu[$i]." ";
}else{
print "".$menu[$i]." ";
}
}
}
}else if($n=="a"){
$menu = explode("{li}",open_file("inc/menu.inc"));
$menu1 = explode("{li}",open_file("inc/menu_links.inc"));
for($i = 0;$i < count($menu);$i++){
print "".$menu[$i]." ";
}
}else{
$menu = explode("{li}",open_file("inc/menu.inc"));
$menu1 = explode("{li}",open_file("inc/menu_links.inc"));
for($i = 0;$i < count($menu);$i++){
print "".$menu[$i]." ";
}
}
}
////////////////////////
// function check_comments($page)
// by Kevin Bluett
// June 2009
// Parameters: $page - pagename of page to be fetched.
// Returns the CMS page content
///////////////////////
function check_comments($page){
$comments = false;
if($page=="1"||$page==""){
$file1 = @fopen("pages/page1.title","r");
$filedata = fread($file1,filesize("pages/page1.title"));
fclose($file1);
$title_array = explode("||", $filedata);
if($title_array[1]=="1"){
$comments = true;
}
}
else
{
if(file_exists("pages/".$page.".title")){
$file1 = @fopen("pages/".$page.".title","r");
$filedata = fread($file1,filesize("pages/".$page.".title"));
fclose($file1);
$title_array = explode("||", $filedata);
if($title_array[1]=="1"){
$comments = true;
}
}else{
$comments = false;
}
}
return $comments;
}
////////////////////////
// function fetch_comments($page)
// by Kevin Bluett
// June 2009
// Parameters: $page - pagename of page to be fetched.
// Returns the CMS page content
///////////////////////
function fetch_comments($page){
if(Get::check_comments($page)){
//fetch comments for this page.
$_SESSION['com_dir'] = "plugins/comments/";
$comments = "";
}
return $comments;
}
////////////////////////
// function write_comment($page)
// by Kevin Bluett
// June 2009
// Parameters: $page - pagename of page to be fetched.
// Returns the CMS page content
///////////////////////
function write_comment($page,$name,$email,$web,$comment){
if($page=='1'||$page==""){
$page = "page1";
}
if(Get::check_comments($page)){
$_SESSION['com_dir'] = "plugins/comments/";
Comment::write($page,Get::strip_html_tags($name),Get::strip_html_tags($email),Get::strip_html_tags($web),Get::strip_html_tags($comment));
}
}
////////////////////////
// function strip_html_tags($page)
// by Kevin Bluett
// June 2009
// Parameters: $text - text of which Html is to be stripped.
// Returns the text with html stripped content
///////////////////////
function strip_html_tags( $text )
{
$text = preg_replace(
array(
// Remove invisible content
'@]*?>.*?@siu',
'@@siu',
'@@siu',
'@]*?.*? @siu',
'@]*?.*? @siu',
'@]*?.*? @siu',
'@]*?.*? @siu',
'@]*?.*? @siu',
'@]*?.*? @siu',
// Add line breaks before and after blocks
'@?((address)|(blockquote)|(center)|(del))@iu',
'@?((div)|(h[1-9])|(ins)|(isindex)|(p)|(pre))@iu',
'@?((dir)|(dl)|(dt)|(dd)|(li)|(menu)|(ol)|(ul))@iu',
'@?((table)|(th)|(td)|(caption))@iu',
'@?((form)|(button)|(fieldset)|(legend)|(input))@iu',
'@?((label)|(select)|(optgroup)|(option)|(textarea))@iu',
'@?((frameset)|(frame)|(iframe))@iu',
),
array(
' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',
"\n\$0", "\n\$0", "\n\$0", "\n\$0", "\n\$0", "\n\$0",
"\n\$0", "\n\$0",
),
$text );
return strip_tags( $text );
}
////////////////////////
// function check_login()
// by Kevin Bluett
// June 2009
// Parameters: None.
// Returns true if an administrator is logged in.
///////////////////////
function check_login(){
$login = false;
$file1 = @fopen("admin/pages/admin.password","r");
$file = fread($file1,filesize("admin/pages/admin.password"));
fclose($file1);
$file2 = @fopen("admin/pages/admin.username","r");
$file3 = fread($file2,filesize("admin/pages/admin.username"));
fclose($file2);
if($_SESSION["username"]==md5($file3)&&$_SESSION["password"]==open_file("admin/inc/current_version.inc")&&$_SESSION["sys"]==$file){
$login = true;
}
else{
$login = false;
}
return $login;
}
}//End Get
?>