Advertise Here

Author Topic: The Coding Guide  (Read 1687 times)

0 Members and 1 Guest are viewing this topic.

Offline Agent Moose

  • Moderator
  • *****
  • Posts: 836
  • Do not PM me for Code Support or Request
    • View Profile

  • Total Badges: 32
    Badges: (View All)
    Search Level 6 Tenth year Anniversary Nineth year Anniversary Eighth year Anniversary
The Coding Guide
« on: May 22, 2007, 03:34:41 pm »
Forum Url: http://smcodes.smfforfree3.com
First of all, this isn't going to teach you how to code, I will do that later on my SMC(Simple Machine Codes) forum though.

First you need to know how to get to your Headers and Footers that is located in your Admin CP, 
Manage Styles-->Edit Headers/Footers

That is where you will put all your codes at.  There are two diffrent places to put the codes for your forum, the Headers, and then there is the Footers.  Then there are others where it doesn't matter where you put them, which means you can put them in the Headers or the Footers.

There will be some codes that you have to put something into the Headers and the Footers, like simply sibyl's Put "Go Up" and "Go Down" Tabs on your forum, and many of the codes I make, infact all of the codes I make, you will have to put this into your headers:
Code: [Select]
<script src="/jquery.js"></script>
Now on to the coding part...
I am going to use my "Change 'Hello' Text" as an example for this part of the guide...
Code: [Select]
<script>
function change_hello(){
//Created by Agent Moose (http://www.smcodes.smfforfree3.com)
$(function() {
text = "YOUR TEXT HERE"
a = $("td span b").html()
$("table td.titlebg2 span").contains("Hello").html(text).append("&nbsp;<b>"+a+"</b>");
});}
change_hello();
</script>

In the above code, you notice this part:
Code: [Select]
text = "YOUR TEXT HERE"That is the only part you will need to edit of the code.  If you edit a code that you didn't make by adding a link to it then posting it and saying that it is yours, that is called "Ripping", I don't like when people do that because they did not make the code.

Now, back to the code, where it says YOUR TEXT HERE, you may use other HTML in with it.  For example, you could use this:
Code: [Select]
text = "<img src='IMAGE URL' /><b>Hello,</b> there is an image next to this text."But you can't use this:
Code: [Select]
text = "<img src="IMAGE URL" /><b>Hello,</b> there is an image next to this text."Notice that in the first code, there are single quotes before and after the image URL, and in the second one there are double quotes.  There is a reason for that,  Since there are already useing double quotes for the text that you want in, you must use single quotes for the HTML that is inside the double quotes like in the first code above.

Here is another example:
Code: [Select]
text = "<font color='red'>You can use this because there are single quote for the font HTML tag.</font>"You can use that becuase there are single quotes for the font HTML tag.
You can't use this because it has double quotes inside double quotes.
Code: [Select]
text = "<font color="red">You can't use this because there are double quotes for the font HTML tag.</font>"
Now for the second part I want to tell you about: The Copyright
For every code you use, you will see a copyright(At least all my codes have copyright).  That means that it is the persons code who created it.  If you remove the copyright, you will get banned from my forum, if you joined yet.  That also goes with Code Ripping.

That is basicly all I have for right now.  I will do some about accuall coding later.  Thanks and I hope you like this guide.
« Last Edit: May 02, 2008, 08:33:37 pm by Agent Moose »
Check out Revolution X's Brand new Code Index!

 

Related Topics

  Subject / Started by Replies Last post
1 Replies
1033 Views
Last post January 15, 2007, 02:08:09 pm
by Crasy
3 Replies
11065 Views
Last post April 13, 2007, 08:11:55 pm
by Mdog
12 Replies
2044 Views
Last post March 17, 2008, 09:35:22 pm
by Ina
6 Replies
1713 Views
Last post February 03, 2009, 01:49:18 pm
by Colette Brunel
3 Replies
1146 Views
Last post July 07, 2009, 11:08:49 pm
by Nevada