Support » Fixing WordPress » [Plugin: Users to CSV] Export extra fields

  • Dana

    (@danaparkinson)


    Do any of you have an idea how I can export extra fields? Currently the plugin only exports the standard data. I’ve used Register-Plus to add the extra fields. Any idea how to have it set up nicely in Excel? Currently I can only open the data in Notepad.

Viewing 3 replies - 1 through 3 (of 3 total)
  • I need the same thing (extra fields in RegisterPlus). Did anyone ever answer your question?

    As for opening the CSV files in Excel. All you should need to do is associate CSV files with Excel directly by modifing the “Open With” and saying always use this app.

    Brian

    Me too! I would really like to know how to export the extra data, so ALL the data pertaining to each user is in the one spreadsheet. If anyone can help here, that would be brilliant.

    Ok I found a little work around. Its not very clean I suppose, but I am not a coder. This works with the extra fields from cimy. I suppose it should also be easy to adjust this for Register Plus.

    Ok here we go for the modifications of the users2csv.php file (Version 1.4.2):

    Line 149 add to the following array the additional fields you would like to have:

    $fields = array('URL','E-Mail','URL','Display Name','Registration Date','First Name','Last Name','Nickname');

    example:
    $fields = array('URL','E-Mail','URL','Display Name','Registration Date','First Name','Last Name','Language','Adress','Zip Code','City','Country','Phone');

    Be sure these extra fields have been created in Cimy or Register Plus

    Line 169:
    Below this Line add a new query to query the table from cimy or Register Plus:

    Line 169
    $query = "SELECT meta_value FROM ".$wpdb->prefix."usermeta WHERE user_id = ".$results[$i]['UID']." AND meta_key = ";
    
    Added query example for cimy:
    $query2 = "SELECT value FROM ".$wpdb->prefix."cimy_uef_data WHERE user_id = ".$results[$i]['UID']." AND field_id = ";

    Now add after Line 175/176 `
    $nnquery = $query . “‘nickname'”;
    $results[$i][‘nickname’] = $wpdb->get_var($nnquery);`

    The new queries for your extra fields (example):

    $langquery = $query2 . "'1'";
    $results[$i]['1'] = $wpdb->get_var($langquery);
    $streetquery = $query2 . "'3'";
    $results[$i]['3'] = $wpdb->get_var($streetquery);
    $codequery = $query2 . "'4'";
    $results[$i]['4'] = $wpdb->get_var($codequery);

    The numbers are the field_id from cimy. Check them through phpmyadmin.
    Hope someone may understand this. At least it works for me 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Users to CSV] Export extra fields’ is closed to new replies.