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:

Username:   Password:
Add Reply
Advanced Weather v1; By Justin186
Topic Started: Feb 3 2010, 11:48 PM (2,717 Views)
Reid
Member Avatar
È una trappola!

This topic has been moved from our official support board.

Originally posted by: Justin186
Advanced Weather v1
 
When i was making this code, I was thinking of jQuery. How the functions written in jQuery make the coding alot easier to write. I decided to make a few functions of my own which I will release a small javascript library which i might start using in most of my new codes. Its just to make things a bit simpler to write :)

eWeathMan is the weather man AKA the only person who can adjust the weather
eWeathManId is the user id of the the weatherman

So this pretty much just creates a Weather System, With a Weather CP :)

Code:
 

<script type='text/javascript'>

var eWeathMan = "ebk forever";
var eWeathManId = 366660;

document.body.innerHTML += "<iframe src = '"+main_url+"profile/"+eWeathManId+"' name = 'fraymez' id='fraymez' onload = 'aDisp()' width='0' height='0' border='0'></iframe>";

getId("submenu").innerHTML += "<a href='"+main_url+"index/?c=Weather'>Weather CP</a>"


if(location.href.indexOf("index/?c=Weather") != -1){
var aDat = "<table class='cat_head' style='-moz-border-radius: 5px;' width='100%' border='3'><tr style='text-align: center;'><td><h2>Error - Access Denied</h2></td></tr></table><table style='margin-top:10px;margin-bottom:10px;height:90px;-moz-border-radius: 5px;' width='100%' border='3'><tr style='-moz-border-radius: 5px;'><td style='text-align: center;-moz-border-radius: 5px;'>You do not have access to this panel. The only user that has access to this panel is:<br>Weatherman: "+eWeathMan+"</td></tr></table>";
var aUser = getUser();
if(isMan(aUser)){
aDat = "<table class='cat_head' style='-moz-border-radius: 5px;' width='100%' border='3'><tr style='text-align: center;'><td><h2>Welcome to Weather CP</h2></td></tr></table><table style='margin-top:10px;margin-bottom:10px;height:90px;-moz-border-radius: 5px;' width='100%' border='3'><tr style='-moz-border-radius: 5px;'><td style='text-align: center;-moz-border-radius: 5px;'>Welcome, "+eWeathMan+".<br><br><iframe src='" + main_url + "home/?c=32' name='setWeath' id='setWeath' width='0' height='0' border='0'></iframe><form onsubmit='eSetWeather()'>Set Weather: <input type='text' id='weather'><br><br><input type='submit'></form></td></tr></table>";
}
getId("main").innerHTML = aDat;
}




function aDisp(){
var aFrame = window.frames['fraymez'].getClass("td","c_sig");
var Weather = "Sunny day, not a cloud in sight";
if(aFrame.innerHTML.indexOf("[Weather: ") !=1){
var aSplitA = aFrame.innerHTML.split("Weather: ")[1];
Weather = aSplitA.split("]")[0];
}
var aFx = getId("fraymez");
aFx.parentNode.removeChild(aFx);
getId("submenu_bar").innerHTML += "Weather Report: <b>"+Weather+"</b>";
}


function eSetWeather(){
var weather = document.getElementById('weather').value;
window.frames['setWeath'].document.forms['posting'].post.value = "[Weather: "+weather+"]"
window.frames['setWeath'].document.forms['posting'].submit();
alert("Weather Set")
}

function isMan(user){
if(user == eWeathMan){
return true;
}
}

function getId(ids){
return document.getElementById(ids);
}

function getUser(){
var aUser = getId("top_info");
return aUser.getElementsByTagName("a")[0].innerHTML;
}

function getClass(aTag, aClass){
var aLtAgo = document.getElementsByTagName(aTag);
for(Agp=0;Agp<aLtAgo.length;Agp++){
if(aLtAgo[Agp].className == aClass){
return aLtAgo[Agp];
}
}
}
</script>
Offline Profile Quote Post Goto Top
 
Weatherservice
Member Avatar
Member
[ * ]
Does this work? It could be handy for my forum which is weather based.

Regards.

link: http://s1.zetaboards.com/WeatherServices/index/
Offline Profile Quote Post Goto Top
 
Skyon Archer
Member Avatar
Member
[ *  *  *  * ]
I could get the Weather Cp link in the submenu, I could visit the weather page, but from there it just died. I couldn't "set the weather" and it never iframed my profile as expected. It partially worked for me.
Offline Profile Quote Post Goto Top
 
Swim-ZNR
Member Avatar
Gaga for Gaga
[ *  *  * ]
Doesn't work.
Offline Profile Quote Post Goto Top
 
.awd (R)
Member Avatar
Member
[ *  *  * ]
Where am I supposed to put this
Offline Profile Quote Post Goto Top
 
.awd (R)
Member Avatar
Member
[ *  *  * ]
Codes Rock
May 18 2010, 04:04 PM
I could get the Weather Cp link in the submenu, I could visit the weather page, but from there it just died. I couldn't "set the weather" and it never iframed my profile as expected. It partially worked for me.
same here
Offline Profile Quote Post Goto Top
 
Weatherservice
Member Avatar
Member
[ * ]
Can someone restyl this?
Offline Profile Quote Post Goto Top
 
.awd (R)
Member Avatar
Member
[ *  *  * ]
Try a request?
Offline Profile Quote Post Goto Top
 
ERVMEDVAC
Member
[ * ]
.awd
Aug 20 2010, 08:55 PM
Where am I supposed to put this
i put it in the Below the Board section. it doesn't seem to do anything. it all works for me. i say rainy day and it says "weather set", but it doesn't really do anything.
Offline Profile Quote Post Goto Top
 
Ferby
Member Avatar
Developer
[ *  *  *  *  * ]
lol what does this do? I change it and it doesnt actually change anything
Offline Profile Quote Post Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Code:
 
#submenu_bar {
display: none;
}
Most themes have something like that added to the CSS to get rid of the submenu bar, you need the submenu bar to display in order for the weather report to be shown, otherwise it will just display in the users signature that you gave Weather CP access to. Here's a preview of what it looks like in the submenu bar: http://img829.imageshack.us/img829/2627/21740d9f60b545e387f89fc.png
Online Profile Quote Post Goto Top
 
Ferby
Member Avatar
Developer
[ *  *  *  *  * ]
Cory
Mar 25 2012, 08:54 AM
Code:
 
#submenu_bar {
display: none;
}
Most themes have something like that added to the CSS to get rid of the submenu bar, you need the submenu bar to display in order for the weather report to be shown, otherwise it will just display in the users signature that you gave Weather CP access to. Here's a preview of what it looks like in the submenu bar: http://img829.imageshack.us/img829/2627/21740d9f60b545e387f89fc.png
Nope, still down work
Offline Profile Quote Post Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
It probably has browser issues and other issues since so many people have had problems with it, I advise not using it, especially considering what it does (for me at least) can be done a lot easier by appending text to your submenu.
Online Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · ZetaBoards Codes & Modifications · Next Topic »
Add Reply