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->uid == $account->uid) {
$account->content['paid_adverts'] = array(
'#type' => 'user_profile_category',
'#title' => t('PayPal Paid Adverts'),
'#weight' => 6, // under History which is 5.
);
$account->content['paid_adverts']['subs'] = array(
'#type' => 'user_profile_item',
'#title' => t('Adverts you paid with us:'),
'#markup' => lm_paypal_paid_adverts_list_nodes($account->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?