summaryrefslogtreecommitdiff
path: root/lib/image/index.php
blob: 59a304d34bf5e040cda2e9d7c1fdfef41c3cbfe3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php

require("lib/conf/image.php");

$filters = array (
	"order" => array (
			"name" => "title",
			"upl_date" => "date uploaded",
		),
	"way" => $ord_ways,
);
$fdefaults = array (
	"order" => "name",
	"way" => "ASC",
);

$title = "Image upload";

$images = array();
$files = sql("SELECT * FROM images WHERE owner = " . $user['id'] .
	" ORDER BY " . get_filter('order') . " " . get_filter('way'));
while ($img = mysql_fetch_assoc($files)) $images[] = $img;

/*if (count($images) >= $quota && $user['priv'] < $min_priv_for_no_quota) {
	$error = "You have already exceeded your quota of $quota uploadable images.";
	$can_upload = false;
} else */

if ($user['priv'] < $apps['image']['upload']) {
	$error = "You don't have the rights to upload images.";
	$can_upload = false;
} else {
	$can_upload = true;
}

$can_delete = ($user['priv'] >= $apps['image']['delete'] && $user['id'] != 0);
$can_rename = ($user['priv'] >= $apps['image']['rename'] && $user['id'] != 0);

require("tpl/image/index.php");