Shoutbox

CSS Code for Status Away - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: CSS Code for Status Away (/showthread.php?tid=70742)

CSS Code for Status Away by ASI Pinoy on 01-16-2007 at 04:38 AM

can anyone give me a code that will enable away status on my forums? *-)


RE: CSS Code for Status Away by FineWolf on 01-16-2007 at 04:46 AM

Number 1, this is not the proper place to post these kinds of questions.

Number 2, the code largely depends on the kind of forums you use, and it's not CSS... If you have no knowledge of the underlaying technology, you rather not modify your forums' code.


RE: CSS Code for Status Away by ASI Pinoy on 01-16-2007 at 04:54 AM

i know what type of forum i have and i know what works on this. i am sorry if this is in the wrong forum. and if u have ever heard of fmods.com, then i am one of the development team members. so i think i know what i am doing.(H)


RE: RE: CSS Code for Status Away by FineWolf on 01-16-2007 at 04:59 AM

quote:
Originally posted by ASI Pinoy
i know what type of forum i have and i know what works on this. i am sorry if this is in the wrong forum. and if u have ever heard of fmods.com, then i am one of the development team members. so i think i know what i am doing.(H)


Then I have no idea why you speak of CSS when you should know that such modification would require PHP code as well as modifications to the MySQL tables in order to hold the away status of the user.

CSS is a stylesheet language used to describe the presentation of a document written in a markup language and doesn't control at all the behaviour a website.
RE: CSS Code for Status Away by ASI Pinoy on 01-16-2007 at 05:17 AM

but my forum isn't php


RE: CSS Code for Status Away by FineWolf on 01-16-2007 at 05:20 AM

Well, it's either PHP, ASP, JSP, Python, Ruby or any other type of dynamic web platform language, but it isn't CSS. What forum platform are you using? Invision's IP.Board?

No offense, but you do not seem to have any knowledge on web technologies.


RE: CSS Code for Status Away by RaceProUK on 01-16-2007 at 07:26 PM

The CSS could be just hiding the controls for Away status.


RE: CSS Code for Status Away by ASI Pinoy on 01-16-2007 at 07:59 PM

this is the online offline code i am using. i don't think css is hiding it.

code:
<script language="javascript" type="text/javascript">
<!-- Online Status Indicator for Forumer

onlineStatus = "<p style='color:green;font-weight:bold'><img src='http://img86.exs.cx/img86/6840/useronline6oh.gif' alt='Online'> Online</p>"
offlineStatus = "<p style='color:red;font-weight:bold'><img src='http://img91.exs.cx/img91/5369/useroffline9qd.gif' alt='Offline'> Offline</p>"

document.write("<iframe name='index' src='{ibf.script_url}act=Online&CODE=listall&sort_key=click' style='display:none' onload='harvest()'></iframe>")

function harvest()
{
var td = window.frames["index"].document.getElementsByTagName("td")
for(var i = 0; i < td.length; i++){
if(td[i].className == "row1" && td[i].parentNode.parentNode.parentNode.parentNode.innerHTML.match("Online Users")){
var tdi = td[i]
harvestLinks(tdi);
}
}
}

function harvestLinks(tdi){
var a = tdi.getElementsByTagName("A")
var names = new Array(a.length)
for(i = 0; i < a.length; i++){
if(a[i].href.match("showuser=")){
names[i] = a[i].innerHTML.replace(/<[^>]+>/g, "")
updateStatus(names);
}
}
}

function updateStatus(names)
{
td=document.body.getElementsByTagName("TD")
for(s=0;s<td.length;s++) {
if((td[s].className=="post1"||td[s].className=="post2")&&td[s].innerHTML.match("Posts: ")&&td[s].width!="100%") {
var poste=td[s].getElementsByTagName("SPAN")[0]
var postName=td[s].parentNode.parentNode.getElementsByTagName("SPAN")[0].getElementsByTagName("A")[0];
for(j = 0; j < names.length; j++){
if(postName.innerHTML==names[j])
{
var replacoo=poste.getElementsByTagName("DIV");
for(p=0;p<replacoo.length;p++){
if(replacoo[p].className=="ShowOn"){
replacoo[p].innerHTML=onlineStatus;
}
else{
//good is sin
}
}
}
}
}
}
}


function OfflineWhen(){
td=document.body.getElementsByTagName("TD")
for(s=0;s<td.length;s++) {
if((td[s].className=="post1"||td[s].className=="post2")&&td[s].innerHTML.match("Posts: ")&&td[s].width!="100%") {
var poste=td[s].getElementsByTagName("SPAN")[0]
if(! poste.innerHTML.match("ShowOn")){
poste.innerHTML += "<br /><div class='ShowOn'>"+offlineStatus+"</div>"
}
}
}
}

OfflineWhen()
// -->
</script>

RE: CSS Code for Status Away by FineWolf on 01-16-2007 at 08:34 PM

Ok, first of all I can clearly see in the code that you are using IP.Board from Invision. Second, why use client side scripting that will fail on workstations with Javascript disabled when you could do the exact same in alot less work directly in the PHP code (Yes, IPB is coded in PHP).

Not to sound rude, but either fmods are accepting anyone in their staff, or they made a mistake by accepting you. Client side scripting should NEVER BE USED if the same could be achived using Server-side scripting (AJAX excluded, but in that case it's an even mix of the two).

(And this is the dirtiest javascript code I have ever seen.)


RE: CSS Code for Status Away by WDZ on 01-16-2007 at 09:08 PM

quote:
Originally posted by ASI Pinoy
document.write("<iframe name='index' src='{ibf.script_url}act=Online&CODE=listall&sort_key=click' style='display:none' onload='harvest()'></iframe>")
[Image: lmao.gif]

That method really sucks, and has some serious limitations. You should only use it if absolutely necessary, like if it's impossible to modify the server-side PHP code. Someone must have access to it, since your board seems to be on a dedicated server: http://69.64.49.113/ :-/

Basically your script just screen-scrapes the "Online Users" page, so unless that page tells you whether someone is "Away" or not, you're out of luck.
RE: CSS Code for Status Away by ASI Pinoy on 01-16-2007 at 11:29 PM

watever, and i didn't make that online code. someone else did. my codes are much more organized and not so complicated, but i am too lazy at this moment to make a new code. and i was posting that at 1am...so i couldn't think straight. so, DO NOT say that FMODS is accepting anyone becuz they aint! trust me, i wasn't thinking (don't try to make a joke out of this!)


RE: CSS Code for Status Away by FineWolf on 01-16-2007 at 11:42 PM

It's still client-side. You could really simplify your code by making modifications to the forum's PHP code (and if you say your forum isn't PHP it just means you have not enough knowledge to make those kinds of modifications to a forum system). Like WDZ and I tried to say, never use client-side scripting languages unless necessary.