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!
i attached my index template thanks
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
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?
yup, by every refresh of the page you will see an another banner
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
in index.template.php
</head>
<body>';
echo'
<div align="center">
<img src="http://sn95forums.com/banners/rotate.php" alt="" />
</div><br />';
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
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
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
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
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
any ideas?
thanks again!!!!
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.