MyBB Community Forums

Full Version: Help! Snowing javascript
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I am trying to get this simple javascript to work.
http://dynamicdrive.com/dynamicindex3/snownoimages.htm

Can someone please tell me where i need to add that javascript?
I know mybb supports html and javascript, so this should work easy.

Thanks Smile
Open the index template and before all the content add the code.
I have the same on my forum and I added the code to my header..

make sure you upload the files to your root ftp though
Thank you guys Smile

Here is how i have it.. at the top
<?php
<script type="text/javascript" src="snow.js">

/***********************************************
* Snow Effect without images-by Kurt Grigg at http://www.btinternet.com/~kurt.grigg/javascript
* Script featured & available at Dynamic Drive at http://www.dynamicdrive.com/
* Please keep this notice intact
***********************************************/

</script>
/**
 * MyBB 1.4
 * Copyright © 2008 MyBB Group, All Rights Reserved
 *
 * Website: http://www.mybboard.net
 * License: http://www.mybboard.net/about/license
 *
 * $Id: index.php 4249 2008-10-25 05:37:16Z Tikitiki $
 */

define("IN_MYBB", 1);
define('THIS_SCRIPT', 'index.php');

$templatelist = "index,index_whosonline,index_welcomemembertext,index_welcomeguest,index_whosonline_memberbit,forumbit_depth1_cat,forumbit_depth1_forum,forumbit_depth2_cat,forumbit_depth2_forum,forumbit_depth1_forum_lastpost,forumbit_depth2_forum_lastpost,index_modcolumn,forumbit_moderators,forumbit_subforums,index_welcomeguesttext";
$templatelist .= ",index_birthdays_birthday,index_birthdays,index_pms,index_loginform,index_logoutlink,index_stats,forumbit_depth3,forumbit_depth3_statusicon,index_boardstats";

require_once "./global.php";

Something i am doing wrong?

snow.js goes in the jscripts folder then? or the root?
The javascript shouldn't be inside the index.php file. Manutd meant put it in your header or index template.
I only have a index.php.
My whole site is only my board, no other pages. I want this on my boards index.

Now what? ...lol

Thanks Smile
Then put it in the index template.
(2009-12-05, 07:44 PM)littleg Wrote: [ -> ]I only have a index.php.
My whole site is only my board, no other pages. I want this on my boards index.

Now what? ...lol

Thanks Smile

You have more than a index.php template Confused
Login into your admin> Go to templates and styles> click on templates on the left side of your screen>click on the name of the template set you are using> click on Header Templates > Header. If you want it in the index like Matt is saying, then find the index templates

Install code as said above.
How stupid of me..!!! Sorry guys Sad

ok, still not working adding before everything.
<script type="text/javascript" src="snow.js">

/***********************************************
* Snow Effect without images-by Kurt Grigg at http://www.btinternet.com/~kurt.grigg/javascript
* Script featured & available at Dynamic Drive at http://www.dynamicdrive.com/
* Please keep this notice intact
***********************************************/

</script>
<html>
<head>
<title>{$mybb->settings['bbname']}</title>
{$headerinclude}
<script type="text/javascript">
<!--
	lang.no_new_posts = "{$lang->no_new_posts}";
	lang.click_mark_read = "{$lang->click_mark_read}";
// -->
</script>
</head>
<body>
{$header}
<table width="100%" cellpadding="6" cellspacing="1" border="0" class="tborder">
<tbody>
            <tr>
                <td class="thead" colspan="2">
<div class="expcolimage"><img src="{$theme['imgdir']}/collapse{$collapsedimg['newbox_e']}.gif" id="newbox_img" class="expander" alt="[-]" title="[-]" /></div>
              <strong>Welcome to your private community</strong>
                </td>
            </tr>
        </tbody>
        <tbody style="{$collapsed['newbox_e']}" id="newbox_e">  
            <tr>
                <td class="trow1"><font face="Verdana" size="2" color="#D7DF01">If you would like to invite someone here, please PM a staff member for help.</a></font></td>
            </tr>
        </tbody>
    </table>
<br />
{$forums}
{$boardstats}

<dl class="forum_legend smalltext">
	<dt><img src="{$theme['imgdir']}/on.gif" alt="{$lang->new_posts}" title="{$lang->new_posts}" style="vertical-align: middle; padding-bottom: 4px;" /></dt>
	<dd>{$lang->new_posts}</dd>

	<dt><img src="{$theme['imgdir']}/off.gif" alt="{$lang->no_new_posts}" title="{$lang->no_new_posts}" style="vertical-align: middle; padding-bottom: 4px;" /></dt>
	<dd>{$lang->no_new_posts}</dd>

	<dt><img src="{$theme['imgdir']}/offlock.gif" alt="{$lang->forum_locked}" title="{$lang->forum_locked}" style="vertical-align: middle;" /></dt>
	<dd>{$lang->forum_locked}</dd>
</dl>
<br style="clear: both" />
{$footer}
</body>
</html>

Can you please help me correct this? snow.js is in the jscripts folder.
It says this on the site:

Quote:Then, add the below code into the <BODY> section of your page, preferably at the very bottom

Put it before just </body>
Pages: 1 2