Please login or register. Welcome to the Studio, guest!


Quick Links:


newBookmarkLockedFalling

Sasuke

Sasuke Avatar

****
Senior Member

418


August 2005
Tutorial: - Adding Something To the top/bottom of your PB Forum



I will explain this whole tutorial by using one of the Codes I've made for Proboardsv4

First we ad a div with an id to the header/footer(We will use this to help us place what we want where we want header[if u want it at the top] or footer[if you want it at the bottom of your board])

<div id='InfoCenter'>
</div>

So you see? Now you close the div and thats it for this part!




<script type="text/javascript">
<!--

we start the script...
Now we grab a table and then loop it...

Table = document.getElementsByTagName('Table');
for(i=0;i<Table.length;i++){

You should have something like that now.
Now we match to the table(or something else depending on what you want)
of the info center:

if(Table[i].className=="bordercolor" && Table[i].innerHTML.match(/Info Center/i)){

So we've matched to the info center!
Now we save the info center table by putting its innerHTML value in a variable like this:

var iCenter = Table[i].innerHTML;

Now we remove the thing that were moving(or you could keep it there...your choice) by hiding/deleting it:

Table[i].style.display='none'


Now its hidden.
Finally this is where the div id comes in...We grab the Id and make the innerHTML of the id our variable that was holding the info center:

document.getElementById('InfoCenter').innerHTML = iCenter;

now we end the script

//-->
</script>

and there you have it :)



Lucifer

Lucifer Avatar

*******
Mythical Studio Member

Eunuch
5,665


August 2005
Does the

<div id='InfoCenter'>
</div>

part have to go above the <script type="text/javascript">?

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
Yep. Otherwise, its not there when the script executes, now is it?

/^(Krayzie)?$/i

/^(Krayzie)?$/i Avatar
I'm so happy, doin the neutron dance!

***
Dedicated Member

165


September 2005
Well, couldn't you use:

document.write("<div id='InfoCenter'></div>");

?



Jordan

Jordan Avatar

***
Dedicated Member

173


July 2006
I saw that in one of California's codes so I think you can.

blu

blu Avatar
My Person Text...

**
Official Member

25


January 2007
Wow, that really cleared up a lot of things for me.

Aaron

Aaron Avatar
Bad Wolf

****
Dedicated Studio Member

859


November 2006
krayzie10291 said:
Well, couldn't you use:

document.write("<div id='InfoCenter'></div>");

?


Yeah but the only good that'd do is prevent the DIV from printing when JS is disabled.

3:

3: Avatar
...xD

***
Dedicated Member

158


June 2006
Which is a good thing if you don't want a useless DIV on the page :P

Aaron

Aaron Avatar
Bad Wolf

****
Dedicated Studio Member

859


November 2006
beta said:
Which is a good thing if you don't want a useless DIV on the page :P


Exactly as I said. ;)

There are other ways though, not that i'd recommend them...

<noscript>
<style type="text/css">
#InfoCenter {
display: none
}
</style>
</noscript>
<div id="InfoCenter"></div>

superkid

superkid Avatar
=]

****
Senior Member

265


June 2008
Just a question. How do we know the id of the thing we're moving?

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
superkid Avatar
Just a question. How do we know the id of the thing we're moving?


Well, in this example, there is no ID for what you're moving. The ID is assigned to WHERE it is being moved. To find the ID of something (only if it already has an ID) can be done by find the ID attribute of the tag...

<div id="infocenter"></div>

There, the id is "infocenter"

superkid

superkid Avatar
=]

****
Senior Member

265


June 2008
yes, but like how do you find out the item's id. I know info center is infocenter.

Aaron

Aaron Avatar
Bad Wolf

****
Dedicated Studio Member

859


November 2006
Sounds to me like you don't know quite enough to make use of this tutorial. You may want to learn a bit about web programming in general first. From there pick up on HTML and JavaScript as those are the languages that give this tutorial any meaning. :)

And if you really don't want to get into that, again, this tut is aimed towards people that are learning the languages and need some tips and tricks on how to achieve certain goals. I recommend in such a case that you make a code request (if you can't find what you need in a database).


Last Edit: Jul 6, 2008 22:27:31 GMT by Aaron

Hotshot

Hotshot Avatar

******
Legendary Studio Member

2,051


June 2008
^ Maybe he meant proboards ID's. I don't know of any FAQ that tells you of them all. Most people just know them, but other don't.

That would make a good guide. All the ID's and stuff you could use in a proboard compatible code.

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
Hotshot Avatar
^ Maybe he meant proboards ID's. I don't know of any FAQ that tells you of them all. Most people just know them, but other don't.

That would make a good guide. All the ID's and stuff you could use in a proboard compatible code.


The only one I know of is "forumjump" :P There are no IDs... well, til v5 hits.


superkid: That id does not deal with the info center at all. Sasuke could have made it "ZOMGWTFBBQSAUCE" and it wouldn't have mattered as long as it was the same ID for both the tag and the code. The ID itself is arbitrary. It doesn't grab the info center for your manipulation. The looping (the for's and the if's) grabbed the info center. His example MOVED the info center to the div that he gave the ID to.

newBookmarkLockedFalling