How do I extract individual fields from rendered user? I am developing a community website. We have two separate types of members -- regular members and business members. Business members can access subscription options to sponsor the chapter (website) but the members are not able to access these subscriptions.

I am using lm_paypal for the subscriptions, as it seems to do just what we need it to do.

My only problem is that lm_paypal hardcodes their information in the user profile. THere are three blocks it places on the user profile (or rendered user): a donations block, an active subscriptions block and a block to allow you to subscribe and unsubscribe from subscriptions.

Here is the function in lm_paypal_paid_averts that does this (I think!)

/**
* Implements hook_user_view().
*/
function lm_paypal_paid_adverts_user_view($account, $view_mode) {
global $user;

// In the "my account" view area show all paid_adverts
if (user_access('administer lm_paypal') || $user-&gt;uid == $account-&gt;uid) {
$account-&gt;content['paid_adverts'] = array(
  '#type' =&gt; 'user_profile_category',
  '#title' =&gt; t('PayPal Paid Adverts'),
  '#weight' =&gt; 6, // under History which is 5.
);
$account-&gt;content['paid_adverts']['subs'] = array(
  '#type' =&gt; 'user_profile_item',
  '#title' =&gt; t('Adverts you paid with us:'),
  '#markup' =&gt; lm_paypal_paid_adverts_list_nodes($account-&gt;uid, 10),
);
 }
}


The only way I can see to display this information is by using the "Rendered User" field in Panels, which displays a lot of other things, including history, recent content, etc. It also displays it on all user profiles, regardless of whether the user can actually access the subscriptions or not (my members can click on the link, but they get access denied page). I would like to have the subscription blocks showing only on the business member profiles and the donation blocks showing on all profiles.

What I need is a way to pull out just this lm_paypal information from the rendered user so that I can display it in its own block and set access control on it so only business members can actually see the subscriptions. 

I've been googling for an answer to this for almost a week and found a few different solutions that may work, but require extra modules to be installed and it seems like a lot of extra weight for just needing a piece of a whole. I've found some answers regarding placing code in places, but I have to admit, I'm so close to having this presentable, I'm slightly terrified of trying too many things and somehow messing up. I've built this site myself, starting with no experience at all, and I've had many ups and downs along the way... I am terrified being this close to done and doing something to mess it up and not be able to recover it.

So I am hopeful that someone here can give me a clear answer where I don't have to make guesses and assumptions and perhaps mess myself up!

Is there a way to pull these fields from the user profile and print them separately in their own block?
A lightweight custom module to create a block for your business members and one for your regular members should do it. Creating a custom block isn't as daunting as it seems, it's one of the easier customizations you can do. The Block API should be very helpful here. Here's a quick example:

 /* Implements hook_block_info() */

function myblock_block_info() {
  $blocks['my block'] = array(
    'info' =&gt; t('Business User Block'),
    'cache' =&gt; DRUPAL_CACHE_PER_PAGE
  );
  return $blocks;
}


/* Implements hook_block_save() */

function myblock_block_save($delta = '', $edit = array()) {
  variable_set('block_text_prefix', $edit['block_text_prefix']);
  variable_set('block_text_suffix', $edit['block_text_suffix']);

}

/* Implements hook_block_view() */
function myblock_block_view($delta = '') {
  //get the information you want out of the profile here
  $block['content'] = //your information formatted here
}




Devel info:

If you double click on a row in the devel table, it will tell you how to reference it: