New Features
- What feature(s) did you add?
In My Steemit Friends, previous to this update, you can only look up upvote statistics between one date and today. After this update, you are able to look up between date1 and date2, how much $ user A has contributed to user B, as well as all the upvote statistics.
To test out the features, please go to http://mysteemitfriends.online, you will see this screen:
From here, enter your username and click the blue "Upvote Stats" button, and you will see some upvote statistics. In the filter box, you will now see 2 dates, which you can change and click "Update" to filter the results. By default, the two dates are between 3 months ago and today.
You can then click on the number of upvotes to go to the contribution calculator page, which will have matching dates to the main page. You can then again adjust the dates if you wish and calculate the contribution amount again by pressing the blue button. You can also click reverse lookup and see how much the reverse contribution is (from author to voter) within the same dates.
You will also notice that the navigation bar menu has changed to the same colored buttons as the buttons on the main page. This will bring some consistency to the user.
- How did you implement it/them?
index.php
In order to change from "the last X months" to "between 2 dates", a lot of editing was required in the SQL code executed on the database. Every SQL statement that involved dates had to be edited. PHP IF-statements were used so that if a user had bookmarked a certain query that involved using Months, it will still work, however the new way is to use the two dates. Links to the contribution calculator page also had to be updated with the two new dates. Jquery is now used to hide the newly aligned buttons when one of them is pressed, and to show them again when the results show up. You can see which lines were edited in the above link.
upvotelist.php
Because this page had one date already implemented, it was easier to change to two dates, but there was still quite a bit of editing involved in the SQL code. I also made sure that the reverse lookup works using the same variables for dates obtained from the URL in PHP. You can see which lines were edited in the above link.
Posted on Utopian.io - Rewarding Open Source Contributors