投票数の編集

時折、特定のトピックについて「Facebookからのいいね数」など、他のソースからの合計値を含める必要がある場合があります。

現在の投票数を編集できるようにすると素晴らしいと思います。この操作が不審に見える可能性があることは理解していますが、トピックを手動で閉じた際に表示されるような、誰が・何を・いつ行ったかを明記した自動返信が追加されることを期待します。例えば:

「Rob 投票数を352に設定しました。」

管理者として、その自動返信を編集して、理由を補足することもできるでしょう。例えば「Facebookの投稿からのいいね数を含めました」などです。

投票は何かしらのテーブルにユーザーIDと共に保存されていると推測されます。そのため、discobot の -2 ユーザーID のように、投票の修正を別の_架空の_ユーザーとして保存することも可能かもしれません。

「いいね!」 3

I know this is a year old, but you can do this by editing the database directly.

From what I’ve found in my spelunking, the plugin keeps information about votes in 2 locations: the topic_custom_fields table contains the vote count for each topic, and the user_custom_fields table contains the actual record of each vote, tied to a user.

If you just edit the vote count in topic_custom_fields, the new vote count will display-- but the next time someone votes, the plugin will cross-check with the user_custom_fields records, realize the count is incorrect, and “fix” it back to before the edit.

So you have to also edit the user_custom_fields table so it agrees. Luckily, even though on the frontend you’re limited to 1 vote per topic per user, it looks like you can insert as many records as you want for 1 user into the database. So something like this:

UPDATE topic_custom_fields SET value = 3 WHERE name = 'vote_count' AND topic_id = <topic_id>;
 
INSERT INTO user_custom_fields VALUES ( DEFAULT,<user_id>,'votes',<topic_id>,<timestamp>,<timestamp>);
INSERT INTO user_custom_fields VALUES ( DEFAULT,<user_id>,'votes',<topic_id>,<timestamp>,<timestamp>);
INSERT INTO user_custom_fields VALUES ( DEFAULT,<user_id>,'votes',<topic_id>,<timestamp>,<timestamp>);

That way, assuming the vote_count was 0 at first, you’ve set it to 3 and given it 3 records to chew on when it goes to cross-check that number. Seems to work o-k for me, and you should be able to set the user_id to -2 or whatever you want.