require("$_SERVER[DOCUMENT_ROOT]/lib/header.inc.php"); $currHeader->setPageTitle("Memorable Sayings"); $currBanner->addContent("Memorable Sayings"); $currNavbar->setCustomLinksTitle("Memorable Sayings"); $currNavbar->addCustomLink("/quotes.php?action=add", "Add a saying"); $currNavbar->addCustomLink("/quotes.php?action=view&type=top&quantity=10", "Top 10"); $currNavbar->addCustomLink("/quotes.php?action=view&type=bottom&quantity=10", "Bottom 10"); $currNavbar->addCustomLink("/quotes.php?action=viewUsers", "Top Ranked Submitters"); $currNavbar->addCustomLink("/quotes.php?action=showAll", "Show Every Quote"); // if the person wants to be added, lets give them a form. if ($_REQUEST["action"] == "add") { ?>
This will let you add a quote to Memorable Sayings. Of course, I retain the right to delete anything I don't like, since this is my site. If you are logged in when you do this, that quote will be registered as such. If not, Anonymous Coward will own it.
} // to actually do an add command elseif ($_REQUEST["action"] == "doAdd") { if (auth(1, false)) { // make sure people don't stick html in here $quoteText = htmlspecialchars($_POST["text"]); $query = "INSERT INTO quotes(type, owner, dateadded, author, extrainfo, text) VALUES($_POST[type], $_SESSION[userid], NOW(), '$_POST[author]', '$_POST[extrainfo]', '$quoteText')"; $result = mysql_query($query); if ($result) { print("Quote added successfully!
"); // zero the counter so the quote will show up randomly $query = "UPDATE quotes SET counter = 0"; mysql_query($query); } if (!$result) print("We could not add that quote. Perhaps it is already in use, or you did not fill out all fields. Here is the exact error: " . mysql_error() . "
"); } else { print("Sorry, you do not have permission to do that. As usual, you can blame this on a few idiots (or actually, just one from Alberta) ruining it for everybody else.
"); } } // if we're voting on a quote elseif ($_REQUEST["action"] == "vote") { // determine what type of vote we are doing, thumbs up or thumbs down if (array_key_exists("voteup_x", $_REQUEST)) $vote = "thumbsup"; else $vote = "thumbsdown"; $query = "UPDATE quotes SET $vote = $vote + 1 WHERE id = $_REQUEST[id]"; //print($query); mysql_query($query); print("Your vote has been registered.
"); print("You can use the links on the left to view the top/bottom 10, or use your back button to return to what you were doing.
"); print("| Author | Quote | ||
|---|---|---|---|
| $row[thumbsup] | $row[thumbsdown] | $row[author] ($row[extrainfo]) | $row[text] |
| Author | Quote | ||
|---|---|---|---|
| $row[thumbsup] | $row[thumbsdown] | $row[author] ($row[extrainfo]) | $row[text] |
| User | Quotes | Points | ||
|---|---|---|---|---|
Memorable Sayings is the my list of random quotes. A lot of these are from the old Riptide days, because I just can't let go of the past. :)
This will restore some of the old quote system functionality that was on Janona. Some, but not all.
} require("$_SERVER[DOCUMENT_ROOT]/lib/footer.inc.php"); ?>