SteemFriends.org New Feature - Distinguish between Written/Voted Articles from Main Panel/Navbar, Excluding Comments checkbox

in #utopian-io5 years ago (edited)

Repository
https://github.com/Bulletproofmonk/MySteemitFriends

Merged Pull Request
https://github.com/Bulletproofmonk/MySteemitFriends/pull/22

http://steemfriends.org is a popular tool with approximately 20,000 hits per month.

New Features

From the main panel, you can now enter your name and click on "User History". You will then be presented with two options - Articles Written and Articles Upvoted. Then, click on one of these links.

You will then be taken to the Articles list page with the most recent month already loaded. You can then customize the dates if you want to display articles outside of this date range.

After changing the date and checking the checkbox for excluding comments, you can press the blue button again and it will refresh the list of articles you have voted on without comments.

The same thing also works with the "Written Articles" mode.

You can also access both modes from the navigation bar at the top right.

How did you implement it/them?

index.html: Adjusted main panel buttons for User History
User History Button now has drop down to two different locations - Written Articles and Upvoted Articles. After the user types their username and clicks one of these buttons, it will take them to the history page with the article list for the most recent month loaded.

views/navbar.php: Updated Navbar to include dropdown for User History
User History now includes two links - one to Articles Upvoted and one to Articles Written. This categorization will help the user decide what they want early rather than confusing the user with multiple options once they are on the history page.

articlelist.php: ArticlesOnly value retrieved from URL
The Articlelist controller will retrieve the ArticlesOnly value from the URL and then pass it onto the model to determine whether the list of articles includes comments or not. It will also influence which buttons are displayed on the view.

views/articlelistview.php: Updated written/Upvotes button selection & checkbox excluding comments

  • The Articles Written / Articles Upvoted button will display depending on which option was chosen by the user from the main index page or the navigation bar.
  • The "excluding comments" checkbox will display in both written / upvoted articles modes. When the list button is pressed, the user will get a list showing articles including / excluding comments depending on whether the checkbox was checked.

models/articlelistmodel.php: Changed SQL to fetch results including / excluding comments
Depending on the ArticlesOnly value passed onto the model, the model will provide an article list including / excluding comments, for both voted and written article modes.

GitHub Account
https://github.com/Bulletproofmonk

Sort:  

Hey there, great updates.

A small note:

if ($articlesonly==2) {
    $result = $this->db->prepare($sql);
    $sql.= "AND (permlink NOT LIKE 're-%')";
}

This may create false positives since we have lots of dapps creating content in the blockchain and not everyone of them follows the "re-$parent_permlink" pattern.

Not sure about SteemSQL's database schema, but should not be possible to check the parent_author exists or not? If it exists, that means it's a comment.


Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

Thank you very much @emrebeyler you are an excellent reviewer. I will definitely look into a better way to do this. Cheers.

Thank you for your review, @emrebeyler!

So far this week you've reviewed 2 contributions. Keep up the good work!

吃了吗?欢迎在steemauto里设置跟赞 @cnbuddy 给整个cn区点赞如果不想再收到我的留言,请回复“取消”。

Hi @magicmonk!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server

Coin Marketplace

STEEM 0.26
TRX 0.11
JST 0.033
BTC 64678.67
ETH 3086.68
USDT 1.00
SBD 3.87