fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2010-09-21 02:34 pm

[dw-free] Kill off Writer's Block

[commit: http://hg.dwscoalition.org/dw-free/rev/1b248ad3489c]

http://bugs.dwscoalition.org/show_bug.cgi?id=2955

Remove Writer's Block code, which was just hanging around.

Patch by [staff profile] denise.

Files modified:
  • bin/upgrading/base-data.sql
  • bin/upgrading/en.dat
  • bin/upgrading/proplists.dat
  • bin/upgrading/update-db-general.pl
  • cgi-bin/DW/External/XPostProtocol/LJXMLRPC.pm
  • cgi-bin/LJ/Entry.pm
  • cgi-bin/LJ/EventLogRecord/NewEntry.pm
  • cgi-bin/LJ/QotD.pm
  • cgi-bin/LJ/Widget.pm
  • cgi-bin/LJ/Widget/AddQotD.pm
  • cgi-bin/LJ/Widget/ManageQotD.pm
  • cgi-bin/LJ/Widget/QotD.pm
  • cgi-bin/LJ/Widget/QotDArchive.pm
  • cgi-bin/LJ/Widget/QotDResponses.pm
  • cgi-bin/ljlib.pl
  • cgi-bin/weblib.pl
  • doc/raw/ljp.book/int/memcache_keys_list.xml
  • htdocs/admin/qotd/add.bml
  • htdocs/admin/qotd/manage.bml
  • htdocs/editjournal.bml
  • htdocs/js/rte.js
  • htdocs/js/widgets/qotd.js
  • htdocs/misc/latestqotd.bml
  • htdocs/misc/qotdarchive.bml
  • htdocs/misc/qotdarchive.bml.text
  • htdocs/misc/suggest_qotd.bml
  • htdocs/misc/suggest_qotd.bml.text
  • htdocs/post_qotd.bml
  • htdocs/stc/widgets/qotd.css
  • htdocs/stc/widgets/qotdarchive.css
  • htdocs/stc/widgets/qotdresponses.css
  • htdocs/talkpost.bml
  • htdocs/talkread.bml
  • htdocs/tools/endpoints/qotd.bml
  • htdocs/update.bml
--------------------------------------------------------------------------------
diff -r f1f9d6f349bc -r 1b248ad3489c bin/upgrading/base-data.sql
--- a/bin/upgrading/base-data.sql	Tue Sep 21 22:20:43 2010 +0800
+++ b/bin/upgrading/base-data.sql	Tue Sep 21 22:33:15 2010 +0800
@@ -869,7 +869,6 @@ REPLACE INTO schematables (des, public_b
 REPLACE INTO schematables (des, public_browsable, redist_mode, redist_where, tablename) VALUES ('Global. Stores data for mapping userid <=> user(name).', '0', 'off', NULL, 'useridmap');
 REPLACE INTO schematables (des, public_browsable, redist_mode, redist_where, tablename) VALUES ('Global. Stores data for mapping value of unique cookie <=> userid.', '0', 'off', NULL, 'uniqmap');
 REPLACE INTO schematables (des, public_browsable, redist_mode, redist_where, tablename) VALUES ('Global. Stores data for site pages tagged using the htdocs/admin/navtag.bml tool. Site administrators can tag any URL.\n\r\nThe tag itself is lowercase UTF-8. Some are recognized as special (FAQs, user profile pages, etc.), and users can then search by tag.', '0', 'off', NULL, 'navtag');
-REPLACE INTO schematables (des, public_browsable, redist_mode, redist_where, tablename) VALUES ('Global. Stores data for the Question of the Day (\"Writer\'s Block\") widget.', '0', 'off', NULL, 'qotd');
 REPLACE INTO schematables (des, public_browsable, redist_mode, redist_where, tablename) VALUES ('Global. Stores data for the Support system.\n\r\nAllows users with the supporthelp priv to see links to support/history.bml, when viewing a Support request, where they can pull up a list of all past requests opened by that user or by that e-mail address.', '0', 'off', NULL, 'support');
 REPLACE INTO schematables (des, public_browsable, redist_mode, redist_where, tablename) VALUES ('Global. Stores data for which Support tickets a user responded to. Used for speedier querying for the Support system \"You Replied\" filter.', '0', 'off', NULL, 'support_youreplied');
 REPLACE INTO schematables (des, public_browsable, redist_mode, redist_where, tablename) VALUES ('Global. Stores data of when different users use which clients, for purposes of statistics.', '0', 'off', NULL, 'clientusage');
diff -r f1f9d6f349bc -r 1b248ad3489c bin/upgrading/en.dat
--- a/bin/upgrading/en.dat	Tue Sep 21 22:20:43 2010 +0800
+++ b/bin/upgrading/en.dat	Tue Sep 21 22:33:15 2010 +0800
@@ -4199,12 +4199,6 @@ widget.accountstatistics.tags2=[[num_com
 
 widget.accountstatistics.title=Account Stats
 
-widget.addqotd.extratext=Extra Text (optional):
-
-widget.addqotd.extratext.note=HTML allowed
-
-widget.addqotd.is_special=Is this a special question?
-
 widget.betafeature.btn.off=Turn OFF beta testing
 
 widget.betafeature.btn.on=Turn ON beta testing
@@ -4725,10 +4719,6 @@ widget.location.timezone.select=(Select 
 
 widget.location.zip.usonly=5 digit ZIP code; US residents only
 
-widget.manageqotd.extratext=Extra Text
-
-widget.manageqotd.is_special=Special?
-
 widget.moodthemechooser.desc=Mood themes are small icons that describe your mood or the mood of a post. Select from a variety of faces and characters.
 
 widget.moodthemechooser.forcetheme=use this mood theme on my friends page
@@ -4772,42 +4762,6 @@ widget.paidaccountstatus.expiretime=Your
 widget.paidaccountstatus.expiretime=Your paid time expires:
 
 widget.popularinterests.viewall=view all popular interests
-
-widget.qotd.answer=Answer
-
-widget.qotd.archivelink=Writer's Block Archive
-
-widget.qotd.entry.subject=Writer's Block: [[subject]]
-
-widget.qotd.entry.submittedby=Submitted By [[user]]
-
-widget.qotd.suggestions=Suggestions
-
-widget.qotd.title=Writer's Block
-
-widget.qotd.view.more=View more
-
-widget.qotd.view.other.answers=View other answers
-
-widget.qotd.viewanswers=View Answers
-
-widget.qotdarchive.skip.next=Newer
-
-widget.qotdarchive.skip.previous=Older
-
-widget.qotdresponses.answer.the.question=Answer the Question
-
-widget.qotdresponses.explore=Explore
-
-widget.qotdresponses.no.entries.to.display=No entries to display
-
-widget.qotdresponses.previous=Previous
-
-widget.qotdresponses.read.more=Read More
-
-widget.qotdresponses.read.your.friends.page=Read your Friends Page
-
-widget.qotdresponses.there.are.no.answers=There are no answers to this Writer's Block.
 
 widget.quickupdate.entry=Entry
 
diff -r f1f9d6f349bc -r 1b248ad3489c bin/upgrading/proplists.dat
--- a/bin/upgrading/proplists.dat	Tue Sep 21 22:20:43 2010 +0800
+++ b/bin/upgrading/proplists.dat	Tue Sep 21 22:33:15 2010 +0800
@@ -1316,13 +1316,6 @@ logproplist.picture_keyword:
   sortorder: 30
   ownership: user
 
-logproplist.qotdid:
-  datatype: 
-  des: Writer's block ID
-  prettyname: Writer's block ID
-  sortorder: 104
-  ownership: user
-
 logproplist.revnum:
   datatype: num
   des: Number of times this post has been edited.
diff -r f1f9d6f349bc -r 1b248ad3489c bin/upgrading/update-db-general.pl
--- a/bin/upgrading/update-db-general.pl	Tue Sep 21 22:20:43 2010 +0800
+++ b/bin/upgrading/update-db-general.pl	Tue Sep 21 22:33:15 2010 +0800
@@ -888,6 +888,7 @@ register_tabledrop("commenturls");
 register_tabledrop("commenturls");
 register_tabledrop("captchas");
 register_tabledrop("captcha_session");
+register_tabledrop("qotd");
 
 register_tablecreate("infohistory", <<'EOC');
 CREATE TABLE infohistory (
@@ -2448,21 +2449,6 @@ CREATE TABLE embedcontent (
 )
 EOC
 
-register_tablecreate("qotd", <<'EOC');
-CREATE TABLE qotd (
-    qid           INT UNSIGNED NOT NULL AUTO_INCREMENT,
-    time_start    INT UNSIGNED NOT NULL DEFAULT '0',
-    time_end      INT UNSIGNED NOT NULL DEFAULT '0',
-    active        ENUM('Y','N') NOT NULL DEFAULT 'Y',
-    text          TEXT NOT NULL DEFAULT '',
-    img_url       VARCHAR(255) DEFAULT NULL,
-
-    PRIMARY KEY (qid),
-    INDEX (time_start),
-    INDEX (time_end)
-)
-EOC
-
 register_tablecreate("jobstatus", <<'EOC');
 CREATE TABLE jobstatus (
     handle VARCHAR(100) PRIMARY KEY,
@@ -3470,12 +3456,6 @@ register_alter(sub {
                  "ALTER TABLE subs DROP INDEX etypeid, ADD INDEX etypeid (etypeid, journalid, userid)");
     }
 
-    # add a column
-    unless (column_type("qotd", "tags")) {
-        do_alter("qotd",
-                 "ALTER TABLE qotd ADD tags VARCHAR(255) DEFAULT NULL AFTER text");
-    }
-
     # fix primary key
     unless (index_name("pollresult2", "UNIQUE:journalid-pollid-pollqid-userid")) {
         do_alter("pollresult2",
@@ -3495,47 +3475,12 @@ register_alter(sub {
                  "ADD INDEX (userid)");
     }
 
-    # add a column
-    unless (column_type("qotd", "extra_text")) {
-        do_alter("qotd",
-                 "ALTER TABLE qotd ADD extra_text TEXT DEFAULT NULL");
-    }
-
-    # add a column
-    unless (column_type("qotd", "subject")) {
-        do_alter("qotd",
-                 "ALTER TABLE qotd " .
-                 "ADD subject VARCHAR(255) NOT NULL DEFAULT '' AFTER active, " .
-                 "ADD from_user CHAR(15) DEFAULT NULL AFTER tags");
-    }
-
     unless (column_type("usermsgproplist", "scope")) {
         do_alter("usermsgproplist",
                  "ALTER TABLE usermsgproplist ADD scope ENUM('general', 'local') "
                  . "DEFAULT 'general' NOT NULL");
     }
 
-    unless (column_type("qotd", "cap_mask")) {
-        do_alter("qotd",
-                 "ALTER TABLE qotd " .
-                 # bitmask representation of cap classes that this question applies to
-                 "ADD cap_mask SMALLINT UNSIGNED NOT NULL, " .
-                 # show to logged out users or not
-                 "ADD show_logged_out ENUM('Y','N') NOT NULL DEFAULT 'N', " .
-                 "ADD countries VARCHAR(255)");
-
-        # set all current questions to be shown to all classes and logged out users
-        if (table_relevant("qotd")) {
-            my $mask = LJ::mask_from_bits(keys %LJ::CAP);
-            do_sql("UPDATE qotd SET cap_mask=$mask, show_logged_out='Y'");
-        }
-    }
-
-    unless (column_type("qotd", "link_url")) {
-        do_alter("qotd",
-                 "ALTER TABLE qotd " .
-                 "ADD link_url VARCHAR(255) NOT NULL DEFAULT ''");
-    }
 
     if (table_relevant("spamreports") && column_type("spamreports", "report_type") !~ /message/) {
         # cache table by running select
@@ -3560,12 +3505,6 @@ register_alter(sub {
                  "ADD INDEX (status)");
     }
 
-    unless (column_type("qotd", "domain")) {
-        do_alter("qotd",
-                 "ALTER TABLE qotd " .
-                 "ADD domain VARCHAR(255) NOT NULL DEFAULT 'homepage'");
-    }
-
     unless (column_type("log2", "allowmask") =~ /^bigint/) {
         do_alter("log2",
                  q{ ALTER TABLE log2 MODIFY COLUMN allowmask BIGINT UNSIGNED NOT NULL });
@@ -3585,18 +3524,6 @@ register_alter(sub {
         do_alter("logproplist",
                  "ALTER TABLE logproplist ADD ownership ENUM('system', 'user') ".
                  "DEFAULT 'user' NOT NULL");
-    }
-
-    unless (column_type("qotd", "impression_url")) {
-        do_alter("qotd",
-                 "ALTER TABLE qotd " .
-                 "ADD impression_url VARCHAR(255) DEFAULT NULL");
-    }
-
-    unless (column_type("qotd", "is_special")) {
-        do_alter("qotd",
-                 "ALTER TABLE qotd " .
-                 "ADD is_special ENUM('Y','N') NOT NULL DEFAULT 'N'");
     }
 
     unless (column_type("jobstatus", "userid")) {
diff -r f1f9d6f349bc -r 1b248ad3489c cgi-bin/DW/External/XPostProtocol/LJXMLRPC.pm
--- a/cgi-bin/DW/External/XPostProtocol/LJXMLRPC.pm	Tue Sep 21 22:20:43 2010 +0800
+++ b/cgi-bin/DW/External/XPostProtocol/LJXMLRPC.pm	Tue Sep 21 22:33:15 2010 +0800
@@ -315,7 +315,7 @@ sub entry_to_req {
     my $entryprops = $entry->props;
     $req->{props} = {};
     # only bring over these properties
-    for my $entrykey (qw ( adult_content current_coords current_location current_music opt_backdated opt_nocomments opt_noemail opt_preformatted opt_screening picture_keyword qotdid taglist used_rte pingback )) {
+    for my $entrykey (qw ( adult_content current_coords current_location current_music opt_backdated opt_nocomments opt_noemail opt_preformatted opt_screening picture_keyword taglist used_rte pingback )) {
         $req->{props}->{$entrykey} = $entryprops->{$entrykey} if defined $entryprops->{$entrykey};
     }
 
diff -r f1f9d6f349bc -r 1b248ad3489c cgi-bin/LJ/Entry.pm
--- a/cgi-bin/LJ/Entry.pm	Tue Sep 21 22:20:43 2010 +0800
+++ b/cgi-bin/LJ/Entry.pm	Tue Sep 21 22:33:15 2010 +0800
@@ -968,26 +968,6 @@ sub comments_disabled_maintainer {
     my $self = $_[0];
 
     return $self->prop( 'opt_nocomments_maintainer' ) && !$self->comments_disabled_poster;
-}
-
-sub qotdid {
-    my $self = shift;
-
-    return $self->prop('qotdid');
-}
-
-# don't use this anymore, instead check for is_special flag on question
-sub is_special_qotd_entry {
-    my $self = shift;
-
-    my $qotdid = $self->qotdid;
-    my $poster = $self->poster;
-
-    if ($qotdid && $poster && LJ::Hooks::run_hook("show_qotd_title_change", $poster)) {
-        return 1;
-    }
-
-    return 0;
 }
 
 sub should_block_robots {
diff -r f1f9d6f349bc -r 1b248ad3489c cgi-bin/LJ/EventLogRecord/NewEntry.pm
--- a/cgi-bin/LJ/EventLogRecord/NewEntry.pm	Tue Sep 21 22:20:43 2010 +0800
+++ b/cgi-bin/LJ/EventLogRecord/NewEntry.pm	Tue Sep 21 22:33:15 2010 +0800
@@ -45,11 +45,6 @@ sub new {
                 'security'       => $e->security,
                 );
 
-    # qotdid if one is associated with this entry
-    if (my $qotdid = $e->prop('qotdid')) {
-        $args{'prop.qotdid'} = $e->prop('qotdid');
-    }
-
     return $class->SUPER::new(%args);
 }
 
diff -r f1f9d6f349bc -r 1b248ad3489c cgi-bin/LJ/QotD.pm
--- a/cgi-bin/LJ/QotD.pm	Tue Sep 21 22:20:43 2010 +0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,507 +0,0 @@
-# This code was forked from the LiveJournal project owned and operated
-# by Live Journal, Inc. The code has been modified and expanded by
-# Dreamwidth Studios, LLC. These files were originally licensed under
-# the terms of the license supplied by Live Journal, Inc, which can
-# currently be found at:
-#
-# http://code.livejournal.org/trac/livejournal/browser/trunk/LICENSE-LiveJournal.txt
-#
-# In accordance with the original license, this code and all its
-# modifications are provided under the GNU General Public License.
-# A copy of that license can be found in the LICENSE file included as
-# part of this distribution.
-
-package LJ::QotD;
-use strict;
-use Carp qw(croak);
-use List::Util qw(shuffle);
-
-sub get_domains {
-    my $class = shift;
-
-    return ( homepage => "Homepage" );
-}
-
-sub is_valid_domain {
-    my $class = shift;
-    my $domain = shift;
-
-    return scalar(grep { $_ eq $domain } $class->get_domains) ? 1 : 0;
-}
-
-# returns 'current' or 'old' depending on given start and end times
-sub get_type {
-    my $class = shift;
-    my %times = @_;
-
-    return $class->is_current(%times) ? 'current' : 'old';
-}
-
-# given a start and end time, returns if now is between those two times
-sub is_current {
-    my $class = shift;
-    my %times = @_;
-
-    return 0 unless $times{start} && $times{end};
-
-    my $now = time();
-    return $times{start} <= $now && $times{end} >= $now;
-}
-
-sub memcache_key {
-    my $class = shift;
-    my $type = shift;
-
-    return "qotd:$type";
-}
-
-sub cache_get {
-    my $class = shift;
-    my $type = shift;
-
-    # first, is it in our per-request cache?
-    my $questions = $LJ::QotD::REQ_CACHE_QOTD{$type};
-    return $questions if $questions;
-
-    my $memkey = $class->memcache_key($type);
-    my $memcache_data = LJ::MemCache::get($memkey);
-    if ($memcache_data) {
-        # fill the request cache since it was empty
-        $class->request_cache_set($type, $memcache_data);
-    }
-    return $memcache_data;
-}
-
-sub request_cache_set {
-    my $class = shift;
-    my $type = shift;
-    my $val = shift;
-
-    $LJ::QotD::REQ_CACHE_QOTD{$type} = $val;
-}
-
-sub cache_set {
-    my $class = shift;
-    my $type = shift;
-    my $val = shift;
-
-    # first set in request cache
-    $class->request_cache_set($type, $val);
-
-    # now set in memcache
-    my $memkey = $class->memcache_key($type);
-    my $expire = 60*5; # 5 minutes
-    return LJ::MemCache::set($memkey, $val, $expire);
-}
-
-sub cache_clear {
-    my $class = shift;
-    my $type = shift;
-
-    # clear request cache
-    delete $LJ::QotD::REQ_CACHE_QOTD{$type};
-
-    # clear memcache
-    my $memkey = $class->memcache_key($type);
-    return LJ::MemCache::delete($memkey);
-}
-
-# returns the current active questions
-sub load_current_questions {
-    my $class = shift;
-    my %opts = @_;
-
-    my $questions = $class->cache_get('current');
-    return @$questions if $questions;
-
-    my $dbh = LJ::get_db_writer()
-        or die "no global database writer for QotD";
-
-    my $sth = $dbh->prepare(
-        "SELECT * FROM qotd WHERE time_start <= UNIX_TIMESTAMP() AND time_end >= UNIX_TIMESTAMP() AND active='Y'"
-    );
-    $sth->execute;
-
-    my @rows = ();
-    while (my $row = $sth->fetchrow_hashref) {
-        push @rows, $row;
-    }
-    $class->cache_set('current', \@rows);
-
-    return @rows;
-}
-
-# returns the non-current active questions that
-# have an end time more recent than a month ago
-sub load_old_questions {
-    my $class = shift;
-    my %opts = @_;
-
-    my $questions = $class->cache_get('old');
-    return @$questions if $questions;
-
-    my $dbh = LJ::get_db_writer()
-        or die "no global database writer for QotD";
-
-    my $sth = $dbh->prepare(
-        "SELECT * FROM qotd WHERE time_end >= UNIX_TIMESTAMP()-86400*30 AND time_end < UNIX_TIMESTAMP() AND active='Y'"
-    );
-    $sth->execute;
-
-    my @rows = ();
-    while (my $row = $sth->fetchrow_hashref) {
-        push @rows, $row;
-    }
-    $class->cache_set('old', \@rows);
-
-    return @rows;
-}
-
-sub filter_by_domain {
-    my $class = shift;
-    my $u = shift;
-    my $domain = shift;
-    my @questions = @_;
-
-    my @questions_ret;
-    foreach my $q (@questions) {
-        push @questions_ret, $q if $q->{domain} eq $domain;
-    }
-
-    return @questions_ret;
-}
-
-sub filter_by_eff_class {
-    my $class = shift;
-    my $u = shift;
-    my @questions = @_;
-
-    my $eff_class = LJ::Hooks::run_hook("qotd_get_eff_class", $u);
-    return @questions unless $eff_class;
-
-    my @questions_ret;
-    if ($eff_class eq "logged_out") {
-        foreach my $q (@questions) {
-            push @questions_ret, $q if $q->{show_logged_out} eq "Y";
-        }
-    } else {
-        my @classes = ( $eff_class );
-        my $class_mask = LJ::mask_from_classes(@classes);
-
-        foreach my $q (@questions) {
-            push @questions_ret, $q if ($q->{cap_mask} & $class_mask) > 0;
-        }
-    }
-
-    return @questions_ret;
-}
-
-sub filter_by_country {
-    my $class = shift;
-    my $u = shift;
-    my $skip = shift;
-    my $all = shift;
-    my @questions = @_;
-
-    # split the list into a list of questions with countries and a list of questions without countries
-    my @questions_with_countries;
-    my @questions_without_countries;
-    foreach my $question (@questions) {
-        if ($question->{countries}) {
-            push @questions_with_countries, $question;
-        } else {
-            push @questions_without_countries, $question;
-        }
-    }
-
-    # get the user's country if defined, otherwise the country of the remote IP
-    my $country;
-    $country = lc $u->country if $u;
-    $country = lc LJ::country_of_remote_ip() unless $country;
-
-    my @questions_ret;
-
-    # get the questions that are targeted at the user's country
-    if ($country) {
-        foreach my $question (@questions_with_countries) {
-            next unless grep { $_ eq $country } split(",", $question->{countries});
-            push @questions_ret, $question;
-        }
-    }
-
-    # if there are questions that are targeted at the user's country
-    # and we're getting the current view, return only those questions
-    #
-    # if the user has an unknown country or there are no questions
-    # targeted at their country, or if we're looking at the history,
-    # return all questions
-    if (@questions_ret && $skip == 0 && !$all) {
-        return @questions_ret;
-    } else {
-        return (@questions_ret, @questions_without_countries);
-    }
-}
-
-sub get_questions {
-    my $class = shift;
-    my %opts = @_;
-
-    my $skip = defined $opts{skip} ? $opts{skip} : 0;
-    my $domain = defined $opts{domain} ? lc $opts{domain} : "homepage";
-
-    # if true, get all questions for this user from the last month
-    # overrides value of $skip
-    my $all = defined $opts{all} ? $opts{all} : 0;
-
-    # direct the questions at the given $u, or remote if no $u given
-    my $u = $opts{user} && LJ::isu($opts{user}) ? $opts{user} : LJ::get_remote();
-
-    my @questions;
-    if ($all) {
-        @questions = ( $class->load_current_questions, $class->load_old_questions );
-    } else {
-        if ($skip == 0) {
-            @questions = $class->load_current_questions;
-        } else {
-            @questions = $class->load_old_questions;
-        }
-    }
-
-    @questions = $class->filter_by_domain($u, $domain, @questions) unless $all;
-    @questions = $class->filter_by_eff_class($u, @questions);
-    @questions = $class->filter_by_country($u, $skip, $all, @questions);
-
-    # sort questions in descending order by start time (newest first)
-    @questions = 
-        sort { $b->{time_start} <=> $a->{time_start} } 
-        grep { ref $_ } @questions;
-
-    if ($all) {
-        return grep { ref $_ } @questions;
-    } else {
-        # if we're getting the current question, return a random one from the list
-        if ($skip == 0) {
-            @questions = List::Util::shuffle(@questions);
-
-            return $questions[0] if ref $questions[0];
-            return ();
-
-        # if we're getting old questions, we need to only return the one for this view
-        } else {
-            my $index = $skip - 1;
-
-            # only return the array elements that exist
-            my @ret = grep { ref $_ } $questions[$index];
-            return @ret;
-        }
-    }
-}
-
-sub store_question {
-    my $class = shift;
-    my %vals = @_;
-
-    my $dbh = LJ::get_db_writer()
-        or die "Unable to store question: no global dbh";
-
-    my @classes = split(/\s*,\s*/, $vals{classes});
-    $vals{cap_mask} = LJ::mask_from_classes(@classes);
-    $vals{show_logged_out} = $vals{show_logged_out} ? 'Y' : 'N';
-
-    # update existing question
-    if ($vals{qid}) {
-        $dbh->do("UPDATE qotd SET time_start=?, time_end=?, active=?, subject=?, text=?, tags=?, " .
-                 "from_user=?, img_url=?, extra_text=?, cap_mask=?, show_logged_out=?, countries=?, link_url=?, domain=?, impression_url=?, is_special=? WHERE qid=?",
-                 undef, (map { $vals{$_} } qw(time_start time_end active subject text tags from_user img_url extra_text cap_mask show_logged_out countries link_url domain impression_url is_special qid)))
-            or die "Error updating qotd: " . $dbh->errstr;
-    }
-    # insert new question
-    else {
-        $dbh->do("INSERT INTO qotd VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
-                 undef, "null", (map { $vals{$_} } qw(time_start time_end active subject text tags from_user img_url extra_text cap_mask show_logged_out countries link_url domain impression_url is_special)))
-            or die "Error adding qotd: " . $dbh->errstr;
-    }
-
-    # insert/update question subject and text in translation system
-    my $qid = $vals{qid} || $dbh->{mysql_insertid};
-    my $ml_key = LJ::Widget::QotD->ml_key("$qid.text");
-    LJ::Widget->ml_set_text($ml_key => $vals{text});
-    $ml_key = LJ::Widget::QotD->ml_key("$qid.subject");
-    LJ::Widget->ml_set_text($ml_key => $vals{subject});
-
-    # insert/update extra text in translation system
-    $ml_key = LJ::Widget::QotD->ml_key("$qid.extra_text");
-    if ($vals{extra_text}) {
-        LJ::Widget->ml_set_text($ml_key => $vals{extra_text});
-    } else {
-        my $string = LJ::no_ml_cache(sub { LJ::Widget->ml($ml_key) });
-        LJ::Widget->ml_remove_text($ml_key) unless LJ::Widget->ml_is_missing_string($string);
-    }
-
-    # clear cache
-    my $type = $class->get_type( start => $vals{time_start}, end => $vals{time_end} );
-    $class->cache_clear($type);
-    return 1;
-}
-
-# returns all questions that started during the given month
-sub get_all_questions_starting_during_month {
-    my $class = shift;
-    my ($year, $month) = @_;
-
-    my $dbh = LJ::get_db_writer()
-        or die "Error: no global dbh";
-
-    my $time_start = DateTime->new( year => $year, month => $month, time_zone => 'America/Los_Angeles' );
-    my $time_end = $time_start->clone;
-    $time_end = $time_end->add( months => 1 );
-    $time_end = $time_end->subtract( seconds => 1 ); # we want time_end to be the end of the last day of the month
-
-    my $sth = $dbh->prepare("SELECT * FROM qotd WHERE time_start >= ? AND time_start <= ?");
-    $sth->execute($time_start->epoch, $time_end->epoch)
-        or die "Error getting this month's questions: " . $dbh->errstr;
-
-    my @rows = ();
-    while (my $row = $sth->fetchrow_hashref) {
-        push @rows, $row;
-    }
-
-    # sort questions in descending order by start time (newest first)
-    @rows =
-        sort { $b->{time_start} <=> $a->{time_start} }
-        grep { ref $_ } @rows;
-
-    return @rows;
-}
-
-# returns all questions that are running during the given month
-sub get_all_questions_running_during_month {
-    my $class = shift;
-    my ($year, $month) = @_;
-
-    my $dbh = LJ::get_db_writer()
-        or die "Error: no global dbh";
-
-    my $time_start = DateTime->new( year => $year, month => $month, time_zone => 'America/Los_Angeles' );
-    my $time_end = $time_start->clone;
-    $time_end = $time_end->add( months => 1 );
-    $time_end = $time_end->subtract( seconds => 1 ); # we want time_end to be the end of the last day of the month
-
-    my $time_start_epoch = $time_start->epoch;
-    my $time_end_epoch = $time_end->epoch;
-
-    my $sth = $dbh->prepare(
-        "SELECT * FROM qotd WHERE " .
-        # starts before the start of the month and ends after the start of the month
-        "(time_start <= ? AND time_end >= ?) OR " .
-        # starts before the end of the month and ends after the end of the month
-        "(time_start <= ? AND time_end >= ?) OR " .
-        # starts after the start of the month and ends before the end of the month
-        "(time_start >= ? AND time_end <= ?) OR " .
-        # starts before the start of the month and ends after the end of the month
-        "(time_start <= ? AND time_end >= ?)"
-    );
-    $sth->execute(
-        $time_start_epoch, $time_start_epoch, $time_end_epoch, $time_end_epoch, $time_start_epoch, $time_end_epoch, $time_start_epoch, $time_end_epoch
-    )
-        or die "Error getting this month's questions: " . $dbh->errstr;
-
-    my @rows = ();
-    while (my $row = $sth->fetchrow_hashref) {
-        push @rows, $row;
-    }
-
-    # sort questions in descending order by start time (newest first)
-    @rows =
-        sort { $b->{time_start} <=> $a->{time_start} }
-        grep { ref $_ } @rows;
-
-    return @rows;
-}
-
-# given an id for a question, returns the info for it
-sub get_single_question {
-    my $class = shift;
-    my $qid = shift;
-
-    my $dbh = LJ::get_db_writer()
-        or die "Error: no global dbh";
-
-   my $sth = $dbh->prepare("SELECT * FROM qotd WHERE qid = ?");
-    $sth->execute($qid)
-        or die "Error getting single question: " . $dbh->errstr;
-
-    return $sth->fetchrow_hashref;
-}
-
-# change the active status of the given question
-sub change_active_status {
-    my $class = shift;
-    my $qid = shift;
-
-    my %opts = @_;
-    my $to = delete $opts{to};
-    croak "invalid 'to' field" unless $to =~ /^(active|inactive)$/; 
-
-    my $question = $class->get_single_question($qid)
-        or die "Invalid question: $qid";
-
-    my $dbh = LJ::get_db_writer()
-        or die "Error: no global dbh";
-
-    my $active_val = $to eq 'active' ? 'Y' : 'N';
-    my $rv = $dbh->do("UPDATE qotd SET active = ? WHERE qid = ?", undef, $active_val, $qid)
-        or die "Error updating active status of question: " . $dbh->errstr;
-
-    my $type = $class->get_type( start => $question->{time_start}, end => $question->{time_end} );
-    $class->cache_clear($type);
-
-    return $rv;
-}
-
-# given a comma-separated list of tags, remove the default tag(s) from the list
-sub remove_default_tags {
-    my $class = shift;
-    my $tag_list = shift;
-
-    my $tag = $class->entry_tag;
-    $tag_list =~ s/\s*${tag},?\s*//g;
-
-    return $tag_list;
-}
-
-# given a comma-separated list of tags, add the default tag(s) to the list
-sub add_default_tags {
-    my $class = shift;
-    my $tag_list = shift;
-
-    my $tag = $class->entry_tag;
-
-    if ($tag_list) {
-        return "$tag, " . $tag_list;
-    } else {
-        return $tag;
-    }
-}
-
-# tag given to QotD entries
-sub entry_tag { "writer's block" }
-
-# parse the given URL
-# * replace '[[uniq]]' with a unique identifier
-sub parse_url {
-    my $class = shift;
-    my %opts = @_;
-
-    my $qid = $opts{qid};
-    my $url = $opts{url};
-
-    my $uniq = LJ::pageview_unique_string() . $qid;
-    $uniq = Digest::SHA1::sha1_hex($uniq);
-
-    $url =~ s/\[\[uniq\]\]/$uniq/g;
-
-    return $url;
-}
-
-1;
diff -r f1f9d6f349bc -r 1b248ad3489c cgi-bin/LJ/Widget.pm
--- a/cgi-bin/LJ/Widget.pm	Tue Sep 21 22:20:43 2010 +0800
+++ b/cgi-bin/LJ/Widget.pm	Tue Sep 21 22:33:15 2010 +0800
@@ -696,8 +696,7 @@ BML pages, which will override what's de
 BML pages, which will override what's defined in en(_LJ).dat.
 
 Strings in the "widget" ML domain get there when a user inputs text that should
-be translatable in a widget web form on the site.  The QotD widget and its admin
-widgets are examples of widgets that use this ML domain.
+be translatable in a widget web form on the site.  
 
 In almost all cases, methods are called on subclasses of this parent class, and
 not on the parent class itself.  It is explicitly noted when a method should be
diff -r f1f9d6f349bc -r 1b248ad3489c cgi-bin/LJ/Widget/AddQotD.pm
--- a/cgi-bin/LJ/Widget/AddQotD.pm	Tue Sep 21 22:20:43 2010 +0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,314 +0,0 @@
-# This code was forked from the LiveJournal project owned and operated
-# by Live Journal, Inc. The code has been modified and expanded by
-# Dreamwidth Studios, LLC. These files were originally licensed under
-# the terms of the license supplied by Live Journal, Inc, which can
-# currently be found at:
-#
-# http://code.livejournal.org/trac/livejournal/browser/trunk/LICENSE-LiveJournal.txt
-#
-# In accordance with the original license, this code and all its
-# modifications are provided under the GNU General Public License.
-# A copy of that license can be found in the LICENSE file included as
-# part of this distribution.
-
-package LJ::Widget::AddQotD;
-
-use strict;
-use base qw(LJ::Widget);
-use Carp qw(croak);
-use LJ::QotD;
-
-sub need_res { }
-
-sub render_body {
-    my $class = shift;
-    my %opts = @_;
-
-    my $qid = $opts{qid};
-    my (@classes, $show_logged_out);
-    my ($subject, $text, $tags, $from_user, $img_url, $extra_text, $impression_url, $domain, $countries, $link_url, $is_special);
-    my ($start_month, $start_day, $start_year);
-    my ($end_month, $end_day, $end_year);
-    if ($qid) {
-        my $question = LJ::QotD->get_single_question($opts{qid})
-            or die "Invalid question: $qid";
-
-        @classes = LJ::classes_from_mask($question->{cap_mask});
-        $show_logged_out = $question->{show_logged_out} eq 'Y' ? 1 : 0;
-
-        $subject = $question->{subject};
-        $text = $question->{text};
-        $tags = LJ::QotD->remove_default_tags($question->{tags});
-        $from_user = $question->{from_user};
-        $img_url = $question->{img_url};
-        $extra_text = $question->{extra_text};
-        $impression_url = $question->{impression_url};
-        $domain = $question->{domain};
-        $countries = $question->{countries};
-        $link_url = $question->{link_url};
-        $is_special = $question->{is_special};
-
-        my $start_date = DateTime->from_epoch( epoch => $question->{time_start}, time_zone => 'America/Los_Angeles' );
-        my $end_date = DateTime->from_epoch( epoch => $question->{time_end}, time_zone => 'America/Los_Angeles' );
-        $start_month = $start_date->month;
-        $start_day = $start_date->day;
-        $start_year = $start_date->year;
-        $end_month = $end_date->month;
-        $end_day = $end_date->day;
-        $end_year = $end_date->year;
-    }
-
-    # default values for year/month/day = today's date
-    # unless we're editing, in which case use the given question's dates
-    my $time_now = DateTime->now(time_zone => 'America/Los_Angeles');
-    unless ($start_month && $start_day && $start_year) {
-        $start_month = $time_now->month;
-        $start_day = $time_now->day;
-        $start_year = $time_now->year;
-    }
-    unless ($end_month && $end_day && $end_year) {
-        $end_month = $time_now->month;
-        $end_day = $time_now->day;
-        $end_year = $time_now->year;
-    }
-
-    # form entry
-    my $ret =
-        "<?p (<a href='$LJ::SITEROOT/admin/qotd/manage'>" . 
-        "Manage questions</a>) p?>" . 
-        "<?p Enter a new Question of the Day. p?>";
-
-    $ret .= $class->start_form;
-
-    $ret .= "<table><tr><td>Start Date:</td><td>";
-    $ret .= $class->html_select
-        ( name => 'month_start',
-          selected => $start_month,
-          list => [ map { $_, LJ::Lang::month_long($_) } 1..12 ] ) . " ";
-
-    $ret .= $class->html_text
-        ( name => 'day_start',
-          size => 2,
-          maxlength => 2,
-          value => $start_day ) . " ";
-
-    $ret .= $class->html_text
-        ( name => 'year_start',
-          size => 4,
-          maxlength => 4,
-          value => $start_year ) . " @ 12:00 AM</td></tr>";
-
-    $ret .= "<tr><td>End Date:</td><td>";
-    $ret .= $class->html_select
-        ( name => 'month_end',
-          selected => $end_month,
-          list => [ map { $_, LJ::Lang::month_long($_) } 1..12 ] ) . " ";
-
-    $ret .= $class->html_text
-        ( name => 'day_end',
-          size => 2,
-          maxlength => 2,
-          value => $end_day ) . " ";
-
-    $ret .= $class->html_text
-        ( name => 'year_end',
-          size => 4,
-          maxlength => 4,
-          value => $end_year ) . " @ 11:59 PM</td></tr>";
-
-    $ret .= "<tr><td valign='top'>Show on:</td><td>";
-    $ret .= $class->html_select
-        ( name => 'domain',
-          selected => $domain || "homepage",
-          list => [ LJ::QotD->get_domains ] ) . "</td></tr>";
-
-    $ret .= "<tr><td valign='top'>" . LJ::Lang::ml('widget.addqotd.is_special') . "</td><td>";
-    $ret .= $class->html_select
-        ( name => 'is_special',
-          selected => $is_special || "N",
-          list => [ "N", "No", "Y", "Yes" ] ) . "</td></tr>";
-
-    $ret .= "<tr><td valign='top'>Subject:</td><td>";
-    $ret .= $class->html_text
-        ( name => 'subject',
-          size => 30,
-          value => $subject ) . "<br /><small>\"Writer's Block\" will be prepended to the given subject; limited HTML allowed<small></td></tr>";
-
-    $ret .= "<tr><td valign='top'>Question:</td><td>";
-    $ret .= $class->html_textarea
-        ( name => 'text',
-          raw => 5,
-          cols => 30,
-          wrap => 'soft',
-          value => $text ) . "<br /><small>HTML allowed</small></td></tr>";
-
-    $ret .= "<tr><td valign='top'>Entry Tags (optional):</td><td>";
-    $ret .= $class->html_text
-        ( name => 'tags',
-          size => 30,
-          value => $tags ) . "<br /><small>\"writer's block\" will always be included as a tag automatically</small></td></tr>";
-
-    $ret .= "<tr><td valign='top'>Submitted By (optional):</td><td>";
-    $ret .= $class->html_text
-        ( name => 'from_user',
-          size => 15,
-          maxlength => 15,
-          value => $from_user ) . "<br /><small>Enter a $LJ::SITENAMESHORT username<small></td></tr>";
-
-    $ret .= "<tr><td>Image URL (optional):</td><td>";
-    $ret .= $class->html_text
-        ( name => 'img_url',
-          size => 30,
-          value => $img_url ) . "</td></tr>";
-
-    $ret .= "<tr><td>Link URL for Image (optional):</td><td>";
-    $ret .= $class->html_text
-        ( name => 'link_url',
-          size => 30,
-          value => $link_url ) . "</td></tr>";
-
-    $ret .= "<tr><td valign='top'>" . $class->ml('widget.addqotd.extratext') . "</td><td>";
-    $ret .= $class->html_textarea
-        ( name => 'extra_text',
-          raw => 5,
-          cols => 30,
-          wrap => 'soft',
-          value => $extra_text ) . "<br /><small>" . $class->ml('widget.addqotd.extratext.note') . "</small></td></tr>";
-
-    $ret .= "<tr><td valign='top'>Impression URL (optional):</td><td>";
-    $ret .= $class->html_text
-        ( name => 'impression_url',
-          size => 30,
-          value => $impression_url ) . "<br />";
-    $ret .= "<small>Use <code>[[uniq]]</code> in the URL to have a unique identifier placed there automatically.</small></td></tr>";
-
-    my $hook_rv = LJ::Hooks::run_hook("qotd_class_checkboxes", class => $class, classes => \@classes, show_logged_out => $show_logged_out);
-
-    if ($hook_rv) {
-        $ret .= "<tr><td valign='top'>$hook_rv";
-
-        $ret .= "who are in the following countries (comma-separated list of country codes, e.g. us,uk,fr,es):<br />";
-        $ret .= $class->html_text
-            ( name => 'countries',
-              size => 30,
-              value => $countries ) . "<br /><small>(if left blank, a user's country will be ignored)</small></td></tr>";
-    } else {
-        my $classes_string = join(',', @classes);
-
-        $ret .= "<tr><td valign='top'>Show this question to users in these classes:</td><td>";
-        $ret .= $class->html_text
-            ( name => 'classes',
-              size => 30,
-              value => $classes_string ) . "<br /><small>(comma-separated list)</small><br />";
-
-        $ret .= $class->html_check
-            ( name => 'show_logged_out',
-              id => 'show_logged_out',
-              selected => $show_logged_out ) . " <label for='show_logged_out'>Show to Logged Out Users?</label></td></tr>";
-
-        $ret .= "<tr><td valign='top'>Show this question to users in the following countries:</td><td>";
-        $ret .= $class->html_text
-            ( name => 'countries',
-              size => 30,
-              value => $countries ) . "<br /><small>(comma-separated list of country codes, e.g. us,uk,fr,es)<br />(if left blank, a user's country will be ignored)</small></td></tr>";
-    }
-
-    $ret .= $class->html_hidden
-        ( qid => $qid );
-
-    $ret .= "<tr><td colspan='2' align='center'>";
-    $ret .= $class->html_submit('Submit') . "</td></tr>";
-    $ret .= "</table>";
-    $ret .= $class->end_form;
-
-    return $ret;
-}
-
-sub handle_post {
-    my $class = shift;
-    my $post = shift;
-    my %opts = @_;
-
-    my $time_start = DateTime->new
-        ( year      => $post->{year_start}+0, 
-          month     => $post->{month_start}+0, 
-          day       => $post->{day_start}+0, 
-
-          # Yes, this specific timezone
-          time_zone => 'America/Los_Angeles' );
-
-    my $time_end = DateTime->new
-        ( year      => $post->{year_end}+0, 
-          month     => $post->{month_end}+0, 
-          day       => $post->{day_end}+0, 
-          hour      => 23, 
-          minute    => 59, 
-          second    => 59, 
-
-          # Yes, this specific timezone
-          time_zone => 'America/Los_Angeles' );
-
-    # Make sure the start time is before the end time
-    if (DateTime->compare($time_start, $time_end) != -1) {
-        die "Start time must be before end time";
-    }
-
-    # Make sure there's a subject and text
-    die "No question subject specified." unless $post->{subject};
-    die "No question text specified." unless $post->{text};
-
-    # Make sure the domain is valid
-    die "Invalid domain: " . LJ::ehtml($post->{domain}) unless LJ::QotD->is_valid_domain($post->{domain});
-
-    # Make sure the from_user is valid (if given)
-    my $from_user = $post->{from_user};
-    if ($from_user) {
-        my $from_u = LJ::load_user($from_user);
-        die "Invalid user: $from_user" unless LJ::isu($from_u);
-    }
-
-    LJ::Hooks::run_hook("qotd_class_checkboxes_post", $post);
-
-    # Make sure at least one class was given
-    die "At least one class of users must be given."
-        unless $post->{classes} || $post->{show_logged_out};
-
-    # Make sure the country list is valid
-    my $countries = $post->{countries};
-    my %country_codes;
-    LJ::load_codes({ country => \%country_codes });
-    my @given_countries = split(/\s*,\s*/, $countries);
-    foreach my $cc (@given_countries) {
-        $cc = uc $cc;
-        next if $country_codes{$cc};
-        die "Invalid country code: $cc";
-    }
-
-    # Pass the countries to the db as a comma-separated list with no spaces, all lowercase
-    $countries = join(',', @given_countries);
-    $countries = lc $countries;
-
-    LJ::QotD->store_question (
-         qid        => $post->{qid},
-         time_start => $time_start->epoch,
-         time_end   => $time_end->epoch,
-         active     => 'Y',
-         subject    => $post->{subject},
-         text       => $post->{text},
-         from_user  => $post->{from_user},
-         tags       => LJ::QotD->add_default_tags($post->{tags}),
-         img_url    => LJ::CleanHTML::canonical_url($post->{img_url}),
-         extra_text => $post->{extra_text},
-         impression_url => LJ::CleanHTML::canonical_url($post->{impression_url}),
-         classes => $post->{classes},
-         show_logged_out => $post->{show_logged_out},
-         countries  => $countries,
-         link_url   => LJ::CleanHTML::canonical_url($post->{link_url}),
-         domain     => $post->{domain},
-         is_special => $post->{is_special} eq "Y" ? "Y" : "N",
-    );
-
-    return;
-}
-
-1;
diff -r f1f9d6f349bc -r 1b248ad3489c cgi-bin/LJ/Widget/ManageQotD.pm
--- a/cgi-bin/LJ/Widget/ManageQotD.pm	Tue Sep 21 22:20:43 2010 +0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,175 +0,0 @@
-# This code was forked from the LiveJournal project owned and operated
-# by Live Journal, Inc. The code has been modified and expanded by
-# Dreamwidth Studios, LLC. These files were originally licensed under
-# the terms of the license supplied by Live Journal, Inc, which can
-# currently be found at:
-#
-# http://code.livejournal.org/trac/livejournal/browser/trunk/LICENSE-LiveJournal.txt
-#
-# In accordance with the original license, this code and all its
-# modifications are provided under the GNU General Public License.
-# A copy of that license can be found in the LICENSE file included as
-# part of this distribution.
-
-package LJ::Widget::ManageQotD;
-
-use strict;
-use base qw(LJ::Widget);
-use Carp qw(croak);
-use LJ::QotD;
-
-sub need_res { }
-
-sub render_body {
-    my $class = shift;
-    my %opts = @_;
-
-    my $get = delete $opts{get};
-
-    my $ret = "";
-
-    # default values for year/month
-    my $year  = $get->{year}+0;
-    my $month = $get->{month}+0;
-
-    # if year and month aren't defined, use the current month
-    unless ($year && $month) {
-        my @time = localtime();
-        $year  = $time[5]+1900;
-        $month = $time[4]+1;
-    }
-
-    $ret .= "<?p (<a href='$LJ::SITEROOT/admin/qotd/add'>Add a question</a>) p?>";
-    $ret .= "<?p Select a month to view all questions that are starting and running during that month. p?>";
-
-    # TODO: supported way for widgets to do GET forms?
-    #       -- lame that GET/POST is done differently in here
-    $ret .= "<form method='GET'>";
-    $ret .= "<?p Year: " . LJ::html_text({ name => 'year', size => '4', maxlength => '4', value => $year }) . " ";
-    $ret .= "Month: " . LJ::html_select({ name => 'month', selected => $month }, map { $_, LJ::Lang::month_long($_) } 1..12) . " p?>";
-    $ret .= "<?p " . LJ::html_submit('View Question(s)') . " p?>";
-    $ret .= "</form>";
-
-    $ret .= "<hr style='clear: both;' />";
-
-    my @questions_starting = LJ::QotD->get_all_questions_starting_during_month($year, $month);
-    my @questions_running = LJ::QotD->get_all_questions_running_during_month($year, $month);
-    return $ret . "<?p No questions starting or running during the selected month. p?>" unless @questions_starting || @questions_running;
-
-    $ret .= $class->start_form;
-
-    if (@questions_starting) {
-        $ret .= "<strong>Questions Starting This Month</strong>";
-        $ret .= $class->table_display(@questions_starting);
-        $ret .= "<br />";
-    } else {
-        $ret .= "<?p No questions starting during the selected month. p?>";
-    }
-
-    if (@questions_running) {
-        $ret .= "<strong>Questions Running During Month (includes above)</strong>";
-        $ret .= $class->table_display(@questions_running);
-    } else {
-        $ret .= "<?p No questions running during the selected month. p?>";
-    }
-
-    $ret .= $class->end_form;
-
-    return $ret;
-}
-
-sub table_display {
-    my $class = shift;
-    my @questions = @_;
-
-    my $ret;
-    $ret .= "<table border='1' cellpadding='3'>";
-    $ret .= "<tr><th>Image</th><th>Subject</th><th>Question</th>";
-    $ret .= "<th>" . LJ::Lang::ml('widget.manageqotd.extratext') . "</th>";
-    $ret .= "<th>" . LJ::Lang::ml('widget.manageqotd.is_special') . "</th>";
-    $ret .= "<th>Domain</th><th>Who Sees Question</th><th>Countries</th><th>Tags</th><th>Submitted By</th><th>Start Date</th><th>End Date</th><th colspan='2'>Active Status</th><th>Edit</th></tr>";
-    foreach my $row (@questions) {
-        my @classes = LJ::classes_from_mask($row->{cap_mask});
-        @classes = LJ::Hooks::run_hook("qotd_filter_classes", @classes);
-        push @classes, "logged out" if $row->{show_logged_out} eq 'Y';
-        my $class_list = join(', ', @classes);
-
-        my $start_date = DateTime->from_epoch( epoch => $row->{time_start}, time_zone => 'America/Los_Angeles' );
-        my $end_date = DateTime->from_epoch( epoch => $row->{time_end}, time_zone => 'America/Los_Angeles' );
-        my $tags = LJ::QotD->remove_default_tags($row->{tags});
-        my $from_u = LJ::load_user($row->{from_user});
-        LJ::CleanHTML::clean_subject(\$row->{subject});
-        LJ::CleanHTML::clean_event(\$row->{text});
-        LJ::CleanHTML::clean_event(\$row->{extra_text});
-
-        $ret .= "<tr>";
-        if ($row->{img_url}) {
-            if ($row->{link_url}) {
-                $ret .= "<td><a href='$row->{link_url}'><img src='$row->{img_url}' /></a></td>";
-            } else {
-                $ret .= "<td><img src='$row->{img_url}' /></td>";
-            }
-        } else {
-            $ret .= "<td>&nbsp;</td>";
-        }
-        $ret .= $row->{subject} ? "<td>$row->{subject}</td>" : "<td>&nbsp;</td>";
-        $ret .= "<td>$row->{text}</td>";
-        $ret .= $row->{extra_text} ? "<td>$row->{extra_text}</td>" : "<td>(none)</td>";
-        $ret .= $row->{is_special} eq "Y" ? "<td>Yes</td>" : "<td>No</td>";
-
-        my %domains = LJ::QotD->get_domains;
-        $ret .= defined $domains{$row->{domain}} ? "<td>$domains{$row->{domain}}</td>" : "<td>&nbsp;</td>";
-        $ret .= "<td>$class_list</td>";
-
-        # put spaces between the country codes so that the text wraps
-        if ($row->{countries}) {
-            my @countries = split(/,/, $row->{countries});
-            my $country_list = join(', ', @countries);
-            $ret .= "<td>$country_list</td>";
-        } else {
-            $ret .= "<td>(any)</td>";
-        }
-
-        $ret .= $tags ? "<td>$tags</td>" : "<td>&nbsp;</td>";
-        $ret .= $from_u ? "<td>" . $from_u->ljuser_display . "</td>" : "<td>&nbsp;</td>";
-        $ret .= "<td>" . $start_date->strftime("%F %r %Z")  . "</td>";
-        $ret .= "<td>" . $end_date->strftime("%F %r %Z")  . "</td>";
-        $ret .= $class->get_active_text($row->{qid}, $row->{active});
-        $ret .= "<td>(<a href='$LJ::SITEROOT/admin/qotd/add?qid=$row->{qid}'>edit</a>)</td>";
-        $ret .= "</tr>";
-    }
-    $ret .= "</table>";
-
-    return $ret;
-}
-
-sub get_active_text {
-    my $class = shift;
-    my ($qid, $active) = @_;
-
-    my ($curr_state, $verb) = $active eq 'Y' ? ("active", "inactivate") : ("inactive", "activate");
-    my $to_state = $curr_state eq 'active' ? 'inactive' : 'active';
-    return "<td>$curr_state</td><td>" . $class->html_submit("chg:$to_state:$qid", $verb) . "</td>";
-}
-
-sub handle_post {
-    my $class = shift;
-    my $post = shift;
-    my %opts = @_;
-
-    # find which to activate/inactivate
-    # do the action
-    my ($state, $qid);
-    while (my ($k, $v) = each %$post) {
-        next unless $k =~ /^chg:((?:in)?active):(\w+)/;
-        ($state, $qid) = ($1, $2);
-        last;
-    }
-
-    die "Invalid state for status change"
-        unless $state;
-
-    return LJ::QotD->change_active_status($qid, to => $state);
-}
-
-1;
diff -r f1f9d6f349bc -r 1b248ad3489c cgi-bin/LJ/Widget/QotD.pm
--- a/cgi-bin/LJ/Widget/QotD.pm	Tue Sep 21 22:20:43 2010 +0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,347 +0,0 @@
-# This code was forked from the LiveJournal project owned and operated
-# by Live Journal, Inc. The code has been modified and expanded by
-# Dreamwidth Studios, LLC. These files were originally licensed under
-# the terms of the license supplied by Live Journal, Inc, which can
-# currently be found at:
-#
-# http://code.livejournal.org/trac/livejournal/browser/trunk/LICENSE-LiveJournal.txt
-#
-# In accordance with the original license, this code and all its
-# modifications are provided under the GNU General Public License.
-# A copy of that license can be found in the LICENSE file included as
-# part of this distribution.
-
-package LJ::Widget::QotD;
-
-use strict;
-use base qw(LJ::Widget);
-use Carp qw(croak);
-use LJ::QotD;
-
-sub need_res {
-    return qw( js/widgets/qotd.js stc/widgets/qotd.css );
-}
-
-sub render_body {
-    my $class = shift;
-    my %opts = @_;
-    my $ret;
-
-    my $skip = $opts{skip};
-    my $domain = $opts{domain};
-    my $u = $opts{user} && LJ::isu($opts{user}) ? $opts{user} : LJ::get_remote();
-
-    my $embed = $opts{embed};
-    my $archive = $opts{archive};
-
-    my @questions = $opts{question} || LJ::QotD->get_questions( user => $u, skip => $skip, domain => $domain );
-
-    return "" unless @questions;
-
-    unless ($embed || $archive) {
-        my $title = LJ::Hooks::run_hook("qotd_title", $u) || $class->ml('widget.qotd.title');
-        $ret .= "<h2>$title";
-    }
-
-    unless ($opts{nocontrols}) {
-        $ret .= "<span class='qotd-controls'>";
-        $ret .= "<img id='prev_questions' src='$LJ::IMGPREFIX/arrow-spotlight-prev.gif' alt='Previous' title='Previous' /> ";
-        $ret .= "<img id='prev_questions_disabled' src='$LJ::IMGPREFIX/arrow-spotlight-prev-disabled.gif' alt='Previous' title='Previous' /> ";
-        $ret .= "<img id='next_questions' src='$LJ::IMGPREFIX/arrow-spotlight-next.gif' alt='Next' title='Next' />";
-        $ret .= "<img id='next_questions_disabled' src='$LJ::IMGPREFIX/arrow-spotlight-next-disabled.gif' alt='Next' title='Next' />";
-        $ret .= "</span>";
-    }
-
-    $ret .= "</h2>" unless $embed || $archive;
-
-    $ret .= "<div id='all_questions'>" unless $opts{nocontrols};
-
-    if ($embed) {
-        $ret .= $class->qotd_display_embed( questions => \@questions, user => $u, %opts );
-    } elsif ($archive) {
-        $ret .= $class->qotd_display_archive( questions => \@questions, user => $u, %opts );
-    } else {
-        $ret .= $class->qotd_display( questions => \@questions, user => $u, %opts );
-    }
-
-    $ret .= "</div>" unless $opts{nocontrols};
-
-    return $ret;
-}
-
-sub question_text {
-    my $class = shift;
-    my $qid = shift;
-
-    my $ml_key = $class->ml_key("$qid.text");
-    my $text = $class->ml($ml_key);
-    LJ::CleanHTML::clean_event(\$text);
-
-    return $text;
-}
-
-# version suitable for embedding in journal entries
-sub qotd_display_embed {
-    my $class = shift;
-    my %opts = @_;
-
-    my $questions = $opts{questions} || [];
-    my $remote = LJ::get_remote();
-
-    my $ret;
-    if (@$questions) {
-        # table used for better inline display
-        $ret .= '<table cellpadding="0" cellspacing="0"><tr><td>';
-        $ret .= "<div style='border: 1px solid #000; padding: 6px;'>";
-        foreach my $q (@$questions) {
-
-            # FIXME: this is a dirty hack because if this widget is put into a journal page
-            #        as the first request of a given Apache, Apache::BML::cur_req will not
-            #        be instantiated and we'll auto-vivify it with a call to BML::get_language()
-            #        from within LJ::Lang.  We're working on a better fix.
-            #
-            #        -- Whitaker 2007/08/28
-
-            #my $ml_key = $class->ml_key("$q->{qid}.text");
-            #my $text = $class->ml($ml_key);
-            my $text = $q->{text};
-            LJ::CleanHTML::clean_event(\$text);
-
-            my $from_text = '';
-            if ($q->{from_user}) {
-                my $from_u = LJ::load_user($q->{from_user});
-                $from_text = "Submitted by " . $from_u->ljuser_display . "<br />"
-                    if $from_u;
-                #$from_text = $class->ml('widget.qotd.entry.submittedby', {'user' => $from_u->ljuser_display}) . "<br />"
-                #    if $from_u;
-            }
-
-            my $extra_text;
-            if ($q->{extra_text} && LJ::Hooks::run_hook('show_qotd_extra_text', $remote)) {
-                $extra_text = $q->{extra_text};
-                LJ::CleanHTML::clean_event(\$extra_text);
-            }
-
-            my $between_text = $from_text && $extra_text ? "<br />" : "";
-
-            my $qid = $q->{qid};
-            my $answers_link = "<a href=\"$LJ::SITEROOT/misc/latestqotd?qid=$qid\">" . $class->ml('widget.qotd.view.other.answers') . "</a>";
-
-            my $answer_link = "";
-            unless ($opts{no_answer_link}) {
-                $answer_link = $class->answer_link
-                    ($q, user => $opts{user}, button_disabled => $opts{form_disabled});
-            }
-
-            $ret .= "<p>$text</p><p style='font-size: 0.8em;'>$from_text$between_text$extra_text</p><br />";
-            $ret .= "<p>$answer_link $answers_link" . $class->impression_img($q) . "</p>";
-        }
-        $ret .= "</div></td></tr></table>";
-    }
-
-    return $ret;
-}
-
-# version suitable for the archive page
-sub qotd_display_archive {
-    my $class = shift;
-    my %opts = @_;
-
-    my $questions = $opts{questions} || [];
-    my $remote = LJ::get_remote();
-
-    my $ret;
-    foreach my $q (@$questions) {
-        my $ml_key = $class->ml_key("$q->{qid}.text");
-        my $text = $class->ml($ml_key);
-        LJ::CleanHTML::clean_event(\$text);
-
-        my $qid = $q->{qid};
-        my $answers_link = "<a href='$LJ::SITEROOT/misc/latestqotd?qid=$qid'>" . $class->ml('widget.qotd.viewanswers') . "</a>";
-
-        my $answer_link = "";
-        unless ($opts{no_answer_link}) {
-            $answer_link = $class->answer_link( $q, user => $opts{user}, button_disabled => $opts{form_disabled} );
-        }
-
-        my $date = '';
-        if ( $q->{time_start} ) {
-            $date = DateTime
-            -> from_epoch( epoch => $q->{time_start}, time_zone => 'America/Los_Angeles' )
-            -> strftime("%B %e, %Y");
-        }
-
-        $ret .= "<p class='qotd-archive-item-date'>$date</p>";
-        $ret .= "<p class='qotd-archive-item-question'>$text</p>";
-        $ret .= "<p class='qotd-archive-item-answers'>$answer_link $answers_link" . $class->impression_img($q) . "</p>";
-    }
-
-    return $ret;
-}
-
-sub qotd_display {
-    my $class = shift;
-    my %opts = @_;
-
-    my $questions = $opts{questions} || [];
-    my $remote = LJ::get_remote();
-
-    my $ret;
-    if (@$questions) {
-        $ret .= "<div class='qotd'>";
-        foreach my $q (@$questions) {
-            my $ml_key = $class->ml_key("$q->{qid}.text");
-            my $text = $class->ml($ml_key);
-            LJ::CleanHTML::clean_event(\$text);
-
-            my $extra_text;
-            if ($q->{extra_text} && LJ::Hooks::run_hook('show_qotd_extra_text', $remote)) {
-                $ml_key = $class->ml_key("$q->{qid}.extra_text");
-                $extra_text = $class->ml($ml_key);
-                LJ::CleanHTML::clean_event(\$extra_text);
-            }
-
-            my $from_text;
-            if ($q->{from_user}) {
-                my $from_u = LJ::load_user($q->{from_user});
-                $from_text = $class->ml('widget.qotd.entry.submittedby', {'user' => $from_u->ljuser_display})
-                    if $from_u;
-            }
-
-            $ret .= "<table><tr><td>";
-            my $viewanswers;
-            if ($opts{small_view_link}) {
-                $viewanswers .= " <a class='small-view-link' href=\"$LJ::SITEROOT/misc/latestqotd?qid=$q->{qid}\">" . $class->ml('widget.qotd.view.more') . "</a>";
-            } else {
-                $viewanswers .= " <br /><a href=\"$LJ::SITEROOT/misc/latestqotd?qid=$q->{qid}\">" . $class->ml('widget.qotd.viewanswers') . "</a>";
-            }
-
-            $ret .= $text;
-            $ret .= $extra_text ? "<p class='detail' style='padding-bottom: 5px;'>$extra_text</p>" : " ";
-
-            $ret .= $class->answer_link($q, user => $opts{user}, button_disabled => $opts{form_disabled}) .
-                "$viewanswers";
-            if ($q->{img_url}) {
-                if ($q->{link_url}) {
-                    $ret .= "</td><td><a href='$q->{link_url}'><img src='$q->{img_url}' class='qotd-img' alt='' /></a>";
-                } else {
-                    $ret .= "</td><td><img src='$q->{img_url}' class='qotd-img' alt='' />";
-                }
-            }
-            $ret .= "</td></tr></table>";
-
-            my $archive = "<a href='$LJ::SITEROOT/misc/qotdarchive'>" . $class->ml('widget.qotd.archivelink') . "</a>";
-            my $suggest = "<a href='$LJ::SITEROOT/misc/suggest_qotd'>" . $class->ml('widget.qotd.suggestions') . "</a>";
-            $ret .= "<p class='detail'><span class='suggestions'>$archive | $suggest</span>$from_text<br />" . $class->impression_img($q) . "</p>";
-        }
-
-        # show promo on vertical pages
-        $ret .= LJ::Hooks::run_hook("promo_with_qotd", $opts{domain});
-        $ret .= "</div>";
-    }
-
-    return $ret;
-}
-
-sub answer_link {
-    my $class = shift;
-    my $question = shift;
-    my %opts = @_;
-
-    my $url = $class->answer_url($question, user => $opts{user});
-    my $txt = LJ::Hooks::run_hook("qotd_answer_txt", $opts{user}) || $class->ml('widget.qotd.answer');
-    my $dis = $opts{button_disabled} ? "disabled='disabled'" : "";
-    my $onclick = qq{onclick="document.location.href='$url'"};
-
-    # if button is disabled, don't attach an onclick
-    my $extra = $dis ? $dis : $onclick;
-
-    return qq{<input type="button" value="$txt" $extra />};
-}
-
-sub answer_url {
-    my $class = shift;
-    my $question = shift;
-    my %opts = @_;
-
-    return "$LJ::SITEROOT/update?qotd=$question->{qid}";
-}
-
-sub subject_text {
-    my $class = shift;
-    my $question = shift;
-    my %opts = @_;
-
-    my $ml_key = $class->ml_key("$question->{qid}.subject");
-    my $subject = LJ::Hooks::run_hook("qotd_subject", $opts{user}, $class->ml($ml_key)) ||
-        $class->ml('widget.qotd.entry.subject', {'subject' => $class->ml($ml_key)});
-
-    return $subject;
-}
-
-sub embed_text {
-    my $class = shift;
-    my $question = shift;
-
-    return qq{<lj-template name="qotd" id="$question->{qid}" />};
-}    
-
-sub event_text {
-    my $class = shift;
-    my $question = shift;
-    my %opts = @_;
-
-    my $remote = LJ::get_remote();
-    my $ml_key = $class->ml_key("$question->{qid}.text");
-
-    my $event = $class->ml($ml_key);
-    my $from_user = $question->{from_user};
-    my $extra_text = LJ::Hooks::run_hook('show_qotd_extra_text', $remote) ? $question->{extra_text} : "";
-
-    if ($from_user || $extra_text) {
-        $event .= "\n<span style='font-size: smaller;'>";
-        $event .= $class->ml('widget.qotd.entry.submittedby', {'user' => "<lj user='$from_user'>"}) if $from_user;
-        $event .= "\n" if $from_user && $extra_text;
-        $event .= $extra_text if $extra_text;
-        $event .= "</span>";
-    }
-
-    return $event;
-}
-
-sub tags_text {
-    my $class = shift;
-    my $question = shift;
-    my %opts = @_;
-
-    my $tags = $question->{tags};
-
-    return $tags;
-}
-
-sub impression_img {
-    my $class = shift;
-    my $question = shift;
-
-    my $impression_url;
-    if ($question->{impression_url}) {
-        $impression_url = LJ::PromoText->parse_url( qid => $question->{qid}, url => $question->{impression_url} );
-    }
-
-    return $impression_url && LJ::Hooks::run_hook("should_see_special_content", LJ::get_remote()) ? "<img src=\"$impression_url\" border='0' width='1' height='1' alt='' />" : "";
-}
-
-sub questions_exist_for_user {
-    my $class = shift;
-    my %opts = @_;
-
-    my $skip = $opts{skip};
-    my $domain = $opts{domain};
-    my $u = $opts{user} && LJ::isu($opts{user}) ? $opts{user} : LJ::get_remote();
-
-    my @questions = LJ::QotD->get_questions( user => $u, skip => $skip, domain => $domain );
-
-    return scalar @questions ? 1 : 0;
-}
-
-1;
diff -r f1f9d6f349bc -r 1b248ad3489c cgi-bin/LJ/Widget/QotDArchive.pm
--- a/cgi-bin/LJ/Widget/QotDArchive.pm	Tue Sep 21 22:20:43 2010 +0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-# This code was forked from the LiveJournal project owned and operated
-# by Live Journal, Inc. The code has been modified and expanded by
-# Dreamwidth Studios, LLC. These files were originally licensed under
-# the terms of the license supplied by Live Journal, Inc, which can
-# currently be found at:
-#
-# http://code.livejournal.org/trac/livejournal/browser/trunk/LICENSE-LiveJournal.txt
-#
-# In accordance with the original license, this code and all its
-# modifications are provided under the GNU General Public License.
-# A copy of that license can be found in the LICENSE file included as
-# part of this distribution.
-
-package LJ::Widget::QotDArchive;
-
-use strict;
-use base qw(LJ::Widget);
-use Carp qw(croak);
-use LJ::QotD;
-
-sub need_res {
-    return qw( stc/widgets/qotdarchive.css );
-}
-
-sub render_body {
-    my $class = shift;
-    my %opts = @_;
-
-    my $page = $opts{page} > 0 ? $opts{page} : 1;
-    my $num_questions_per_page = $opts{questions_per_page} > 0 ? $opts{questions_per_page} : 5;
-    my @questions = LJ::QotD->get_questions( all => 1 );
-
-    my $start_index = $num_questions_per_page * ($page - 1);
-    my $end_index = ($num_questions_per_page * $page) - 1;
-
-    my $ret;
-    foreach my $q (@questions[$start_index..$end_index]) {
-        last unless ref $q;
-        $ret .= LJ::Widget::QotD->render( question => $q, archive => 1, nocontrols => 1 );
-    }
-
-    my $page_back = $page + 1;
-    my $page_forward = $page - 1;
-    my $show_page_back = ref $questions[$end_index + 1] ? 1 : 0;
-    my $show_page_forward = $page_forward > 0 ? 1 : 0;
-
-    $ret .= "<p class='skiplinks'>" if $show_page_back || $show_page_forward;
-    if ($show_page_back) {
-        $ret .= "<a href='$LJ::SITEROOT/misc/qotdarchive?page=$page_back'>&lt; " . $class->ml('widget.qotdarchive.skip.previous') . "</a>";
-    }
-    $ret .= " | " if $show_page_back && $show_page_forward;
-    if ($show_page_forward) {
-        my $url = $page_forward == 1 ? "$LJ::SITEROOT/misc/qotdarchive" : "$LJ::SITEROOT/misc/qotdarchive?page=$page_forward";
-        $ret .= "<a href='$url'>" . $class->ml('widget.qotdarchive.skip.next') . " &gt;</a>";
-    }
-    $ret .= "</p>" if $show_page_back || $show_page_forward;
-
-    return $ret;
-}
-
-1;
diff -r f1f9d6f349bc -r 1b248ad3489c cgi-bin/LJ/Widget/QotDResponses.pm
--- a/cgi-bin/LJ/Widget/QotDResponses.pm	Tue Sep 21 22:20:43 2010 +0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,156 +0,0 @@
-# This code was forked from the LiveJournal project owned and operated
-# by Live Journal, Inc. The code has been modified and expanded by
-# Dreamwidth Studios, LLC. These files were originally licensed under
-# the terms of the license supplied by Live Journal, Inc, which can
-# currently be found at:
-#
-# http://code.livejournal.org/trac/livejournal/browser/trunk/LICENSE-LiveJournal.txt
-#
-# In accordance with the original license, this code and all its
-# modifications are provided under the GNU General Public License.
-# A copy of that license can be found in the LICENSE file included as
-# part of this distribution.
-
-package LJ::Widget::QotDResponses;
-
-use strict;
-use base qw(LJ::Widget);
-use Carp qw(croak);
-use LJ::QotD;
-
-sub need_res {
-    return qw( js/widgets/qotd.js stc/widgets/qotd.css stc/widgets/qotdresponses.css );
-}
-
-# how many individual
-sub responses_per_page { 30 }
-
-# how much of each entry should we show?
-sub entry_show_length { 200 }
-
-sub load_responses {
-    my $class = shift;
-    my %opts = @_;
-
-}
-
-sub render_body {
-    my $class = shift;
-    my %opts = @_;
-
-    my $hide_question = $opts{hide_question};
-
-    my $remote = LJ::get_remote();
-
-    my $get = $class->get_args;
-
-    my $qid  = $get->{qid}+0;
-    my $skip = $get->{skip}+0;
-
-    my ($q) = $qid ? LJ::QotD->get_single_question($qid) : LJ::QotD->get_questions;
-    $qid = $q->{qid} if $q;
-    return $class->ml('widget.qotdresponses.no.entries.to.display') unless $qid;
-
-    # get responses
-    my $show_size = $class->responses_per_page;
-    my $queue = LJ::queue("latest_qotd_$qid");
-    my @responses = $queue->get($skip, $show_size+1, reverse => 1);
-
-    # we'll try to fetch 1 more than we need... if it came back then
-    # we know we need a 'more' link below.
-    my $need_more = @responses >= $show_size + 1 ? 1 : 0;
-
-    # now truncate the list back down to $show_size
-    @responses = @responses[0..($show_size-1)] if @responses > $show_size;
-
-    my $ret = "";
-    unless (@responses) {
-        my $answer_url = LJ::Widget::QotD->answer_url($q);
-
-        $ret .= "<?p " . $class->ml('widget.qotdresponses.there.are.no.answers') . " p?>";
-        $ret .= "<ul>";
-        $ret .= "<li><a href='$answer_url'>" . $class->ml('widget.qotdresponses.answer.the.question') . "</a></li>" if $answer_url;
-        $ret .= "<li><a href='" . $remote->journal_base . "/read'>" . $class->ml('widget.qotdresponses.read.your.friends.page') . "</a></li>"
-            if $remote;
-        $ret .= "<li><a href='$LJ::SITEROOT/site/search.bml'>" . $class->ml('widget.qotdresponses.explore') . " $LJ::SITENAMEABBREV</a></li>";
-        $ret .= "</ul>";
-        return $ret;
-    }
-
-
-    unless ($hide_question) {
-       my $widget_html = LJ::Widget::QotD->render(question => $q, nocontrols => 1);
-
-        $ret .= "<div class='qotd-container'>$widget_html</div>";
-    }
-
-    $ret .= $class->render_responses(@responses);
-
-    # did we have more to display?
-    if ($need_more) {
-        my $newskip = $skip + $show_size;
-        $ret .= "<div><a href='$LJ::SITEROOT/misc/latestqotd.bml?qid=$qid&skip=$newskip'>" . $class->ml('widget.qotdresponses.previous') . " $show_size</a></div>";
-    }
-
-    return $ret;
-}
-
-sub render_responses {
-    my $class = shift;
-    my @responses = @_;
-
-    my $remote = LJ::get_remote();
-
-    my $ret = "";
-    
-  RESPONSE:
-    foreach my $resp (@responses) {
-        my ($userid, $jitemid) = split(',', $resp);
-
-        if (! $userid || ! $jitemid) {
-            warn "invalid qotd queue item: '$resp'";
-            next;
-        }
-
-        my $journal = LJ::load_userid($userid);
-        my $entry = LJ::Entry->new($journal, jitemid => $jitemid);
-        next unless $journal && $entry && $entry->valid;
-        next unless $entry->visible_to($remote);
-
-        foreach my $u (($entry->journal, $entry->poster)) {
-            next RESPONSE unless $u->is_visible;
-            next RESPONSE if $u->prop("exclude_from_verticals");
-            next RESPONSE if $u->prop("latest_optout");
-        }
-
-        my $userpic = $entry->userpic;
-        my $userpic_html = '';
-
-        if ($userpic) {
-            my $img = $userpic->imgtag(width => 75);
-            $userpic_html = qq { <div class="lj_qotd_entry_userpic">$img</div> };
-        }
-
-        my $entry_html = LJ::trim($entry->event_html_summary($class->entry_show_length, { noexpandembedded => 1 }));
-        my $entry_subject = $entry->subject_html;
-        my $entry_url = $entry->url;
-        my $entry_cmt_link = $entry->reply_url;
-        my $comments = $entry->comment_text;
-
-        $ret .= qq {
-            <div class="lj_qotd_entry_container">
-                $userpic_html
-                <div class="lj_qotd_entry_subject">$entry_subject</div>
-                <div class="lj_qotd_entry_body">$entry_html</div>
-                <div>
-        };    
-                
-        $ret .= "<a href=\"$entry_url\">" . $class->ml('widget.qotdresponses.read.more') . "</a> | <a href=\"$entry_cmt_link\">$comments</a>";
-        $ret .= '</div><div class="clear">&nbsp;</div></div>';
-        
-    }
-
-    return $ret;
-}
-
-1;
diff -r f1f9d6f349bc -r 1b248ad3489c cgi-bin/ljlib.pl
--- a/cgi-bin/ljlib.pl	Tue Sep 21 22:20:43 2010 +0800
+++ b/cgi-bin/ljlib.pl	Tue Sep 21 22:33:15 2010 +0800
@@ -1277,7 +1277,6 @@ sub start_request
     %LJ::S2::REQ_CACHE_STYLE_ID = (); # styleid -> hashref of s2 layers for style
     %LJ::S2::REQ_CACHE_LAYER_ID = (); # layerid -> hashref of s2 layer info (from LJ::S2::load_layer)
     %LJ::S2::REQ_CACHE_LAYER_INFO = (); # layerid -> hashref of s2 layer info (from LJ::S2::load_layer_info)
-    %LJ::QotD::REQ_CACHE_QOTD = ();   # type ('current' or 'old') -> Question of the Day hashrefs
     $LJ::SiteMessages::REQ_CACHE_MESSAGES = undef; # arrayref of cached site message hashrefs
     %LJ::REQ_HEAD_HAS = ();           # avoid code duplication for js
     %LJ::NEEDED_RES = ();             # needed resources (css/js/etc):
@@ -2452,7 +2451,6 @@ sub list_valid_args {
         mysqlstatus    => "Access to /admin/mysql_status",
         navtag         => "Access to /admin/navtag",
         propedit       => "Allow to change userprops for other users",
-        qotd           => "Access to /admin/qotd",
         rename         => "Access to rename_opts console command",
         sitemessages   => "Access to /admin/sitemessages",
         spamreports    => "Access to /admin/spamreports",
diff -r f1f9d6f349bc -r 1b248ad3489c cgi-bin/weblib.pl
--- a/cgi-bin/weblib.pl	Tue Sep 21 22:20:43 2010 +0800
+++ b/cgi-bin/weblib.pl	Tue Sep 21 22:33:15 2010 +0800
@@ -1184,11 +1184,6 @@ sub entry_form {
         ### Subject
         $out .= "<div id='compose-entry' class='pkg'>\n";
 
-        if ($opts->{prop_qotdid} && !$opts->{richtext}) {
-            my $qotd = LJ::QotD->get_single_question($opts->{prop_qotdid});
-            $out .= "<div style='margin-bottom: 10px;' id='qotd_html_preview'>" . LJ::Widget::QotD->qotd_display_embed( questions => [ $qotd ], no_answer_link => 1 ) . "</div>";
-        }
-
         $out .= "<label class='left' for='subject'>" . BML::ml('entryform.subject') . "</label>\n";
         $out .= LJ::html_text({ 'name' => 'subject', 'value' => $opts->{'subject'},
                                 'class' => 'text', 'id' => 'subject', 'size' => '43', 'maxlength' => '100',
@@ -2070,7 +2065,7 @@ sub entry_form_decode
                 prop_opt_screening prop_opt_noemail
                 prop_opt_preformatted prop_opt_nocomments
                 prop_current_location prop_current_coords
-                prop_taglist prop_qotdid)) {
+                prop_taglist )) {
         $req->{$_} = $POST->{$_};
     }
 
diff -r f1f9d6f349bc -r 1b248ad3489c doc/raw/ljp.book/int/memcache_keys_list.xml
--- a/doc/raw/ljp.book/int/memcache_keys_list.xml	Tue Sep 21 22:20:43 2010 +0800
+++ b/doc/raw/ljp.book/int/memcache_keys_list.xml	Tue Sep 21 22:33:15 2010 +0800
@@ -632,13 +632,6 @@
     </row>
     <row>
         <entry></entry>
-        <entry>qotd:&lt;type&gt;</entry>
-        <entry><acronym>QotD</acronym>s of the type &lt;type&gt; (&apos;current&apos; or &apos;old&apos;)</entry>
-        <entry>livejournal</entry>
-        <entry>Widget</entry>
-    </row>
-    <row>
-        <entry></entry>
         <entry>sitemessages</entry>
         <entry>site messages</entry>
         <entry>livejournal</entry>
diff -r f1f9d6f349bc -r 1b248ad3489c htdocs/admin/qotd/add.bml
--- a/htdocs/admin/qotd/add.bml	Tue Sep 21 22:20:43 2010 +0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-<?_c
-# This code was forked from the LiveJournal project owned and operated
-# by Live Journal, Inc. The code has been modified and expanded by
-# Dreamwidth Studios, LLC. These files were originally licensed under
-# the terms of the license supplied by Live Journal, Inc, which can
-# currently be found at:
-#
-# http://code.livejournal.org/trac/livejournal/browser/trunk/LICENSE-LiveJournal.txt
-#
-# In accordance with the original license, this code and all its
-# modifications are provided under the GNU General Public License.
-# A copy of that license can be found in the LICENSE file included as
-# part of this distribution.
-_c?>
-<?page
-body<=
-<?_code
-{
-    use strict;
-    use vars qw(%GET %POST $title $headextra @errors @warnings);
-    use Class::Autouse qw( LJ::QotD );
-
-    my $remote = LJ::get_remote();
-    my @displayprivs = ( "siteadmin:qotd", "siteadmin:*" );
-    my $numprivs = @displayprivs;
-
-    return "<?needlogin?>"
-        unless $remote;
-
-    return BML::ml( "admin.noprivserror", { numprivs => $numprivs, needprivs => "<b>" . join(", ", @displayprivs) . "</b>"} )
-        unless $remote->has_priv( 'siteadmin', 'qotd' ) || $LJ::IS_DEV_SERVER;
-
-    my $ret = "";
-
-    # add a spotlight
-    LJ::Widget->handle_post(\%POST, qw(AddQotD));
-
-    # QotD preview
-    $ret .= "<div style='float: right; width: 400px; border: 1px solid'>";
-    $ret .= LJ::Widget::QotD->render . "</div>";
-    
-    # add question form
-    $ret .= LJ::Widget::AddQotD->render( qid => $GET{qid} );
-
-    return $ret;
-}
-_code?>
-<=body
-title=><?_code return $title; _code?>
-head<=
-<?_code return $headextra; _code?>
-<=head
-page?>
diff -r f1f9d6f349bc -r 1b248ad3489c htdocs/admin/qotd/manage.bml
--- a/htdocs/admin/qotd/manage.bml	Tue Sep 21 22:20:43 2010 +0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-<?_c
-# This code was forked from the LiveJournal project owned and operated
-# by Live Journal, Inc. The code has been modified and expanded by
-# Dreamwidth Studios, LLC. These files were originally licensed under
-# the terms of the license supplied by Live Journal, Inc, which can
-# currently be found at:
-#
-# http://code.livejournal.org/trac/livejournal/browser/trunk/LICENSE-LiveJournal.txt
-#
-# In accordance with the original license, this code and all its
-# modifications are provided under the GNU General Public License.
-# A copy of that license can be found in the LICENSE file included as
-# part of this distribution.
-_c?>
-<?page
-body<=
-<?_code
-{
-    use strict;
-    use vars qw(%POST %GET);
-    use Class::Autouse qw( LJ::QotD );
-
-    my $remote = LJ::get_remote();
-
-    return "<?needlogin?>"
-        unless $remote;
-
-    my @displayprivs = ( "siteadmin:qotd", "siteadmin:*" );
-    my $numprivs = @displayprivs;
-
-    return BML::ml( "admin.noprivserror", { numprivs => $numprivs, needprivs => "<b>" . join(", ", @displayprivs) . "</b>"} )
-        unless $remote && $remote->has_priv( 'siteadmin', 'qotd' ) || $LJ::IS_DEV_SERVER;
-
-    my $ret = "";
-
-    # activate/inactivate a question
-    LJ::Widget->handle_post(\%POST, qw(ManageQotD));
-
-    # spotlight preview
-    $ret .= "<div style='float: right; width: 400px; border: 1px solid'>";
-    $ret .= LJ::Widget::QotD->render . "</div>";
-
-    # manage QotD form
-    $ret .= LJ::Widget::ManageQotD->render( get => \%GET );
-
-    return $ret;
-}
-_code?>
-<=body
-title=><?_code return $title; _code?>
-head<=
-<?_code return $headextra; _code?>
-<=head
-page?>
diff -r f1f9d6f349bc -r 1b248ad3489c htdocs/editjournal.bml
--- a/htdocs/editjournal.bml	Tue Sep 21 22:20:43 2010 +0800
+++ b/htdocs/editjournal.bml	Tue Sep 21 22:33:15 2010 +0800
@@ -443,10 +443,6 @@ body<=
 
             $ret .= "</tr></table>";
 
-            my $qotd = LJ::QotD->get_single_question($entry->{prop_qotdid});
-            my $qotd_text = LJ::Widget::QotD->qotd_display_embed( questions => [ $qotd ] );
-            my $escaped_qotd_text = LJ::ejs($qotd_text);
-
             # javascript to initialize entry form since we've just called into entry_form
             # -- shove into \$head which is a reference into $_[1]->{head} and will
             #    be placed in the correct BML head portion later
@@ -459,7 +455,6 @@ body<=
             $onload
         }
     //]]>
-    LiveJournal.qotdText = "$escaped_qotd_text";
     </script>
 };
 
diff -r f1f9d6f349bc -r 1b248ad3489c htdocs/js/rte.js
--- a/htdocs/js/rte.js	Tue Sep 21 22:20:43 2010 +0800
+++ b/htdocs/js/rte.js	Tue Sep 21 22:33:15 2010 +0800
@@ -131,10 +131,6 @@ function useRichText(textArea, statPrefi
     setTimeout("LJUser('" + textArea + "')", 2000);
 
 
-    if ($("qotd_html_preview")) {
-       $("qotd_html_preview").style.display='none';
-    }
-
     $("switched_rte_on").value = '1';
 
     return false; // do not follow link
@@ -147,10 +143,6 @@ function usePlainText(textArea) {
     var oEditor = FCKeditorAPI.GetInstance(textArea);
     if (! oEditor) return;
     var editor_frame = $(textArea + '___Frame');
-
-    if ($("qotd_html_preview")) {
-       $("qotd_html_preview").style.display='block';
-    }
 
     var html = oEditor.GetXHTML(false);
     html = convertToTags(html);
@@ -187,7 +179,6 @@ function convert_post(textArea) {
     var html = oEditor.GetXHTML(false);
 
     var tags = convert_poll_to_tags(html, true);
-    tags = convert_qotd_to_ljtags(tags, true);
 
     $(textArea).value = tags;
     oEditor.SetData(tags);
@@ -197,7 +188,6 @@ function convert_to_draft(html) {
     if ( $("switched_rte_on").value == '0' ) return html;
 
     var out = convert_poll_to_tags(html, true);
-    out = convert_qotd_to_ljtags(out, true);
     out = out.replace(/\n/g, '');
 
     return out;
@@ -235,26 +225,6 @@ function generate_pollHTML(ljtags, pollI
     return tags;
 }
 
-function convert_qotd_to_ljtags (html, post) {
-    var tags = html.replace(/<div .*qotdid=['"]?(\d+)['"]? .*class=['"]?ljqotd['"]?.*>[^\b]*<\/div>(<br \/>)*/g, "<lj-template name=\"qotd\" id=\"$1\"></lj-template>");
-    tags = tags.replace(/<div .*class=['"]?ljqotd['"]? .*qotdid=['"]?(\d+)['"]?.*>[^\b]*<\/div>(<br \/>)*/g, "<lj-template name=\"qotd\" id=\"$1\"></lj-template>");
-    return tags;
-}
-
-function convert_qotd_to_HTML(plaintext) {
-    var qotdText = LiveJournal.qotdText;
-
-    var styleattr = " style='cursor: default; -moz-user-select: all; -moz-user-input: none; -moz-user-focus: none; -khtml-user-select: all;'";
-
-    var html = plaintext;
-    html = html.replace(/<lj-template name=['"]?qotd['"]? id=['"]?(\d+)['"]?>.*?<\/lj-template>(<br \/>)*/g, "<div class=\"ljqotd\" qotdid=\"$1\" contenteditable=\"false\"" + styleattr + ">" + qotdText + "</div>\n\n");
-    html = html.replace(/<lj-template id=['"]?(\d+)['"]? name=['"]?qotd['"]?>.*?<\/lj-template>(<br \/>)*/g, "<div class=\"ljqotd\" qotdid=\"$1\" contenteditable=\"false\"" + styleattr + ">" + qotdText + "</div>\n\n");
-    html = html.replace(/<lj-template name=['"]?qotd['"]? id=['"]?(\d+)['"]? \/>(<br \/>)*/g, "<div class=\"ljqotd\" qotdid=\"$1\" contenteditable=\"false\"" + styleattr + ">" + qotdText + "</div>\n\n");
-    html = html.replace(/<lj-template id=['"]?(\d+)['"]? name=['"]?qotd['"]? \/>(<br \/>)*/g, "<div class=\"ljqotd\" qotdid=\"$1\" contenteditable=\"false\"" + styleattr + ">" + qotdText + "</div>\n\n");
-
-    return html;
-}
-
 // Constant used to check if FCKeditorAPI is loaded
 var FCKeditor_LOADED = false;
 
@@ -285,7 +255,6 @@ function convertToTags(html) {
     html = html.replace(/<div class=['"]ljcut['"]>(.+?)<\/div>/g, '<cut>$1</cut>');
 
     html = convert_poll_to_tags(html);
-    html = convert_qotd_to_ljtags(html);
     return html;
 }
 
@@ -298,7 +267,6 @@ function convertToHTMLTags(html, statPre
     html = html.replace(/<(lj|site)-embed\s*(id="(\d*)")?\s*>\s*(.*)\s*<\/\1-embed>/gim, '<div class="ljembed" embedid="$3">$4</div>');
 
     html = convert_poll_to_HTML(html);
-    html = convert_qotd_to_HTML(html);
 
     return html;
 }
diff -r f1f9d6f349bc -r 1b248ad3489c htdocs/js/widgets/qotd.js
--- a/htdocs/js/widgets/qotd.js	Tue Sep 21 22:20:43 2010 +0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +0,0 @@
-var QotD = new Object();
-
-QotD.init = function () {
-    QotD.skip = 0;
-    QotD.domain = "homepage";
-
-    if (! $('prev_questions')) return;
-    if (! $('next_questions')) return;
-    if (! $('prev_questions_disabled')) return;
-    if (! $('next_questions_disabled')) return;
-
-    if ($('vertical_name')) {
-        QotD.domain = $('vertical_name').value;
-    }
-
-    DOM.addEventListener($('prev_questions'), "click", QotD.prevQuestions);
-    DOM.addEventListener($('next_questions'), "click", QotD.nextQuestions);
-
-    QotD.checkDirections();
-}
-
-QotD.checkDirections = function () {
-    QotD.tryForQuestions("prev");
-    QotD.tryForQuestions("next");
-}
-
-QotD.prevQuestions = function () {
-    QotD.skip = QotD.skip + 1;
-    QotD.getQuestions();
-}
-
-QotD.nextQuestions = function () {
-    if (QotD.skip > 0) {
-        QotD.skip = QotD.skip - 1;
-    }
-    QotD.getQuestions();
-}
-
-QotD.tryForQuestions = function (direction) {
-    if (QotD.skip == 0 && direction == "next") {
-        $('next_questions').style.display = "none";
-        $('next_questions_disabled').style.display = "inline";
-        return;
-    }
-
-    var skip;
-    if (direction == "prev") {
-        skip = QotD.skip + 1;
-    } else {
-        skip = QotD.skip - 1;
-    }
-
-    HTTPReq.getJSON({
-        url: LiveJournal.getAjaxUrl("qotd"),
-        method: "GET",
-        data: HTTPReq.formEncoded({ skip: skip, domain: QotD.domain }),
-        onData: function (data) {
-            if (data.text) {
-                if (direction == "prev") {
-                    $('prev_questions_disabled').style.display = "none";
-                    $('prev_questions').style.display = "inline";
-                } else {
-                    $('next_questions_disabled').style.display = "none";
-                    $('next_questions').style.display = "inline";
-                }
-            } else {
-                if (direction == "prev") {
-                    $('prev_questions').style.display = "none";
-                    $('prev_questions_disabled').style.display = "inline";
-                } else {
-                    $('next_questions').style.display = "none";
-                    $('next_questions_disabled').style.display = "inline";
-                }
-            }
-        },
-        onError: function (msg) { }
-    });
-}
-
-QotD.getQuestions = function () {
-    HTTPReq.getJSON({
-        url: LiveJournal.getAjaxUrl("qotd"),
-        method: "GET",
-        data: HTTPReq.formEncoded({skip: QotD.skip, domain: QotD.domain }),
-        onData: QotD.printQuestions,
-        onError: function (msg) { }
-    });
-}
-
-QotD.printQuestions = function (data) {
-    if (data.text || QotD.skip == 0) {
-        $('all_questions').innerHTML = data.text;
-    } else {
-        if (QotD.skip > 0) {
-            QotD.skip = QotD.skip - 1;
-        }
-    }
-
-    QotD.checkDirections();
-}
-
-LiveJournal.register_hook("page_load", QotD.init);
diff -r f1f9d6f349bc -r 1b248ad3489c htdocs/misc/latestqotd.bml
--- a/htdocs/misc/latestqotd.bml	Tue Sep 21 22:20:43 2010 +0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-<?_c
-# This code was forked from the LiveJournal project owned and operated
-# by Live Journal, Inc. The code has been modified and expanded by
-# Dreamwidth Studios, LLC. These files were originally licensed under
-# the terms of the license supplied by Live Journal, Inc, which can
-# currently be found at:
-#
-# http://code.livejournal.org/trac/livejournal/browser/trunk/LICENSE-LiveJournal.txt
-#
-# In accordance with the original license, this code and all its
-# modifications are provided under the GNU General Public License.
-# A copy of that license can be found in the LICENSE file included as
-# part of this distribution.
-_c?>
-<?page
-body<=
-<?_code
-{
-    use strict;
-    use vars qw(%GET %POST $title $headextra @errors @warnings);
-
-    my $remote = LJ::get_remote(); # used to check entry security
-
-    $title = "Writer's Block";
-
-    my $ret;
-
-    my $qid = $GET{qid}+0;
-    my $qotd = $qid ? LJ::QotD->get_single_question($qid) : undef;
-
-    $ret .= "<table width='100%' cellspacing='5' cellpadding='0'><tr><td valign='top'>";
-    $ret .= LJ::Widget::QotDResponses->render;
-    $ret .= "</td></tr></table>";
-
-    return $ret;
-}
-_code?>
-<=body
-title=><?_code return $title; _code?>
-head<=
-<?_code return $headextra; _code?>
-<=head
-page?>
diff -r f1f9d6f349bc -r 1b248ad3489c htdocs/misc/qotdarchive.bml
--- a/htdocs/misc/qotdarchive.bml	Tue Sep 21 22:20:43 2010 +0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-<?_c
-# This code was forked from the LiveJournal project owned and operated
-# by Live Journal, Inc. The code has been modified and expanded by
-# Dreamwidth Studios, LLC. These files were originally licensed under
-# the terms of the license supplied by Live Journal, Inc, which can
-# currently be found at:
-#
-# http://code.livejournal.org/trac/livejournal/browser/trunk/LICENSE-LiveJournal.txt
-#
-# In accordance with the original license, this code and all its
-# modifications are provided under the GNU General Public License.
-# A copy of that license can be found in the LICENSE file included as
-# part of this distribution.
-_c?>
-<?page
-body<=
-<?_code
-{
-    use strict;
-    use vars qw(%GET %POST $title $headextra @errors @warnings);
-
-    $title = $ML{'.title'};
-
-    my $page = defined $GET{page} ? $GET{page} : 1;
-
-    return LJ::Widget::QotDArchive->render( page => $page );
-}
-_code?>
-<=body
-title=><?_code return $title; _code?>
-head<=
-<?_code return $headextra; _code?>
-<=head
-page?>
diff -r f1f9d6f349bc -r 1b248ad3489c htdocs/misc/qotdarchive.bml.text
--- a/htdocs/misc/qotdarchive.bml.text	Tue Sep 21 22:20:43 2010 +0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-;; -*- coding: utf-8 -*-
-
-.title=Writer's Block Archive
diff -r f1f9d6f349bc -r 1b248ad3489c htdocs/misc/suggest_qotd.bml
--- a/htdocs/misc/suggest_qotd.bml	Tue Sep 21 22:20:43 2010 +0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-<?_c
-# This code was forked from the LiveJournal project owned and operated
-# by Live Journal, Inc. The code has been modified and expanded by
-# Dreamwidth Studios, LLC. These files were originally licensed under
-# the terms of the license supplied by Live Journal, Inc, which can
-# currently be found at:
-#
-# http://code.livejournal.org/trac/livejournal/browser/trunk/LICENSE-LiveJournal.txt
-#
-# In accordance with the original license, this code and all its
-# modifications are provided under the GNU General Public License.
-# A copy of that license can be found in the LICENSE file included as
-# part of this distribution.
-_c?>
-<?page
-title=><?_ml .title _ml?>
-head<=
-<=head
-body<=
-<?_code
-{
-    use strict;
-    use vars qw($POST);
-
-    my $ret;
-    my $remote = LJ::get_remote()
-        or return "<?needlogin?>";
-
-    if (LJ::did_post()) {
-        return LJ::bad_input($ML{'error.invalidform'})
-            unless LJ::check_form_auth();
-
-        my $questions = LJ::ehtml($POST{questions});
-        my $credit = $POST{credit} ? "DOES" : "DOES NOT";
-
-        return LJ::bad_input($ML{'.error.noquestion'})
-            unless $questions;
-
-        my $user = $remote->user;
-
-        my $rv = LJ::send_mail({
-            to => "writersblock\@$LJ::DOMAIN",
-            from => "lj_noreply\@$LJ::DOMAIN",
-            charset => "utf-8",
-            subject => "Writer's Block Suggestion(s) from $user",
-            body => qq{
-The user $user $credit want credit for their Writer's Block suggestion(s).
-
-Their suggestion(s):
-
-$questions
-            },
-        });
-
-        return $ret . "<?p <strong>$ML{'.form.error.header'}</strong> $ML{'.form.error.sendfailed'} p?>"
-            unless $rv;
-
-        $ret .= "<?h2 $ML{'.success.header'} h2?>";
-        $ret .= "<?p $ML{'.success.text'} p?>";
-
-        return $ret;
-    }
-
-    $ret .= "<?p $ML{'.intro'} p?>";
-
-    $ret .= "<form action='suggest_qotd' method='post'>";
-    $ret .= LJ::form_auth();
-    $ret .= "<div style='padding: 10px; margin-left: 20px;'>";
-
-    $ret .= "<p><label for='questions'>$ML{'.form.question.label'}</label><br />";
-    $ret .= LJ::html_textarea({ id => 'questions', name => 'questions',
-                                        raw => "rows='10' cols='40' wrap='soft'" }) . "</p>";
-
-    $ret .= "<p>" . LJ::html_check({ id => 'credit', name => 'credit', selected => 1 }) . " ";
-    $ret .= "<label for='credit'>$ML{'.form.credit.label'}</label></p>";
-
-    $ret .= "<p>" . LJ::html_submit('submit', $ML{'.btn.submit'}) . "</p>";
-
-    $ret .= "</div>";
-    $ret .= "</form>";
-
-    return $ret;
-}
-_code?>
-<=body
-page?>
diff -r f1f9d6f349bc -r 1b248ad3489c htdocs/misc/suggest_qotd.bml.text
--- a/htdocs/misc/suggest_qotd.bml.text	Tue Sep 21 22:20:43 2010 +0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-;; -*- coding: utf-8 -*-
-
-.btn.submit=Submit Writer's Block Suggestion(s)
-
-.error.noquestion=You didn't fill out the question field.
-
-.form.credit.label=I want my name to appear publicly with my suggested Writer's Block question(s).
-
-.form.error.header=Error:
-
-.form.error.sendfailed=Message failed to send.
-
-.form.question.label=Your suggested question(s):
-
-.intro=Fill out this form to suggest one or more Writer's Block questions:
-
-.success.header=Success
-
-.success.text=Your Writer's Block suggestion(s) have been sent. Thanks!
-
-.title=Suggest Writer's Block Questions
diff -r f1f9d6f349bc -r 1b248ad3489c htdocs/post_qotd.bml
--- a/htdocs/post_qotd.bml	Tue Sep 21 22:20:43 2010 +0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-<?_c
-# This code was forked from the LiveJournal project owned and operated
-# by Live Journal, Inc. The code has been modified and expanded by
-# Dreamwidth Studios, LLC. These files were originally licensed under
-# the terms of the license supplied by Live Journal, Inc, which can
-# currently be found at:
-#
-# http://code.livejournal.org/trac/livejournal/browser/trunk/LICENSE-LiveJournal.txt
-#
-# In accordance with the original license, this code and all its
-# modifications are provided under the GNU General Public License.
-# A copy of that license can be found in the LICENSE file included as
-# part of this distribution.
-_c?>
-<?page
-body<=
-<?_code
-{
-    use strict;
-    use vars qw(%GET %POST $title $headextra @errors @warnings);
-
-    my $u = LJ::load_user($GET{user});
-    $u = LJ::get_remote() unless $u;
-
-    return "<?needlogin?>" unless $u;
-
-    my @questions = LJ::QotD->get_questions( user => $u, skip => 0 );
-
-    # redirect to the update page with the most recent QotD filled in
-    if (@questions) {
-        my $url = LJ::Widget::QotD->answer_url($questions[0]);
-        return BML::redirect($url);
-    }
-
-    return BML::redirect("$LJ::SITEROOT/");
-}
-_code?>
-<=body
-title=><?_code return $title; _code?>
-head<=
-<?_code return $headextra; _code?>
-<=head
-page?>
diff -r f1f9d6f349bc -r 1b248ad3489c htdocs/stc/widgets/qotd.css
--- a/htdocs/stc/widgets/qotd.css	Tue Sep 21 22:20:43 2010 +0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-.appwidget-qotd {
-    margin-bottom: 8px !important;
-    position: relative;
-}
-.appwidget-qotd #prev_questions, .appwidget-qotd #next_questions,
-.appwidget-qotd #prev_questions_disabled, .appwidget-qotd #next_questions_disabled {
-    display: none;
-}
-.appwidget-qotd #prev_questions, .appwidget-qotd #next_questions {
-    cursor: pointer;
-}
-.appwidget-qotd h2 {
-    background: url(/img/jabber.gif) no-repeat 0 50%;
-    padding: 0 0 0 20px !important;
-    margin: 0 0 5px 0 !important;
-}
-.appwidget-qotd .qotd-controls {
-    padding-left: 10px;
-}
-.appwidget-qotd .qotd-controls img {
-    vertical-align: bottom;
-}
-.appwidget-qotd .qotd-img {
-    margin: 0 0 0 10px;
-    border: 0;
-}
-.appwidget-qotd p {
-    margin: 0;
-}
-.appwidget-qotd p.detail {
-    margin: 0;
-    padding: 5px 0 0 0;
-    font-size: 10px;
-}
-.appwidget-qotd p.detail span.suggestions {
-    display: block;
-    position: relative;
-    float: right;
-}
-.appwidget-qotd .answer {
-    font-weight: bold;
-}
-.appwidget-qotd h2 span.special-title {
-    background: none !important;
-    padding: 0 !important;
-}
diff -r f1f9d6f349bc -r 1b248ad3489c htdocs/stc/widgets/qotdarchive.css
--- a/htdocs/stc/widgets/qotdarchive.css	Tue Sep 21 22:20:43 2010 +0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-.appwidget-qotd {
-    padding-top: 10px;
-    margin: 0 !important;
-}
-
-.qotd-archive-item-date {
-    font-size: 11px;
-    padding-bottom: 5px;
-}
-
-.qotd-archive-item-question {
-    font-size: 14px;
-    font-weight: bold;
-    padding-bottom: 5px;
-}
-
-.qotd-archive-item-answers {
-    border-bottom: 1px solid #ededed;
-    padding-bottom: 10px;
-}
-
-.qotd-archive-item-answers a {
-    font-size: 11px;
-}
diff -r f1f9d6f349bc -r 1b248ad3489c htdocs/stc/widgets/qotdresponses.css
--- a/htdocs/stc/widgets/qotdresponses.css	Tue Sep 21 22:20:43 2010 +0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-.lj_qotd_entry_userpic {
-    float: left;
-    margin-right: 6px;
-}
-
-.lj_qotd_entry_container {
-    padding: 8px;
-    border-bottom: 1px solid #ccc;
-}
-
-.lj_qotd_entry_subject {
-    font-weight: bold;
-}
-.qotd-container {
-    position: relative;
-    width: 100%;
-  }
-.appwidget-qotd h2 {
-    margin: 0 0 4px 0 !important;
-    font-size: 1em;
-    font-weight: bold;
-}
-
-.appwidget-qotd {
-    margin: 0 10px 0 10px;
-    padding: 8px 10px;
-    background-color: #ECF6FF;
-    border-bottom: 2px solid #ffd8d8;
-}
-
diff -r f1f9d6f349bc -r 1b248ad3489c htdocs/talkpost.bml
--- a/htdocs/talkpost.bml	Tue Sep 21 22:20:43 2010 +0800
+++ b/htdocs/talkpost.bml	Tue Sep 21 22:33:15 2010 +0800
@@ -346,9 +346,6 @@ body<=
 
     $ret .= "<br clear='both' /><hr size='2' align='center' />";
 
-    my $qotd = 0;
-    $qotd = $entry->prop("qotdid") if $entry;
-
     my $jarg = "journal=$u->{'user'}&amp;";
     my $readurl = LJ::Talk::talkargs($talkurl, LJ::viewing_style_args( %GET ) );
 
diff -r f1f9d6f349bc -r 1b248ad3489c htdocs/talkread.bml
--- a/htdocs/talkread.bml	Tue Sep 21 22:20:43 2010 +0800
+++ b/htdocs/talkread.bml	Tue Sep 21 22:33:15 2010 +0800
@@ -328,9 +328,6 @@ body<=
     $ret .= "</div>";
 
     $ret .= "<br style='clear: both' /><hr width='100%' size='2' align='center' />";
-
-    my $qotd = 0;
-    $qotd = $entry->prop("qotdid") if $entry;
 
 
     my $view_arg = $GET{'view'} || "";
diff -r f1f9d6f349bc -r 1b248ad3489c htdocs/tools/endpoints/qotd.bml
--- a/htdocs/tools/endpoints/qotd.bml	Tue Sep 21 22:20:43 2010 +0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-<?_c
-# This code was forked from the LiveJournal project owned and operated
-# by Live Journal, Inc. The code has been modified and expanded by
-# Dreamwidth Studios, LLC. These files were originally licensed under
-# the terms of the license supplied by Live Journal, Inc, which can
-# currently be found at:
-#
-# http://code.livejournal.org/trac/livejournal/browser/trunk/LICENSE-LiveJournal.txt
-#
-# In accordance with the original license, this code and all its
-# modifications are provided under the GNU General Public License.
-# A copy of that license can be found in the LICENSE file included as
-# part of this distribution.
-_c?>
-<?_code # -*-bml-*-
-{
-    use strict;
-    use vars qw(%GET);
-    use JSON;
-
-    # if any opts aren't defined, they'll be passed in as empty strings
-    my $skip = $GET{skip} eq "" ? undef : $GET{skip};
-    my $domain = $GET{domain} eq "" ? undef : $GET{domain};
-
-    my $u = LJ::load_user($GET{user});
-    $u = LJ::get_remote() unless $u;
-
-    my @questions = LJ::QotD->get_questions( user => $u, skip => $skip, domain => $domain );
-
-    my $ret = "";
-    if (@questions) {
-        $ret = LJ::Widget::QotD->qotd_display( questions => \@questions );
-    }
-
-    return JSON::objToJson({ text => $ret });
-}
-_code?>
diff -r f1f9d6f349bc -r 1b248ad3489c htdocs/update.bml
--- a/htdocs/update.bml	Tue Sep 21 22:20:43 2010 +0800
+++ b/htdocs/update.bml	Tue Sep 21 22:33:15 2010 +0800
@@ -116,18 +116,6 @@ _c?>
         $event = '<a href="' . $page->url . '">' . ( LJ::ehtml( $page->description ) || $subject || $page->url ) . "</a>\n\n";
     }
 
-    # if a QotD id was passed in, fill in the fields with that QotD
-    my $qid = $GET{qotd}+0;
-    my $qotd;
-    $qotd = LJ::QotD->get_single_question($qid) if $qid;
-    if ($qotd) {
-        $subject = LJ::Widget::QotD->subject_text($qotd, user => $remote);
-        $event = LJ::Widget::QotD->embed_text($qotd);
-        $tags = LJ::Widget::QotD->tags_text($qotd);
-        my $text = LJ::Widget::QotD->qotd_display_embed( questions => [ $qotd ], form_disabled => 1 );
-        $$head .= "<script>LiveJournal.qotdText = \"" . LJ::ejs($text) . "\";</script>";
-    }
-
     # try to call a hook to fill in the fields
     my $override_fields = LJ::Hooks::run_hook('update_fields', \%GET);
     my $opt_preformatted = 0;
@@ -211,7 +199,6 @@ _c?>
         # their settings from the GET requests
         my $getextra = '?';
         $getextra .= "altlogin=1&" if $GET{'altlogin'};
-        $getextra .= "qotd=" . LJ::eurl($GET{qotd}) . "&" if $GET{'qotd'};
         chop $getextra;
 
         # if crossposter values were checked, remember them
@@ -236,7 +223,6 @@ _c?>
             'richtext_default' => $remote ? $remote->new_entry_editor eq 'rich' ? 1 : 0  # User setting
                                           : $LJ::DEFAULT_EDITOR       eq 'rich' ? 1 : 0, # Site default
             'include_insert_object' => $GET{'insobj'},
-            'prop_qotdid' => $qid,
             'altlogin' => $GET{altlogin} ? 1 : 0,
             'prop_opt_preformatted' => $opt_preformatted ? 1 : 0,
             
@@ -385,7 +371,6 @@ _c?>
             $errors->{'entry'} = $ML{'.error.noentry'};
         }
 
-        $req{prop_qotdid} = $qid;
 
         my %res;
         LJ::do_request(\%req, \%res, $flags);
@@ -489,11 +474,6 @@ _c?>
                         $$body .= "<br/>";
                     }
 
-                    my $writersblocklink = '';
-
-                    if ($qid && LJ::Hooks::run_hook('show_qotd_extra_text', $remote)) {
-                        $writersblocklink = "<li><a href=\"$LJ::SITEROOT/misc/latestqotd?qid=$qid\">View answers to Writer's Block</a></li>";
-                    }
 
                     my @after_entry_post_extra_options = LJ::Hooks::run_hooks('after_entry_post_extra_options', user => $ju, itemlink => $itemlink);
                     my $after_entry_post_extra_options = join('', map {$_->[0]} @after_entry_post_extra_options) || '';
@@ -508,7 +488,7 @@ _c?>
                                        . "$ML{'.success.links.backdated'}</a></li>";
                     }
 
-                    $$body .= " p?><?p $ML{'.success.links'} p?><ul>" . $writersblocklink .
+                    $$body .= " p?><?p $ML{'.success.links'} p?><ul>" .
                         "<li><a href=\"$itemlink\">$ML{'.success.links.view'}</a></li>" . $backdatedlink .
                         "<li><a href=\"$edititemlink\">$ML{'.success.links.edit'}</a></li>" .
                         "<li><a href=\"/tools/memadd?journal=$juser&itemid=$itemid\">$ML{'.success.links.memories'}</a></li>" .
--------------------------------------------------------------------------------