Remove old images and logos
[elgg.git] / units / icons / function_add_icons.php
blob6496e285835dda11395f932909ecfcf3dab0332c
1 <?php
3 global $page_owner;
5 // Allow the user to add more icons
6 $numicons = db_query("select count(*) as iconnum from icons where owner = " . $page_owner);
7 $numicons = $numicons[0]->iconnum;
8 if ($page_owner != $_SESSION['userid']) {
9 $iconquota = db_query("select icon_quota from users where ident = " . $page_owner);
10 $iconquota = $iconquota[0]->icon_quota;
11 } else {
12 $iconquota = $_SESSION['icon_quota'];
15 if ($numicons < $iconquota) {
17 $header = gettext("Upload a new picture"); // gettext variable
18 $desc = gettext("Upload a picture for this profile below. Pictures need to be 100x100 pixels or smaller, but don't worry - if you've selected a larger picture, we'll shrink it down for you. You may upload up to"); // gettext variable
19 $desc_two = gettext("pictures in total."); // gettext variable
20 $body = <<< END
21 <h2>$header</h2>
22 <p>
23 $desc
24 {$iconquota} $desc_two
25 </p>
26 <form action="" method="post" enctype="multipart/form-data">
27 END;
28 $name = "<label for=\"iconfile\">" . gettext("Picture to upload:") . "</label>";
29 $column1 = "
30 <input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"2000000\" />
31 <input name=\"iconfile\" id=\"iconfile\" type=\"file\" />
33 $body .= run("templates:draw", array(
34 'context' => 'databox',
35 'name' => $name,
36 'column1' => $column1
39 $name = "<label for=\"icondescription\">". gettext("Icon description:") ."</label>";
40 $column1 = "<input type=\"text\" name=\"icondescription\" id=\"icondescription\" value=\"\" />";
41 $body .= run("templates:draw", array(
42 'context' => 'databox',
43 'name' => $name,
44 'column1' => $column1
47 $name = "<label for=\"icondefault\">" . gettext("Make this the default icon:") . "</label>";
48 $column1 = "
49 <select name=\"icondefault\" id=\"icondefault\">
50 <option value=\"yes\">".gettext("Yes")."</option>
51 <option value=\"no\">".gettext("No")."</option>
52 </select>
54 $body .= run("templates:draw", array(
55 'context' => 'databox',
56 'name' => $name,
57 'column1' => $column1
60 $upload = gettext("Upload new icon"); // gettext variable
61 $body .= <<< END
62 <p><input type="hidden" name="action" value="icons:add" />
63 <input type="submit" value="$upload" /></p>
64 </form>
66 END;
67 } else {
68 $iconQuota = sprintf(gettext("The icon quota is 1st: $s and you have 2nd: $s icons uploaded. You may not upload any more icons until you've deleted some."),$iconquota,$numicons); // gettext variable NOT SURE!!!
69 $body = <<< END
70 <p>
71 $iconQuota
72 </p>
73 END;
76 $run_result .= $body;