Sub Menu
Links Menu
Online Users

In total there are 303 users online :: 2 registered, 0 hidden and 301 guests

Most users ever online was 1091 on Wed Aug 16, 2023 5:27 pm

Registered users: Bing [Bot], Google [Bot] based on users active over the past 60 minutes

Xbox Live Gamertag

This forum contains member submitted mods and hacks for IntegraMOD/IM Portal versions

*please read the "Read Me" post*

Moderator: Integra Moderator

Xbox Live Gamertag

PostAuthor: Pogue Moran » Tue Feb 13, 2007 7:19 am

Your phpBB Version: 2.0.22
phpBB Type: Standard phpBB
MODs: Yes
Your knowledge: Beginner
Board URL: [url]http://[/url]

PHP Version:
MySQL Version:


What was done before the problem appeared?



What was done to try to solve the problem?




De.scription and Message

This isn't exactly fully my code I remember getting it off the phpbb site but I modified it a bit to work with PCP.
Please note I haven't had a chance to try this with Integramod yet as some things in PCP have changed in IM that I haven't checked out yet. This was done for PHPbb plus with PCP installed.

Anyway here are the additions:

In Def_userfuncs_custom.php add before ?>
Code: Select all
//----------------------------------- // //  Xbox Gamertag // //----------------------------------- function pcp_output_gamertag($field_name, $view_userdata, $map_name='') {    global $board_config, $phpbb_root_path, $phpEx, $images, $userdata;    global $values_list, $tables_linked, $classes_fields, $user_maps, $user_fields;      $txt = '';    $img = '';    $res = '';    $gamertag = '';    $sendmessage = '';    $addgamer = '';           $gamertag = ( $view_userdata['user_gamertag'] && $view_userdata['user_id'] != ANONYMOUS ) ? '<iframe>' . $view_userdata['user_gamertag'] . '</iframe>' : '';;                $sendmessage = ( $view_userdata['user_gamertag'] && $view_userdata['user_id'] != ANONYMOUS ) ? '<a><img>'  : '';;                $addgamer = ( $view_userdata['user_gamertag'] && $view_userdata['user_id'] != ANONYMOUS ) ? '<a><img>'  : '';;  if ( $view_userdata['user_id'] != ANONYMOUS )    {                $img = $gamertag . '<br>' . $addgamer . ' ' . $sendmessage;    }       // result       $res = pcp_output_format($field_name, $txt, $img, $map_name);    return $res; }


What this above code will show is the xbox gamertag from the xbox site that links your last few games played as well as the gamerscore and etc. Also it will show buttons for sending a friend request through the xbox site and a message to the gamer. This part above will be used for the profile.

If you dont want the buttons with the friends request and message link then add the below code instead to def_userfuncs_custom.php. I use both.
Code: Select all
//----------------------------------- // //  Xbox Gamertag // //----------------------------------- function pcp_output_gamertagt($field_name, $view_userdata, $map_name='') {    global $board_config, $phpbb_root_path, $phpEx, $images, $userdata;    global $values_list, $tables_linked, $classes_fields, $user_maps, $user_fields;      $txt = '';    $img = '';    $res = '';   if ( $view_userdata['user_id'] != ANONYMOUS ) {           $img = ( $view_userdata['user_gamertag'] && $view_userdata['user_id'] != ANONYMOUS ) ? '<iframe>' . $view_userdata['user_gamertag'] . '</iframe>' : '';;        }       // result       $res = pcp_output_format($field_name, $txt, $img, $map_name);    return $res; }


I use the above code for viewtopic and the previous one for the profile view anyone with more experience can help clean this up so you don't need two separate entries in the def_userfuncs_custom.php.

in def_userfields.php
Code: Select all
FIND:      'user_gender' => array(         'lang_key'     => 'Gender',         'class'        => 'real',         'type'         => 'TINYINT',         'dsp_func'     => 'pcp_output_gender',         'get_mode'     => 'LIST_RADIO',         'values'       => 'list_gender',     ),Add After     'user_gamertag' => array(         'lang_key'     => 'Xbox Gamertag',         'class'        => 'real',         'type'         => 'VARCHAR'         ),  


In Def_usermaps.php note in the profile view you don't have to put the gamertag where I put it. I like it right under the user title in the avatar view section.
Code: Select all
Find 'PCP.viewprofile.base.avatar' => array(Find         'user_rank_title' => array(                 'txt'          => true,                 'img'          => true,                 'crlf'         => true,                 'style'        => '<span>%s</span>',             ),  ADD AFTER     'user_gamertag' => array(                 'leg'          => true,                 'txt'          => true,                 'img'          => true,                 'dsp_func'     => 'pcp_output_gamertag',                 ),  FIND     'PCP.viewprofile.base.real' => array(  FIND    'user_occ' => array(                 'leg'          => true,                 'txt'          => true,             ),ADD AFTER     'user_gamertag' => array(                 'leg'          => true,                 'txt'          => true,                 ),FIND 'PCP.profil.profile_prefer.base.Real_info' => array(  FIND    'user_occ' => array(                 'input_id'     => 'occupation',                 'user_only'    => true,             ),  ADD AFTER       'user_gamertag' => array(                             'input_id'     => 'Xbox Gamertag',                       'user_only'    => true,     ),  FIND 'PCP.buddy' => array(FIND 'username' => array(                 'dsp_func'     => 'pcp_output_username_linked',                 'lang_key'     => 'Username',                 'ind'          => '2',                 'rqd'          => true,             ),ADD AFTER   'user_gamertag' => array(                 'ind'          => '28',                 'lang_key'     => 'Gamertag',             ),FIND     'PHPBB.viewtopic.left' => array(  You can add the following anywhere in the viewtopic left array       'user_gamertag' => array(                 'class'        => 'generic',                 'type'         => 'VARCHAR',                 'dsp_func'     => 'pcp_output_gamertagt',                 'img'          => true,                 'style'        => '<div>%s</div>',             ),            


Please note if you were using only the first code the dsp_func in viewtopic.left would be set to pcp_output_gamertag

[url=http]You can get the images mentioned in the above code here:[/url]

Also add the following to your phpbb_users table of your database

Field: user_gamertag Type: varchar Length: 25 NULL Default: NULL
Last edited by Pogue Moran on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
User avatar
Pogue Moran
Members
Members
 
Posts: 74
Likes: 0 post
Liked in: 0 post
Joined: Sat Jun 24, 2006 4:48 pm
Cash on hand: 0.00

Re: Xbox Live Gamertag

PostAuthor: Taegost » Sun Jul 01, 2007 11:29 am

Just so everyone knows, this code works perfectly under 1.4.0, I have it up and running on my site by copy/pasting everything exactly as it is here.
Thanks for this code, it's greatly appreciated!
Last edited by Taegost on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
http://www.thetampasportsguys.com
Forging the Future in Sports
User avatar
Taegost
Newbie
Newbie
 
Posts: 11
Likes: 0 post
Liked in: 0 post
Joined: Wed Apr 26, 2006 6:49 pm
Cash on hand: 0.00

PostAuthor: zenrei » Tue Sep 18, 2007 3:22 am

works great in 141 too!

my members LOVE it!
Last edited by zenrei on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
IntegraMOD 141 RULES!!
[img=left]http://www.falloutzone.net/foz/images/smiles/attentionwhore.gif[/img]

[url=http]Click here to go to my site built with IntegraMOD 141[/url] <img>
User avatar
zenrei
Sr Integra Member
Sr Integra Member
 
Posts: 286
Likes: 0 post
Liked in: 0 post
Joined: Mon Oct 09, 2006 7:36 am
Cash on hand: 0.00


Return to Mods/Hacks

Who is online

Registered users: Bing [Bot], Google [Bot]

cron