panel.php

File Type: php File Location: monofiles/ File name: panel.php
<?php 
    
include_once 'data_connect.php'
?>
<!doctype html>
<html>
<head>
<title>Control panel</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="cmstyle.css">
<?php include 'csstheme.php' ?>
</head>
<body>
<?php

    
include 'mypanel.php';
    
    
//if the user has author rights, we must change the number of posts from sum, to owned only.
    
if ($acc_info['rights'] != 'administrator'){
        
        
$c=0;
        
        
$directory = new DirectoryIterator('autosaves/');
        
        foreach (
$directory as $fileinfo) {

                if (
$fileinfo->isFile()) {

                    
$name $fileinfo->getFilename();
                    
$namexml simplexml_load_file('autosaves/'.$name);
                    
                    if (((string)
$namexml->postinfo->post->createdby == $_SESSION['userID']) && (strpos($name,'nu') === false) )
                        
                        
$c++;
                }
        }
    }
    

?>
<div class="main">
<div class="welcome-box">
<?php

/*
    $st = array('Posts'=>$c,'Pages'=>$d);
        
        foreach($st as $title=>$numeric)
            echo '<div class="statcat"><span class="catvalue">'.$numeric.'</span><span class="statdes">'.$title.'</span></div>'.PHP_EOL;
    
    */
?>
Welcome! You have <?php echo $c ?> posts<?php if(get_account($_SESSION['userID'])['rights'] == 'administrator') echo ' and '.$d.' pages.' ?>
</div>
<div class="welcome-box plugin">Plugins installed:<?php 

// Check for installed plugins:
$plugged = array('Autologout','Rssburn');
$p=0;
foreach (
$plugged as $plugin)
        if (
file_exists('../plugins/'.lcfirst($plugin).'.php')) {
            echo 
'<span class="pl-title">'.$plugin.'</span>';
            
$p++;
        }

if (
$p == 0
    echo 
'<span class="pl-title"><i>none</i></span>'

?></div>
</div>
</body>
</html>