• Hi All,

    I am trying to create a prototype which should be very simple but I can’t see to wrap my head around it.

    All I want to do is create a database with user specific information about cars so for example:
    NAME: FORD
    TYPE: FIESTA
    YEAR: 2001
    USER: TIM

    The idea is that Tim logs in with his login information and he gets directed to a page which shows him all the information on the cars that are assigned to him.

    I’m sure this is a very simple problem I am having but I just can’t figure out how to tie the two together. Is this even possible to do with WordPress?

    Any information would be much appreciated.

    Regards.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Simba123

    (@simba123)

    Hi,

    I had a look at the two links you sent me. I hope the questions I am about to ask are not stupid.

    If I was to create custom post types, would I create individual ones eg. ‘type’, ‘year’? or would each user have their own custom post?

    Once I have done this, how would I go about making sure the user only sees the information specific to them? Find a user plugin which only shows the user their ‘custom post’?

    You create them for the car, and use the meta data for type, year etc.

    Take a look at the roles and capabilities system in WordPress.
    https://codex.www.ads-software.com/Roles_and_Capabilities

    You can probably set them to private and restrict the capabilities of the users so they can’t read private posts.

    Thread Starter Simba123

    (@simba123)

    After a lot of research and trial and error I have progressed.

    First I created several users in the WordPress dashboard and set them to subscribers. (I will later create a register page)

    Next, I installed the ‘csv importer’ plugin and made a post for each car and assigned the specific user.

    Next I went to wp-admin/includes/meta-boxes.php and changed

    $visibility = 'public';
    	$visibility_trans = __('Public');

    to

    $visibility = 'private';
    	$visibility_trans = __('Private');

    This now means that when I upload a new post, it is set to private by default meaning only the assigned user can view that post.

    When a user logs in now, all they see are their assigned cars.

    HOWEVER

    After using the csv importer, the posts are all set to private but they are still public. I have to manually go to each post and re-click private (even though it is already on private). When I create a new post on WordPress however, the post IS private.

    So my problem now is how do I make sure the posts uploaded with ‘csv importer’ actually go to private?

    That’s strange. Perhaps you could check the database and see what’s different about the posts you create through WordPress and those imported with the importer.

    Posts are in the wp_posts table. wp_postmeta stores the meta data for the posts.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘User Specific Information From Database’ is closed to new replies.