There were a couple of problems with yours. First off, you have to define a variable before you can use it. Javascript is read from the top down.
document.write('Display Name);
var display_name="pb_displayname";
The variable line has to come before the other. You haven't defined what it means yet, so the browser doesn't know how to read it. It should read:
var display_name="pb_displayname";
document.write('Display Name);
Now, putting that bit of code into the global headers would give you the text "Display Name". The problem is that you put an apostrophe before Display Name which caused the browser to think that it was a string. You don't want it to think that because you are trying to pull from the variable display_name. Variables are also case sensitive, so the line needs to read.
document.write(display_name);
Now, pb_displayname is a built in ProBoards variable, so putting it as a string will just give you the text. It should be:
var display_name=pb_displayname;
That's it for that one. The whole thing up to now should be:
<script type="text/javascript">
<!--
//Copyright The Other Side and Co
//Do not repost this code
//Use in global header
document.write('Mini Page Profile');
var display_name=pb_displayname;
var user_name=pb_username;
Now for the next bit.
document.write('User Name');
var user_name="pb_username;"
You have the same ordering problem as the first, so reverse that.
var user_name="pb_username;"
document.write('User Name');
You also did the same thing with the variable. If you want to pull text, you use quotations marks or apostrophes. If you want to pull a variable, you don't. Variables are also case sensitive. It should read:
var user_name="pb_username;"
document.write(user_name);
pb_username is also a variable, so it shouldn't have the quotations around it(especially not with the semicolon inside of it. The browser stops reading after the semicolon). You should have:
var user_name=pb_username;
document.write(user_name);
And that is it. Your finished code should be:
[code]
<script type="text/javascript">
<!--
//Copyright The Other Side and Co
//Do not repost this code
//Use in global header
document.write('Mini Page Profile');
var display_name=pb_displayname;
var user_name=pb_username;
document.write(display_name);
document.write(user_name);
//This is my first code so it may be a bit dodgy
//-->
</script>
I hope that helps.