コード例 #1
0
ファイル: get-navg.php プロジェクト: spandey2405/api
require 'connect/connect.php';
require 'conf/conf.php';
if (isset($_GET["p"])) {
    $p = htmlspecialchars($_GET["p"]);
} else {
    $p = 0;
}
//execute body
if (isset($_GET["page"])) {
    $type = $defaultdata["type"];
    if (isset($_GET["type"])) {
        $type = htmlspecialchars($_GET["type"]);
    }
    $current_page = htmlspecialchars($_GET["page"]);
    $no_of_pages = count_folder($type);
    $next = $current_page + 1;
    $prev = $current_page - 1;
    if ($next > $no_of_pages) {
        $next = 1;
    }
    if ($prev < 1) {
        $prev = $no_of_pages;
    }
    $data["prev"] = $prev;
    if ($current_page - 3 < 1) {
        $start = 1;
    } else {
        if ($current_page + 3 > $no_of_pages) {
            $start = $no_of_pages - 4;
        } else {
コード例 #2
0
ファイル: check-folders.php プロジェクト: spandey2405/mikz
    }
    mysqli_close($conn);
    $folders = count_folder($type);
    $id = $count;
    if ($type == "posts") {
        $needed = $id;
    } else {
        $needed = ceil($id / 4);
    }
    $folder = "pages/" . $type . "/";
    for ($i = $folders; $i < $needed; $i++) {
        $c = $i + 1;
        mkdir($folder . $c);
        copy("index.txt", $folder . $c . "/index.php");
    }
    $folders = count_folder($type);
    if ($access == 1) {
        $data["Posts"] = $count;
        $data["folders"] = $folders;
        $data["required"] = $needed;
        $data["folder"] = $folder;
    }
    $data['success'] = 1;
} else {
    $data['error'] = "Post Type Is Required";
}
//print responce
if ($p == 1) {
    echo json_encode($data);
} else {
    echo "<pre>" . json_encode($data, JSON_PRETTY_PRINT) . "</pre>";
コード例 #3
0
function exploreProject($fd)
{
    $filety = '';
    if (!empty($fd)) {
        if (is_dir($fd)) {
            $read = opendir($fd);
            while ($open = readdir($read)) {
                if ($open != '.' && $open != '..') {
                    $rr = count_folder($open);
                    $ss = count_file($open);
                    if (is_file($open)) {
                        $filety = '(File)';
                    } else {
                        $filety = '(Folder)';
                    }
                    $srvr = $_SERVER["PHP_SELF"] . "?path=" . $fd . "/" . $open;
                    echo "<div id='hs' title='{$rr} folders,{$ss} files'><a href='{$srvr}'><k style='color:white; background:black;'>" . $open . ' ' . $filety . "</k>{$srvr}</a><br></div>";
                }
            }
        } elseif (is_file($fd)) {
            ?>
 
<div id='hss' title=' 0 folders,1 file'>
    
   <div id='embd'>
    <ul class="lin"><div>
    setting<button id="rerun"style='margin-left:20p;'></button>
    <button id="select"></button>
  </div>
  <ul>
    <?php 
            $srvers = $_SERVER["PHP_SELF"];
            ?>
    <li><a href="<?php 
            echo $srvers;
            ?>
?rfile=<?php 
            echo $fd;
            ?>
">See source File</a></li>
    <li><a href="index.php?runfile=<?php 
            echo $fd;
            ?>
">Run File</a></li>
    <li><a href="<?php 
            echo $srvers;
            ?>
/?rfile=<?php 
            echo $fd . '#tabs-3';
            ?>
">Edit File</a></li>
    <li><a href="index.php?dfile=<?php 
            echo $fd;
            ?>
">Delete File</a></li>
  </ul>
    </ul>
   </div>
   <div id='maind'>
 
    <a href='<?php 
            echo $srvers;
            ?>
?path=<?php 
            echo $fd;
            ?>
'><?php 
            echo $fd;
            ?>
</a>
   </div>
</div>
<?php 
        } else {
            "<h1>Whoops!! Something Went Wrong..</h1>";
        }
    }
}