template integration documentation needs help
scarer - July 13, 2007 - 06:23
| Project: | Meez Integration |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Hi,
I was wondering if anyone could help me with getting the Meez module running?
I have a profile field called profile_meez
I have added the following function to template.php
function theme_user_meez($account,$version) {
if ($account->data['avatars'][$version]->src) {
$picture = $account->data['avatars'][$version]->src;
}
else if (variable_get('user_picture_default', '')) {
$picture = variable_get('user_picture_default', '');
}
if (isset($picture)) {
$alt = t("@user's profile", array('@user' => $account->name ? $account->name : variable_get('anonymous', t('Anonymous'))));
$picture = theme('image', $picture, $alt, $alt, '', FALSE);
if (!empty($account->uid) && user_access('access user profiles')) {
$picture = l($picture, "user/$account->uid", array('title' => t("View @user's profile.", array('@user' => $account->name))), NULL, NULL, FALSE, TRUE);
}
return "<span class=\"picture\">$picture</span>";
}
}But I am bit stuck on how to call the function in template from the user_profile.tpl.php file. I am just printing out the text field to test if the profile field value is being stored. It is. This is the code I have.
<? //Call theme_user_meez($account,$version) function to display user's meez character
$meezResult .= $user->profile_meez;
//$meezResult .= 'testing meez output';
print ('Meez name: ' . $meezResult);
?>How do I modify it to show the user's meez avatar?
Any help would rock.
Cheers,
Sarah

#1
I believe you need to do two things:
1. function theme_user_meez($account,$version) { should be
function phptemplate_user_meez($account,$version) {
2. Make your template like:
$meezResult = theme('user_meez', $user,'string_of_version');print ('Meez name: ' . $meezResult);
Let me know how it goes.
I changed the title of the issue because I hope that when we fix this for you we can improve the documentation to make this module easier to use.
#2
hi
#3
I just made a small update to the README.txt to make this easier.
See also http://drupal.org/node/203281#comment-667869 which makes this easier to implement without all the theming gobbledygook.
Vishnu12 - don't randomly reassign issues unless you plan to work on them.
#4
and unassigning.
Given that this is no longer a necessary step and given that I did clean up the docs a little, I'm going to mark this issue fixed.
#5
Automatically closed -- issue fixed for two weeks with no activity.
#6
Also see http://drupal.org/node/321908