function maxscale($file)
 {
     $size = getimagesize($file);
     if ($size[0] > $this->max_scale['x'] || $size[1] > $this->max_scale['y']) {
         if (!class_exists('Bilder')) {
             include_once 'Bilder.php';
         }
         if (!is_writeable($file)) {
             RheinaufFile::chmod($file, '777');
         }
         $img = new Bilder($file, $file);
         if ($size[0] > $this->max_scale['x']) {
             $img->scaleMaxX($this->max_scale['x']);
         } else {
             $img->scaleMaxY($this->max_scale['y']);
         }
         $img->output();
     }
 }
<?php

session_start();
include 'classes/bilder.php';
$gallery = new Bilder();
$data = $_FILES["img"];
$userid = $_SESSION['userid'];
$gallery->upload($data, $userid);
 function big_img()
 {
     $img = INSTALL_PATH . '/' . $_GET['bigimg'];
     if (!class_exists('Bilder')) {
         include_once 'Bilder.php';
     }
     $thumb = new Bilder($img);
     $thumb->scaleMaxX($this->bigimg_size);
     $thumb->output();
     exit;
 }
 function new_db_insert()
 {
     $uniqid = md5(uniqid(rand(), true));
     $schulname = General::input_clean($_POST['Schulname']);
     $plz = General::input_clean($_POST['PLZ']);
     $bilder_pfade = array();
     if ($_FILES['bild']['name'][0] != '') {
         $output_path = DOCUMENT_ROOT . INSTALL_PATH . '/Images/BuddyListe/' . $plz . '_' . $schulname . '/';
         if (!is_dir($output_path)) {
             RheinaufFile::mkdir($output_path);
             RheinaufFile::chmod($output_path, 777);
         }
         for ($i = 0; $i < count($_FILES['bild']); $i++) {
             if ($_FILES['bild']['error'][$i] == '0') {
                 $bild = new Bilder($_FILES['bild']['tmp_name'][$i], $output_path . $_FILES['bild']['name'][$i]);
                 $bild->scaleMaxX(200);
                 $bild->output();
                 $bilder_pfade[] = 'Images/BuddyListe/' . $plz . '_' . $schulname . '/' . $_FILES['bild']['name'][$i];
             }
         }
     }
     $insert_sql = 'INSERT INTO `RheinaufCMS>BuddyListe` ( `id` ,';
     $field_names = array();
     for ($i = 0; $i < count($this->fields); $i++) {
         $field_name = $this->fields[$i]['name'];
         $field_names[] = '`' . $field_name . '`';
     }
     $insert_sql .= implode(', ', $field_names);
     $insert_sql .= ",`Bilder`,`angenommen`,`uniqid`) VALUES ('',";
     $field_values = array();
     for ($i = 0; $i < count($this->fields); $i++) {
         $field_value = $_POST[rawurlencode($this->fields[$i]['name'])];
         $field_value = !strstr($field_value, '--') ? $field_value : '';
         $field_value = is_array($field_value) ? implode(', ', $field_value) : $field_value;
         $field_values[] = "'" . General::input_clean(rawurldecode($field_value), true) . "'";
     }
     $insert_sql .= implode(', ', $field_values) . ",'" . implode(';', $bilder_pfade) . "','0','{$uniqid}')";
     $this->connection->db_query($insert_sql);
 }
Example #5
0
<?php

if (!isset($_SESSION)) {
    session_start();
}
include 'classes/bilder.php';
$bilder = new Bilder();
if (isset($_SESSION)) {
    $images = $bilder->getImages($_SESSION['userid']);
    $amountImages = sizeof($images);
    $id = $_SESSION['userid'];
    $pdo = new PDO('mysql:host=localhost;dbname=wpf', 'root', '');
    $statement = $pdo->prepare("SELECT * FROM users WHERE id = :id");
    $result = $statement->execute(array('id' => $id));
    $user = $statement->fetch();
    $email = $user["email"];
    $created = $user["created_at"];
}
?>
    <!DOCTYPE HTML>
    <html>

    <head>
        <?php 
include 'partials/head.php';
?>
    </head>

    <body class="test">
        <div class="content">
            <!-- MenĂ¼-->