|
1
on: September 21, 2009, 07:14:28 am
|
|
Started by Agent Moose - Last post by Agent Moose
|
Footers: <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.htmlThis 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  Enjoy  EDIT: Code Updated
|
|
2
on: September 21, 2009, 07:14:08 am
|
|
Started by Agent Moose - Last post by Agent Moose
|
Footers: <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=register'>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  If you put {user} in the var yes = ""; part, it will show the users' username  Enjoy 
|
|
3
on: July 21, 2009, 11:46:42 pm
|
|
Started by Agent Moose - Last post by Agent Moose
|
Footers: <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.htmlThis will add a notice box to a certain user, which the admin can specify  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 
|
|
4
on: July 21, 2009, 11:45:03 pm
|
|
Started by Agent Moose - Last post by Agent Moose
|
<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.htmlThis 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: This topic has been moved to [BOARD] by [USER].\n\n[TOPIC URL] It would look like this: 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 
|
|
5
on: June 28, 2009, 12:06:53 pm
|
|
Started by Agent Moose - Last post by Agent Moose
|
Footers: <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  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 
|
|
6
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:
|
|
7
on: June 16, 2009, 08:04:43 am
|
|
Started by Agent Moose - Last post by Agent Moose
|
Footers: <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.htmlThis 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  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: 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: 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: PassProWeb("test","moose"); PassProWeb("p=1","Agent"); Also, to add more pages to protect, add more of these lines: PassProWeb("PAGE","PASSWORD"); Enjoy 
|
|
8
on: June 12, 2009, 08:31:38 am
|
|
Started by Agent Moose - Last post by Agent Moose
|
Footers: <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: var new = "Text; "; Enjoy 
|
|
9
on: June 03, 2009, 11:51:27 am
|
|
Started by Agent Moose - Last post by Agent Moose
|
Footers: <script type="text/javascript"> var NumWords = 3;
//Created by Agent Moose (revolutionx.smfforfree3.com) var username = $("td.titlebg2 span b").not($("td.titlebg2 span b:contains(News)")).html(); if(username){ if(location.href.match(/action=post/i)){ $("textarea[name='message']").after("<span id='SMC_Count'>Total words typed: <b>0</b></span>"); }else if(location.href.match(/topic,/i) && document.forms.postmodify.message){ $("tr#quickReplyOptions td[width='25%']").html("<span id='SMC_Count'>Total words typed: <b>0</b></span>"); }; if(location.href.match(/action=post/i) || location.href.match(/topic,/i) && document.forms.postmodify.message){ $("input[value='Post'],input[value='Preview']").attr("disabled","disabled"); document.forms.postmodify.message.onkeyup = function(){ var Words = document.forms.postmodify.message.value.split(/ /g); var Count = 0; for(i=0;i<Words.length;i++) if(Words[i].length > 2) Count++; var Bar = Count * 2; $("#SMC_Count").html("Total words typed: <b>" + Count + "</b>"); if(Count < NumWords) $("input[value='Post'],input[value='Preview']").attr("disabled","disabled"); if(Count >= NumWords) $("input[value='Post'],input[value='Preview']").attr("disabled",""); };}; }; </script> Well, I decided to finally release this code. Its not the same as the one we have on here, but its all you need  This code makes it so if you have under a certain amount of words in a post, you can't post that post. See this line at the top of the code? var NumWords = 3; The 3 is how many words you need enable to submit a post  Enjoy 
|
|
10
on: May 30, 2009, 08:59:20 pm
|
|
Started by Agent Moose - Last post by Agent Moose
|
Headers: <script type="text/javascript"> function CertainBanner(tab,img){ if(location.href.match("action=" + tab)) document.write("<center><img src='" + img + "' /></center>"); }; CertainBanner("SECTION","URL"); </script> Original Request: http://www.smfsupport.com/support/code_requests/request_certain_banners_for_certain_pages-t27113.0.html SECTION = The page you want the image to show To get the SECTION part, click on one of the tabs and look in the URL for the red part: ?action=forum That would be the part you need to put in the SECTION part of the code. URL = The URL of the image. Here is an example of how to edit the code: CertainBanner("admin","http://i56.photobucket.com/albums/g188/yort124/lick.gif"); The SECTION part is "admin", which I got from "?action=admin", meaning that the image specified would only appear on the admin section of the forum. Enjoy 
|
|