InvisionFree - Free Forum Hosting
Free Forums. Reliable service with over 8 years of experience.

Learn More · Register Now
Welcome to RPGXP Unlimited. We hope you enjoy your visit.


You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Name:   Password:


 

 A couple of scripts for this site
SCMike
Posted: Aug 26 2006, 05:19 AM


Advanced
*

Group: Advanced
Posts: 395
Member No.: 16
Joined: 17-May 06



Hey, I figured I'd share these with you, Marked. It's an award system and a "today, yesterday" post script as well as a hide posts by certain group system. Place them in the footer if you use them...

Award:
CODE
<script language="javascript">
// Advanced Awards System
// created by Ryan Fan/Nitrogenix
// http://www.ifsz.com , 2005
var x = document.getElementsByTagName('TABLE')
for(y=0;y<x.length;y++){
if(x[y].cellPadding == "6" && x[y].cellSpacing == "1" && x[y].width == "100%" && x[y].rows[0].cells[0].innerHTML == "Information" && x[y].rows[0].cells[0].className == "maintitle"){
iRowx = x[y].insertRow(5)
rowt = iRowx.insertCell(0)
rowt.innerHTML = "<b>Awards</b>"
rowt.className = "row3"
rowt.width = "30%"
rowt.vAlign = "top"
rowf = iRowx.insertCell(1)
rowf.innerHTML = "<i>No Information</i>"
}}
function awarduser(iD, Img, Iname){
if(location.href.match('showuser=' + iD + '$')){
rowf.innerHTML = rowf.innerHTML.replace(/No Information/i, "")
rowf.innerHTML += Iname + " - " + "<img src='" + Img + "'><br>"
rowf.className = "row1"
rowf.align = "left"
}}
awarduser("1", "http://img.photobucket.com/albums/v59/tamo_konichi/Fire.png", "Test Award")
</script>
Just take where it says awarduser at the bottom. It will give people awards. You just have to know user number, then a picture for the award, then a name for the award.

Yesterday, Today posting
CODE
<script language="JavaScript">
/*
Show "Today" or "Yesterday" in Last Post Info - v2.0
by Verminox
http://forum.ifcode.com
*/

function write_date(theday)
{
var thetime=new Date();

var nmonth=thetime.getMonth();
if(theday=='t'){
var ntoday=(thetime.getDate());
}
else if(theday=='y'){
var ntoday=(thetime.getDate()-1);
}
var nyear=thetime.getYear();

nmonth+=1;

var xmonth = new Array()
xmonth[1] = "Jan"
xmonth[2] = "Feb"
xmonth[3] = "Mar"
xmonth[4] = "Apr"
xmonth[5] = "May"
xmonth[6] = "Jun"
xmonth[7] = "Jul"
xmonth[8] = "Aug"
xmonth[9] = "Sept"
xmonth[10] = "Oct"
xmonth[11] = "Nov"
xmonth[12] = "Dec"

for(n=1;n<13;n++){
if (nmonth==n){
nmonth=xmonth[n];
}}


if (nyear<=99)
nyear= "19"+nyear;

if ((nyear>99) && (nyear<2000))
nyear+=1900;


return nmonth + " " + ntoday + " " + nyear;


}

var today = write_date('t')

var yesterday = write_date('y')

var datecell = document.getElementsByTagName('TD')

for(x=0;x<datecell.length;x++){
if(datecell[x].innerHTML.match(today) && datecell[x].innerHTML.match(/By:/i)){
datecell[x].innerHTML = datecell[x].innerHTML.replace(today, "Today")
}}

for(y=0;y<datecell.length;y++){
if(datecell[y].innerHTML.match(yesterday) && datecell[y].innerHTML.match(/By:/i)){
datecell[y].innerHTML = datecell[y].innerHTML.replace(yesterday, "Yesterday")
}}

</script><script language='javascript' type='text/javascript'>
<!--
itm = null;
itm = document.getElementById('qr_open');
if (itm) itm.style.display = '';
//-->
</script>
This code changes it so that the posts say "Today" if it was posted today or "yesterday" if it was posted yesterday...otherwise, it goes back to normal.

Hide Posts of Banned Group:
CODE
<script type="text/javascript">
/*
Hide Posts of Banned Group
by Verminox
http://forum.ifcode.com
*/


var group = "Permanently Banned"


var spn = document.getElementsByTagName('SPAN')
for(x=0;x<spn.length;x++){
if(spn[x].className=="postdetails" && spn[x].innerHTML.match("Group: " + group)){
spn[x].parentNode.parentNode.parentNode.parentNode.style.display = "none"
}}
</script>
I use this to hide the posts of banned people...

EDIT: Added an offline/online legend. Just put it in the Header & Body underneath everything else...

CODE
<script>//Online/Offline Legend v2 - By Markup
dir="http://img.photobucket.com/albums/v59/tamo_konichi/Forum/"
home=location.href.lastIndexOf("/")>26?location.href.substr(0,location.href.lastIndexOf("/")):location.href
names=[]
if(top.location==location)
document.write("<IFRAME id=index name=index src="+home+" width=0 height=0 border=0 frameBorder=0></IFRAME>")
else
{
div=document.body.getElementsByTagName("DIV")
for(i=0;i<div.length;i++)
if(div[i].className=="thin")
 break
a=div[i].getElementsByTagName("A")
for(i=0;i<a.length;i++)
names[i]=a[i].innerHTML.replace(/<[^>]+>/g,"")
parent.updateStatus()
}
function updateStatus()
{
td=document.body.getElementsByTagName("TD")
for(i=0;i<td.length;i++)
if((td[i].className=="post1"||td[i].className=="post2")&&td[i].innerHTML.match("Posts: ")&&td[i].width!="100%")
{
 found=false
 sPost=td[i].getElementsByTagName("SPAN")[0]
 names=parent.frames['index'].names
 for(a=0;a<names.length;a++)
  if(td[i-2].innerHTML.replace(/<[^>]+>/g,"")==names[a])
  {
   sPost.innerHTML+="<P align=left><IMG SRC="+dir+"Online.png"+"></P>"
   found=true
  }
 if(!found)
  sPost.innerHTML+="<P align=left><IMG SRC="+dir+"Offline.png"+"></P>"
}
}
</script>

At the top you will see "dir="http://img.photobucket.com/albums/v59/tamo_konichi/Forum/"" Edit that to wherever your online and offline images are. Then just find where it says "Online.png" and "Offline.png" and change them to whatever the image is that you have.

This post has been edited by SCMike on Aug 26 2006, 05:36 AM


--------------------
I became third toppest poster on July 5, 2006 at 12:10 AM. I'M HAPPY!!! Wanna see what post made me third toppest (probably not)? Go here.
RPGXP Unlimited reached it's 1,000th post on July 11, 2006 at 11:05PM with the following post: 1,000th post This posted was done by Marked. (GO MARKED!)
Top
Marked
Posted: Aug 26 2006, 04:20 PM


Master
Group Icon

Group: Admin
Posts: 703
Member No.: 1
Joined: 8-May 06



Thanks SCMike, I'll move this into the correct section.
I had many script added before, but they one was making the forum topics not viewable by some members. So I have to be careful. I dont think we need an awards system yet, but if other members want one, I will add it in.
Top
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
DealsFor.me - The best sales, coupons, and discounts for you

Topic Options



User legend
Administrator | Moderator | Newbie | Member | Expert | Advanced | Master | Supreme

Lo-Fi Version

Skin designed by Zeus00 of the IF Skin Zone
Hosted for free by InvisionFree* (Terms of Use: Updated 2/10/2010) | Powered by Invision Power Board v1.3 Final © 2003 IPS, Inc.
Archive