|
Page 1 of 4
|
n1cks21 
Joined: May 2008
Posts: 99
Location:
|
 SOLVED - User Block Mod
Last edited by n1cks21 on Sat 21 Feb, 2009 18:02; edited 1 time in total |
#1 Tue 10 Feb, 2009 18:52 |
|
Sponsors

|
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.
|
|
Limun 
Joined: January 2008
Posts: 1334
Location: ![[Censor] (Croatia) croatia.png](images/flags/croatia.png) [Censor]
|
 Re: User Block Mod
are we talking about this user block?
what you want to do exactly ?
____________ We are the phpBBorg. Lower your Crackers. Your phpological and forumological distinctivness will be added to our own. Resistance if futile!
|
#2 Fri 13 Feb, 2009 16:30 |
|
n1cks21 
Joined: May 2008
Posts: 99
Location:
|
 Re: User Block Mod
are we talking about this user block?
what you want to do exactly ?
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
|
#3 Sat 14 Feb, 2009 00:43 |
|
spydie 
Joined: December 2008
Posts: 1796
Location:  In the Boxes
|
 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
____________ Out of Order
|
#4 Sat 14 Feb, 2009 00:48 |
|
Limun 
Joined: January 2008
Posts: 1334
Location: ![[Censor] (Croatia) croatia.png](images/flags/croatia.png) [Censor]
|
 Re: User Block Mod
you can try like this
<!-- IF S_LOGGED_IN -->
<table class="empty-table" width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td align="center">
<br /><img src="http://avatar.xboxlive.com/avatar/{memberrow.custom_fields.CUSTOM_FIELD}/avatar-body.png</img><br /><br />
<span class="name">{U_NAME_LINK}</span><br />
<span class="gensmall">{LAST_VISIT_DATE}</span><br />
<span class="gensmall"><a href="{U_SEARCH_NEW}">{L_NEW_SEARCH}</a></span><br /><br />
</td>
</tr>
</table>
<!-- ELSE -->
<form method="post" action="{S_LOGIN_ACTION}">
<table class="empty-table" width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td align="center">
<br />
<img src="http://avatar.xboxlive.com/avatar/{memberrow.custom_fields.CUSTOM_FIELD}/avatar-body.png</img><br /><br /><span class="gensmall">
<input type="hidden" name="redirect" value="{U_PORTAL}" />
{L_USERNAME}:<br />
<input class="post" type="text" name="username" size="15" />
<br />
{L_PASSWORD}:<br />
<input class="post" type="password" name="password" size="15" />
<br />
</span>
<!-- BEGIN switch_allow_autologin -->
<br />
<input class="text" type="checkbox" name="autologin" /><span class="gensmall"> {L_REMEMBER_ME}</span><br />
<!-- END switch_allow_autologin -->
<br/>
<input type="submit" class="mainoption" name="login" value="{L_LOGIN}" /><br /><br />
<a href="{U_SEND_PASSWORD}" class="gensmall">{L_SEND_PASSWORD}</a><br /><br />
<span class="gensmall">{L_REGISTER_NEW_ACCOUNT}</span><br /><br />
</td>
</tr>
</table>
</form>
<!-- ENDIF -->
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
____________ We are the phpBBorg. Lower your Crackers. Your phpological and forumological distinctivness will be added to our own. Resistance if futile!
|
#5 Sat 14 Feb, 2009 01:12 |
|
n1cks21 
Joined: May 2008
Posts: 99
Location:
|
 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 :-
<!-- 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 -->
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
|
#6 Sat 14 Feb, 2009 04:05 |
|
DWho 
Joined: August 2006
Posts: 1307
Location:  hampshire
|
 Re: User Block Mod
remove memberrow. twice from this code
<!-- 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 -->
memberrow is used in the memberlist code and the variable is not used in the block...
let me know
____________ Mods and themes for Icy Phoenix 1.3
IcyPhoenix UK is off-line permanently due to lack of time to update mods.
if anyone is interested in my templates I will upgrade them to Icy 2.0.
|
#7 Sat 14 Feb, 2009 11:33 |
|
n1cks21 
Joined: May 2008
Posts: 99
Location:
|
 Re: User Block Mod
remove memberrow. twice from this code
<!-- BEGIN custom_fields -->
<td class="row1 row-center">{memberrow.custom_fields.CUSTOM_FIELD}</td>
img src="http://avatar.xboxlive.com/avatar/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

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="
|
#8 Sat 14 Feb, 2009 12:21 |
|
DWho 
Joined: August 2006
Posts: 1307
Location:  hampshire
|
 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...
____________ Mods and themes for Icy Phoenix 1.3
IcyPhoenix UK is off-line permanently due to lack of time to update mods.
if anyone is interested in my templates I will upgrade them to Icy 2.0.
|
#9 Sat 14 Feb, 2009 13:50 |
|
n1cks21 
Joined: May 2008
Posts: 99
Location:
|
 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...
erm.... no  which php code ????
|
#10 Sat 14 Feb, 2009 14:13 |
|
DWho 
Joined: August 2006
Posts: 1307
Location:  hampshire
|
 Re: User Block Mod
Well for example in memberlist.php you have this code..
// 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
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
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..
____________ Mods and themes for Icy Phoenix 1.3
IcyPhoenix UK is off-line permanently due to lack of time to update mods.
if anyone is interested in my templates I will upgrade them to Icy 2.0.
|
#11 Sat 14 Feb, 2009 17:40 |
|
spydie 
Joined: December 2008
Posts: 1796
Location:  In the Boxes
|
 Re: User Block Mod
one question .
is that the size you want your avatar to apear ???
looks a bit big for me
____________ Out of Order
|
#12 Sat 14 Feb, 2009 18:31 |
|
n1cks21 
Joined: May 2008
Posts: 99
Location:
|
 Re: User Block Mod
Well for example in memberlist.php you have this code..
// 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
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
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..

 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
|
#13 Sat 14 Feb, 2009 19:43 |
|
DWho 
Joined: August 2006
Posts: 1307
Location:  hampshire
|
 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...?
____________ Mods and themes for Icy Phoenix 1.3
IcyPhoenix UK is off-line permanently due to lack of time to update mods.
if anyone is interested in my templates I will upgrade them to Icy 2.0.
|
#14 Sat 14 Feb, 2009 20:08 |
|
n1cks21 
Joined: May 2008
Posts: 99
Location:
|
 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...?
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
|
#15 Sat 14 Feb, 2009 22:49 |
|
|
Page 1 of 4
|
Was this topic useful?
Was this topic useful?
Link this topic |
URL |
|
BBCode |
|
HTML |
|
You cannot post new topics You 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
|
|
|
|