SOLVED - User Block Mod


Goto page Previous  1, 2, 3, 4  Next

Subject: Re: User Block Mod
I understand exactly what you are wanting to do. I have an Xbox themed website as well and I used to use the Xbox LIVE Gamercard MOD on my site.

I was thinking you could adapt a few changes in the MOD I'm about to post that may give you the results you want. Wherever you see offical Xbox codes, replace them with the avatar codes you have. It's a lengthy MOD and you'll have to find things that aren't easily found using FIND. I was going to perfect this MOD for IP and release it here if the original MOD author would get back to me.

Give it a try, but make sure you back up all files that you edit.

Spoiler: [ Show ]

Subject: Re: User Block Mod
thanks Chaotic I will give it a try, I am not very confident around IP but am willing to try...... at least you understand what I am trying to do, I am not very good at explaining things......

Nick

Subject: Re: User Block Mod
You also need to make these changes after installing the MOD. Be aware that you'll be using iFrame. It's recommended you don't use this code, so please use at your own risk. We won't be held responsible for any harm that may come of adding these codes!

To display the gamercard in profile:

OPEN: /includes/usercp_viewprofile.php

FIND:

Code: [Download] [Hide] [Select]
[code linenumbers=false]'GAMERTAG' => ( $profiledata['user_gamertag'] ) ? $profiledata['user_gamertag'] : ' ',[/code]


REPLACE WITH:

Code: [Download] [Hide] [Select]
'GAMERTAG' => ( $profiledata['user_gamertag'] ) ? '<iframe src="http://gamercard.xbox.com/' . $profiledata['user_gamertag']. '.card" scrolling="no" frameBorder="0" height="140" width="204"></iframe>' :'',


To display gamercard in viewtopic:

OPEN: /viewtopic.php

FIND:

Code: [Download] [Hide] [Select]
$poster_gamertag = ( $postrow[$i]['user_gamertag'] && $postrow[$i]['user_id'] != ANONYMOUS ) ? $lang['Gamertag'] . ': ' . $postrow[$i]['user_gamertag'] : '';


REPLACE WITH:

Code: [Download] [Hide] [Select]
$poster_gamertag = ( $postrow[$i]['user_gamertag'] && $postrow[$i]['user_id'] != ANONYMOUS ) ? '<iframe src="http://gamercard.xbox.com/' . $postrow[$i]['user_gamertag'] . '.card" scrolling="no" frameBorder="0" height="140" width="204">' . $postrow[$i]['user_gamertag'] . '</iframe>' : '';

Subject: Re: User Block Mod
Thanks Chaotic...saved me from going through files...

:mrgreen: :mrgreen:

Subject: Re: User Block Mod
No problem!

This will surely work for someone wanting to add their Xbox LIVE Avatar. All you gotta do is replace the iFrame code I bet.

Subject: Re: User Block Mod
I am a bit confused, :oops: :oops:

does the above code give me a Gamertag field ??? becuase I have one already that I created in Custom fields, and is shown correctly in memberlist see below :-

avatar0

what I want to do is have my user_block_block

look like this when your not signed in (which is how it looks now)

avatar1

and look like this when you are signed in (but with your own xbox avatar) the below was done using photoshop to give u an idea of what I am after

avatar2

I only want the xbox avatar shown in the user_block_block

Last edited by n1cks21 on Sun 15 Feb, 2009 18:59; edited 1 time in total
Subject: Re: User Block Mod
That is totally my fault. I saw your topic title and it does say User Block.

I was thinking you wanted to show your Xbox LIVE Avatar on viewtopic, but you wanted it to replace the avatar in the User Block. :(

Subject: Re: User Block Mod
partial success, I have managed to make it work in the memberlist_body, but that is only becuase {memberrow.custom_fields.CUSTOM_FIELD} has been defined there, what I need to do is query the database in user_block_block but I am not sure how :oops: :oops: :oops: :oops:

Inactive User
Subject: Re: User Block Mod
Im not sure what this Gamer thing is But!

Try this:

Copy avatar-body.png To /images/avatar-body.png


Spoiler: [ Show ]

Subject: Re: User Block Mod
if Lobalongs code does not work (though I am sure it will) I will have a look as I have place custom fields code in another file recently... to pi**ed at the moment to concentrate on it..

:mrgreen: :mrgreen:

Subject: Re: User Block Mod
Lopalong, your code worked however the link I need to use for the avatar is :-

"http://avatar.xboxlive.com/avatar/ custom field value for the user /avatar-body.png"

The contents of my custom field is each members gamertag (xbox name) which they are required to enter when they register mine is n1cks21

so my xbox avatar link is "http://avatar.xboxlive.com/avatar/n1cks21 /avatar-body.png"

I have used this link "http://avatar.xboxlive.com/avatar/ {memberrow.custom_fields.CUSTOM_FIELD} /avatar-body.png" in the members screen with the following results :-

a different avatar pic for each member :mryellow: :mryellow:

avatar3


I need to use your code with my link, sql needs to be queried for the vale of the custom field for the member logging in and that value to be entered into the link "http://avatar.xboxlive.com/avatar/custom field value /avatar-body.png"

sorry I dont know how else to explain it :( :( :(

Inactive User
Subject: Re: User Block Mod
Not sure where we're at with this, but try the script below as it includes the string you use elsewhere with the spaces removed.

Code: [Download] [Hide] [Select]
AFTER ADD:


if( $userdata['session_logged_in'] )
$template->assign_vars(array(
'AVATAR_IMG' => '<img src="h**p://avatar.xboxlive.com/avatar/{memberrow.custom_fields.CUSTOM_FIELD}/avatar-body.png" alt=""/>',
'U_NAME_LINK' => $name_link,
'L_REMEMBER_ME' => $lang['Remember_me'],
'L_SEND_PASSWORD' => $lang['Forgotten_password'],
'U_SEND_PASSWORD' => append_sid(PROFILE_MG . '?mode=sendpassword'),
'L_REGISTER_NEW_ACCOUNT' => sprintf($lang['Register_new_account'], '<a href="' . append_sid(PROFILE_MG . '?mode=register') . '">', '</a>'),
'L_NEW_SEARCH' => $lang['Search_new'])
);


If you get any errors about "Unexpected whatever" then try this string. Either way let us know what happens.

<img src="h**p://avatar.xboxlive.com/avatar/' . {memberrow.custom_fields.CUSTOM_FIELD} . '/avatar-body.png" alt=""/>



Arrivederci! Now I'm out of here for a couple of months or maybe longer. ;)

Subject: Re: User Block Mod
Lopalong wrote: [View Post]
Arrivederci! Now I'm out of here for a couple of months or maybe longer. ;)


:mryellow: :mryellow: Well thanks for all your help

The above link didnt work :( but I am pretty sure it's because "{memberrow.custom_fields.CUSTOM_FIELD}" has no value, I am sure there should be some sort of sql query before the above code giving "{memberrow.custom_fields.CUSTOM_FIELD}" it's value.

Subject: Re: User Block Mod
Ok I got this to work for you

here is the code let me know... replace all the code in blocks/blocks_imp_user_block.php with

Spoiler: [ Show ]


open templates/YOUR TEMPLATE/blocks/user_block_block.tpl

and replace all the code with

Spoiler: [ Show ]


Goto admin and set the field to whatever you are calling it...

Field Type text
Viewable in User Profile yes
These options are for if this field is to be viewed in the user's profile. about column

and save

you just have to add your name to the text box you have created so for you it would be n1cks21

but I am not sure if you can create any more custom fields now though

logged out

logged_out

logged in

logged_in


Let me know

:mrgreen: :mrgreen: :mrgreen:

Last edited by DWho on Mon 16 Feb, 2009 21:48; edited 1 time in total
Subject: Re: User Block Mod
Thanks for looking at this for me, It still doesnt work however it doesnt give me any errors either, basically when you log in it puts you on the profile page and not the home page, if you click on home page, you simply get the users login name ??? I had already created a custom field and it was already set as

Field Type text
Viewable in User Profile yes


avatar4

Goto page Previous  1, 2, 3, 4  Next

Page 2 of 4


  
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

   

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.4819s (PHP: 7% SQL: 93%)
SQL queries: 31 - Debug Off - GZIP Enabled