Mercurial > hg > fapweb
changeset 45:842003d78994
Remove stuff.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 05 Oct 2013 00:02:29 +0300 |
parents | 72dcc1d48809 |
children | 86582e43a4c8 |
files | entry.inc.php esubmit.php usrlogout.php |
diffstat | 3 files changed, 1 insertions(+), 173 deletions(-) [+] |
line wrap: on
line diff
--- a/entry.inc.php Fri Oct 04 23:54:25 2013 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,82 +0,0 @@ -<? -$sessionType = "entry"; - -// Check if entry submission is enabled -if (!stChkSetting("allowSubmit")) -{ - echo - "<h1>Sorry, entry submission disabled!</h1>\n". - "<p>Compo entry submission not available at this time.</p>\n"; -} -else -{ - $status = stGetSubmitStatus(); - - stStartSubmitStatus($status, "entry", "esubmit.php", "Compo entry submission (login)"); - - if ($status == 1) - { - echo - "<h1>Compo entry submission (info)</h1>\n". - stGetFormStart("entry", "esubmit.php")."\n". - " ".stGetFormHiddenInput("mode", "info")."\n". - " ".stGetFormHiddenInput("key", stGetSessionItem("key"))."\n". - " <table>\n". - " <tr>\n". - " <th>Compo</th>\n". - " <th>Title</th>\n". - " <th>Author(s)</th>\n". - " </tr>\n". - " <tr>\n". - " <td>\n". - " <select class=\"dropdown\" name=\"compo_id\">\n"; - foreach (stExecSQL("SELECT id,name FROM compos WHERE visible<>0") as $entry) - echo " <option value=\"".$entry["id"]."\">".chentities($entry["name"])."</option>\n"; - echo - " </select>\n". - " </td>\n". - " <td>".stGetFormTextInput(35, 64, "name", "", "", stGetSessionItem("name", ""))."</td>\n". - " <td>".stGetFormTextInput(30, 64, "author", "", "", stGetSessionItem("author", ""))."</td>\n". - " </tr>\n". - " </table>\n". - " ".stGetFormSubmitInput("entry", "Continue")."\n". - "</form>\n"; - stSubmitLogout("entry", "esubmit.php"); - echo "<p>".stGetSetting("entrySubmitInfo")."</p>\n"; - } - else - if ($status == 2) - { - $compo = stFetchSQLColumn( - stPrepareSQL("SELECT name FROM compos WHERE visible<>0 AND id=%D", - "compo_id")); - - echo - "<h1>Compo entry submission (files)</h1>\n". - stGetFormStart("entry", "esubmit.php")."\n". - " ".stGetFormHiddenInput("mode", "files")."\n". - " ".stGetFormHiddenInput("key", stGetSessionItem("key"))."\n". - " <table>\n". - " <tr>\n". - " <td>".chentities($compo)."</td>\n". - " <td>".chentities(stGetSessionItem("name"))."</td>\n". - " <td>".chentities(stGetSessionItem("author"))."</td>\n". - " </tr>\n". - " <tr>\n". - " <td>Entry file:</td>\n". - " <td><input type=\"file\" name=\"file\" id=\"file\"></td>\n". - " <td>".stGetFormSubmitInput("entry", "Submit entry")."</td>\n". - " </tr>\n". - " </table>\n". - "</form>\n". - "<p>".stGetSetting("entrySubmitInfo")."</p>\n"; - } - else - if ($status == 3) - { - echo "<h1>Yay, you submitted some entries!</h1>\n". - "<p>Now go FAP some more! And make wait for voting.</p>"; - stSessionEnd(TRUE); - } -} -?> \ No newline at end of file
--- a/esubmit.php Fri Oct 04 23:54:25 2013 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ -<? -$sessionType = "entry"; -require "mconfig.inc.php"; -require "msite.inc.php"; - -// -// Start of the main code -// -if (stStartSubmitSession("allowSubmit", $sessionType)) -{ - print_r($_SESSION); - exit; - - // Entry submission - if (!$errorSet && $mode == "info") - { - if (stChkRequestItem("compo_id") && - stChkRequestItem("name") && stChkRequestItem("author")) - { - $compo_id = stGetRequestItem("compo_id", FALSE); - $name = stGetRequestItem("name", ""); - $author = stGetRequestItem("author", ""); - stSetSessionItem("compo_id", $compo_id); - stSetSessionItem("name", $name); - stSetSessionItem("author", $author); - - if ($compo_id !== FALSE && $name != "" && $author != "") - { - stSetSessionStatus(2); - } - else - { - stError("Entry name/title and author must be set."); - stSetSessionStatus(1); - } - } - else - { - stError("Required entry information not set (name, compo, author)."); - } - } - - if (!$errorSet && $mode == "files") - { -/* - stSessionEnd(); - $allowedExts = array("zip", "rar", "lha", "7z"); - $filename = $_FILES["file"]["name"]; - $extension = end(explode(".", $filename)); - $type = $_FILES["file"]["type"]; - - if (($type == "image/gif" || $type == "image/jpeg" || $type == "image/png" || $type == "image/pjpeg") && - ($_FILES["file"]["size"] < 20000) && in_array($extension, $allowedExts)) - { - if ($_FILES["file"]["error"] > 0) - { - echo "Return Code: " . $_FILES["file"]["error"] . "<br>"; - } - else - { - - echo "Upload: " . $filename . "<br>"; - echo "Type: " . $type . "<br>"; - echo "Size: " . ($_FILES["file"]["size"] / 1024) . " kB<br>"; - echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br>"; - - if (file_exists("upload/" . $filename)) - { - echo $filename . " already exists. "; - } - else - { - move_uploaded_file($_FILES["file"]["tmp_name"], - "upload/" . $filename); - echo "Stored in: " . "upload/" . $filename; - } - } - } - else - { - echo "Invalid file"; - } - stSetSessionStatus(3); -*/ - } - - stEndSubmitSession($sessionType); -} - -?> \ No newline at end of file