Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

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

  • tipsy
    Participant

    @tipsy

    Here is were I am at the moment:

    
    <?php 
    	$field = xprofile_get_field_data(2, $user_id); 
    	$data = wp_excel_cms_get("EXCEL");
    	if ($field == $data);  {
    	echo get_avatar( get_current_user_id(2, $user_id) ); 
    	}
    ?>
    

    tipsy
    Participant

    @tipsy

    @danbp

    xprofile_get_field_data(2) where 2 = field id, this is not the entered value. For what do you need each member to give a number ?

    I need every player to enter their play-number.

    The field has an ID and a value. What you need is the value, not the ID as all user use the same field ID to enter a number.

    This means if field ID 2 contains 35 or other value, do something and if empty do nothing or else.

    xprofile_get_field_data fetch a value, let’s say 35 (as example)

    Your document has a var $entry[35] with 35 in array.

    User Igor registered on the site with a user ID of 2156. Completed his profile and entered number 35. Igor’s avatar is generated by Gravatar.

    Have to read this ten more times, I’m to new to this, I’ll be back 🙂

    What i don’t understand for the moment is the relation between the document and Igor !

    In the excel file I get points from other players, with results. This is were I need to connect number with number.

    The usage example given by the author let me doubt that you can bind a user in a excel tab with a BP user avatar, at least because the doc is not stored in the DB, but only screen readable.

    Have to google on this subject.


    tipsy
    Participant

    @tipsy

    @danbp Sorry If I’m blurry, been sitting on and of with this since yesterday 🙂

    1. I have 90 users/subscribers.

    2. All users are forced to write a number when they registerer. This I force them to do with BuddyPress Profile Fields. This field have the id 2, xprofile_get_field_data(2)

    2. I have a plugin “WP Excel CMS” were I render out a excel-document with information on a page. Here I also have numbers. And the value of this cells are $entry[1]

    3. Now when I have xprofile_get_field_data(2) and $entry[1] I want to echo get_avatar() of the $user_id in the database who have this number match.


    tipsy
    Participant

    @tipsy

    @danbp just realized. The $user_id isn’t getting rendered at the page somewhere on the pages. It is just in the database, can this be a part of the problem?


    tipsy
    Participant

    @tipsy

    thank you @danbp I will start right away!

    Here is were I am now (not working):

    
    <?php
    if ($entry[1] == xprofile_get_field_data(2, $user_id));  {
         echo bp_core_fetch_avatar($user_id);
    }  
    ?>
    

    tipsy
    Participant

    @tipsy

    @henrywright So I’m trying to get this right, this starting to get more and more fun, even if it doesnt work 🙂

    I say if ($entry[1] is the same as == Profile fields 2 (that the user have been forced to write in that field xprofile_get_field_data(2) ); render avatar from the $user_id that match echo get_avatar($field);

    Is this right thinking? But who do I get the $user_id in?

    This is my none working code for now. (This one is still spits out the default-avatar but doesn’t grab the users avatar)

    
    <?php  
    if ($entry[1] == xprofile_get_field_data(2));  {
         echo get_avatar($field);
    } 
    ?>
    

    tipsy
    Participant

    @tipsy

    Yes thank you @danbp, that were useful. Version 01 is working but I’m kinda stuck in another task. So I open a new question now!


    tipsy
    Participant

    @tipsy

    This solved it:

    $field = xprofile_get_field_data(2, $user_id); 
    echo '' . $field . '';

    If someone have a better solution, shoot!

Viewing 8 replies - 1 through 8 (of 8 total)
Skip to toolbar