Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Topic started by: SN95Forums on December 03, 2008, 10:10:56 PM

Title: trying to add image to top of forum with a javascript...HELP
Post by: SN95Forums on December 03, 2008, 10:10:56 PM
My forum is here:
http://sn95forums.com/index.php

Im trying to add this javascript in:
http://sn95forums.com/banners/randomcarimage.js

I want it to go where the current banner is, its a random image java script.  I cant find where to enter the code, index template?  Its kind of an odd script.

Also I tried to test load the script with the following code in a html page:
<SCRIPT language="JavaScript" SRC="http://sn95forums.com/banners/randomcarimage.js"></SCRIPT>

But it doesn't load, what am I doing wrong, the only way I can get it to load is to paste the entire script in the html page and I would perfer not to have to do that.

Thanks!
Title: Re: trying to add image to top of forum with a javascript...HELP
Post by: SN95Forums on December 04, 2008, 06:42:30 PM
i attached my index template  thanks
Title: Re: trying to add image to top of forum with a javascript...HELP
Post by: Kermit on December 04, 2008, 08:19:18 PM
I can suggest you an another way

with a little random image script,you should put the attached file rotate.php in http://sn95forums.com/banners directory

and to show your banners randomly

you should use this code

echo'
<div align="center">
<img src="http://sn95forums.com/banners/rotate.php" alt="" />
</div><br />';



banners and rotate.php should be in the same directory

Title: Re: trying to add image to top of forum with a javascript...HELP
Post by: SN95Forums on December 04, 2008, 11:24:04 PM
humm cool, ill try that.  So i upload that php file into my banners directory and it will load the banners within that directory?

also where in my index template would i insert that code?
Title: Re: trying to add image to top of forum with a javascript...HELP
Post by: Kermit on December 05, 2008, 04:14:57 AM
yup, by every refresh of the page you will see an another banner
Title: Re: trying to add image to top of forum with a javascript...HELP
Post by: SN95Forums on December 05, 2008, 09:26:34 PM
Quote from: Duncan85 on December 05, 2008, 04:14:57 AM
yup, by every refresh of the page you will see an another banner

so where do I insert that in my index template, I keep getting Template Parse Errors.

????

Thanks
Title: Re: trying to add image to top of forum with a javascript...HELP
Post by: Kermit on December 06, 2008, 02:48:34 AM
in index.template.php

Code (find) Select

</head>
<body>';


Code (add after) Select

echo'
<div align="center">
<img src="http://sn95forums.com/banners/rotate.php" alt="" />
</div><br />';

Title: Re: trying to add image to top of forum with a javascript...HELP
Post by: SN95Forums on December 07, 2008, 03:53:02 PM
ok I got a error:

Quote"Template Parse Error!
There was a problem loading the /Themes/morestyle/index.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in .../Themes/morestyle/index.template.php on line 203

194:
195:             current_header_ic = mode;
196:          }
197:       // ]]></script>';
198:
199:    echo '
200: </head>
201: <body>
202: echo'

203: <div align="center">

204: <img src="http://sn95forums.com/banners/rotate.php" alt="" />
205: </div><br />';
206:    <div id="header">';
207:          echo '

The thing is I couldnt find
</head>
<body>';


I could only find:

echo '
</head>
<body>
<div id="header">';


I attached my index template a few posts up if you dont mind taking a quick look.

Thanks again,
Matt
Title: Re: trying to add image to top of forum with a javascript...HELP
Post by: Kermit on December 07, 2008, 03:57:38 PM
how about this   ::)


btw don't forget to move rotate.php (http://www.simplemachines.org/community/index.php?action=dlattach;topic=278319.0;attach=78526) in http://sn95forums.com/banners directory
Title: Re: trying to add image to top of forum with a javascript...HELP
Post by: SN95Forums on December 07, 2008, 08:06:45 PM
Quote from: Duncan85 on December 07, 2008, 03:57:38 PM
how about this   ::)


btw don't forget to move rotate.php (http://www.simplemachines.org/community/index.php?action=dlattach;topic=278319.0;attach=78526) in http://sn95forums.com/banners directory

Ok that works but it doesnt refresh on each click in the forums.  I used to have it setup like that before.  Right now it will only change if you physcially click refresh.

also any chance of having it where the current logo is, below the line?
http://www.sn95forums.com
Title: Re: trying to add image to top of forum with a javascript...HELP
Post by: Kermit on December 08, 2008, 05:35:10 AM
Quote from: SN95Forums on December 07, 2008, 08:06:45 PM


Ok that works but it doesnt refresh on each click in the forums.  I used to have it setup like that before.  Right now it will only change if you physcially click refresh.


This is the problem just with firefox,i've tested with internet explorer & opera,it works fine,but i don't know,why firewoks needs to be clicked on refresh button

Quote from: SN95Forums on December 07, 2008, 08:06:45 PM
also any chance of having it where the current logo is, below the line?
http://www.sn95forums.com

I will take a look at that

Edit: I need your style.css for that
Title: Re: trying to add image to top of forum with a javascript...HELP
Post by: SN95Forums on December 08, 2008, 02:47:32 PM
weird, any other script maybe? because everyone seems to use firefox these days. I tried some other scripts but they wouldnt load up.

I have attached a style.css (there are 5 colors so let me know what you did and ill change the others)

Thanks,
Matt
Title: Re: trying to add image to top of forum with a javascript...HELP
Post by: SN95Forums on December 09, 2008, 05:13:53 PM
any ideas?

thanks again!!!!
Title: Re: trying to add image to top of forum with a javascript...HELP
Post by: Rumbaar on January 06, 2009, 05:01:26 PM
For the original question you might not have been echoing it or putting it in the correct location try:
echo '
<SCRIPT language="JavaScript" SRC="http://sn95forums.com/banners/randomcarimage.js"></SCRIPT>
';


Also be sure to run repair_settings.php (http://docs.simplemachines.org/index.php?topic=663) tool as your paths are incorrect for your current domain URL.