Acidmods

Acid Mods Community Area => Discussion Boards => Spam & Chat => Topic started by: FreeK on December 12, 2010, 12:09:28 PM

Title: Christmas theme
Post by: FreeK on December 12, 2010, 12:09:28 PM
I like the concept and all, but on a low-spec gaming PC running 1080p res, all it does is causes lag (like 1FPS while typing a post).

I just wanted to say something about it for those who maybe don't have a decent computer.

Anyone else having similar problems?
Title: Re: Christmas theme
Post by: FOOKz™ on December 12, 2010, 04:44:01 PM
i've got a crappy on-board video card running 25fps @ 60hz  (makes it look crappy) but no big performance issues
Title: Re: Christmas theme
Post by: HiddenVenom on December 12, 2010, 11:59:51 PM
What browser are you using?
Title: Re: Christmas theme
Post by: Modded Matt on December 13, 2010, 06:37:24 AM
a gaming pc with 1080p res should have no problems displaying this.
Title: Re: Christmas theme
Post by: Famas on December 13, 2010, 06:47:22 AM
yea my pc is making it lag like scroling down the page :(
Title: Re: Christmas theme
Post by: robin1989 on December 13, 2010, 08:54:15 AM
Hey sorry it's been lagging for your guys. I will take a look into it and see if i can make it so that you can turn it on and off using a button.

It's not to bad running on an iPad so it should be ok on most other computers. Doesn't seem to lag the page much it just the snow seems a bit slower. In the vid it look a bit lagy but that's because I'm running a screen capture software on my iPad ath the same time.

Acidmods Christmas theme snowing iPad (http://www.youtube.com/watch?v=TmyZb1xABsk&feature=youtube_gdata#)

Title: Re: Christmas theme
Post by: whitetop on December 13, 2010, 09:12:00 AM
no lag on my side and mines just a casual pc but yeah a on/off button would be great for slow pc specs

acidmods snow theme (http://www.youtube.com/watch?v=sW6hKFwjP2s#ws)
Title: Re: Christmas theme
Post by: jacobia jacob on December 13, 2010, 11:48:55 AM
i miss the snow :(
Title: Re: Christmas theme
Post by: robin1989 on December 13, 2010, 04:20:07 PM
yeah i have disabled it until i can work out a way that works to load a .js file on click or to stop a .js file on click either will do (even better if it can be used to toggle it). as long as its done in html or javascript or php
Title: Re: Christmas theme
Post by: HiddenVenom on December 13, 2010, 04:21:49 PM
I can probably make you a php control for it... Probably have to edit the CSS too.
Title: Re: Christmas theme
Post by: FOOKz™ on December 13, 2010, 04:26:41 PM
the snow should just be JavaScript, i've seen similar scripts on dynamic drive. It just would just have to check a variable (yes/no) via a button to let the main part run.
Title: Re: Christmas theme
Post by: HiddenVenom on December 13, 2010, 04:42:55 PM
Right. This SHOULD work, in theory. It might be a little ugly though. Replace the indicated square brackets section in this code with the script tag which points to the snow JavaScript file. Then, put this code where that script tag was. Simples? :)



<script type="text/css">
#jssnowcontroller {
position: absolute;
bottom: 0;
left: 0;
background-color: #444;
color: #fff;
}
</script>

<div id="jssnowcontroller">
  <form action="index.php" method="GET">
    Snow On&nbsp<input type="radio" name="snow" value="true" />
    Snow Off&nbsp<input type="radio" name="snow" value="false" />
    <input type="submit" value="Make it Snow!" />
  </form>
</div>

<?php

$snow = $_GET['snow'];

if (!$snow) {
$snow = false;
};

if ($snow==true) {
echo "[PUT THE JAVASCRIPT COMMAND THAT YOU HAVE ALREADY HERE MINUS THE SQUARE BRACKETS]";
};

?>


Post Merge: December 13, 2010, 04:47:11 PM
One Other thing: make sure  it isnt inside any other tags. Put it all right before the final </body> tag. Otherwise wierd crap may occur.
Title: Re: Christmas theme
Post by: robin1989 on December 13, 2010, 05:00:02 PM
tried that hidden but it diddnt work - this is the js file https://www.acidmods.com/forum/snowstorm.js (https://www.acidmods.com/forum/snowstorm.js)
Title: Re: Christmas theme
Post by: HiddenVenom on December 13, 2010, 05:11:32 PM
Okay, give this a try.

Tell me if:

1- the form does not appear
2- if the form doesn't change anything
3- if an error message appears
4- if no snow appears




<script type="text/css">
#jssnowcontroller {
position: absolute;
bottom: 0;
left: 0;
background-color: #444;
color: #fff;
}
</script>

<div id="jssnowcontroller">
  <form action="index.php" method="GET">
    Snow On&nbsp<input type="radio" name="snow" value="on" />
    Snow Off&nbsp<input type="radio" name="snow" value="off" />
    <input type="submit" value="Make it Snow!" />
  </form>
</div>

<?php

if (!$snow) {
$snow = "on"
};

if ($snow=="on") {
echo "<script type='text/javascript' src='snowstorm.js' />";
};

?>
Title: Re: Christmas theme
Post by: robin1989 on December 13, 2010, 05:23:54 PM
hmm - still not working - you on msn hidden
Title: Re: Christmas theme
Post by: HiddenVenom on December 13, 2010, 05:32:46 PM
I know the problem. I'm not on msn. Will be tomorrow afternoon so if it still isn't working I'll help you then.

1. Don't move the style or the form. They are fine.
2. Take the entire php section and move it to be at the bottom of the HTML file just above </body>. Nothing else below it. If you are still having issues, email me / pm me a copy of this page.

Post Merge: December 13, 2010, 05:34:01 PM
Last note: I'm about to get to sleep. If I don't answer that's why lol :)
Title: Re: Christmas theme
Post by: PspKicks316 on December 13, 2010, 05:44:39 PM
You don't need

if (!$snow) {
$snow = "on"
};

because all that does is say "if $snow is false, turn it on. No matter what it would set to on. Also, you can't do if(!$snow) because $snow is on/off. A boolean statement is true/false or 1/0, not on or off. If you change it to true/false like in your original code, it would function properly (not sure if it would run though).

Another thing you forgot, in that new code you didn't add the $snow=$_GET['snow'] anywhere. You have no $snow variable.

The form is fine. Use this for php:

<?
$snow = $_GET['snow'];
if($snow)
{
     echo '<script type="text/javascript" src="snowstorm.js"></script>';
}
?>

This should be good. You'd need an option to turn it off then.
Title: Re: Christmas theme
Post by: HiddenVenom on December 13, 2010, 05:55:32 PM

<?
$snow = $_GET['snow'];
if($snow)
{
     echo '<script type="text/javascript" src="snowstorm.js"></script>';
}
?>

This should be good. You'd need an option to turn it off then.

My bad lol been working with Bools all day.

<?
$snow = $_GET['snow'];
if(isset($snow)==false)
{
$snow = "on";
};

if($snow=="on")
{
     echo '<script type="text/javascript" src="snowstorm.js" />';
};

?>



That should do it. The isset() function will detect if a value has been assigned to it, so we can make it "on" by default.
Title: Re: Christmas theme
Post by: PspKicks316 on December 13, 2010, 06:06:39 PM
I'm 99.9% sure you must escape the double quotes.
Title: Re: Christmas theme
Post by: HiddenVenom on December 13, 2010, 06:14:19 PM
It won't affect anything in the script, but yeah, it's a bad habit I picked up from visual basic... Which unfortunately I have to do for my computing a level.
Title: Re: Christmas theme
Post by: PspKicks316 on December 13, 2010, 06:16:32 PM
I *hate* VB =(
Title: Re: Christmas theme
Post by: robin1989 on December 13, 2010, 06:45:54 PM
tried


Code: [Select]
<script type="text/css">
#jssnowcontroller {
position: absolute;
bottom: 0;
left: 0;
background-color: #444;
color: #fff;
}
</script>

<div id="jssnowcontroller">
  <form action="index.php" method="GET">
    Snow On <input type="radio" name="snow" value="true" />
    Snow Off <input type="radio" name="snow" value="false" />
    <input type="submit" value="Make it Snow!" />
  </form>
</div>

<?
$snow = $_GET['snow'];
if(isset($snow)==false)
{
$snow = "on";
};

if($snow=="on")
{
     echo '<script type="text/javascript" src="https://www.acidmods.com/forum/snowstorm.js" />';
};

?>

but still no dice. thanks for trying though
Title: Re: Christmas theme
Post by: PspKicks316 on December 13, 2010, 07:25:31 PM
Does it show the form? I just realized he's not using the <style> tag..

Post Merge: December 13, 2010, 07:54:01 PM
Here. Fully working.

Code: [Select]
<html>
<head>
<title>Untitled Document</title>
<?php
$snow
=$_GET['snow'];
if(!isset(
$snow))
{
$snow "true";
}
if(
$snow == "true")
{
echo '<script src="snowstorm.js"></script>';
}
?>

<style>
body{
background:#000;
color: #FFF;
};
</style>

</head>
<body>
<div id="f">
        <form action="index.php" method="get">
            Snow on: <input type="radio" name="snow" value="true"/><br />
             Snow off: <input type="radio" name="snow" value="false"/><br />
            <input type="submit" />           
            </form>
</div>
</body>
</html>
Title: Re: Christmas theme
Post by: HiddenVenom on December 13, 2010, 11:58:28 PM
I also detest vb.
Whoops lol did write that code at like 1am though :) and it would work without style anyway :). And the style you put is wrong- it needs to be:

#f {
position:absolute;
left:0;
bottom:0;
background: #777;
color: #fff;
}
Title: Re: Christmas theme
Post by: PspKicks316 on December 14, 2010, 03:59:39 PM
No, it works fine. I had sent Robin an updated code for him to add into the forum. That was just a demo that worked. The code Robin has is updated with a style for the form. I would've posted it here, but I kept getting that annoying 500 Internal Server error because it didn't like my post.
Title: Re: Christmas theme
Post by: robin1989 on December 14, 2010, 07:04:22 PM
ok so it didnt work - im probably tired and just pasting stuff in wrong area or something i dont know but for now i will just give up and leave the snow off - might put it back on new years eve till boxing day and just slow the fram rate on the snow down a bit and hopefully that will stop freeks problems
Title: Re: Christmas theme
Post by: PspKicks316 on December 14, 2010, 07:27:36 PM
Robin, check your PMs.
Title: Re: Christmas theme
Post by: HiddenVenom on December 15, 2010, 06:32:49 AM
Came up with a much better solution than my original one, much simpler. Easy to install too. Robin, check your PMs, I've sent it to you. :)

The way I've done it ensures no ugly php errors. Because it doesn't use php.
SimplePortal 2.3.5 © 2008-2012, SimplePortal