TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,004
  • Total Topics: 21,330
  • Online today: 125
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 106
  • Total: 106

Automaic Sigs

Started by PapaLazarou84, July 19, 2006, 10:59:41 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

PapaLazarou84

I have an XBox 360 site and I want to have a gamercard automatically assigned to each member using the custom profile Gamertag, so when they join it's takes the info from Gamertag and assigns them there uniques gamercard.

WiiPlay360Leagues

akulion

#1
That will require you to create edit some files for your specific needs...here are the instructions for it......

I can help you out if there are a 'set number' of cards specified by default...but if you want help regarding that it should read the info the user types, then thats beyond me.

IMPORTANT MAKE BACKUP OF FILES USED BEFORE PROCEEDING!!!!

1. Download 2 files which you will need to modify:

- Themes/yourtheme/Display.template.php
- Themes/yourtheme/Profile.template.php

Both these files can be found in your Themes folder (for your current theme ONLY) if you have additional themes then the changes will be have to be made to each themes files if they use seperate post and profile templates. Themes based on the default will have no problem since they pick their info up from the default theme folder. Please note if you cant find the Profile.template.php file in your theme folder look in the default folder :)

2- In Profile.template.php find:



<td><input type="text" name="websiteUrl" size="50" value="', $context['member']['website']['url'], '" /></td>



Add AFTER it the following:



</tr><tr>
<td><b>GameCard: </b></td>
<td><select name="default_options[profile_GameCard]">
<option', @$context['member']['options']['profile_GameCard'] == 'Card1' ? ' selected="selected"' : '', '>Gamecard1</option>
<option', @$context['member']['options']['profile_GameCard'] == 'Card2' ? ' selected="selected"' : '', '>Gamecard2</option>
<option', @$context['member']['options']['profile_GameCard'] == 'Card3' ? ' selected="selected"' : '', '>Gamecard3</option>
<option', @$context['member']['options']['profile_GameCard'] == 'Card4' ? ' selected="selected"' : '', '>Gamecard4</option>
<option', @$context['member']['options']['profile_GameCard'] == 'Card5' ? ' selected="selected"' : '', '>Gamecard5</option>
<option', @$context['member']['options']['profile_GameCard'] == 'Card6' ? ' selected="selected"' : '', '>Gamecard6</option>
<option', @$context['member']['options']['profile_GameCard'] == 'Card7' ? ' selected="selected"' : '', '>Gamecard7</option>
<option', @$context['member']['options']['profile_GameCard'] == 'Card8' ? ' selected="selected"' : '', '>Gamecard8</option>
<option', @$context['member']['options']['profile_GameCard'] == 'Card9' ? ' selected="selected"' : '', '>Gamecard9</option>
</select></td>



Now please note in the above code I have only included up to 9 options...you can have more by adding more lines like so after the last option tag



<option', @$context['member']['options']['profile_GameCard'] == 'Cardx' ? ' selected="selected"' : '', '>Game card x</option>



3 - Now in the same file look for:



<td><a href="', $context['member']['website']['url'], '" target="_blank">', $context['member']['website']['title'], '</a></td>



Add AFTER it this:



', !empty($context['member']['options']['profile_GameCard']) ? '</tr><tr>
<td><b>GameCard: </b></td>
<td>' . $context['member']['options']['profile_GameCard'] . '</td>' : '', '




4 - In Display.template.php find this:



// Show the member's gender icon?



Add BEFORE it:



// Profile Gamecard

if (empty($message['member']['options']['profile_GameCard'])) {
    $message['member']['options']['profile_GameCard']='Card1';
}
echo '
   GameCard: ', $message['member']['options']['profile_GameCard'] , ' <img src="', $settings['images_url'], '/', $message['member']['options']['profile_GameCard'], '.gif" /> <br />';

      

Now the above code is important since it will display the images in peoples post profile too...I recommend having image 1 as a "undisclosed" option since the above code will use it if the user dosent specify anything..so by default it will show it as undisclosed

5 - Finally create images for EACH option you specified in the feilds above (for the example here you will need 9 images with the names as: Game card 1.gif , Game card 2.gif, Game card 3.gif ....... Game card 9.gif ) the names contain spaces yes.

After your images are created place them all in your images folder of the theme folder and you are set to go!

Thats all :)
         

G6Cad

Now here comes the stupid question of the day here i think  ::)

But what exactly IS this doing ? Is it some kind of signature badges  ???


akulion

ooohhh man i totally gave the wrong thing lol

Sorry thats for PROFILE and POSt PROFILE

it adds a custom tag to the profile and post profile which will show badges under the users names depending on what the person selected in their profile....its very useful still

For signatures - ive never played around with signatures but it shouldnt be that difficult.ill have a look around to see if i can figure it out or not

But in case I cant..just ask someone at SMF..it should be very similar, the modifications for the profile template file should be the same only thing that would change is adding the display.template codes to where the signature usually occurs...


akulion

#4
ok found it - should be relatively simple....I have not tested this yet but theoratically it should work just fine.....

In dislay.template.php file find this line:

Quote

      // Show the member's signature?


just after it add:



if (empty($message['member']['options']['profile_GameCard'])) {
    $message['member']['options']['profile_GameCard']='Card1';
}
echo '
   <img src="', $settings['images_url'], '/', $message['member']['options']['profile_GameCard'], '.gif" /> <br />';



that should show the card in the persons Signature which is selectable via the profile....

But you may want to remove the code from their Post profile by not following step 4

hope u understood whats going on

try it out - should work - if not simply restore the backup files to ur server and let me know and ill try and figue it out

:D

PapaLazarou84

Thanks for the help I'll have a look into it tomorrow when I've got some time and let you know how it goes  :)

akulion

ur welcome :)

just remember follow all the steps
make the customized changes needed (like image names etc)
Leave out step 4 instead follow the step in my last post

and it should all work :)

akulion

here i tested it for you on my test site and it works A-OK

have a look at the Admin profile and there is only one post in the forum located here

view it to see the signature which was specified via a drop down box in the profile

You are welcome to create an account and test it out

for this example I just used some banners I had handy, but u can make ur own images for game cards :)

akulion

oh i nearly forgot to mention

if you intend to use the code above EXACTLY as is then name ur images as:

Game card 1.gif
Game card 2.gif
Game card 3.gif
Game card 4.gif
all the way up to
Game card 9.gif

oki doki :D

PapaLazarou84

That's great work mate.I'll need to modify it abit as my images will be coming from a site like www.mygamercard.net rather than a static image. I'll see what I can do but if I have any problems I'll ask.

This website is proudly hosted on Crocweb Cloud Website Hosting.