News:

Create A Forum Installed

Author Topic: [Code] Name Across Board  (Read 1872 times)

0 Members and 1 Guest are viewing this topic.

Offline Agent Moose

  • Newbie
  • *
  • Posts: 37
  • Karma: 12
  • Gender: Male
  • Miss me?
  • Location: South Carolina, United States
    • View Profile

Badges: (View All)
Linux User Mobile User Level 5
[Code] Name Across Board
« on: November 27, 2014, 04:21:53 am »
It's been a long time since I've made a code :P  I decided to look up and see how this board is going and noticed people wanted a code that would add a crown to their username.  Solution is here!

Place in Footers:
Code: [Select]
<script type="text/javascript">
function NAB(real, owned){
//Created by Agent Moose
for(i in document.links){
if(document.links[i].innerHTML === real){
document.links[i].innerHTML = owned;
};};};
NAB("Agent Moose", "<font color='#00aabb'><b>Agent Caboose</b></font>");
NAB("OLD NAME", "NEW NAME");
</script>

So as I said above, this code will change all the links that have whatever username you say, to whatever new username you will want it to be.

Code: [Select]
NAB("OLD NAME", "NEW NAME");OLD NAME = Current Username (THIS IS CASE SENSITIVE)
NEW NAME = What you want your users to see. (You can use the same OLD NAME as the NEW NAME if you just want to add an image in front or bold ect)

As in the example above, you can use any HTML you would like.  You can use the font tag, bold, add an image before and after the name, whatever.

Here's an example if you want an image before the name:
Code: [Select]
NAB("Agent Moose", "<img src='IMAGE URL HERE' />Agent Moose");
Also, you can add as many of these lines as you wish:
Code: [Select]
NAB("OLD NAME", "NEW NAME");
Enjoy! :)
Code: [Select]
//Hint hint :)
if(/action=profile;u=(.*);sa=UserPage/i.test(location.href)){
var number = RegExp.$1;
var username = (smf_id_member !== "0") ? document.getElementById("upper_section").getElementsByTagName("li")[0].getElementsByTagName("span")[0].innerHTML : void(0);

Share on Facebook Share on Twitter


Offline CyanProductions

  • Newbie
  • *
  • Posts: 39
  • Karma: -1
    • View Profile

Badges: (View All)
Level 3 10 Posts Karma Good
Re: [Code] Name Across Board
« Reply #1 on: December 02, 2014, 12:01:26 pm »
Thanks :)

Offline CyanProductions

  • Newbie
  • *
  • Posts: 39
  • Karma: -1
    • View Profile

Badges: (View All)
Level 3 10 Posts Karma Good
Re: [Code] Name Across Board
« Reply #2 on: December 02, 2014, 12:44:53 pm »
Is it possible to make it so it displays the users avatar. So something like:
NAB("UserName", "<img src='http://{forumname}.createaforum.com/cavatars/{forumname}/' & UserName /><font color='#ff33cc'><b>UserName</b></font>");


In a way so that it updates for everyone automatically.

Offline Agent Moose

  • Newbie
  • *
  • Posts: 37
  • Karma: 12
  • Gender: Male
  • Miss me?
  • Location: South Carolina, United States
    • View Profile

Badges: (View All)
Linux User Mobile User Level 5
Re: [Code] Name Across Board
« Reply #3 on: December 06, 2014, 03:19:02 am »
There is not a way for me to do that, sadly.

I mean, is the whole "cavatars" thing a board or what?  I've never seen anything with that url on any forum.
Code: [Select]
//Hint hint :)
if(/action=profile;u=(.*);sa=UserPage/i.test(location.href)){
var number = RegExp.$1;
var username = (smf_id_member !== "0") ? document.getElementById("upper_section").getElementsByTagName("li")[0].getElementsByTagName("span")[0].innerHTML : void(0);

Offline CyanProductions

  • Newbie
  • *
  • Posts: 39
  • Karma: -1
    • View Profile

Badges: (View All)
Level 3 10 Posts Karma Good

Offline aIURbliS

  • Hero Member
  • *****
  • Posts: 1215
  • Karma: 45
  • Gender: Male
  • Location: U.S.
    • View Profile

Badges: (View All)
Level 6 Sixth year Anniversary Fifth year Anniversary
Re: [Code] Name Across Board
« Reply #5 on: December 23, 2014, 03:41:12 am »
The link is only available if you upload your avatar directly to the site, which not everyone does. The filename is also unpredictable
All codes I make are tested on the latest version of Google Chrome and upon request of other browsers.

Offline CyanProductions

  • Newbie
  • *
  • Posts: 39
  • Karma: -1
    • View Profile

Badges: (View All)
Level 3 10 Posts Karma Good
Re: [Code] Name Across Board
« Reply #6 on: January 02, 2015, 11:39:38 pm »
The link is only available if you upload your avatar directly to the site, which not everyone does. The filename is also unpredictable
I've seen a website do it before, it's not createaforum but it's an SMF

Offline aIURbliS

  • Hero Member
  • *****
  • Posts: 1215
  • Karma: 45
  • Gender: Male
  • Location: U.S.
    • View Profile

Badges: (View All)
Level 6 Sixth year Anniversary Fifth year Anniversary
Re: [Code] Name Across Board
« Reply #7 on: January 03, 2015, 04:32:27 am »
The link is only available if you upload your avatar directly to the site, which not everyone does. The filename is also unpredictable
I've seen a website do it before, it's not createaforum but it's an SMF
Most likely, that website was using a mod which users can't install here at CreateAForum.
All codes I make are tested on the latest version of Google Chrome and upon request of other browsers.

Offline CyanProductions

  • Newbie
  • *
  • Posts: 39
  • Karma: -1
    • View Profile

Badges: (View All)
Level 3 10 Posts Karma Good
Re: [Code] Name Across Board
« Reply #8 on: January 03, 2015, 03:45:11 pm »
The link is only available if you upload your avatar directly to the site, which not everyone does. The filename is also unpredictable
I've seen a website do it before, it's not createaforum but it's an SMF
Most likely, that website was using a mod which users can't install here at CreateAForum.
kk, wish it was added to createaforum.

 

Related Topics

  Subject / Started by Replies Last post
12 Replies
4478 Views
Last post December 02, 2014, 06:57:57 pm
by CyanProductions
2 Replies
2233 Views
Last post March 01, 2011, 03:11:15 am
by Arekay
4 Replies
881 Views
Last post March 03, 2011, 05:45:26 pm
by Justincase
1 Replies
629 Views
Last post June 02, 2011, 05:24:30 am
by simply sibyl
1 Replies
1339 Views
Last post March 14, 2012, 04:53:55 pm
by aIURbliS