Revolution X

Coding Community => Coding Snippets => Topic started by: Spoken on November 06, 2008, 05:38:48 pm



Title: SMF Page
Post by: Spoken on November 06, 2008, 05:38:48 pm
To start off, I DID NOT make either of these codes. Agent Moose made em. I tweaked the second one.

This code is to add a custom page to your forums.

Footers
Code:
<script>
function smf_page_v1(link,title,content){
//Created by Agent Moose (smcodes.smfforfree3.com)
if(location.href.match("action="+link)){
document.title=""+title+"";
$("#bodyarea").hide()
$("#bodyarea").before("<div class='tborder'><div class='catbg' style='padding: 6px; vertical-align: middle; text-align: center; '>"+title+"</div><div id='upshrinkHeaderIC'><table border='0' width='100%' cellspacing='1' cellpadding='4' class='bordercolor'><tr><td class='windowbg2' width='100%'>"+content)
$("#bodyarea").after("</td></tr></table></div></div>")
};};
smf_page_v1("URL","TITLE","CONTENT")
</script>

Replace "URL" with the URL you want for the page. (action=URL)
Replace "TITLE" with the title of the page.
Replace "CONTENT" with the content you want in the page.

Note: In the content of your page, you CANNOT have any enters or double quotes ("). You MUST use <BR> when you want a line break and use single quotes (') instead of double (").



This code is to add extra content boxes to one of your existing custom pages.

Footers:
Code:
<script>
function smf_page_v1(link,title,content){
//Created by Agent Moose (smcodes.smfforfree3.com)
if(location.href.match("action="+link)){
$("#bodyarea").hide()
$("#bodyarea").before("<div class='tborder'><div class='catbg' style='padding: 6px; vertical-align: middle; text-align: center; '>"+title+"</div><div id='upshrinkHeaderIC'><table border='0' width='100%' cellspacing='1' cellpadding='4' class='bordercolor'><tr><td class='windowbg2' width='100%'>"+content)
$("#bodyarea").after("</td></tr></table></div></div>")
};};
smf_page_v1("URL","TITLE","CONTENT")
</script>

Replace "URL" with the page URL you want to add the box to.
Replace "TITLE" with the Title of the new box.
Replace "CONTENT" with the content of the new box.

Just as in the code to add a page, you CANNOT use enters or double quotes (").

Again, I DID NOT make these. I only tweaked the second one. Moose did all the good work ;)


Title: Re: [Code] SMF Page
Post by: shimmy shabby on November 06, 2008, 06:11:30 pm
I dont see any tweaking? and i'd leave it up to moose to post the original SMF Page code. And first i would ask permission from him if he even would let you modify it. But, if he said ok. Just like at the bottom put credits to Agent Moose for making the original SMF Page code. And so people don't jump at u for it, Put: Permission from Agent Moose to modify this code. Or something like that.


Title: Re: [Code] SMF Page
Post by: deathwilldie on November 06, 2008, 09:43:48 pm
Well I'll see what moose says about it cause he is grounded from the computer. 

Also if you want a code to be added here just PM him and ask...but I guess now PM me and I shall add it to here.


Title: Re: [Code] SMF Page
Post by: shimmy shabby on November 06, 2008, 10:01:52 pm
Naughty moose... lol, bad grades or something?


Title: Re: [Code] SMF Page
Post by: Spoken on November 06, 2008, 10:15:11 pm
Lol sorry. I thought it would be fine posting it as long as I gave credit to him

Quote
Well I'll see what moose says about it cause he is grounded from the computer.

Lol hes what, 17? And hes grounded!? LOL


Title: Re: [Code] SMF Page
Post by: deathwilldie on November 07, 2008, 03:21:37 pm
Yea bad grades.... :P

He is gonna sneak on sometime and do what ever it is he is going to do...he wouldn't tell me :P


Title: Re: [Code] SMF Page
Post by: Spoken on November 07, 2008, 04:02:48 pm
Lol. Dont his parent this hes too old for grounding??


Title: Re: [Code] SMF Page
Post by: deathwilldie on November 07, 2008, 04:12:43 pm
Nah cause I could get grounded also...

Alright lets not get off topic.


Title: Re: [Code] SMF Page
Post by: Agent Moose on November 07, 2008, 06:34:43 pm
Alrighty, I am on for tonight.  My mom is out of town :P  but death is probably going to kick me off when he gets home  >:D

Anyway.  Please PM me or deathwilldie when your going to post one of my codes.  For now, it would be smart to PM my brother(deathwilldie).

I'll keep this one here...but I don't know why you would need it since there is a WebPage Editor :P


Title: Re: SMF Page
Post by: shimmy shabby on November 07, 2008, 06:46:38 pm
lol, brothers can be a pain sometimes.

Anyways... Could someone point out the tweaking spoken said he did? i can't notice it lol, maybe im blind.


Title: Re: SMF Page
Post by: Agent Moose on November 07, 2008, 07:22:19 pm
Honestly, I couldn't see it either :P  And its my code :)


Title: Re: SMF Page
Post by: Spoken on November 07, 2008, 07:22:31 pm
In the first code you can see.
Code:
document.title=""+title+"";

I took that out in the second code. What it does is instead of making it the title of the whole page AND the title of the first box, it only makes it the title of the new box. If that makes sense


Title: Re: SMF Page
Post by: shimmy shabby on November 07, 2008, 07:25:17 pm
I see now :P


Title: Re: SMF Page
Post by: Agent Moose on November 07, 2008, 07:25:47 pm
Yep, it makes since :)


Title: Re: SMF Page
Post by: Spoken on November 07, 2008, 07:30:25 pm
Quote
In the first code you can see.

Code:
document.title=""+title+"";
I took that out in the second code. What it does is instead of making it the title of the whole page AND the title of the first box, it only makes it the title of the new box. If that makes sense

All that taking that out does is remove the Title, Example if you use IE, at the top it would have like SMF Page - Windows Internet Explorer, All taking out the document.title thing would do would be get rid of that

Yes, but if you have the original code, AND the tweaked code, the new code will add a box without changing the title from the original code. Sorry im not good at explaining XD


Title: Re: SMF Page
Post by: shimmy shabby on November 07, 2008, 07:36:13 pm
Quote
In the first code you can see.

Code:
document.title=""+title+"";
I took that out in the second code. What it does is instead of making it the title of the whole page AND the title of the first box, it only makes it the title of the new box. If that makes sense

All that taking that out does is remove the Title, Example if you use IE, at the top it would have like SMF Page - Windows Internet Explorer, All taking out the document.title thing would do would be get rid of that

Yes, but if you have the original code, AND the tweaked code, the new code will add a box without changing the title from the original code. Sorry im not good at explaining XD
Lol, no im just not that good at comprehending, i edited my post if u noticed before u posted this =p probably were in the progress of posting this when i edited it though, lol.


Title: Re: SMF Page
Post by: Spoken on November 07, 2008, 07:38:03 pm
Oh lol. I didnt see that before I posted XD


Title: Re: SMF Page
Post by: Exilis on November 08, 2008, 08:04:20 am
By the way, if you're going to use the webpage editor like Agent suggested, codes don't work on it most of the time. And java/flash things. It can get annoying. The editor simply doesn't recognize the stuff and deletes it. My suggestion is you disable JavaScript before going into the editor page, then you get a regular textarea because the editor is entirely JavaScript.


Title: Re: SMF Page
Post by: Spoken on November 08, 2008, 08:07:26 am
OOORRR you could just click the button in teh web editor that says "Veiw HTML source"

I think thats what it says


Title: Re: SMF Page
Post by: shimmy shabby on November 08, 2008, 12:22:22 pm
Yea, put usually when your putting codes into the webpage editor, u usually don't have to because if there already in your headers/footers they'll be including in that page because the headers and footers are global. But, if u want to use a code just for that and u need to put it like in the footer or headers, thats what that little bottom section is for.


Title: Re: SMF Page
Post by: Exilis on November 13, 2008, 06:46:18 am
That doesn't work, because the editor doesn't recognize JavaScript, so it takes it right out next time you start the editor.