|
|
Joined: Jun 2010
Posts: 58
journeyman
|
|
journeyman
Joined: Jun 2010
Posts: 58 |
I run a javascript ad banner rotator on my site, (and it's been there for years) and I have been recently been getting emails and messages from a few members saying my site is infected, as they have received warnings from MacAfee, and AVG reports. I have told them over and over again, that it's just a false positive and that the javascript is safe, and only a website redirect, but they insist that there is a security issue. Isn't this just an issue due to those program's new overly anal definitions? Should I just ignore them, or are they correct, and I should change the way I do it? AVG says it's dangerous as a .js obfuscator. I am using: Banner Ad Rotater v3.02 Author: Anarchos > [email protected] http://anarchos.xs.mw/bannerad.phtml Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/
|
|
|
|
|
Joined: Jun 2006
Posts: 1,344
veteran
|
|
veteran
Joined: Jun 2006
Posts: 1,344 |
I switched to using a php rotator instead of javascript. I created a file banner.php and added below and wherever I want it to be displayed did a php include to that file.
<?php
$banner_src[0]="http://www.linktoimage.jpg";
$banner_link[0]="http://www.linktosite.com";
$banner_src[1]="http://www.linktoimage.jpg";
$banner_link[1]="http://www.linktosite.com";
$banner_src[2]="http://www.linktoimage.jpg";
$banner_link[2]="http://www.linktosite.com";
$banner_src[3]="http://www.linktoimage.jpg";
$banner_link[3]="http://www.linktosite.com";
$banner_count=((count($banner_src))-1);
$which_banner=(rand(0, $banner_count));
print "<center><a href=\"$banner_link[$which_banner]\" target=\"_blank\">
<img src=\"$banner_src[$which_banner]\" border=\"0\"></a></center>";
?>
|
|
|
|
|
Joined: Jun 2010
Posts: 58
journeyman
|
|
journeyman
Joined: Jun 2010
Posts: 58 |
Thanks, I tried this and put the php include in the "HTML includes" section of Control Panel/General Display Options, but it didn't work. Am I missing something here?
|
|
|
|
|
Joined: Dec 2003
Posts: 6,649 Likes: 88
|
|
Joined: Dec 2003
Posts: 6,649 Likes: 88 |
You do realize that the example shows generic paths to images? http://www.linktoimage.jpghttp://www.linktosite.comThey don't exist. So you need to edit them and add a valid path to a image. Also since it is random, if you don't have a valid path for each one then you may not get something on each refresh.
Blue Man Group There is no such thing as stupid questions. Just stupid answers
|
|
|
|
|
Joined: Jun 2010
Posts: 58
journeyman
|
|
journeyman
Joined: Jun 2010
Posts: 58 |
Yes sir, I made a .php file called banner.php, I copied and pasted the info given, then edited it for the image path for my site, and external urls. I then put a php include into HTML includes section of Control Panel (forum admin), Display Options, General, but nothing. I used <?php include ("banner.php"); ?>for the HTML include section. I am supposed to use the parenthesis correct? Did I miss something? Should I have used some echo tags somewhere? I think my issue is that I didn't add the correct info into the control panel section? Since there is no other .php in there should I have created a style text/php tag?
|
|
|
|
|
Joined: Jun 2010
Posts: 58
journeyman
|
|
journeyman
Joined: Jun 2010
Posts: 58 |
Ah ok, I sort of have it working now but got this error...
Message: 'Banner' is undefined
Line: 1177
Char: 3
Code: 0
URI: http://www.mydomain.com/members/forum/ubbthreads.php?ubb=cfrm
|
|
|
|
|
Joined: Dec 2003
Posts: 6,649 Likes: 88
|
|
Joined: Dec 2003
Posts: 6,649 Likes: 88 |
Well I see Gliderdad is here. but has not responded But maybe he is on a coffee break. But anyway. Since I have never tried a include using the html includes from the control panel. It looks correct but there is not a path to the file. Meaning it needs to reside in the same location as the ubbscript if you don't have a path. First thing I would do is test the page with a browser directly. http://www.YourUrl.com/includes/banner.phpThen where ever it is located you need to edit it to something like. <?php include("http://www.YourUrl.com/includes/banner.php");
?>
Blue Man Group There is no such thing as stupid questions. Just stupid answers
|
|
|
|
|
Joined: Jun 2010
Posts: 58
journeyman
|
|
journeyman
Joined: Jun 2010
Posts: 58 |
It tests fine, when I go directly to the .php page, and the complete url is not needed, but I still get the error. When I add the complete url, it vanishes.
|
|
|
|
|
Joined: Jun 2006
Posts: 1,344
veteran
|
|
veteran
Joined: Jun 2006
Posts: 1,344 |
Try using a the path not the http
<?php include("/home/path/to/ubbthreads/includes/banner.php"); ?>
|
|
|
|
|
Joined: Jun 2010
Posts: 58
journeyman
|
|
journeyman
Joined: Jun 2010
Posts: 58 |
Nope, same error. Which file has a Line: 1177? ubbthreads.inc?
|
|
|
|
|
Joined: Jun 2006
Posts: 1,344
veteran
|
|
veteran
Joined: Jun 2006
Posts: 1,344 |
Where in the cp html includes you adding this? The header section?
|
|
|
|
|
Joined: Jun 2010
Posts: 58
journeyman
|
|
journeyman
Joined: Jun 2010
Posts: 58 |
Duh! Never mind I fixed it. I had the old javascript banner rotator code in the footer. Now, the old one would rotate all my banners every few seconds. This one rotates on refresh. Can I add the rotate all the banners every few seconds function to this?
|
|
|
|
|
Joined: Jun 2010
Posts: 58
journeyman
|
|
journeyman
Joined: Jun 2010
Posts: 58 |
Display Options/General/html includes, it works fine now but I would like to add the other feature if possible? Can someone help me do that?
|
|
|
|
|
Joined: Dec 2003
Posts: 6,649 Likes: 88
|
|
Joined: Dec 2003
Posts: 6,649 Likes: 88 |
I think you are going to find that the script is not refreshed until the internal cache runs again. Or using the refresh option on the browser.
Somebody here posted a workaround for a similar issue with banner rotators. Can't find it now but I think it was Sirdude.
Blue Man Group There is no such thing as stupid questions. Just stupid answers
|
|
|
|
|
Joined: Jun 2010
Posts: 58
journeyman
|
|
journeyman
Joined: Jun 2010
Posts: 58 |
I wish I could find that...
|
|
|
|
0 members (),
206
guests, and
158
robots. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
|