mypanel.php

File Type: php File Location: monofiles/ File name: mypanel.php
<?php

    
include_once 'data_connect.php';
    include_once 
'log.php';

    
libxml_clear_errors();
    
libxml_use_internal_errors(true);

    if (!
file_exists('filesinfo/settings.xml'))
    exit(
'Could not load page. Settings file is missing.');

    
$settingsXML simplexml_load_file('filesinfo/settings.xml');

    
$log_info get_log();
    
$acc_info get_account($_SESSION['userID']);

    
// user rights
    
$monrights $acc_info['rights'];


    if (
$settingsXML === false)
    exit(
'Error: Settings file is corrupt');

    
$user $_SESSION['username'];
    
$usericon $acc_info['icon'];

    
$c $log_info['posts'];
    
$d $log_info['pages'];

?>

<!-- Shadow effect -->
<div class="darkline"></div>

<!-- Works as a cover -->
<div class="topbar topbg"></div>

<!-- Actual container of the top bar -->
<div style="height:55px;z-index:999;position:fixed;width:100%;top:15px;min-width:700px">
<?php if ($acc_info['sidemenu'] == 'on') : ?>

    <div class="logo">
        <a href="panel.php" id="logolink"><?php print $settingsXML->general->title ?></a>
    </div>
    
    <?php endif ?>
    
    <div class="editbar">
    
        <?php if ($acc_info['sidemenu'] != 'on') : ?>
        
        <div class="logo">
            <a href="panel.php" id="logolink"><?php print $settingsXML->general->title ?></a>
        </div>
        <div id="dropdown" tabindex="0">
                <div class="dpline">
                    <div class="hoverline"></div>
                </div>
                <div class="dpline">
                    <div class="hoverline"></div>
                </div>
                <div class="dpline">
                    <div class="hoverline"></div>
                </div>
                <div id="dropdown-content">
                    <div class="dropsub">
                        <div class="subeff">
                            <div class="tr1"></div>
                            </div>
                        Posts
                        <div class="dropsub-content-posts">
                            <a href="newpage.php" class="dropdown-option" title="Write post">Write post</a>
                            <a href="opensaved.php" class="dropdown-option" title="All posts">All posts <?php print '<span class="dinf">'.$c.'</span>' ?></a>
                            <a href="category.php" class="dropdown-option" title="Categories">Categories</a>
                        </div>
                    </div>

                    <?php if ($monrights == 'administrator') : ?>
                    
                    <div class="dropsub">
                        <div class="subeff">
                            <div class="tr1"></div>
                        </div>Pages
                        <div class="dropsub-content-pages">
                            <a href="createpage.php" class="dropdown-option" title="Add page">Add page</a>
                            <a href="pages.php" class="dropdown-option" title="All pages">All pages <?php print '<span class="dinf">'.$d.'</span>' ?></a>
                        </div>
                    </div>
                    <a href="uploads.php" class="dropdown-option" title="Images">Images</a>
                    <a href="general.php" class="dropdown-option" title="Settings">Settings</a>
                    <a href="accmanage.php" class="dropdown-option" title="Users">Users</a>
                    <a class="dropdown-option" href="navigation.php" title="Navigation menu">Navigation menu</a>
                    <a class="dropdown-option" href="theme.php" title="Theme">Theme</a>
                    
                    <?php else : ?>
                    
                    <a href="uploads.php" class="dropdown-option" title="Images">Images</a>
                    <a href="generaluser.php" class="dropdown-option" title="Settings">Settings</a>
                    
                    <?php endif ?>
                    
                </div>
        </div>
        
        <?php endif ?>
    
    </div>
    
    <a id="lgcon" href="?logout=1" title="Logout">
        <div id="logout-arrow">
                <div class="lgarrow" style="transform:rotate(45deg)"></div>
                <div class="lgarrow" style="transform:rotate(-45deg);margin-top:4px"></div>
        </div>
        <span class="logout">&nbsp; Logout</span>
    </a>
    <div class="user-info">
        <div id="user"><?php print $user ?></div>
        <img class="panelicon" src="<?php print $usericon ?>" title="<?php print $user ?>">
        
        <!-- small screens alternative -->
        
        <div class="resp-userinfo">
            <span><?php print $user ?></span>
            <a href="?logout=2"><b>&rarr;</b> Logout</a>
        </div>
        
    </div>
</div>