PHP Web Host - Quality Web Hosting For All PHP Applications Just Great Software
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
ciph3r
Worker
Worker


Joined: Jun 01, 2005
Posts: 176

PostPosted: Tue Aug 01, 2006 5:47 pm Reply with quote Back to top

I have been doing some testing, and figured out this is a fix for the issues people are having with ShoutBox / vWar Countdown & Ravens ForumsCollapsing Block.

A simple change in the readme, could fix everyones issue.

Here is the problem, in the block file itself, it calls upon the window.onload command, and its a known issue, that this command being used multiple times will cause conflicts.

After doing a little reading I found out how to fix this.
Look for the line (around 413):
Code:
window.onload=start_ticking

Comment out this line, by adding // in front of it
Code:
//window.onload=start_ticking


Now open your shoutbox.js file located in your root directory, and under:
Code:
function allonloads(){
SBpopulate();
}

Add
Code:
start_ticking();


Like this:
Code:
function allonloads(){
SBpopulate();
getVWarTime();
start_ticking();
}


What this does, is eliminates the block from executing the command to actually start the ticker, and other javascripts.....and it executes it from the shoutbox.js file....along with all the other functions that need to be executed. Im more a better coder could elaborate more.

getVWarTime loads my match countdown for the vwar block, so ignore that line...unless you use vwar and are having issues.

I hope this contributes to this amazing community that has helped me out so much.
View user's profile Send private message Visit poster's website
ciph3r
Worker
Worker


Joined: Jun 01, 2005
Posts: 176

PostPosted: Tue Aug 01, 2006 6:40 pm Reply with quote Back to top

Ive noticed that once I made this change, when I go into anything that DOES NOT display the block, the page gets errors.
View user's profile Send private message Visit poster's website
ciph3r
Worker
Worker


Joined: Jun 01, 2005
Posts: 176

PostPosted: Tue Aug 01, 2006 8:08 pm Reply with quote Back to top

Ok, it seems that I have corrected that issue.

What I did, is kind of reverse from what was previously posted.
In the shoutbox.js file, I commented out the window.onload for all the onloads:
Code:
//window.onload=allonloads;


Then in the block-ForumsCollapsing.php file I changed:
Code:
window.onload=start_ticking

To:
Code:
window.onload=allonloads;


All 3 blocks are working now, with no errors on any pages.
View user's profile Send private message Visit poster's website
montego
Site Admin


Joined: Aug 29, 2004
Posts: 7339
Location: Arizona

PostPosted: Tue Aug 01, 2006 8:19 pm Reply with quote Back to top

I have made this a sticky, but want everyone to understand that there are too many combinations of blocks / scripts out there to cover them in the readme, nor does the author have time to test this out on all sorts of combinations.

That is what makes this community so great in that we have folks like yourself which offer up these excellent solutions. I know that this will help others and applaud you for it.

Thanks!

Cheers
View user's profile Send private message Visit poster's website
ciph3r
Worker
Worker


Joined: Jun 01, 2005
Posts: 176

PostPosted: Tue Aug 01, 2006 10:57 pm Reply with quote Back to top

Well, I want to update this, saying its not 100% a fix. I was under the impression it fixed all the pages with all the errors, but for some reason Im stilling getting them on some pages. It is deffinatly the way the start_ticking is set up to load...and I would I knew more about coding so I could figure out another way to execute it.
View user's profile Send private message Visit poster's website
ciph3r
Worker
Worker


Joined: Jun 01, 2005
Posts: 176

PostPosted: Wed Aug 23, 2006 1:25 am Reply with quote Back to top

Anyone got any Ideas?
View user's profile Send private message Visit poster's website
technocrat
Involved
Involved


Joined: Jul 07, 2005
Posts: 492

PostPosted: Wed Aug 23, 2006 9:25 am Reply with quote Back to top

You need to handle the loads differently. First of all the standard is to not even use onload at all. You should be using window.addEventListener. So what you need to do is the change them to an if statement. In this example you just need to change "function" to what your javascript function is.

Code:
    if (window.addEventListener)
        window.addEventListener(\"load\", function, false)
    else if (window.attachEvent)
        window.attachEvent(\"onload\", function)
    else if (document.getElementById)
        womAdd('function()');


The last line uses this:
Only registered users can see links on this board!
Get registered or login to the forums!

Which is simular to what you are using, but a bit cleaner and faster. If you want to see a working example is in the Evo 2.0.0 RC1 download.
View user's profile Send private message
ciph3r
Worker
Worker


Joined: Jun 01, 2005
Posts: 176

PostPosted: Sun Aug 27, 2006 1:31 pm Reply with quote Back to top

so if im running the shoutbox, and the forumscollapsing block...............where exactly will i put this.

Im sorry but im a bit of a newbie.

Would I put this in the shoutbox.js file.......or add it where the onload function is in both the forumscollapsing block, and the shoutbox.js?
View user's profile Send private message Visit poster's website
technocrat
Involved
Involved


Joined: Jul 07, 2005
Posts: 492

PostPosted: Mon Aug 28, 2006 10:42 am Reply with quote Back to top

You just need to replace ALL the onload with the code I provided and then use the WOM loader, or something else like it to create a loading system as a backup for all other browsers.
View user's profile Send private message
ciph3r
Worker
Worker


Joined: Jun 01, 2005
Posts: 176

PostPosted: Mon Aug 28, 2006 7:35 pm Reply with quote Back to top

Ok, so I erase all the window.onload commands, and paste that code.

Then where exactly would I use the command to initiate that new loader, and what exactly would the command be?

Sorry, just a bit confused.
View user's profile Send private message Visit poster's website
ciph3r
Worker
Worker


Joined: Jun 01, 2005
Posts: 176

PostPosted: Tue Aug 29, 2006 12:32 pm Reply with quote Back to top

Any help will be greatly appriciated.

This is still what i have so far.

Code:
function allonloads(){
SBpopulate();
getVWarTime();
start_ticking();
}
View user's profile Send private message Visit poster's website
technocrat
Involved
Involved


Joined: Jul 07, 2005
Posts: 492

PostPosted: Wed Aug 30, 2006 9:09 am Reply with quote Back to top

Did you read the article I posted it explains what to do
View user's profile Send private message
ciph3r
Worker
Worker


Joined: Jun 01, 2005
Posts: 176

PostPosted: Wed Aug 30, 2006 1:26 pm Reply with quote Back to top

Yes I read it, but am a little bit confused.

I would remove function allonloads from the shoutbox.js file.
I opened that file, removed the allonloads and added the code you gave me.

Code:
if (window.addEventListener)
        window.addEventListener(\"load\", function, false)
    else if (window.attachEvent)
        window.attachEvent(\"onload\", function)
    else if (document.getElementById)
        womAdd('SBPopulate()');


But cant get the shoutbox working.
I uploaded the WOM.js file, which I think is the loader right?
View user's profile Send private message Visit poster's website
ciph3r
Worker
Worker


Joined: Jun 01, 2005
Posts: 176

PostPosted: Wed Aug 30, 2006 1:47 pm Reply with quote Back to top

Dont ask me how, but everything seems to be working fine now.
I changed the window.onload=start_ticking to window.onload1=start_ticking() and it seems like everything is working fine now, without errors on any of the pages.

I have
Code:
function allonloads(){
SBpopulate();
getVWarTime();
}


in the Shoutbox.js file, and the block is still working on the main page, so i dunno what changed.........but its working.

I do however want to get this WOM loader stuff figured out, because I would like to use that instead of how it is setup.

Thx in advance.
View user's profile Send private message Visit poster's website
technocrat
Involved
Involved


Joined: Jul 07, 2005
Posts: 492

PostPosted: Thu Aug 31, 2006 9:33 am Reply with quote Back to top

But you dont want to use window.onload thats not a good way to make your scripts work. Which is what I have been telling you. Confused

I am not sure how to make it any clearer. I have given you all the tools to make this work, but I dont know what each script you have is using or how they are setup. So hopefully you will figure this out
View user's profile Send private message
ciph3r
Worker
Worker


Joined: Jun 01, 2005
Posts: 176

PostPosted: Thu Aug 31, 2006 12:23 pm Reply with quote Back to top

The only thing that really confuses me is this:

Code:
if (window.addEventListener)
        window.addEventListener(\"load\", function, false)
    else if (window.attachEvent)
        window.attachEvent(\"onload\", function)
    else if (document.getElementById)
        womAdd('SBPopulate()');
        womAdd('start_ticking()');
        womAdd('getvWarTime()');


I pasted this code where the function allonloads was in the shoutbox.js file.
I then uploaded the WOM.js file, and refreshed my site, and nothing that used javascripts worked. I noticed in dreamweaver when I pasted the code, half of it was still blue, which means its not closed correctly i think.

I have been reading, and trying different things, but my schedule @ work, and trying to run a clan are keeping me busy.

Ill keep trying.
Thx
View user's profile Send private message Visit poster's website
technocrat
Involved
Involved


Joined: Jul 07, 2005
Posts: 492

PostPosted: Thu Aug 31, 2006 12:25 pm Reply with quote Back to top

Have you been changing function to the name of the function to load?
View user's profile Send private message
ciph3r
Worker
Worker


Joined: Jun 01, 2005
Posts: 176

PostPosted: Thu Aug 31, 2006 11:24 pm Reply with quote Back to top

all the functions...im retarted....

I just changed the last function, in the womAdd part.
I didnt change all the functions.

So how would I do more than one function? For example, if I wanted to load the shoutbox, vwartime, and forumscollapsing on the main page, but not use forumscollapsing on other pages.

Code:
if (window.addEventListener)
        window.addEventListener(\"load\", SBPopulate, false)
    else if (window.attachEvent)
        window.attachEvent(\"onload\", SBPopulate)
    else if (document.getElementById)
        womAdd('SBPopulate()');


Instead of

Code:
window.onload=allonloads


Am I on the right track?
View user's profile Send private message Visit poster's website
technocrat
Involved
Involved


Joined: Jul 07, 2005
Posts: 492

PostPosted: Fri Sep 01, 2006 10:10 am Reply with quote Back to top

Yes you are
View user's profile Send private message
ciph3r
Worker
Worker


Joined: Jun 01, 2005
Posts: 176

PostPosted: Fri Sep 01, 2006 2:23 pm Reply with quote Back to top

I cant seem to get it to work. I noticed when i pasted that code into the shoutbox.js file, it was still blue (i use dreamweaver) like it isnt closed off correctly or something.
View user's profile Send private message Visit poster's website
ciph3r
Worker
Worker


Joined: Jun 01, 2005
Posts: 176

PostPosted: Wed Oct 04, 2006 11:19 am Reply with quote Back to top

Any ideas?
View user's profile Send private message Visit poster's website
technocrat
Involved
Involved


Joined: Jul 07, 2005
Posts: 492

PostPosted: Thu Oct 05, 2006 9:30 am Reply with quote Back to top

Here is what we used
Code:
if(window.addEventListener)
    window.addEventListener("load",allonloads,false);
else if (window.attachEvent)
    window.attachEvent("onload", allonloads)
else if (document.getElementById)
    womAdd('allonloads()');
View user's profile Send private message
ciph3r
Worker
Worker


Joined: Jun 01, 2005
Posts: 176

PostPosted: Sun Oct 22, 2006 11:39 pm Reply with quote Back to top

Fixed, and thank you so much.
View user's profile Send private message Visit poster's website
ciph3r
Worker
Worker


Joined: Jun 01, 2005
Posts: 176

PostPosted: Sat Nov 18, 2006 2:21 pm Reply with quote Back to top

I am a bit confused still on what I did.......but I deleted the WOM.js file from my root to see if the javascripts would still work, and they do.

I was told by a friend that the code doesnt call anything from the wom.js file, so they were unsure why I was told to use it. So I deleted it, and still have the code I posted above (that you gave me) and all seems to be working.

Any ideas, or better ways to explain exactly what is happening?
View user's profile Send private message Visit poster's website
technocrat
Involved
Involved


Joined: Jul 07, 2005
Posts: 492

PostPosted: Sun Nov 19, 2006 10:16 am Reply with quote Back to top

It's meant for browsers that do not follow the previous 2 types of loading. Its a backup plan basically. If all else fails do this. IE 5 for example would need this.

Though rare, it is better to error on the side of caution in my opinion.
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic