Esempio n. 1
0
function conv_rich_content($matches)
{
    global $view;
    return view_image($view, $matches[1], $matches[2]);
}
Esempio n. 2
0
{
    $query = 'SELECT id, title FROM snyggve ORDER by ID DESC LIMIT 12';
    $result = mysql_query($query) or die(report_sql_error($query, __FILE__, __LINE__));
    while ($data = mysql_fetch_assoc($result)) {
        $items[] = $data;
    }
    return $items;
}
if ($_GET['action'] == 'upload' && login_checklogin()) {
    $identifier = displace_image();
    saveform($identifier);
} elseif ($_GET['action'] == 'save' && login_checklogin()) {
    $id = saveimage();
    jscript_location('?action=view_image&image_id=' . $id);
} elseif ($_GET['action'] == 'view_image') {
    $user = view_image($_GET['image_id']);
    if (!view_album($user)) {
        echo '<h2>Senast uppladdat till Snyggve</h2>' . "\n";
        snyggve_list_items(snyggve_get_latest());
    }
    if (login_checklogin()) {
        uploadform();
    }
} elseif ($_GET['action'] == 'view_user' && is_numeric($_GET['user_id'])) {
    snyggve_intro();
    view_album($_GET['user_id'], 'fulhack');
    if (login_checklogin()) {
        uploadform();
    }
} elseif ($_GET['action'] == 'remove' && is_privilegied('snyggve_admin') && is_numeric($_GET['id'])) {
    snyggve_remove($_GET['id']);
Esempio n. 3
0
function css_style()
{
    header('Content-type: text/css');
    $css = <<<CSS
body {
    color: #333;
    background: #fff;
    padding: 25px;
    font: .9em Arial, Helvetica, "Bitstream Vera Sans", Tahoma, sans-serif;
    text-align: center;
}
#wrapper {
    margin: 0 auto;
    text-align: left;
}
#footer {
    font-size: 0.7em;
    margin: 0 auto;
    padding: 15px;
    clear: both;
}
table {
    border-collapse: collapse;
    background: #fff;
    margin-right: 10px;
    width: 100%;
}
td {
    border: 1px solid #fff;
    padding: 5px;
}
.tr1 {
    font-size: .9em;
    background: #fdfdfd;
    border-bottom: 1px solid #eee;
}
.tr2 {
    font-size: .9em;
    background: #f6f6f6;
    border-bottom: 1px solid #eee;
}
#functions {
    padding: 20px;
    background: #f6f6f6;
}
#func_left {
    width: 50%;
    float: left;
}
#func_right {
    width: 50%;
    margin-left: 50%;
}
input {
    margin-bottom: 2px;
}
label {
    font-size: 1.2em;
}
h2 a:link, .head:link {
    color: #333;
    text-decoration: none;
}
h2 a:visited, .head:visited {
    color: #333;
    text-decoration: none;
}
h2 a:hover, .head:hover {
    color: #666;
    text-decoration: underline;
}
#toggle:link, .file:link {
    color: #1d8fff;
    text-decoration: none;
}
#toggle:visited, .file:visited {
    color: #1773cd;
    text-decoration: none;
}
#toggle:hover, .file:hover {
    color: #1b86ee;
    text-decoration: underline;
}
.dir:link {
    color: #00bfff;
    font-weight: bold;
    text-decoration: none;
}
.dir:visited {
    color: #0099cd;
    font-weight: bold;
    text-decoration: none;
}
.dir:hover {
    color: #00b1ee;
    text-decoration: underline;
}
.notice {
    background: #f6f6f6;
    font-size: 0.9em;
    text-align: center;
    margin: 100px auto;
    width: 250px;
    padding: 100px;
}
.bullet {
    white-space: pre;
    text-decoration: none;
    font: bold 1.1em "Bitstream Vera Sans Mono", "Courier New", monospace;
}
CSS;
    if (isset($_GET['imageview'])) {
        $imageview = view_image($_GET['imageview']);
        $width = $imageview[0] < 250 ? 250 : $imageview[0];
        $css .= '
.image {
    background: #f6f6f6;
    font-size: 0.9em;
    margin: 0 auto;
    width: ' . $width . 'px;
    padding: 25px;
}
.image img {
    display: block;
    margin: 0 auto;
}
.image hr {
    width: ' . ($width - 50) . 'px;
    border: 0 none;
    height: 1px;
    background: #666;
    margin: 15px auto;
}';
    }
    header('Content-length: ' . strlen($css));
    return $css;
}
Esempio n. 4
0
     $url_img = $data['url_img'];
     $url_img_thumb = $data['url_img_thumb'];
     foreach ($_FILES['photos']['name'] as $name => $value) {
         $filename = stripslashes($_FILES['photos']['name'][$name]);
         $size = filesize($_FILES['photos']['tmp_name'][$name]);
         //get the extension of the file in a lower case format
         $ext = getExtension($filename);
         $ext = strtolower($ext);
         if (in_array($ext, $valid_formats)) {
             if ($size < MAX_SIZE * 1024) {
                 $image_name = time() . '.' . $ext;
                 $newname = $uploaddir . $image_name;
                 if (move_uploaded_file($_FILES['photos']['tmp_name'][$name], $newname)) {
                     $result = xuly_image($image_name, $uploaddir, $url_img, $url_img_thumb);
                     if ($result) {
                         echo view_image($image_name, $url_img_thumb);
                     }
                     //mysql_query("INSERT INTO user_uploads(image_name,user_id_fk,created) VALUES('$image_name','$session_id','$time')");
                 } else {
                     echo '<span class="imgList">You have exceeded the size limit! so moving unsuccessful! </span>';
                 }
             } else {
                 echo '<span class="imgList">You have exceeded the size limit!</span>';
             }
         } else {
             echo '<span class="imgList">Unknown extension!</span>';
         }
     }
     //end foreach
 }
 return true;
Esempio n. 5
0
function img_insert_content($matches)
{
    global $row;
    return view_image($row, $matches[1], $matches[2]);
}