New Features
- What feature(s) did you add?
The Estimated Account Value ranking feature has been integrated into the My Steemit Friends website. You can find a link to the ranking table from the navigation bar of the main page of the My Steemit Friends website here: http://mysteemitfriends.online.
After you click into the link in the drop down, you will see the Estimated Account Value ranking table:
You can type your name into the search box to see your ranking, and then click the link to be directed to the page with your name highlighted in the ranking tables.
From the main My Steemit Friends page, you can also type in your username here and see the ranking directly, without going into the ranking table.
Click on the blue link at the bottom to see your name in ranking table page.
How did you implement it/them?
update_steem_price: retrieves the current median history price of Steem and stores in steemprice.txt. This value is necessary for calculating the Estimated Account Value. It stores the updated price in steemprice.txt and is schedule to run daily via a Cron job.
steemprice.txt: Text file containing the updated steem price needed to calculate a user's Estimated Account Value from amount of STEEM and SBD. Updated periodically using update_steem_price.php.
accountvalue.php: A list of Steemit Users ranked by the amount of Estimated Account Value. SQL is used to retrieve the ranking data, and PHP is used to dispaly them. PHP sanitizing function is used on the page number input from the user and prepared SQL statements are used to prevent SQL injection. PHP statements are used to check for highlights and assist with converting from vests to SP as well as appending the latest Steem Price to the SQL query to calculate each user's estimated account value before ordering them.
The Estimated Account Value is calculated from this equation: Latest Steem Median Price * (Amount of Steem in Savings + Amount of Steem + Amount of Steem Power) + Amount of SBD + Amount of SBD in Savings. There may be a slight delay to see your latest increase/decreases on the ranking table.get_av_rank.php: This PHP file is accessed by using AJAX when users click on Search Ranking button in either the ranking table page or the main My Steemit Friend page. PHP used is used to append the latest steem price and global total_vesting_fund_steem and total_vesting_shares values to the SQL, which is then used to order the users and retrieve the ranking of a particular user. Finally PHP and HTML is used to create the link to the correct page on the ranking table. PHP Sanitizing function is used on the username input and then prepared SQL statement is used to prevent SQL injection.
Posted on Utopian.io - Rewarding Open Source Contributors