Quote database webapp
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?PHP
  2. require_once('inc/account.php');
  3. require_once('inc/database.php');
  4. require_once('inc/settings.php');
  5. if (!isset($_SESSION['uid'])) {
  6. header('Location: '.BASE);
  7. exit('Must be logged in');
  8. }
  9. if (isset($_POST['quote']) && $_SESSION['standing'] > -2) {
  10. if (get_magic_quotes_gpc()) {
  11. $_POST['quote'] = stripslashes($_POST['quote']);
  12. }
  13. $sql = 'INSERT INTO quotes (quote_quote, quote_time, user_id) VALUES (\''.m($_POST['quote']).'\', '.time().', '.$_SESSION['uid'].')';
  14. mysql_query($sql);
  15. header('Location: '.BASE.'latest');
  16. exit;
  17. }
  18. define('TITLE', 'Add quote');
  19. require_once('inc/header.php');
  20. ?>
  21. <div class="oneThird right">
  22. <h2>Quote guidelines</h2>
  23. <p>
  24. The usual quote-site rules apply: don't include anything that's not
  25. neccessary, such as timestamps, hostmasks, twenty 'lol's after the funny
  26. part, etc. Try to avoid injokes if possible.
  27. </p>
  28. <p>
  29. <em>Quotes go live as soon as you submit them</em>. There is no moderation.
  30. If you submit a rubbish quote, people will rate it down, and your standing
  31. will fall.
  32. </p>
  33. <p>
  34. Try to stick to standard notation. Enclose nicks in angle brackets
  35. (&lt;nick&gt; hi!), and prefix actions with an asterisk (* nick waves).
  36. Remove mode prefixes (@, +, etc) that don't directly add to the humour.
  37. </p>
  38. </div>
  39. <div>
  40. <?PHP if ($_SESSION['standing'] > -2) { ?>
  41. <h2>Add a quote</h2>
  42. <p>Enter your quote in the text area below. Please read the guidelines to
  43. the right if you haven't done so before.</p>
  44. <form action="submit" method="post">
  45. <textarea name="quote" cols="80" rows="10"></textarea>
  46. <br>
  47. <input type="submit" value="Add">
  48. </form>
  49. <?PHP } else { ?>
  50. <h2>Error</h2>
  51. <p>You do not have sufficient standing to submit a new quote. Please try
  52. <a href="unrated">rating some quotes</a> to increase your standings. </p>
  53. <?PHP } ?>
  54. </div>
  55. <?PHP
  56. require_once('inc/footer.php');
  57. ?>