Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6995613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:03:07+00:00 2026-05-27T20:03:07+00:00

I want user to view by recent Post in the order they were posted,

  • 0

I want user to view by recent Post in the order they were posted, but only if the user that created the post gave the user permission to view them. Much like google+ circle list.

Here is my original design, any suggestion on improvement, would be appreciated.

USER
Id
Name
...


POST
Id
Message
IsCloseFriendCanView
IsFamilyCanView
IsAcquaintanceCanView
IsDisabledComment
IsPostLock
CreatedByUserId
Created_Time
LastComment_Time 
...

POST_COMMENT
Id
PostId
Message
CreatedByUserId
Created_Time


FRIEND
Id
UserId
FriendUserId
IsCloseFriend
IsFamily
IsAcquaintance
IsBlocked
....

FRIEND_LIST (custom friends list only)
Id
UserId (owner)
FriendId
FriendListTypeId

FRIEND_LIST_TYPE 
Id
UserId
Name
...

POST_FRIEND (CAN VIEW)
Id
PostId
FriendId
....


POST_FRIEND_LIST (CAN VIEW - custom)
Id
PostId
FriendListTypeId
....

EDIT: updated

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T20:03:08+00:00Added an answer on May 27, 2026 at 8:03 pm

    Not sure if this is what you want but seems you will also need a table holding the relation between user and friends

    e.g.

    FRIEND
    user_id
    friend_id
    close_friend
    

    And on POST you would need something to identify whether it is visible to “All Friends”,”Close Friends” or “Public”.

    Then assuming $this_user is a logged in user or some dummy value e.g. -1 if not logged in, you can select a list of valid posts which will show

    1. posts created by the logged in user
    2. posts created by friends of the logged in user visible to all friends
    3. posts created by friends of the logged in user visible to close friends
    4. posts set as public

    using something like

    select p.id, p.message, 
      from POST p
     where createdbyuserid=$this_user 
        or (visible='F' 
            and exists (select 1 
                     from friend f 
                    where p.createdbyuserid=f.user_id 
                      and f.friend_id=$this_user)
           )
        or (visible='C' 
            and exists (select 1 
                     from friend f 
                    where p.createdbyuserid=f.user_id 
                      and f.friend_id=$this_user
                      and f.close_friend='Y')
           )
        or (visible='P')
     order by created_time
    

    If no user is logged in, then $this_user would be set to -1 so only the public posts would be visible.

    Then you use the result from this select to get the relevant comments for each post in a subsequent select.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want anonymous user can view projects' status and logs but can not start/stop/force
I have such view that handles user registration. After creating new user i want
I want to select a view from my sys user, but with other connection.
I have an index view that I want to update automatically as the user
All of my view has a blue navigation bar but when I want user
on one of my web pages I want my manager user to view all
In my view I want to add the text user enter in a textarea
I want to do the following: The user sets 3 parameters in MVC3 view:
I have a user database which I want the admin to be able view
I have a dilema, I want to present to the user a semi-transparent view.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.