diff options
| -rw-r--r-- | .hgignore | 1 | ||||
| -rw-r--r-- | contribute.php | 108 | ||||
| -rw-r--r-- | template.png | bin | 0 -> 1196 bytes |
3 files changed, 108 insertions, 1 deletions
| diff --git a/.hgignore b/.hgignore index 47241b6..378539b 100644 --- a/.hgignore +++ b/.hgignore | |||
| @@ -1 +1,2 @@ | |||
| 1 | images/ | 1 | images/ |
| 2 | moderation/ | ||
| diff --git a/contribute.php b/contribute.php index 363aab3..3d63fb2 100644 --- a/contribute.php +++ b/contribute.php | |||
| @@ -1,14 +1,120 @@ | |||
| 1 | <?php | 1 | <?php |
| 2 | 2 | ||
| 3 | $title = 'Contribute'; | ||
| 3 | include('header.php'); | 4 | include('header.php'); |
| 4 | 5 | ||
| 6 | if (!isset($_GET['submit'])) | ||
| 7 | { | ||
| 8 | |||
| 9 | ?> | ||
| 10 | <H1>Contribute</H1> | ||
| 11 | |||
| 12 | <P> | ||
| 13 | Aha, contributing! Starla admits that she isn't the only person on Earth. If you wish to contribute a comic to | ||
| 14 | Pillowcase, you can. But you have to follow the procedure below. | ||
| 15 | </P> | ||
| 16 | |||
| 17 | <P> | ||
| 18 | First, of course, you have to actually write the comic. You can <A HREF="/template.png">download the template here</A>. | ||
| 19 | There are some rules about how you can layout the comic, though. | ||
| 20 | |||
| 21 | <UL> | ||
| 22 | <LI>You are allowed to move around the pillowcase. You are also allowed to make him face the other way, make | ||
| 23 | him look weird, add special effects, but you cannot change the base pillowcase.</LI> | ||
| 24 | |||
| 25 | <LI>You are allowed to make multi-panelled comics. However, they cannot be more than two panels wide. You can | ||
| 26 | make it how ever many panels you want in height, but the width cannot exceed two panels. This applies only to | ||
| 27 | regularly sized panels (see below rule).</LI> | ||
| 28 | |||
| 29 | <LI>You are allowed to resize the base panel to make it bigger (making it smaller wouldn't make much sense), | ||
| 30 | but if you do so, it cannot exceed a width of 500 pixels. Also, if you enlarge the base panel and you wish to | ||
| 31 | make a multi-panelled comic (see above rule), the comic cannot grow horizontally (you can't add any panels to | ||
| 32 | the width), only vertically.</LI> | ||
| 33 | |||
| 34 | <LI>The template is a PNG image. The comic you upload must also be a PNG image (as in, the extension is ".png").</LI> | ||
| 35 | </UL> | ||
| 36 | </P> | ||
| 37 | |||
| 38 | <P> | ||
| 39 | Second, come up with a title and some alt text (a.k.a. the addendum that appears when you hover over the comic with | ||
| 40 | your mouse). | ||
| 41 | </P> | ||
| 42 | |||
| 43 | <P> | ||
| 44 | Finally, fill out the form below. Upload your comic in the appropriate field. If you wish to be credited for your | ||
| 45 | comic, fill out the Author field as well. Submit the form and your comic will be added to the moderation list where | ||
| 46 | Starla will review it and (hopefully!) put it on the pending list! | ||
| 47 | </P> | ||
| 48 | |||
| 49 | <CENTER> | ||
| 50 | <H3>Contribute A Comic</H3> | ||
| 51 | |||
| 52 | <FORM ACTION="/contribute.htm?submit=" METHOD="POST" ENCTYPE="multipart/form-data"> | ||
| 53 | Title: <INPUT TYPE="textbox" NAME="title" MAXLENGTH="40"><BR> | ||
| 54 | Alt Text: <INPUT TYPE="textbox" NAME="text" MAXLENGTH="400"><BR> | ||
| 55 | Author (optional): <INPUT TYPE="textbox" NAME="author"><BR> | ||
| 56 | Comic: <INPUT TYPE="file" NAME="comic"><BR> | ||
| 57 | <INPUT TYPE="submit"> | ||
| 58 | </FORM> | ||
| 59 | </CENTER> | ||
| 60 | <?php | ||
| 61 | |||
| 62 | } else { | ||
| 63 | if ($_POST['title'] != '') | ||
| 64 | { | ||
| 65 | if ($_POST['text'] != '') | ||
| 66 | { | ||
| 67 | $insimage = "INSERT INTO moderation (title, text, author) VALUES (\"" . mysql_real_escape_string($_POST['title']) . "\",\"" . mysql_real_escape_string($_POST['text']) . "\",\"" . mysql_real_escape_string($_POST['author']) . "\")"; | ||
| 68 | $insimage2 = mysql_query($insimage) or die($insimage); | ||
| 69 | |||
| 70 | $id = mysql_insert_id(); | ||
| 71 | if ($id != 0) | ||
| 72 | { | ||
| 73 | if (move_uploaded_file($_FILES['comic']['tmp_name'], $_SERVER['DOCUMENT_ROOT'] . '/moderation/' . $id . '.png')) | ||
| 74 | { | ||
| 75 | ?> | ||
| 76 | <H1>Contribute</H1> | ||
| 77 | |||
| 78 | <P> | ||
| 79 | You have successfully uploaded a comic! Woo-hoo! Now, Starla will review it and (hopefully) add it to the pending | ||
| 80 | queue! Good luck! | ||
| 81 | </P> | ||
| 82 | <?php | ||
| 83 | } else { | ||
| 84 | $delimage = "DELETE FROM moderation WHERE id = " . $id; | ||
| 85 | $delimage2 = mysql_query($delimage); | ||
| 86 | |||
| 87 | ?> | ||
| 88 | <H1>Contribute</H1> | ||
| 89 | |||
| 90 | <P> | ||
| 91 | Uh oh, due to some unknown reason (are you sure you uploaded an image?), the comic upload failed! That's not good. | ||
| 92 | Please go back to the form and ensure you filled it in correctly. | ||
| 93 | </P> | ||
| 94 | <?php | ||
| 95 | } | ||
| 96 | } | ||
| 97 | } else { | ||
| 98 | ?> | ||
| 99 | <H1>Contribute</H1> | ||
| 100 | |||
| 101 | <P> | ||
| 102 | Uh oh, you neglected to add an "alt text" description to your comic upload! That's a required field, so you have to | ||
| 103 | go back and try filling in the form again. | ||
| 104 | </P> | ||
| 105 | <?php | ||
| 106 | } | ||
| 107 | } else { | ||
| 5 | ?> | 108 | ?> |
| 6 | <H1>Contribute</H1> | 109 | <H1>Contribute</H1> |
| 7 | 110 | ||
| 8 | <P> | 111 | <P> |
| 9 | This page is soooo under construction. Hopefully Starla'll be bothered to finish it someday. | 112 | Uh oh, you neglected to add an title to your comic upload! That's a required field, so you have to go back and try |
| 113 | filling in the form again. | ||
| 10 | </P> | 114 | </P> |
| 11 | <?php | 115 | <?php |
| 116 | } | ||
| 117 | } | ||
| 12 | 118 | ||
| 13 | include('footer.php'); | 119 | include('footer.php'); |
| 14 | 120 | ||
| diff --git a/template.png b/template.png new file mode 100644 index 0000000..77a3ef5 --- /dev/null +++ b/template.png | |||
| Binary files differ | |||
