Ejemplo n.º 1
0
function cleanCache(&$images)
{
    global $destination;
    global $rm;
    // load the currently cached images
    loadImages($cache, $destination);
    $items = array_diff($cache, $images);
    // remove the pictures that were removed from the originals
    foreach ($items as $item) {
        `{$rm} -f '{$destination}/{$item}'`;
    }
}
Ejemplo n.º 2
0
    ?>
        <img title="List" src="img/cd-icon-list.png" class="headerIcon floatRight" onclick="window.location.href = 'pluginconfig.php?file_style=list';">
    <?php 
} elseif ($file_style == "list") {
    ?>
        <img title="Block" src="img/cd-icon-block.png" class="headerIcon floatRight" onclick="window.location.href = 'pluginconfig.php?file_style=block';">
        <img title="Quick Edit" id="qEditBtnOpen" src="img/cd-icon-qedit.png" class="headerIcon floatRight" onclick="toogleQEditMode();">
        <img title="Quick Edit" id="qEditBtnDone" src="img/cd-icon-done.png" class="headerIcon floatRight" onclick="toogleQEditMode();">
    <?php 
}
?>
</p>

<div id="files">
    <?php 
loadImages();
?>
</div>

    
<?php 
if ($file_style == "block") {
    ?>
    <div class="fileDiv" onclick="window.location.href = 'http://imageuploaderforckeditor.altervista.org';">
        <div class="imgDiv">Image Uploader for CKEditor</div>
        <p class="fileDescription">&copy; 2016 by Moritz Maleck</p>
        <p class="fileTime">imageuploaderforckeditor.altervista.org</p>
        <p class="fileTime">180 KB</p>
    </div>
<?php 
} elseif ($file_style == "list") {
Ejemplo n.º 3
0
<?php 
// Copyright 2002 - Robert Pufky
// Display engine for picture frame
// load configuration
require_once "/etc/pictureframe/config.php";
// Disable screen power management
`{$xset} -display :0 s off > /dev/null 2>&1;\n{$xset} -display :0 -dpms > /dev/null 2>&1;\n{$setterm} -blank 0 > /dev/null 2>&1;\n{$setterm} -powerdown 0 > /dev/null 2>&1;\n{$setterm} -powersave off > /dev/null 2>&1`;
// write any system information not committed to disk, to the disk
// this will let us just unplug it without worry
`{$sync};{$sync};{$sync}`;
// put up the loading images screen and give convertengine some time to process the first picture
`{$xview} -display localhost:0.0 -fork -fullscreen -normalize "/tmp/loading.png" > /dev/null 2>&1 &`;
sleep(3);
// continue indefinitely
while (true) {
    loadImages($images, $destination);
    // prevent runaway case where there are no pictures
    if (count($images) == 0) {
        sleep($throttle);
    } else {
        // render each picture
        foreach ($images as $image) {
            $image = "{$destination}/{$image}";
            // load new image to be displayed, and fork the process
            `{$xview} -display localhost:0.0 -fork -fullscreen -normalize "{$image}" > /dev/null 2>&1 &`;
            sleep($waittime);
            // remove "stale" images (not currently being displayed)
            $pids = explode("\n", `{$pgrep} [x]view`);
            array_pop($pids);
            reset($pids);
            // remove old pictures, except for the new picture being displayed (has the highest pid)
Ejemplo n.º 4
0
function loadImages($dir){

        foreach ($_FILES["pictures"]["error"] as $key => $error) {
            if ($error == UPLOAD_ERR_OK) {
                $tmp_name = $_FILES["pictures"]["tmp_name"][$key];
                $name = $_FILES["pictures"]["name"][$key];
                move_uploaded_file($tmp_name, $dir.$name);
            }
        }

}

$dir    = 'img/';

if(!empty($_FILES)){
    loadImages($dir);
    header('Location: /gallery.php');
    exit;
}

?>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>

<pre>
    <form action="loadimg.php" method="post" enctype="multipart/form-data">