PageRenderTime 44ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/upload2.php

https://github.com/delete66/sikevux-s-tracker
PHP | 93 lines | 88 code | 4 blank | 1 comment | 4 complexity | 875653c6013d65a2dde53979d83abd46 MD5 | raw file
Possible License(s): GPL-2.0
  1. <?php
  2. require_once("include/bittorrent.php");
  3. require_once ("include/user_functions.php");
  4. require_once ("include/bbcode_functions.php");
  5. dbconn(false);
  6. maxcoder();
  7. if(!logged_in())
  8. {
  9. header("HTTP/1.0 404 Not Found");
  10. // moddifed logginorreturn by retro//Remember to change the following line to match your server
  11. print("<html><h1>Not Found</h1><p>The requested URL /{$_SERVER['PHP_SELF']} was not found on this server.</p><hr /><address>Apache/1.1.11 (xxxxx) Server at ".$_SERVER['SERVER_NAME']." Port 80</address></body></html>\n");
  12. die();
  13. }
  14. stdhead("Upload");
  15. if ($CURUSER["uploadpos"] == 'no')
  16. {
  17. stdmsg("Sorry...", "You are not authorized to upload torrents. (See <a href=\"rules.php\">Read the site rules</a>)");
  18. stdfoot();
  19. exit;
  20. }
  21. ?>
  22. <div align=Center>
  23. <form name=upload enctype="multipart/form-data" action="takeupload2.php" method="post">
  24. <input type="hidden" name="MAX_FILE_SIZE" value="<?=$max_torrent_size?>" />
  25. <p>The tracker's announce url is <b><?= $announce_urls[0] ?></b></p>
  26. <p><b>Only upload torrents you're going to seed!</b> Uploaded torrents won't be visible on the main page until you start seeding them.</p>
  27. <p><b>Your torrent will automatically download once you press submit !</b></p>
  28. <?
  29. echo'<table class=message cellspacing=0 cellpadding=5>';
  30. //==== offer dropdown for offer mod
  31. $res = mysql_query("SELECT id, name, allowed FROM offers WHERE userid = $CURUSER[id] ORDER BY name ASC") or sqlerr(__FILE__, __LINE__);
  32. if (mysql_num_rows($res) > 0) {
  33. $offer = "<select name=offer><option value=0>Your Offers</option>";
  34. while($row = mysql_fetch_array($res)) {
  35. if ($row['allowed'] == 'allowed')
  36. $offer .= "<option value=\"" . $row["id"] . "\">" . htmlspecialchars($row["name"]) . "</option>";
  37. }
  38. $offer .= "</select>";
  39. tr("Offer", $offer."<br> If you are uploading one of your offers please select it here so the voters will be notified." , 1);
  40. }
  41. tr("Torrent file", "<input type=file name=file size=80>\n", 1);
  42. echo'<tr><td class=rowhead>'.
  43. '<table align=right><tr><td class=rowhead><b>Non-Audio file</b></td></tr>'.
  44. '<tr><td class=rowhead><input name="filetype" type="radio" value="2" checked></td></tr>'.
  45. '</table></td>'.
  46. '<td align=center>'.
  47. '<table align=center cellpadding=5><tr>'.
  48. '<td class=embedded>Torrent name </td><td class=embedded><input type="text" name="name" size="80" /><br>(Taken from filename if not specified. <b>Please use descriptive names.</b>)</td>'.
  49. '</tr></table><br>'.
  50. '<table align=center><tr>'.
  51. '<td class=embedded> NFO file </td><td class=embedded><input type="file" name="nfo" size="60"></td>'.
  52. '</tr></table>'.
  53. '</td></tr>'.
  54. '<tr><td class=rowhead>'.
  55. '<table align=right><tr><td class=rowhead><b>Audio file</b></td></tr>'.
  56. '<tr><td class=rowhead><input name="filetype" type="radio" value="1" ></td></tr>'.
  57. '</table></td>'.
  58. '<td align=center>'.
  59. '<table align=center cellpadding=5><tr>'.
  60. '<td class=embedded>Artist </td><td class=embedded><input type="text" size="40" name="artist"></td>'.
  61. '<td class=embedded> Album </td><td class=embedded><input type="text" size="40" name="album"></td>'.
  62. '</tr></table><br>'.
  63. '<table align=center cellpadding=5><tr>'.
  64. '<td class=embedded>Year </td><td class=embedded><input type="text" size="20" name="year"></td>'.
  65. '<td class=embedded> Format </td><td class=embedded><input type="text" size="20" name="format"></td>'.
  66. '<td class=embedded> Bitrate </td><td class=embedded><input type="text" size="10" name="bitrate"></td>'.
  67. '</tr></table><br>'.
  68. '<table align=center><tr>'.
  69. '<td class=embedded> NFO file </td><td class=embedded><input type="file" name="nfo2" size=60><br></td>'.
  70. '</tr></table>'.
  71. '</td></tr>'.
  72. '<tr><td class=rowhead>Description</td><td>'.
  73. '<textarea name="descr" cols="60" rows="5"></textarea></td></tr>';
  74. tr("Show uploader", "<input type=checkbox name=uplver value=yes>Don't show my username in 'Uploaded By' field in browse.", 1);
  75. tr("Strip ASCII", "<input type=checkbox name=strip value=strip unchecked /> <a href=\"http://en.wikipedia.org/wiki/ASCII_art\" target=\"_blank\">what is this ?</a>", 1);
  76. $s = "<select name=\"type\">\n<option value=\"0\">(choose one)</option>\n";
  77. $cats = genrelist();
  78. foreach ($cats as $row)
  79. $s .= "<option value=\"" . $row["id"] . "\">" . htmlspecialchars($row["name"]) . "</option>\n";
  80. $s .= "</select>\n";
  81. tr("Type", $s, 1);
  82. echo'<tr><td align="center" colspan="2"><input type="submit" class=btn value="Do it!" /></td></tr></table></form>';
  83. stdfoot();
  84. ?>