• can the RSVP list output user names or avatars instead of first and last names. People last names are hidden on my site. can I change the output of RSVP.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author davidfcarr

    (@davidfcarr)

    So you’re requiring users to be logged in when they RSVP, and you want to change what is displayed when they click on Show Attendees, correct?

    The function that pulls the data to be displayed there is defined as a pluggable function, which means you can override it. You do this by adding your own version of the ajax_guest_lookup() function shown below to a rsvpmaker-custom.php file. You put that file in the plugins directory (the directory above the rsvpmaker folder).

    Here is how it is defined by default.

    if(!function_exists('ajax_guest_lookup') )
    {
    function ajax_guest_lookup() {
    if(!isset($_GET["ajax_guest_lookup"]))
    	return;
    $event = $_GET["ajax_guest_lookup"];
    global $wpdb;
    
    $sql = "SELECT first,last,note FROM ".$wpdb->prefix."rsvpmaker WHERE event=$event AND yesno=1 ORDER BY id DESC";
    $attendees = $wpdb->get_results($sql);
    echo '<div class="attendee_list">';
    foreach($attendees as $row)
    	{
    ;?>
    <h3 class="attendee"><?php echo $row->first;?> <?php echo $row->last;?></h3>
    <?php	
    if($row->note);
    echo wpautop($row->note);
    	}
    echo '</div>';
    exit();
    } }

    Change the sql statement to SELECT * or add user_id to the list of fields to be retrieved. You should then be able to use get_userdata to pull in the information you want to display.

    I probably should build in some filter functions to make this easier, but this is the option I can offer based on the current code.

    Plugin Author davidfcarr

    (@davidfcarr)

    Note that this answer only applies to the front end UI. The RSVP Report on the admin dashboard will still show first and last name. The function that outputs the RSVP Report is also pluggable. You’ll find it in rsvpmaker-pluggable.php

    Thread Starter donpooper

    (@donpooper)

    wow I just realized you answered this but great stuff. Thank you so much

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Screen names instead of First and Last name’ is closed to new replies.