Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
469 views
in Q2A Core by

When a question is created, it is started with 1 view (actually it's 0 views but you are the first views) and 0 votes.

I just don't like zero. Can I make questions with fake views (like 14), and fake upvotes (like 3) ?

I see that, in the database file (https://github.com/q2a/question2answer/blob/78b969da37468e8668559e3ffe23687ae5587129/qa-include/db/install.php), we can manipulate

'upvotes' => 'SMALLINT UNSIGNED NOT NULL DEFAULT 0',
'downvotes' => 'SMALLINT UNSIGNED NOT NULL DEFAULT 0',
'netvotes' => 'SMALLINT NOT NULL DEFAULT 0',
'lastviewip' => 'VARBINARY(16)', // INET6_ATON of IP address which last viewed the post
'views' => 'INT UNSIGNED NOT NULL DEFAULT 0',

Can I change those default values other than zero?

Q2A version: 1.8.5
by
Oh it seems to affect answers and comments as well :(

1 Answer

0 votes
by

You can change the views easily. They are just a number.

The problem will arise with the votes, because they are both: calculated based on actual data and cached. If you change the cached data and then a vote is added, then the value will reset. It is better to create the votes themselves in the qa_uservotes table.

...