Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Awesome plugin, very versatile – I’m using it as an address book for business contacts.

    I’ve successfully added a Company field, and it’s not too hard, 23 additional lines over 5 files – lots of copy and paste. I do have a question though, how do I make the new column, added for the field, sortable on the All Staff Members admin page? The name field is sortable, I’d like to be able to sort by company. Also, is Name the only searchable field?

    Anyway… Brett, I can send you the 5 edited files to post somewhere for others to grab and edit. All they would need to do is Find & Replace “company” and change it to whatever they want. Or I could just post them here… pretty long though.

    Cheers.

    Thread Starter codzprc

    (@codzprc)

    I got it working, and I’m embarrassed to say the answer was really simple and obvious. I’m assuming pods stores the additional fields right in the user meta – because all I did to fix the issue was call metavalues instead of theuser, like so

    //these are the meta_keys for the fields (arrays are object, property. so e.g. $theuser->ID)
    	$default_columns = array(
    		array("theuser", "ID"),
    		array("theuser", "user_login"),
    		array("metavalues", "first_name"),
    		array("metavalues", "last_name"),
    		array("metavalues", "student_name"),

    That’s the only change that was needed and presto!

    Here’s the part of memberslist-csv.php that I edited, guess this is all it takes.

    //add student name column after last name
    $csvoutput = "id,username,firstname,lastname,student name,email,billing firstname,billing lastname,address1,address2,city,state,zipcode,country,phone,membership,initial payment,fee,term,joined,expires";
    
    	//these are the meta_keys for the fields (arrays are object, property. so e.g. $theuser->ID)
    	$default_columns = array(
    		array("theuser", "ID"),
    		array("theuser", "user_login"),
    		array("metavalues", "first_name"),
    		array("metavalues", "last_name"),
    		array("metavalues", "student_name"),
    		array("theuser", "user_email"),
    		array("metavalues", "pmpro_bfirstname"),
    		array("metavalues", "pmpro_blastname"),
    		array("metavalues", "pmpro_baddress1"),
    		array("metavalues", "pmpro_baddress2"),
    		array("metavalues", "pmpro_bcity"),
    		array("metavalues", "pmpro_bzipcode"),
    		array("metavalues", "pmpro_bzipcode"),
    		array("metavalues", "pmpro_bcountry"),
    		array("metavalues", "pmpro_bphone"),
    		array("theuser", "membership"),
    		array("theuser", "initial_payment"),
    		array("theuser", "billing_amount"),
    		array("theuser", "cycle_period")
    		//joindate and enddate are handled specifically below
    	);

    Didn’t even need the $student = get_user_meta( $theuser->ID, ‘student_name’, true );

    For those looking for how to display User field data, use

    <?php echo get_user_meta( $theuser->ID, 'field_name', true ); ?>

    I found this page, looking for the answer I just posted, so I thought it might help others.

    I’d like to see this as a standard feature of future PMP releases. First, an option to turn on expiration, then a conditional option that makes the membership expire on a given date, or you could choose after a certain amount of time. One or the other, or none at all.

    It makes a PMP more useful to sites that don’t operate year round. Classes, conferences, conventions – a bunch of organizations could benefit from the simple addition of Date of Expiration rather than your current stock countdown to expiry.

    Don’t get me wrong, I love that there’s a fix – I’m just not pleased I had to go looking for something that seems elementary to your end product. I’d go as far to Highlight that in your plug-in’s features once it’s fully implemented.

    You can change the background and logo of the maintenance page, in the dashboard sidebar, there’s a Maintenance tab. There’s nothing I see on my page that links back to the developer.

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