Author Topic: [Code] Add Box to Stats  (Read 2027 times)

0 Members and 0 Guests are viewing this topic.

Offline Agent Moose

  • Newbie
  • *
  • Posts: 37
  • Karma: 12
  • Gender: Male
  • Miss me?
  • Location: South Carolina, United States
    • View Profile
[Code] Add Box to Stats
« on: August 02, 2010, 02:43:32 pm »
Footers: (Admin > Style Manager > Headers and Footers > Footers)
Code: [Select]
<script type="text/javascript">
function AddBoxToStats(Title, Info){
//Created by Agent Moose
if(document.getElementById("upshrinkHeaderIC") !== null) document.getElementById("upshrinkHeaderIC").innerHTML += "<div class='title_barIC'><h4 class='titlebg'><span class='ie6_header floatleft'><img src='https://cdn.smfboards.com/caf/images/icons/online.gif' /> " + Title + "</span></h4></div><p class='inline'>" + Info + "</p>";
};
AddBoxToStats("TITLE","INFORMATION");
</script>

TITLE = The Title of the box.
INFORMATION = The information for the box (you may use HTML, just use single quotes instead of double quotes)

To add more boxes, add more of these lines:
Code: [Select]
AddBoxToStats("TITLE","INFORMATION");
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 DMVA

  • Newbie
  • *
  • Posts: 8
  • Karma: 0
    • View Profile
Re: [Code] Add Box to Stats
« Reply #1 on: August 04, 2010, 03:12:36 pm »
What's an example of something you would put in a box, and an example code maybe?
For those of us who also aren't that html sassy, would it be possible to add things like daily best poster or something?

Offline Nick9

  • Jr. Member
  • **
  • Posts: 61
  • Karma: -38
    • View Profile
Re: [Code] Add Box to Stats
« Reply #2 on: August 04, 2010, 03:44:54 pm »
I agree with DMVA completely... I am also one of the people who doesn't understand HTML that well... Could you make that code give me top poster of the day and top topic starter of the day??
CreateAForum Codes | RuckaScape | Open Testing Forum

I like the people who come on here JUST to defect my karma. ;)

Offline Fate

  • Newbie
  • *
  • Posts: 36
  • Karma: -1
  • Gender: Male
  • US Navy Seal - Commander Fate
    • View Profile
    • CIA
Re: [Code] Add Box to Stats
« Reply #3 on: August 04, 2010, 07:33:30 pm »
A preview can be found on my site using simple html. This is the code I used:

Code: [Select]
<script type="text/javascript">
function AddBoxToStats(Title, Info){
   //Created by Agent Moose
   if(document.getElementById("upshrinkHeaderIC") !== null) document.getElementById("upshrinkHeaderIC").innerHTML += "<div class='title_barIC'><h4 class='titlebg'><span class='ie6_header floatleft'><img src='https://cdn.smfboards.com/caf/images/icons/online.gif' /> " + Title + "</span></h4></div><p class='inline'>" + Info + "</p>";
};
AddBoxToStats("Featured Members","<a href='http://cfcoding.createaforum.com/index.php?action=profile;u=1'>Fate</a>, <a href='http://cfcoding.createaforum.com/index.php?action=profile;u=3'>Nick</a>, <a href='http://cfcoding.createaforum.com/index.php?action=profile;u=2'>Agent Moose</a>");
</script>


If you wish to use the Featured Members thing, just replace "cfcoding" with your Forum. Replace the names above to the names of your members that you want to display. Replace the "u=1" (or whatever number is shown above) with the user number of that person.

Offline Nick9

  • Jr. Member
  • **
  • Posts: 61
  • Karma: -38
    • View Profile
Re: [Code] Add Box to Stats
« Reply #4 on: August 04, 2010, 08:42:13 pm »
Lol, Fate... Usually when you help me you make it REALLY simple to understand... I don't get this at all!!
CreateAForum Codes | RuckaScape | Open Testing Forum

I like the people who come on here JUST to defect my karma. ;)

Offline Fate

  • Newbie
  • *
  • Posts: 36
  • Karma: -1
  • Gender: Male
  • US Navy Seal - Commander Fate
    • View Profile
    • CIA
Re: [Code] Add Box to Stats
« Reply #5 on: August 05, 2010, 03:21:20 am »
Mmm. Which don't you get? The code I used or html?


(I'll make the code I used easier to follow if you choose to use this one):

Quote
<script type="text/javascript">
function AddBoxToStats(Title, Info){
   //Created by Agent Moose
   if(document.getElementById("upshrinkHeaderIC") !== null) document.getElementById("upshrinkHeaderIC").innerHTML += "<div class='title_barIC'><h4 class='titlebg'><span class='ie6_header floatleft'><img src='https://cdn.smfboards.com/caf/images/icons/online.gif' /> " + Title + "</span></h4></div><p class='inline'>" + Info + "</p>";
};
AddBoxToStats("Featured Members","<a href='http://cfcoding.createaforum.com/index.php?action=profile;u=1'>Fate</a>, <a href='http://cfcoding.createaforum.com/index.php?action=profile;u=3'>Nick</a>, <a href='http://cfcoding.createaforum.com/index.php?action=profile;u=2'>Agent Moose</a>");
</script>


Replace the Red text with your Forum.
Replace the Blue number(s) with the "User ID" of the member.
Replace the Green text with the Name of the member.


To find out the User ID's of your members, use the following link:

http://YOURFORUMNAMEHERE.createaforum.com/index.php?action=admin;area=viewmembers

Offline Nick9

  • Jr. Member
  • **
  • Posts: 61
  • Karma: -38
    • View Profile
Re: [Code] Add Box to Stats
« Reply #6 on: August 05, 2010, 03:27:09 am »
Ohhhhhhhhh!!!! I understand what you meant now. Can you make a box stat
code for keeping track of the player with the highest karma?
CreateAForum Codes | RuckaScape | Open Testing Forum

I like the people who come on here JUST to defect my karma. ;)

Offline Fate

  • Newbie
  • *
  • Posts: 36
  • Karma: -1
  • Gender: Male
  • US Navy Seal - Commander Fate
    • View Profile
    • CIA
Re: [Code] Add Box to Stats
« Reply #7 on: August 05, 2010, 03:41:36 am »
Not entirely sure how that would be done with just a box stat code. For now you can do it manually if you'd like: replace "Featured Members" with whatever you'd like it to be.

Offline Nick9

  • Jr. Member
  • **
  • Posts: 61
  • Karma: -38
    • View Profile
Re: [Code] Add Box to Stats
« Reply #8 on: August 05, 2010, 03:50:53 am »
Ok, thanks. I know a way it can be done. It'll basically be your version of the code..
CreateAForum Codes | RuckaScape | Open Testing Forum

I like the people who come on here JUST to defect my karma. ;)

 

Related Topics

  Subject / Started by Replies Last post
1 Replies
823 Views
Last post March 14, 2012, 04:53:55 pm
by aIURbliS
4 Replies
821 Views
Last post June 17, 2013, 07:09:14 pm
by CreateAForum
1 Replies
303 Views
Last post October 02, 2013, 12:30:52 pm
by CreateAForum
1 Replies
246 Views
Last post July 11, 2014, 04:02:43 pm
by Amila
2 Replies
370 Views
Last post April 28, 2015, 07:40:42 am
by hudumapoa