Tuesday, October 30, 2018

pin post on top

q2a

By add plugin, go to

https://github.com/NoahY/q2a-featured

download plugin,  unzip, copy whole folder to under qa-plugin/qa-featured

Then, navigate to your site, go to Admin -> Plugins, find the Featured Questions list, enter featured question ids seperated by commas, then click 'Save'.




carbon forum


I know when edit post, you can click 'Rise' button to pin it on top for 7 days.
If you click again, add 7 more days, and so on.
But I want to permanent pin post on top, no need to click click again again for 7 days.

Solution is make 7 days to 7000 days, by modify code

C:\Apache24\htdocs\carbon\controller\manage.php

// edit post, click sink, sink 7 days = 604800 second, 
                // I want 7000 days = 604800000
$this->db->query("UPDATE " . PREFIX . "topics SET LastTime = LastTime-604800000 WHERE ID=:ID", array(
"ID" => $this->id


// edit post, click rise, will pin top for 7 days = 604800 second, 
                // I want 7000 days = 604800000
$this->db->query("UPDATE " . PREFIX . "topics SET LastTime = LastTime+604800000 WHERE ID=:ID", array(
"ID" => $this->id
));





No comments: