$font = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'fonts' . DIRECTORY_SEPARATOR . 'impact.ttf';
}
//datetime
$datetimeid = $_GET['id'];
//set default data
$x1 = 195;
$y1 = 449;
$width = 195;
$height = 449;
$radius = 449;
$dir = -1;
$color = "#FFFFFF";
$length = 11;
//init db handler
$dbHandler = new JsonDB("./admin/database.json");
$currentListLayout = $dbHandler->read('layout');
$existFile = $config['image_path'] . 'CH-Profile.jpg';
$filename = "";
foreach ($currentListLayout as $key => $value) {
    if ($datetimeid == $value->datetime) {
        $existFile = $config['image_path'] . $value->background_image;
        $filename = $value->background_image;
        $x1 = $value->x1;
        $y1 = $value->y1;
        $width = $value->w;
        $height = $value->h;
        $radius = $value->r;
        $color = $value->color;
        $dir = $value->d;
        $length = $value->l;
        $text = substr($text, 0, $value->l);
예제 #2
0
 case 'save layout':
     $new_layout = new Layout();
     $new_layout->set_name($_POST['layout_name']);
     $new_layout->set_background_image($_POST['image_name']);
     $new_layout->set_datetime(time());
     $new_layout->set_x1($_POST['x1']);
     $new_layout->set_y1($_POST['y1']);
     $new_layout->set_x2($_POST['x2']);
     $new_layout->set_y2($_POST['y2']);
     $new_layout->set_w($_POST['w']);
     $new_layout->set_h($_POST['h']);
     $new_layout->set_l($_POST['l']);
     $new_layout->set_color($_POST['color']);
     $new_layout->set_r($_POST['r']);
     $new_layout->set_d($_POST['d']);
     $currentListLayout = $dbHandler->read('layout');
     if ($currentListLayout != null) {
         if (is_array($currentListLayout)) {
             $tmparr = $currentListLayout;
         } else {
             $tmparr = get_object_vars($currentListLayout);
         }
         array_push($tmparr, (object) $new_layout->getAllData());
     } else {
         $tmparr = array((object) $new_layout->getAllData());
     }
     // $tmparr[]= (object) $new_layout->getAllData();
     $currentListLayout = $tmparr;
     $rs = $dbHandler->set("layout", $currentListLayout)->save();
     if ($rs) {
         $tmpdata = $new_layout->getAllData();
예제 #3
0
<?php

if (!$instance) {
    exit;
}
$padname = htmlspecialchars($_GET['show']);
//header("Location: ".$padurl.$padname); #+$padurl+$padname);
$padID = $groupmap[$group] . '$' . $padname;
$pwdb = new JsonDB('passwords');
$password = $pwdb->read($groupmap[$group] . '$' . $padname);
$passw = "";
if ($password) {
    $passw = "Passwort: <input type='text' value='{$password}' readonly ondblclick='event.stopPropagation();return false' onclick='this.select()' id='padview_pw'>";
}
$sldb = new JsonDB('shortlnk');
$shortnam = $sldb->read($groupmap[$group] . '$' . $padname);
$shortlnk = "";
if ($shortnam) {
    $shortlnk = "Kurz-Link: <br><b><a href='" . SHORTLNK_PREFIX . "{$shortnam}' class='elipsis'>" . SHORTLNK_PREFIX . "{$shortnam}</a></b>";
}
try {
    $public = $instance->getPublicStatus($padID);
    $tags = "";
} catch (InvalidArgumentException $ex) {
    header("HTTP/1.1 404 Not Found");
    load_view("pad_not_found", array("pad" => "{$group}/{$padname}"));
    return;
}
if ($password) {
    setcookie("password", $password, 0, PAD_URL . $padID);
}