Not sure what I am trying to achieve is possible, I want to replace the avatar pic in the User Block with an image however the url for the image will include {memberrow.custom_fields.CUSTOM_FIELD}
I have had a look at the block but got really confused :( :( :(
any help ??? :( :(
SOLVED - User Block Mod
Subject: SOLVED - User Block Mod
Last edited by n1cks21 on Sat 21 Feb, 2009 18:02; edited 1 time in total
Last edited by n1cks21 on Sat 21 Feb, 2009 18:02; edited 1 time in total
Subject: Re: User Block Mod
Yes thats the block, when a user logs in instead of showing there avatar picture I would like to diaplay an image from this url:-
"http://avatar.xboxlive.com/avatar/{memberrow.custom_fields.CUSTOM_FIELD}/avatar-body.png"
I think that {memberrow.custom_fields.CUSTOM_FIELD} is the Custom Profile Field I set.
this is the image that would be displayed if I signed in
which is "http://avatar.xboxlive.com/avatar/n1cks21/avatar-body.png"
hope thats make sense
Limun wrote: [View Post]
Yes thats the block, when a user logs in instead of showing there avatar picture I would like to diaplay an image from this url:-
"http://avatar.xboxlive.com/avatar/{memberrow.custom_fields.CUSTOM_FIELD}/avatar-body.png"
I think that {memberrow.custom_fields.CUSTOM_FIELD} is the Custom Profile Field I set.
this is the image that would be displayed if I signed in

which is "http://avatar.xboxlive.com/avatar/n1cks21/avatar-body.png"
hope thats make sense
Subject: Re: User Block Mod
youve got 2 possibilitys.
you can upload the avatar to your site or you enable gravatar and put the link to your avatar on your personal profil avatar managment
you can upload the avatar to your site or you enable gravatar and put the link to your avatar on your personal profil avatar managment
Subject: Re: User Block Mod
you can try like this
but i m not sure if its gona work because i dont know what did you add in Custom Profile Field
and i m not sure about this link
well try then we gona see :?
Spoiler: [ Show ]
but i m not sure if its gona work because i dont know what did you add in Custom Profile Field
and i m not sure about this link
http://avatar.xboxlive.com/avatar/{memberrow.custom_fields.CUSTOM_FIELD}/avatar-body.png
well try then we gona see :?
Subject: Re: User Block Mod
No It Didnt work :( when I clicked on the image link it was "http://avatar.xboxlive.com/avatar//avatar-body.png%3C/img%3E%3Cbr%20/%3E%3Cbr%20/%3E%3Cspan%20class=" so it obviously didnt know what {memberrow.custom_fields.CUSTOM_FIELD} was and I am not sure what all that junk is after the png, as a test I tried it in my memberlist_body.tpl :-
the image didnt show however the link was "http://avatar.xboxlive.com/avatar/n1cks21/avatar-body.png%3C/img%3E%20%20%20%20%20%20%20%3Ctd%20class="
which shows it did know what {memberrow.custom_fields.CUSTOM_FIELD} was it just didnt work because of all the junk after png
I dont want to upload the avatars to my site as members do change them every now and then and it would mean uploading them all the time.
hope that makes sense
<!-- BEGIN custom_fields -->
<td class="row1 row-center">{memberrow.custom_fields.CUSTOM_FIELD}</td>
img src="http://avatar.xboxlive.com/avatar/{memberrow.custom_fields.CUSTOM_FIELD}/avatar-body.png</img>
<!-- END custom_fields -->
<td class="row1 row-center">{memberrow.custom_fields.CUSTOM_FIELD}</td>
img src="http://avatar.xboxlive.com/avatar/{memberrow.custom_fields.CUSTOM_FIELD}/avatar-body.png</img>
<!-- END custom_fields -->
the image didnt show however the link was "http://avatar.xboxlive.com/avatar/n1cks21/avatar-body.png%3C/img%3E%20%20%20%20%20%20%20%3Ctd%20class="
which shows it did know what {memberrow.custom_fields.CUSTOM_FIELD} was it just didnt work because of all the junk after png
I dont want to upload the avatars to my site as members do change them every now and then and it would mean uploading them all the time.
hope that makes sense
Subject: Re: User Block Mod
remove memberrow. twice from this code
memberrow is used in the memberlist code and the variable is not used in the block...
let me know
:mrgreen: :mrgreen:
<!-- BEGIN custom_fields -->
<td class="row1 row-center">{memberrow.custom_fields.CUSTOM_FIELD}</td>
img src="http://avatar.xboxlive.com/avatar/{memberrow.custom_fields.CUSTOM_FIELD}/avatar-body.png</img>
<!-- END custom_fields -->
<td class="row1 row-center">{memberrow.custom_fields.CUSTOM_FIELD}</td>
img src="http://avatar.xboxlive.com/avatar/{memberrow.custom_fields.CUSTOM_FIELD}/avatar-body.png</img>
<!-- END custom_fields -->
memberrow is used in the memberlist code and the variable is not used in the block...
let me know
:mrgreen: :mrgreen:
Subject: Re: User Block Mod
I tried it in user_block_block, but got the same problem no picture and the URL was:-
"http://avatar.xboxlive.com/avatar//avatar-body.png%3C/img%3E%3Cbr%20/%3E%3Cbr%20/%3E%3Cspan%20class="
again it doesnt know what {custom_fields.CUSTOM_FIELD} is and I still dont know what all that junk is after the png "%3C/img%3E%3Cbr%20/%3E%3Cbr%20/%3E%3Cspan%20class="
DWho wrote: [View Post]
I tried it in user_block_block, but got the same problem no picture and the URL was:-
"http://avatar.xboxlive.com/avatar//avatar-body.png%3C/img%3E%3Cbr%20/%3E%3Cbr%20/%3E%3Cspan%20class="
again it doesnt know what {custom_fields.CUSTOM_FIELD} is and I still dont know what all that junk is after the png "%3C/img%3E%3Cbr%20/%3E%3Cbr%20/%3E%3Cspan%20class="
Subject: Re: User Block Mod
Have you added the php code into the block php file..?
otherwise it will not know where to call the information from...
otherwise it will not know where to call the information from...
Subject: Re: User Block Mod
Well for example in memberlist.php you have this code..
and
this pulls the info from your database and the template code you used above will then show the correct ode in the block...
you then need to find the code out of the above that fits the user_block.php file to show correctly...
hope the gives you a few hints..
:mrgreen: :mrgreen:
// Custom Profile Fields MOD - BEGIN
include_once($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
$profile_data = get_fields('WHERE view_in_memberlist = ' . VIEW_IN_MEMBERLIST . ' AND users_can_view = ' . ALLOW_VIEW);
foreach($profile_data as $field)
{
$template->assign_block_vars('custom_field_names', array('FIELD_NAME' => $field['field_name']));
}
$template->assign_var('NUMCOLS', count($profile_data) + 12);
// Custom Profile Fields MOD - END
include_once($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
$profile_data = get_fields('WHERE view_in_memberlist = ' . VIEW_IN_MEMBERLIST . ' AND users_can_view = ' . ALLOW_VIEW);
foreach($profile_data as $field)
{
$template->assign_block_vars('custom_field_names', array('FIELD_NAME' => $field['field_name']));
}
$template->assign_var('NUMCOLS', count($profile_data) + 12);
// Custom Profile Fields MOD - END
and
// Custom Profile Fields MOD - BEGIN
foreach($profile_data as $field)
{
$name = text_to_column($field['field_name']);
$sql2 = "SELECT $name FROM " . USERS_TABLE . "
WHERE user_id = $user_id";
if(!($result2 = $db->sql_query($sql2)))
message_die(GENERAL_ERROR,'Could not get custom profile data','',__LINE__,__FILE__,$sql2);
$val = $db->sql_fetchrow($result2);
$val = displayable_field_data($val[$name],$field['field_type']);
$template->assign_block_vars('memberrow.custom_fields',array('CUSTOM_FIELD' => $val));
}
// Custom Profile Fields MOD - END
foreach($profile_data as $field)
{
$name = text_to_column($field['field_name']);
$sql2 = "SELECT $name FROM " . USERS_TABLE . "
WHERE user_id = $user_id";
if(!($result2 = $db->sql_query($sql2)))
message_die(GENERAL_ERROR,'Could not get custom profile data','',__LINE__,__FILE__,$sql2);
$val = $db->sql_fetchrow($result2);
$val = displayable_field_data($val[$name],$field['field_type']);
$template->assign_block_vars('memberrow.custom_fields',array('CUSTOM_FIELD' => $val));
}
// Custom Profile Fields MOD - END
this pulls the info from your database and the template code you used above will then show the correct ode in the block...
you then need to find the code out of the above that fits the user_block.php file to show correctly...
hope the gives you a few hints..
:mrgreen: :mrgreen:
Subject: Re: User Block Mod
one question .
is that the size you want your avatar to apear ???
looks a bit big for me
is that the size you want your avatar to apear ???
looks a bit big for me
Subject: Re: User Block Mod
:shock: :shock: :shock: no hints just a headache hahahahahahahahahaha
maybe I should knock this idea on the head it's way to complicated for me :( :( shame nice idea though
DWho wrote: [View Post]
:shock: :shock: :shock: no hints just a headache hahahahahahahahahaha
maybe I should knock this idea on the head it's way to complicated for me :( :( shame nice idea though
Subject: Re: User Block Mod
Do you want everyone to have the same image...? or the image that gets placed in the users custom field if they have placed an image there...?
Subject: Re: User Block Mod
sorry, let me explain..... my site is an xbox 360 site and when members sign up they get asked for there xbox gamertag (custom field), anyone's xbox avatar can been seen at the url of "http://avatar.xboxlive.com/avatar/(gamertag)/avatar-body.png", the best example I can give is if you check My Site you can see my xbox avatar now, if/when I change my avatar through xbox live that picture automatically updates.
all I need to do is pull the info from the database from my Custom Field and insert it into the url, so that when a member signes in they have there own xbox avatar shown in user_block_block which sounds simply but I have no idea how :( :( :( :( :( :(
DWho wrote: [View Post]
sorry, let me explain..... my site is an xbox 360 site and when members sign up they get asked for there xbox gamertag (custom field), anyone's xbox avatar can been seen at the url of "http://avatar.xboxlive.com/avatar/(gamertag)/avatar-body.png", the best example I can give is if you check My Site you can see my xbox avatar now, if/when I change my avatar through xbox live that picture automatically updates.
all I need to do is pull the info from the database from my Custom Field and insert it into the url, so that when a member signes in they have there own xbox avatar shown in user_block_block which sounds simply but I have no idea how :( :( :( :( :( :(
Page 1 of 4
You cannot post new topicsYou cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events
This is a "Lo-Fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by Icy Phoenix based on phpBB
Generation Time: 0.9257s (PHP: 2% SQL: 98%)
SQL queries: 16 - Debug Off - GZIP Enabled