• Resolved jonuk80

    (@jonuk80)


    Hey Peter,

    First of all thanks for making such a flippin’ useful plugin! You might have saved me the headache of a lifetime!

    So I have a couple of questions before I get my head around trying to implement a site.

    I’m trying to form a client portal. At the moment I have the DB, which is essentially a series of tables which sit alongside the general WP tables.

    I want a user to be able to log into my portal then the site queries the DB based on their login session. For example, I have a table called “projects”. I have created an ID FK to the WP_users ID. This would contain, a project number (or maybe 2 or even 3) for example.

    So questions

    1. Can this tool help my clients retrieve information from tables based on their login id?
    2. Can I embed these tables into general WP design/WPBakery layouts?
    3. Can I query single fields at a time (again based on session_id) and plonk the results into a page wherever I see fit?

    Hope that makes sense and I look forward to hearing from you πŸ™‚

    Best
    Jon

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi Jon,

    Welcome! Let me try to answer your qeustions:

    1. Yes! You can use $$USERID$$ in your where clause. You can also use $$USERID$$ as a default value if you want to allow your clients to enter client specific data. You can find more information here: https://wpdataaccess.com/docs/documentation/data-projects/user-roles-and-where-clauses/

    2. Sorry, I don’t have any experience with WPDesign/WPBakery. In general there are two options to use Data Projects: in your dashboard or on your web pages with a shortcode. The first option is my preferred option and the most stable one (you can use roles to manage access to your pages). If you want to use the second option, project parameter names might collapse with parameter names of a theme or other plugin. You’ll need to test this specifically for your configuration.

    3. The plugin does not support single field queries. I am working on a pro extension which supports this feature, but the extension is not free.

    Hope this helps! Let me know if you have more questions… πŸ™‚

    Best regards,
    Peter

    Thread Starter jonuk80

    (@jonuk80)

    Hi Peter,

    Many thanks! That’s amazing. The single field enquiries is really important to me, so consider me your first buyer! I really need that feature so I can do things like the logged in page shows:

    Welcome, ($$user_logged_in$$)
    Project: ($$project_name$$)
    Status: ($$project_status$$)
    Project address: ($$client_address$$).

    What’s the ETA? πŸ˜‰

    Many thanks,
    Jon

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi Jon,

    At this time the plugin only supports $$USER$$ (wp user name) and $$USERID$$ (wp user id). These are regarded as plugin environment variables.

    Where do values like $$project_name$$ come from? How do you want to use them? And where?

    Stupid question: what is ETA? πŸ™ˆ

    Best regards,
    Peter

    Thread Starter jonuk80

    (@jonuk80)

    Hi Peter,

    Not a stupid question at all, sorry I shouldn’t use acronyms! ETA = Estimated Time of Arrival. In other words, do you know when you might have this functionality implemented?

    As for your other question, let me try and explain.

    I want to use the ‘client portal’ as a tracking facility. In my work, for each client, I have to track a large number of things and would like to do it via a web interface.

    Here’s a reduced example of the structure:

      Tables

    wp-users (my clients will go in here)
    user-data (their addresses, telephone numbers etc)
    projects (a list of all current projects, with status, project number etc)
    project-constraints (a list of project constraints, like flooding, fire etc).

      Queries

    This is where I get stuck! So on one page, I want to be able to, based on the user alone, query the database so it extracts information from ‘projects’ and ‘project-constraints’. In reality it’s about 7 tables. I figure if I can do it with 2, I can work out how to do the remaining 5.

    So one page may say

    Good morning $$user$$
    Your current projects are (queried from ‘projects’)
    $$project_name$$, $$project_status$$, $$project_link$$

    Most of the time it will be only one, but it could be more. They can then click on that project to a details page.

    In that page it might say

    $$project-name$$, $$project-ref$$

    The current constraints are as follows

    Flooding: $$project-constraints-flooding$$ (which will just be a yes, no or TBC)
    Fire: $$project-constraints-fire$$
    Notes: $$project-notes$$

    etc etc.

    Does that make sense? πŸ™‚

    Kind regards

    Jon

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi Jon,

    I thought ETA was for the airport! 😊 Sorry for the misunderstanding and thanks for helping me to improve my English.

    It’s hard to say when the extension will be available. I do this part time. At day time I teach at the university. But I hope before the summer…

    From what I understand from your requirements, you could create a parent-child page where your project table would be the parent and your constraints table the child table. You can store the relationship between projects and users either within the project table (one user per project) or in a separate table (multiple users per project).

    The good news is that you can start with it right away. You can add searching on on individual columns later. So yes, it makes sense. Just give a try… πŸ˜‰ And let me know if I can help.

    Best regards,
    Peter

    Thread Starter jonuk80

    (@jonuk80)

    Thanks for the ETA peter πŸ˜‰

    I think I understand it, although I’m likely to need multiple project -> one login. Or maybe two logins -) multiple projects. Say a husband and wife wanted their own login but to access the same sets of data…

    I will see what I can do with your fantastic tool for now however!! πŸ™‚

    Thanks!!

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi Jon,

    Multiple projects per login is no problem. If you store the login with a project your query on the projects table will return all projects for the logged in user. Your default where clause would look like this:
    where user_id = $$USERID$$

    If you want to allow multiple users to share projects, your default where clause would look like this:
    where project_id in (select project_id from project_users where user_id = $$USERID$$)

    Let me know if I can help! πŸ˜‰

    Best regards,
    Peter

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi Jon,

    I’m closing this topic. Please open a new topic if you have any questions.

    Best regards,
    Peter

    Thread Starter jonuk80

    (@jonuk80)

    That’s great – thank you Peter! πŸ™‚

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘General Plugin Questions’ is closed to new replies.