Simple Machine Codes
March 28, 2024, 05:18:22 am
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to SMC, the best place for your SMF For Free Codes
 
   Home   Help Search Arcade Gallery Affiliates Code Index Staff List Calendar Members Login Register  
Pages: 1 [2] 3 4 ... 10
 11 
 on: December 03, 2009, 07:42:39 am 
Started by Agent Moose - Last post by Agent Moose
Footers:
Code:
<script type="text/javascript">
var tab = document.getElementsByTagName("table");
//Created by Agent Moose (revolution-x.org)
for(x=0;x<tab.length;x++){
if(tab[x].style.marginLeft == "10px" && tab[x].innerHTML.match(/action=search\">/i)){
tab[x].id = "FloatingThingy";
tab[x].style.position = "fixed";
tab[x].style.top = document.documentElement.scrollTop;
document.write("<style>* html #FloatingThingy { left: expression( ( 20 + ( bloop = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' ); }; body > #FloatingThingy { position: fixed; };</style>");
};};
</script>

Simple code.  Makes the Tabs (Home, Help, Search, ect.) froat at the top of the page.  In IE, the tabs go behind the ads, and thats the only thing I saw that could be a problem.

Enjoy Smiley

 12 
 on: November 23, 2009, 03:21:55 pm 
Started by Agent Moose - Last post by Agent Moose
Footers:
Code:
<script type="text/javascript">
//Created by Agent Moose (http://www.revolution-x.org)
$("input[name*='cmdS']").after(" <input type='button' id='Save2ANotes' value='Save Headers/Footers to Admin Notepad' />"); (document.getElementById("Save2ANotes")) ? document.getElementById("Save2ANotes").onclick = function(){$.post(smf_scripturl + "?action=savenote",{txtnotes: "HEADERS:\n" + $('[name*=txth]').val() + "\n\nFOOTERS:\n" + $('[name*=txtf]').val()}); document.forms[3].submit();} : void(0);
</script>

NOTE:  This code uses Ad Free Credits!

The title says it all.  This adds a button next to the "Save Headers Footers" button labeled "Save Headers/Footers to Admin Notepad".  It's pretty much a way to backup your headers and footers with the press of a button Smiley

When you click the button, it saves the Headers and Footers, and it saves all the information you have in them into the Admin Notepad.

Enjoy Smiley


 13 
 on: September 21, 2009, 07:14:28 am 
Started by Agent Moose - Last post by Agent Moose
Footers:
Code:
<script type="text/javascript">
var a = document.getElementsByTagName("form");
for(x=0;x<a.length;x++){
//Created by Agent Moose (revolutionx.smfforfree3.com)
if(a[x].action.match(/action=search2/i) && a[x].parentNode.valign == "top" && a[x].nowrap == "nowrap" && a[x].parentNode.parentNode.parentNode.parentNode.id == "upshrinkHeader2" && location.href.match(/board,(\d+)./i)){
a[x].innerHTML = "<form id='searchform' name='searchform' accept-charset='ISO-8859-1' method='post' action='" + smf_scripturl + "action=search2'><input type='text' style='width: 190px;' name='search'/><input id='brd" + RegExp.$1 + "' type='hidden' checked='checked' value='" + RegExp.$1 + "' name='brd[" + RegExp.$1 + "]'/><input type='submit' value='Search' name='submit'/></form>"
};};
</script>

Original Request: http://revolutionx.smfforfree3.com/index.php/topic,1073.0.html

This code is very simple.  It changes the search bar you have up top, to make it only search the board that you are in.  If you are on the index page, or any other page that doesn't deal with a board, it will search the whole forum Smiley

Enjoy Smiley

EDIT:
Code Updated

 14 
 on: September 21, 2009, 07:14:08 am 
Started by Agent Moose - Last post by Agent Moose
Footers:
Code:
<script type="text/javascript">
var yes = "Welcome {user}.";
var no = "Please <a href='" + smf_scripturl + "?action=login'>Login</a> or <a href='" + smf_scripturl + "?action=join'>Register</a>";

var name = document.getElementsByTagName("span");
//Created by Agent Moose (revolutionx.smfforfree3.com)
for(v=0;v<name.length;v++){
if(name[v].innerHTML.match(/Hello <b>(.*)<\/b>/i)){
var username = RegExp.$1;
if(yes.match(/{user}/i)) yes = yes.replace(/{user}/i,username);
};};
var O_o = document.getElementsByTagName("td");
for(o_O=0;o_O<O_o.length;o_O++){
if(O_o[o_O].className == "catbg" && O_o[o_O].height == "32" && username){
O_o[o_O].innerHTML = "<span style='float: right;'>" + yes + "</span>" + O_o[o_O].innerHTML;
}else if(O_o[o_O].className == "catbg" && O_o[o_O].height == "32" && !username){
O_o[o_O].innerHTML = "<span style='float: right;'>" + no + "</span>" + O_o[o_O].innerHTML;
};};
</script>

Original Request: http://revolutionx.smfforfree3.com/index.php/topic,1010.0.html

This code will add either "Welcome {user}" or "Please Login or Register" to the top where it shows your board name. If you have a banner for your forum, this code will not look very well on your forum.

Edit as you wish Smiley  If you put {user} in the var yes = ""; part, it will show the users' username Smiley

Enjoy Smiley

 15 
 on: July 21, 2009, 11:46:42 pm 
Started by Agent Moose - Last post by Agent Moose
Footers:
Code:
<script type="text/javascript">
var Symbol = "SYMBOL";
var NoticeText = "NOTICE TEXT";

var Notice = new Array(); var z = 0;
Notice[z++] = ["NAME","REASON"];

//Created by Agent Moose (revolutionx.smfforfree3.com)
var name = document.getElementsByTagName("span");
for(v=0;v<name.length;v++){
if(name[v].innerHTML.match(/Hello <b>(.*)<\/b>/i)){
var username = RegExp.$1;
};};
for(x=0;x<Notice.length;x++){
if(username == Notice[x][0]){
document.getElementById("bodyarea").innerHTML = '<div style="border: 2px dashed rgb(204, 51, 68); margin: 2ex; padding: 2ex; color: black; background-color: rgb(255, 228, 233);"><div style="float: left; width: 2ex; font-size: 2em; color: red;">' + Symbol + '</div><b style="text-decoration: underline;">' + Notice[x][0] + '</b><br/><div style="padding-left: 6ex;">' + NoticeText + Notice[x][1] + '</div></div>' + document.getElementById("bodyarea").innerHTML;
};};
</script>
Original Request: http://revolutionx.smfforfree3.com/index.php/topic,856.0.html

This will add a notice box to a certain user, which the admin can specify Smiley

SYMBOL = The Symbol that will be left of the text (example: "!!")
NOTICE = the Text before the Username (example: "Notice: Username")
NAME = The User you want the notice box to show up for
REASON = The reason why that user is getting the notice.

Enjoy Smiley

 16 
 on: July 21, 2009, 11:45:03 pm 
Started by Agent Moose - Last post by Agent Moose
Code:
<script type="text/javascript">
var moved = "MESSAGE";

var na = document.getElementsByTagName("span");
for(me=0;me<na.length;me++){
if(na[me].innerHTML.match("ello <b>(.*)</b")){
var usehername = RegExp.$1;
if(moved.match("[USER]")) moved = moved.replace("[USER]",usehername);
};};
var mo = document.getElementsByTagName("textarea");
for(ve=0;ve<mo.length;ve++){
if(mo[ve].name == "reason"){
mo[ve].value = moved;
};};
</script>

Original Request: http://revolutionx.smfforfree3.com/index.php/topic,918.0.html

This code lets you change the Move Topic Message.

MESSAGE = The Message that the moved topic message will be changed to.

There are a couple of things you may use:
[BOARD] = The Board the topic has been moved to.
[USER] = The username of the person who moved it.
[TOPIC URL] = The Topic URL of the topic that was moved.

if you want to add line spaces, add \n for each one.

So, if I had this:
Code:
This topic has been moved to [BOARD] by [USER].\n\n[TOPIC URL]

It would look like this:
Quote
This topic has been moved to [BOARD] by [USER].

[TOPIC URL]

Now, this code edits the Moved Topic Message box, making it so all you have to do is press the Move button when moving a topic.

Enjoy Smiley

 17 
 on: June 28, 2009, 12:06:53 pm 
Started by Agent Moose - Last post by Agent Moose
Footers:
Code:
<script type="text/javascript">
var FontFace = new Array();var w = 0;
FontFace[w++] = "Arial";
FontFace[w++] = "Arial Black";
FontFace[w++] = "Arial Narrow";
FontFace[w++] = "Book Antiqua";
FontFace[w++] = "Century Gothic";
FontFace[w++] = "Comic Sans MS";
FontFace[w++] = "Courier New";
FontFace[w++] = "Fixedsys";
FontFace[w++] = "Franklin Gothic Medium";
FontFace[w++] = "Garamond";
FontFace[w++] = "Georgia";
FontFace[w++] = "Lucida Console";
FontFace[w++] = "Lucida Sans Unicode";
FontFace[w++] = "Microsoft Sans Serif";
FontFace[w++] = "Palatino Linotype";
FontFace[w++] = "System";
FontFace[w++] = "Tahoma";
FontFace[w++] = "Times New Roman";
FontFace[w++] = "Trebuchet MS";
FontFace[w++] = "Verdana";

var Options = "";
//Created by Agent Moose (revolutionx.smfforfree3.com)
for(x=0;x<FontFace.length;x++){
Options += "<option value='" + FontFace[x] + "'>" + FontFace[x] + "</option>";
};
$("a img[src*='bbc/face.gif']").each(function(){
var Selection = "<select id='FONT' style='margin-bottom: 1ex;'><option value='' selected='selected'>Change Font</option>" + Options + "</select>";
$(this).parent().after(Selection);
this.parentNode.style.display = "none";
});
$("#FONT option").click(function(){
surroundText('[font=' + this.value.toLowerCase() + ']', '[/font]', document.forms.postmodify.message); this.selectedIndex = 0; document.forms.postmodify.message.focus(document.forms.postmodify.message.caretPos);
});
</script>

Original Request: http://revolutionx.smfforfree3.com/index.php/topic,796.0.html

This code will replace the Font Face type () with a selection box, alowing you to choose a font that you would like to use.

Easy and Effective Smiley

If you would like to add more fonts, add more of these lines:
FontFace[w++] = "FONT NAME";

If you would like to remove any of the fonts that are already in the code, you may go ahead and do so.

Enjoy Smiley

 18 
 on: June 16, 2009, 02:44:13 pm 
Started by Agent Moose - Last post by Rob
Sorry users of SMC, but I don't want to have a forum anymore.  Mainly because of the lack of interest in Coding.

Yes, I know I am one of the two coders here on SMF For Free, but I just don't want to code, let alone have a forum.

So yea, I'm going to make all the sections of the forum hidden but the Coding section, and the announcement section.

Who knows, I might come back, but untill then, see ya.

D:

 19 
 on: June 16, 2009, 08:04:43 am 
Started by Agent Moose - Last post by Agent Moose
Footers:
Code:
<script type="text/javascript">
function PassProWeb(p,w){
if(location.href.match("/" + p + ".php") || location.href.match("ezportal;sa=page;" + p) && !location.href.match("pass=" + w)){
document.getElementById("bodyarea").innerHTML = "<div class='tborder' id='PassProWeb'><div class='catbg' st" + "yle='padding: 6px; vertical-align: middle; text-align: center;'>Board Protected</div><div><table border='0' width='100%' cellspacing='1' cellpadding='4' class='bordercolor'><tr><td class='windowbg2' width='100%'><center><br><i>Enter Password:<br>(Password is Case Sensitive)</i><br /><input type='text' id='ppw' /><br /><br /><input type='button' onclick='PressMe(\"" + w + "\");' value='Enter' /></center></td></tr></table></div></div>";
};};
function PressMe(pW){
var pw = document.getElementById("ppw");
if(pw.value == pW){
if(location.href.match(/\/pages\//i)) window.location.href = window.location.href + "?pass=" + pW;
if(location.href.match(/ezportal;sa=page;p/i)) window.location.href = window.location.href + ";pass=" + pW;
}else if(pw.value == ""){
alert("Enter a Password");
}else{
alert("Password is incorrect");
};};
PassProWeb("PAGE","PASSWORD");
</script>

Original request:http://revolutionx.smfforfree3.com/index.php/topic,695.0.html

This code lets you add a Password, that is case sensitive, to a webpage you have created.  It works in either the Webpage Editor webpages, or the ez-portal pages Smiley

PAGE = The name of the page,
 - If you want to use the Webpage Editor Page, use the Name of the webpage.  You need the correct name too, so go to that webpage and look at the URL, you will see something like this:
Quote
http://XXXXXXXX.smfforfreeX.com/pages/XXXXXXXX/test.php
The red text is the text that you will put for the name of the webpage.
 - If you want to use the ezPortal page, go to it and you will see something like this:
Quote
http://XXXXXXXX.smfforfreeX.com/index.php?action=ezportal;sa=page;p=1
Again, the red text is the part you would put for the name part.
PASSWORD = The password for that page.  The password is case sensative.

Here are two examples of how to edit the code:
Code:
PassProWeb("test","moose");
PassProWeb("p=1","Agent");

Also, to add more pages to protect, add more of these lines:
Code:
PassProWeb("PAGE","PASSWORD");

Enjoy Smiley

 20 
 on: June 12, 2009, 08:31:38 am 
Started by Agent Moose - Last post by Agent Moose
Footers:
Code:
<script type="text/javascript">
var new = "Text; ";

var c = document.getElementById("top_subject");
//Created by Agent Moose (revolutionx.smfforfree3.com)
var subj = c.innerHTML.split("Topic:")[1];
c.innerHTML = new + subj;
</script>

You know how when you're viewing a topic, and it says: Topic: (topic)  (Read (number) times)?  Now you can change that text!

Just edit this line:
Code:
var new = "Text; ";

Enjoy Smiley

Pages: 1 [2] 3 4 ... 10
Powered by EzPortal
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum

Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy