Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

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

  • jarvo1980
    Member

    @jarvo1980

    Hi hnla, I personally like the way I’ve written it, I find it far easier to maintain the code and helps me be consistent throughout


    jarvo1980
    Member

    @jarvo1980

    Hi hnla, thanks for the reply, after a slight bit of tweaking, I found this worked:
    `<a href="”>

    `
    Cheers again


    jarvo1980
    Member

    @jarvo1980

    hi hnla, the while loop is already part of the file, it’s within the groups dir not the members dir, just incase this makes a difference?
    I’m also a bit puzzled by your code, all I wish to do is display the value of my field, your code looks like it says if it equals? Perhaps I’m wrong?
    TIA


    jarvo1980
    Member

    @jarvo1980

    Hi hnla,

    The above seems to work just fine for me. I created the custom profile field account type and then using the above I can do what I need too.

    Not sure if it helps anyone but certainly does the job for me!

    Thank you, your reply certainly kick started the grey matter!


    jarvo1980
    Member

    @jarvo1980

    Ah I think the penny has just dropped! I need to call it as a standard field value, then compare it. So:
    `

    standard

    premium

    `
    Unless there is an easier way?
    TIA


    jarvo1980
    Member

    @jarvo1980

    Hi hnla, I set it within the account registration page. So when you register, you select the account type.


    jarvo1980
    Member

    @jarvo1980

    For arguments sake, I’ve deleted the Nickname one and tried with another. Here’s my code incase I’m being a complete thicko
    `

    • <a href="”>

      <!


      >

      <?php
      $account_type= xprofile_get_field_data( ‘Account Type’,bp_get_member_user_id());
      if ($account_type== ‘Standard’) {
      echo ‘standard’;
      } else {
      echo ‘premium’;
      };
      ?>

      <?php $Street= xprofile_get_field_data( "Street");
      echo $Street;
      ?>

      <!


      >

       

    `

    The only thing that displays on the custom field front is the account_type of either Standard or Premium.


    jarvo1980
    Member

    @jarvo1980

    Yes, I’ve even tried with a couple of others. It’s so frustrating! And yes, it does also have text in the field ;-)


    jarvo1980
    Member

    @jarvo1980

    Sadly “ is a no go either. :-(


    jarvo1980
    Member

    @jarvo1980

    I tried “
    Is that what you meant? Otherwise not sure as it’s on the main loop page (groups/single/members.php)
    Thanks


    jarvo1980
    Member

    @jarvo1980

    Thanks Travel-Junkie. Yeah it’s odd, as it works for account type. I thought maybe it was the way I was echoing out the info. Hmmm…


    jarvo1980
    Member

    @jarvo1980

    Ooops sorry “ AND “
    Both to no avail..

    Oddly, this does work for one of my other custom fields though:
    `<?php
    $account_type= xprofile_get_field_data( ‘Account Type’,bp_get_member_user_id());
    if ($account_type== ‘Standard’) {
    echo ‘standard’;
    } else {
    echo ‘premium’;
    };
    ?>`
    Most confusing!!

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