• Resolved cristch_27

    (@cristch_27)


    Thank you for your valuable plugin Xnau

    Create a template for the control panel, where registered users can manage their records sent validating user data. (user_login).

    To this would need to review the tutorials presented by the author of the plugin.

    1.
    2.

    The first thing you have to validate whether the user is registered or not. Then filter records that the user had registered and are linked to your username.

    <?php if ( is_user_logged_in() ) { ?>
        <!-- text that logged in users will see -->

    If this short code below imprimiríamos met.
    The template contains desktop link to edit the records.

    <?php echo do_shortcode('[pdb_list template = desktop filter="user_login=' . $current_user->user_login . '"]');?>

    Otherwise display a message that you register or log in with your data.

    <?php } else {   ?>
    <!-- here is a paragraph that is shown to anyone not logged in -->
    <p>Is necessary<a href="<?php home_url(); ?>/wp-login.php">login</a>, to see your records.</p><?php } ?>

    Works perfect form validation, but the short code does not display the list of records associated with the user, only shows the column headings without the record list.

    I appreciate your help with comments

    https://www.ads-software.com/plugins/participants-database/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author xnau webdesign

    (@xnau)

    You must eliminate spaces between the attribute name and it’s value in the shortcode:

    <?php echo do_shortcode('[pdb_list template=desktop filter="user_login=' . $current_user->user_login . '"]');?>

    Thread Starter cristch_27

    (@cristch_27)

    I made a copy and paste of code and still not working!!

    Attached screenshot for better explanation
    https://drive.google.com/open?id=0B2_uvBIKI8JJWTJoa3ZkMnhFTnM&authuser=0

    Plugin Author xnau webdesign

    (@xnau)

    Copy and paste from a web page can be unreliable due to hidden characters. Try pasting it in in text mode.

    It looks like there is a syntax error in your template. Take a close look at it…they can be hard to spot.

    Thread Starter cristch_27

    (@cristch_27)

    At last. This is the solution I found and it works perfect.

    To page the following short code

    [pdb_list template=desktop]

    And for the template.

    <?php
    /*
     *
     * template for participants list shortcode output
     *
     * this is the default template which formats the list of records as a table
     * using shortcut functions to display the componenets
     *
     * If you need more control over the display, look at the detailed template
     * (pdb-list-detailed.php) for an example of how this can be done
     *
     * Please note that if you have more than one list on a page, searching, sorting
     * and pagination will not work correctly.
     *
    */
    ?>
    <div class="wrap <?php echo $this->wrap_class ?>">
    <?php global $current_user;
    	get_currentuserinfo();
    	echo do_shortcode('[pdb_list filter="user_login=' . $current_user->user_login . '"]');
    	echo 'Username: ' . $current_user->user_login . "\n";
    ?>
    </div>

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Template control panel for users’ is closed to new replies.