So I am going to develop an add on but hopefully lean quite a lot on this community.
This is the end product I want to accomplish of being able to vote on Topics (not comments on threads just yet) To begin I believe I need to modify the topics table to the following
Code: Select all
ALTER TABLE phpbb_topics
ADD topics_upvotes int default 0 ;
with the following columns
id / topic_id / posts_id / state
Is that enough or is there something I've missed? The State would be an int with 0 representing not voted on, 1 representing upvoted and 2 representing downvoted.
Ok - presumably I've not missed anything from the SQL I'll move onto next bit.
For php I would create a class-function to echo the up arrow, the upvote number and the downvote arrow
$o_Upvotes = new class_Upvotes();
$o_Upvotes->Display_UpvoteArrow($State) ;
$o_Upvotes->Display_UpvoteNumber($State) ;
$o_Upvotes->Display_DownvoteNumber($State) ;
Upon calling Display_UpvoteArrow() function it would present the correct upvote arrow colour depending on the $State and then echo out a <div> tag etc.
I would then handle the function of cilcking the upvote/downvote arrow by a javascript script
My question is - is this method so far easy enough to turn into an add on for phpbb?