Advertise Here

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Vitality

Pages: [1]
1
What does it do: It will fade all locked topics in forum view.
Preview: None
Where does it go: Footers

Code: [Select]
<script type="text/javascript">
/*Vitality - ZBCode*/
if(location.href.indexOf("board,")!=-1){
var getTd=document.getElementsByTagName("td")
var gotTD=getTd.length;
while(gotTD--){
if(getTd[gotTD].className=="windowbg"&&getTd[gotTD].innerHTML.indexOf("<span id=")!=-1&&getTd[gotTD].innerHTML.indexOf("<img")!=-1){
getTd[gotTD].parentNode.style.opacity='0.7';
}
}
}
</script>
You can edit that last line to change the opacity. Just change the 0.7 to whatever you want. The lower the number, the more you won't be able to see.

2
SMF For Free Codes and Support / [Code] Quick Announcements
« on: March 28, 2009, 12:50:59 pm »
A quick announcement system where a new tab is added next to the "Members" tab, and when you hover over it, news will appear below the "Welcome to SMF For Free" text right above the tabs. When your mouse leaves the news area (the added news), it will collapse.

Preview: http://vitalitytests.smfforfree.com/index.php

Headers
Code: [Select]
<script src="/jquery.js"></script>
Footers
Code: [Select]
<script type="text/javascript">
/*Vitality - TCZ|SMFforfree Support|Revolution X*/
var thenewnews="THIS IS THE NEWS!";

$("td.maintab_back:contains('Members')").after("<td id='thetab' class='maintab_back' style='cursor:pointer'>News</td>");$("td.titlebg2:contains('Welcome to SMF For Free')").append("<div id='thenews' style='display: none;'><br />"+thenewnews+"</div>");$("#thetab").mouseover(function(){$("#thenews").show();});$("#thenews").mouseout(function (){$("#thenews").hide();});
</script>
Quickly edit the line
Code: [Select]
var thenewnews="THIS IS THE NEWS!"; with the news you would like to have shown. Edit the part between the " ".
Enjoy!

3
SMF For Free Codes and Support / Scroll Up In Topics
« on: November 27, 2008, 10:52:55 pm »
A simple script that will place a link next to your report to a moderator link, and when it is clicked, it will scroll to the top of the page. I found scrolling back up to read previous posts on certain pages to be a bit tedious, so I wrote this up really quickly.

If you don't already have it, paste this into your headers
Code: [Select]
<script src="/jquery.js"></script>
Footers
Code: [Select]
<script>
/*Vitality of TCZ || smfsupport || Revolution X*/
if(location.href.match('topic,')){
$("a:contains('Report to moderator')").after(" <a href='javascript:window.scrollTo(0,0);'>Go Up</a>");
}
</script>
Enjoy!

4
General Discussion / jQuery
« on: November 14, 2008, 10:38:48 am »
Just a question for all of the coders here on smf. Why is jQuery the most used language (library) here? Is there a reason why most of the codes (excluding Moose's) are in jQuery? What's wrong with classic JS?
Just wondering, and it's interesting to see various perspectives. :)

5
SMF For Free Codes and Support / [Code] Change Username Colors Across Board
« on: November 11, 2008, 10:43:46 pm »
If you're an admin, and your group color is red, this will find every link to your profile, and change the color of it to the color the group; in this case, it would be red. You can have multiple names colored, and in different colors.
FOOTERS
Code: [Select]
<script>
/*Change username colors across board by Vitality of TCZ || Revolution X*/
var a = document.getElementsByTagName('a')
function changer (xid,xuser,xcolor){
for(i=0,n=a.length;i<n;i++){
if(a[i].href.match(xid) && a[i].innerHTML.match(xuser)){
a[i].style.color=xcolor
}}}
changer("u=1","Vitality","blue");
</script>
All you need to edit is that line at the bottom, right before the final script tag.
Here is the outline if you're unsure of what goes where/if you'd like to add more (for reference):
Code: [Select]
changer("u=#","USERNAME","COLOR");
Enjoy!

6
SMF For Free Codes and Support / [Code] Change Info Center Text
« on: November 05, 2008, 09:03:33 pm »
My first SMF code, something simple to get used to the new classes and such.
This replaces the text that says "Info Center" on the header above your stats.

Footers
Code: [Select]
<script>
/*Change Info Center Text By Vitality; Revolution X SMF For Free Support*/

newtext = "NEW_TEXT"

var a = document.getElementsByTagName('div')
for(i=0;i<a.length;i++){
if(a[i].className == "catbg" && a[i].innerHTML.match(/Info Center/i)){
a[i].innerHTML = a[i].innerHTML.replace("Info Center",newtext);
}}
</script>

Pages: [1]