Welcome Guest [Log In] [Register]
Viewing Single Post From: [CODE] XProfile 2.0
Paper
Member Avatar
Member
[ *  *  *  *  *  * ]
Important announcement 30/05/05
This is an update on the breaking out of frames script

Sorry everyone. I made an error in my new breaking out of frames script. If you need to break out of frames and use this script, please use the following code instead. If you get redirected to your edit signature page then you need this code.

Quote:
 
<script language="Javascript" type="text/javascript">
<!--
if (window != window.top && document.location.href.indexOf("act=UserCP&CODE=22") == -1)
top.location.href = location.href;
//-->
</script>




Contents
Introduction
Support
Preview
Installing
Basic functionality
Using the custom box in the Code CP
Disclaimer


Introduction
This code is based on the code called XProfile 1.5 (Final) by Markup. You need to remove his old code before installing this one. All user settings will still be kept.

This code will allow the user to add functionality for more fields. Instead of just Home Page, Birthday, Location, and Interests, you can now have more.

This code corrects the Mozilla Firefox compatibility issue that XProfile 1.5 has. It also adds a control panel, so that you no longer have to use your Admin CP. It uses the Easy Admin CP code to do this.

Please report errors that you find. Please tell me which browser you are using, which OS you are using and please provide a link to your board.


Support
I will no longer be offering support here on a regular basis. I am still happy to provide support, however, and will continue to do so on a regular basis at a forum called the United Coders Organisation

If you still require help, please feel free to send me a PM here, or for quicker support ask for support at the UCO (Look in my signature)

Sorry for this inconvenience and thank you again for using the code


Preview
Here


Installing
Installing this code is straight forward.

1) Log in to your Admin CP, and go to the wrappers section (Admin CP -> Skinning & Styles -> Board Wrappers).

2) Go to the Javascript wrapper

3) Put the following code in that wrapper. Do not change the code
Quote:
 
<script>
var beginxprofile; var xage=true; var AlabelPrefix = "<B>"; var AlabelSuffix = "</B>"; var AvaluePrefix = "<I>"; var AvalueSuffix = "</I>"; var AwhereShown = "Both"; var xlocation=true; var LlabelPrefix =""; var LlabelSuffix =""; var LvaluePrefix ="<FONT color=red>"; var LvalueSuffix ="</FONT>"; var xflags=true; var FlabelPrefix = "<SPAN style=display:none>"; var FlabelSuffix = "</SPAN>"; var FvaluePrefix = ""; var FvalueSuffix = ""; var FwhereShown = "Profile"; var xsound=true; var xcustom="newField[i++] = ['Name', '<B>', '</B>', '', '<BR>', 'Both', [], 1]; newField[i++] = ['Gender', '<SPAN style=display:none>', '</SPAN>', '<CENTER>', '</CENTER>', 'Profile', ['Male', 'Female'], -1]"; var endxprofile;
</script>


4) Directly below the <% NAVIGATION %> tag in the Header & Body add:
Quote:
 
<script src="http://www.webpost.net/if/ifpaper/easyadmincp.js"></script>

Do not add another if this piece of code is already there.


5) Put the following code in the footer wrapper
Quote:
 
<script src="http://www.webpost.net/if/ifpaper/main2.js"></script>



Now it has been installed


Basic functions
If you go to someone's profile, you will now see some new information added on. You will also see some new information added on to the posts.

To edit your information, edit your profile. The new entry boxes will appear as well as the usual entry boxes.

An admin can edit the XProfile code by clicking on the "XProfile CP" link that should be among the user links. Only users with admin status can see this. Once you have clicked it a new forum section will appear asking you to log in. Enter your username and password.

Once you press "Submit" you should wait for it to log in. Even if it seems like it isn't doing anything, it is. After it has logged in, the section will change giving you a table with different options in.

Features - If you untick a feature then it will be turned off

Label prefix, Label suffix, Value prefix, and Value suffix - These all control the look and style of these aspects. On the forum, the information is viewed as "Label: value" where the label tells you what the data is about, and the value is the data belonging to that person.

Where shown - Where the feature is shown. "Both" means it will be shown both in the person's profile and on the person's posts. The other options are self explanatory.

You should not use double quotes (") in any of the text boxes. Use single quotes(') instead.

Press Save to update the code.


Using the custom box in the Code CP
There is a custom box underneath so that you may add more fields.

You should not use double quotes (") in any of the custom box. Use single quotes(') instead.

In this post read the bit about the "compressed" version of the code, towards the bottom.

After you have read that the following should make sense.

The following code has already been added. You do not have to put it into the custom box.
Quote:
 

i = 0
newField = []


Let's assume we wanted to put the following code into the custom box
Quote:
 
newField[i++] = ["Name", "<B>", "</B>", "", "<BR>", "Both", [], 1]


We would firstly change all the double quotes to single quotes, and then we would just simply put it into the custom box.
Quote:
 
newField[i++] = ['Name', '<B>', '</B>', '', '<BR>', 'Both', [], 1]


If we wanted to add another field, along with that one, we would need to add a ";" onto the end of the first one, and then add the other one on.
Quote:
 
newField[i++] = ['Name', '<B>', '</B>', '', '<BR>', 'Both', [], 1]; newField[i++] = ['Sur Name', '<B>', '</B>', '', '<BR>', 'Both', [], 1]


You just need to keep repeating this process. If you don't want any more fields than the features, then you can delete all of the text out of the custom box.


Disclaimer
This is an update of the XProfile code that was originally made by the user called Markup. Please note that this code is not mine and I do not claim it as my own, nor do I copyright the parts programmed by Markup.

I do, however, claim as my own and copyright the parts that I added in, including the fix to make it compatible with Mozilla FireFox, and the "Admin Controllable" functionality.

As a result of giving credit to Markup for developing the XProfile code, I have not stolen his code.
Offline Profile
[CODE] XProfile 2.0 · Code Snippets