VideoHelp Forum




+ Reply to Thread
Results 1 to 14 of 14
  1. Video Restorer lordsmurf's Avatar
    Join Date
    Jun 2003
    Location
    dFAQ.us/lordsmurf
    Search Comp PM
    I need help, I don't know what I'm doing. Things I've tried all fail, been working on this for months with no success, just really pissed off.

    I have a website built in Microsoft Frontpage 2000, and the site pages are all built with includes. There is a main window, a navigation bar, a header and a footer. Inside the header is several more includes to maintain the various things found in the header. One of those includes is a spot for banner ads.

    I need to have 2-4 ads randomly rotate.

    The ad rotator thing that comes in FP2000 is a piece of shit. It wants to start up this java garbage and slows the whole site down. So that's not gonna happen.

    I tried this too: http://www.haneng.com/lessons_2.asp
    But damned if I can't get it to work.

    I hate the Internet these days. It's such a clusterfuck of information that you can ask and ask and read and read and read and still not get any answers to do what you want. So here I am asking people. Please help. This sucks.

    Site is all HTML pages. I have ASP too.
    I don't have SQL or ASP.NET, and I cannot add it.
    Want my help? Ask here! (not via PM!)
    FAQs: Best Blank DiscsBest TBCsBest VCRs for captureRestore VHS
    Quote Quote  
  2. Video Restorer lordsmurf's Avatar
    Join Date
    Jun 2003
    Location
    dFAQ.us/lordsmurf
    Search Comp PM
    Try what?
    I just tried about 6 things that didn't work out.
    Want my help? Ask here! (not via PM!)
    FAQs: Best Blank DiscsBest TBCsBest VCRs for captureRestore VHS
    Quote Quote  
  3. Video Restorer lordsmurf's Avatar
    Join Date
    Jun 2003
    Location
    dFAQ.us/lordsmurf
    Search Comp PM
    This has potential, but I get error messages?

    http://simplythebest.net/scripts/DHTML_scripts/javascripts/javascript_55.html

    Code:
    <html>
    
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>Banner Rotation</title>
    </head>
    
    <body topmargin="1" leftmargin="0">
    
    <script language="JavaScript"> var ads = new adArray(
    "store1.gif","http://test1.htm",
    "store2.gif","http://test2.htm",
    "store2.gif","http://test3.htm");
    var ad_num = getAdNum(); 
    document.write('[img]'+ads[ad_num].src+'[/img]');
    setTimeout("rotateSponsor()",5000); // the default is a new image every 5 seconds
    </script>
    
    </body>
    
    </html>
    I'm told that 'adArray is undefined'
    Want my help? Ask here! (not via PM!)
    FAQs: Best Blank DiscsBest TBCsBest VCRs for captureRestore VHS
    Quote Quote  
  4. Greetings Supreme2k's Avatar
    Join Date
    Feb 2003
    Location
    Right Here, Right Now
    Search Comp PM
    In your code, it is (undefined)
    Code:
    <html> 
    <head> 
    <title>Banner Rotation</title> 
    </head> 
    <body topmargin="1" leftmargin="0"> 
    <script language="JavaScript">
    // Copyright 1996, Infohiway, Inc. (http://www.infohiway.com)
    // Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/
    <!--
    function adArray() {
     for (i=0; i*2<adArray.arguments.length; i++) {
      this[i] = new Object();
      this[i].src = adArray.arguments[i*2];
      this[i].href = adArray.arguments[i*2+1];
     }
     this.length = i;
    }
    function getAdNum() {
     dat = new Date();
     dat = (dat.getTime()+"").charAt(8);
     if (dat.length == 1)
      ad_num = dat%ads.length;
     else
      ad_num = 0;
     return ad_num;
    }
    var ads = new adArray(
    "store1.gif","http://planmagic.com",
    "store2.gif","http://simplythebest.net",
    "store3.gif","http://simplythebest.net/scripts/");
    var ad_num = getAdNum(); 
    document.write('<CENTER><TABLE CELLPADDING=0 CELLSPACING=1 BORDER=0><TR><TD>[img]'+ads[ad_num].src+'[/img]</TD></TR></TABLE></CENTER>');
    link_num = document.links.length-1;
    function rotateSponsor() {
     if (document.images) {
      ad_num = (ad_num+1)%ads.length;
      document.js_ad.src = ads[ad_num].src;
      document.links[link_num].href = ads[ad_num].href;
      setTimeout("rotateSponsor()",5000);
     }
    }
    setTimeout("rotateSponsor()",5000);
    // -->
    </script>
    </body> 
    </html>
    Quote Quote  
  5. Video Restorer lordsmurf's Avatar
    Join Date
    Jun 2003
    Location
    dFAQ.us/lordsmurf
    Search Comp PM
    This has the randomness I need:

    Code:
    <html>
    
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>Banner Rotation</title>
    
    <script type="text/javascript">
    <!--
    pic_width=400;   /*change to match the height of all your images */
    pic_height=60;   /* change to match the width of all your images */
    border_size=0;   /* change to the border size you want on the images */
    alignment=0;      /* 0=left,1=center */
    
    /* define image urls */
    
    if (document.images)
     {
         pic1= new Image(pic_width,pic_height);
         pic1.src="1.gif";  
         pic2= new Image(pic_width,pic_height); 
         pic2.src="2.gif"; 
         pic3= new Image(pic_width,pic_height);
         pic3.src="3.gif";  
     }    
    
    /* define banner urls */
    
    urlad1="http://1.htm";
    urlad2="http://2.htm";
    urlad3="http://3.htm";
    
    /* no need to edit past this point (unless you want to add more image and url slots) */
    
    if (alignment==1)
     {
      cent_it="<center>";
      cent_it2="</center>";
     }
    else
     {
      cent_it="";
      cent_it2="";
     }
     
    function get_random(maxNum)
    {
      if (Math.random && Math.round)
      {
        var ranNum= Math.round(Math.random()*(maxNum-1));
        ranNum+=1;
        return ranNum;
      }
      else
      {
      today= new Date();
      hours= today.getHours();
      mins=   today.getMinutes();
      secn=  today.getSeconds();
      if (hours==19)
       hours=18;
      var ranNum= (((hours+1)*(mins+1)*secn)%maxNum)+1;
      return ranNum; 
      }
    }
    
    function get_Image()
    {
     if (document.images)
     {
      var choose_one= get_random(3);  
      choose_one--;
    
      var pics= new Array(5) 
       pics[0]=pic1.src;
       pics[1]=pic2.src;
       pics[2]=pic3.src;
    
      var aurl= new Array(5)
      aurl[0]=urlad1;
      aurl[1]=urlad2;
      aurl[2]=urlad3;
    
      document.write(cent_it+"[img]"+pics[choose_one]+"[/img]"+cent_it2);
     }
    }
    //-->
    </script>
    
    
    </head>
    
    <body topmargin="1" leftmargin="0">
    <script type="text/javascript">
    <!--
     get_Image()
    //-->
    </script>
    
    
    </body>
    
    </html>

    And this has the rotation I need:


    Code:
    <html>
    
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>Banner Rotation</title>
    
    
    
    <script language="javascript"><!--
    //JavaScript Banner Ad Rotator version 2.1 - last modified 16 November 2000
    //Obtained from http://www.brettb.com/js_banner_ad_rotator.asp
    
    //User defined variables - change these variables to alter the behaviour of the script
    var ImageFolder = "images"; //Folder name containing the images
    
    //List of images to use
    var ImageFileNames = new Array(
    '1.gif', 
    '2.gif', 
    '3.gif'); 
    
    //List of hyperlinks associated with the list of images
    var ImageURLs = new Array(
    'http://1.htm', 
    'http://2.htm', 
    'http://3.htm'); 
    
    //Default hyperlink for the Banner Ad
    var DefaultURL = 'http://1.htm'; 
    
    //Number of seconds to wait before the next image is displayed
    var DisplayInterval = 6; 
    
    //Name of the frame to open the hyperlink into
    var TargetFrame = ""; 
    
    //Internal variables (do not change these unless you know what you are doing)
    var IsValidBrowser = false;
    var BannerAdCode = 0;
    var BannerAdImages = new Array(NumberOfImages);
    var DisplayInterval = DisplayInterval * 1000;
    var NumberOfImages = ImageFileNames.length;
    
    //Add a trailing forward slash to the ImageFolder variable if it does not already have one
    if (ImageFolder.substr(ImageFolder.length - 1, ImageFolder.length) != "/" && ImageFolder != "") { ImageFolder += "/";
    }
    
    if (TargetFrame == '') {
    var FramesObject = null;
    } else {
    var FramesObject = eval('parent.' + TargetFrame);
    }
    
    //Function runs when this page has been loaded and does the following:
    //1. Determine the browser name and version  (since the script will only work on Netscape 3+ and Internet Explorer 4+).
    //2. Start the timer object that will periodically change the image displayed by the Banner Ad.
    //3. Preload the images used by the Banner Ad rotator script
    function InitialiseBannerAdRotator() {
    
    //Determine the browser name and version
    //The script will only work on Netscape 3+ and Internet Explorer 4+
    var BrowserType = navigator.appName;
    var BrowserVersion = parseInt(navigator.appVersion);
    
    if (BrowserType == "Netscape" && (BrowserVersion >= 3)) {
    IsValidBrowser = true;
    }
    
    if (BrowserType == "Microsoft Internet Explorer" && (BrowserVersion >= 4)) {
    IsValidBrowser = true;
    }
    
    if (IsValidBrowser) {
    TimerObject = setTimeout("ChangeImage()", DisplayInterval);
    BannerAdCode = 0;
    
    for (i = 0; i < NumberOfImages; i++) {
    BannerAdImages[i] = new Image();
    BannerAdImages[i].src = ' ' + ImageFolder + ImageFileNames[i];
    }
    
    }
    
    }
    
    //Function to change the src of the Banner Ad image
    function ChangeImage() {
    
    if (IsValidBrowser) {
    BannerAdCode = BannerAdCode + 1;
    
    if (BannerAdCode == NumberOfImages) {
    BannerAdCode = 0;
    }
    
    window.document.bannerad.src = BannerAdImages[BannerAdCode].src;
    TimerObject = setTimeout("ChangeImage()", DisplayInterval);
    }
    }
    
    //Function to redirect the browser window/frame to a new location,
    //depending on which image is currently being displayed by the Banner Ad.
    //If Banner Ad is being displayed on an old browser then the DefaultURL is displayed
    function ChangePage() {
    
    if (IsValidBrowser) {
    
    if (TargetFrame != '' && (FramesObject)) {
    FramesObject.location.href = ImageURLs[BannerAdCode];
    } else {
    document.location = ImageURLs[BannerAdCode];
    }
    
    } else if (!IsValidBrowser) {
    document.location = DefaultURL;
    }
    
    }
    // --></script> 
    
    
    
    
    
    </head>
    
    
    
    <body topmargin="1" leftmargin="0" onload="InitialiseBannerAdRotator()"> 
    
    [img]images/1.gif[/img] 
    
    </body>
    
    </html>

    I need to merge these two concepts, but I don't know how.
    The MATH.RANDOM function is clearly the key to a random generated sequence, but I'm not sure how to integrate that into the other rotating code.
    Want my help? Ask here! (not via PM!)
    FAQs: Best Blank DiscsBest TBCsBest VCRs for captureRestore VHS
    Quote Quote  
  6. Greetings Supreme2k's Avatar
    Join Date
    Feb 2003
    Location
    Right Here, Right Now
    Search Comp PM
    try this:
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html lang="en">
    <head>
    	<title>Banner example</title>
    <script language="JavaScript" type="text/javascript"> 
    <!--  
    var min_num = 1;  
    var max_num = 5; 
    var diff = max_num-min_num+1 ; 
    var rnd_number=1;
    //the refresh delay in seconds
    var r_delay = 2; 
    //one for each image
    var banner_image = new Array(5);
    banner_image[1]="store1.gif";
    banner_image[2]="store2.gif";
    banner_image[3]="store3.gif";
    banner_image[4]="store4.gif";
    banner_image[5]="store5.gif";
    
    //one for each image
    var banner_link = new Array(5);
    banner_link[1]="http://www.webdevtips.co.uk";
    banner_link[2]="http://www.webdevtips.co.uk";
    banner_link[3]="http://www.webdevtips.co.uk";
    banner_link[4]="http://www.webdevtips.co.uk";
    banner_link[5]="http://www.webdevtips.co.uk";
    
    //one for each image leave as "" for current window
    var banner_target = new Array(5);
    banner_target[1]="";
    banner_target[2]="new";
    banner_target[3]="new";
    banner_target[4]="new";
    banner_target[5]="new";
    r_delay=r_delay*1000;
    
    function get_img(){
    
    rnd_number=Math.floor(Math.random()*diff + min_num); 
    eval("document.images.the_banner.src=banner_image["+rnd_number+"]");
    //remove this line if you only want the banner rotated at load
    setTimeout("get_img();",r_delay);
    }
    
    function go_url(){
    if(banner_target[rnd_number] == ""){targetwin="_top";}else{targetwin=banner_target[rnd_number];}
    eval("window.open(url = banner_link["+rnd_number+"],'"+targetwin+"');"); 
    }
    // --> 
    </script>
    
    </head>
    
    <body onload="get_img();">
    [img]1.gif[/img]
    
    The delay in this example has been set to 2 seconds
    </body>
    </html>

    I have it running on my server if you want to see it in cation. Works great ither way (on time or on load).
    Quote Quote  
  7. Video Restorer lordsmurf's Avatar
    Join Date
    Jun 2003
    Location
    dFAQ.us/lordsmurf
    Search Comp PM
    Thank you, supreme2k, that works well.

    I also found this and am tinkering with it.
    http://www.dyn-web.com/javascript/rotate-img/rotate-rand.html

    I think I can manage the rest from here. I just needed some help over the tougher hurdles (tougher for me, at least).

    Want my help? Ask here! (not via PM!)
    FAQs: Best Blank DiscsBest TBCsBest VCRs for captureRestore VHS
    Quote Quote  
  8. Video Restorer lordsmurf's Avatar
    Join Date
    Jun 2003
    Location
    dFAQ.us/lordsmurf
    Search Comp PM
    Crap.

    Snagged a problem.


    Code:
    <html>
    
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>Banner Rotation</title>
    
    <style type="text/css">
    a img { border:none; color:#fff }
    </style>
    
    </head>
    
    <body topmargin="3" leftmargin="0" onload="dw_Rotator.start()">
    
    <script src="dw_rotator.js" type="text/javascript"></script>
    <script src="dw_random.js" type="text/javascript"></script>
    
    
    
    <script type="text/javascript">
    // rotation speed, path to images, linked (boolean), mouse events (boolean), target window name
    var rotator1 = new dw_RandRotator(9000, "images/", true, false, "adlink");
    var imgList = new Array("1.gif", "2.gif");
    // images array, width and height of images, transition filter (boolean)
    rotator1.setUpImage(imgList, 400, 60, true);
    rotator1.addActions( "http://1.htm", "http://2.htm");
    </script>
    
    
    </body>
    
    </html>
    On this line here, I need absolutely addresses for the files, not what's used.

    Code:
    var imgList = new Array("1.gif", "2.gif");
    But for some reason when I change it to an absolute address, be it c:\address or http://address, the code quits working.



    EDIT! UPDATE!

    I wrote my own little piece of code!

    Code:
    var rotator1 = new dw_RandRotator(9000, "", true, false, "adlink");
    var adimg1 = ("http://www.com/1.gif");
    var adimg2 = ("http://www.com/2.gif");
    var imgList = new Array(adimg1, adimg2);
    It works! It works! It works! It works! 8)
    Want my help? Ask here! (not via PM!)
    FAQs: Best Blank DiscsBest TBCsBest VCRs for captureRestore VHS
    Quote Quote  
  9. Video Restorer lordsmurf's Avatar
    Join Date
    Jun 2003
    Location
    dFAQ.us/lordsmurf
    Search Comp PM
    Nevermind, back to square one. Those bitches over at dyn-web.com provided code and then failed to mention the "licensing" crap until it was loaded on my server and failed to execute.

    Sigh. Dammit.

    Your code doesn't work as is supreme, even if I try to tweak stuff (but I really don't know whats wrong, so not sure what to tweak).
    Want my help? Ask here! (not via PM!)
    FAQs: Best Blank DiscsBest TBCsBest VCRs for captureRestore VHS
    Quote Quote  
  10. Greetings Supreme2k's Avatar
    Join Date
    Feb 2003
    Location
    Right Here, Right Now
    Search Comp PM
    You must be making some MAJOR rookie mistakes. Both of those codes work fine. I'll PM my server address so you can see for yourself.

    The licensing has nothing to do with it working. You can't really copy-protect javascript. Kind of like you can't do DRM on HTML. They probably put a message box in the code (easily removed). Also, you may have forgotten to include the external .js files.

    I would stick with the last code that I posted for you. It is much simpler and does everything that you need (to my knowledge).
    Quote Quote  
  11. Video Restorer lordsmurf's Avatar
    Join Date
    Jun 2003
    Location
    dFAQ.us/lordsmurf
    Search Comp PM
    Me makes mistakes? That's unpossible.

    When it comes to coding the non-HTML parts of web sites, I make more more mistakes than code. I'm a designer primarily, not a programmer. So that's why I need, and appreciate, all the help I can get.

    Anyway, yes, the code I found from dyn-web spits out this "contact us, blah blah blah" pop-up window.

    The code that you cobbled together for me looks great on your site, but on mine it will never load anything other than the startup default image that was specified. And then when I go to click on the link, I get a javascript error. I'm fairly certain the problem is do to the way FrontPage does includes, but it can be made workable eventually.

    This is dw_random.js
    http://www.lordsmurf.com/temp/dw_random.js.txt

    This is the dw_rotator.js
    http://www.lordsmurf.com/temp/dw_rotator.js.txt

    And of course, the HTML file that calls on the JS files:

    Code:
    <html>
    
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>Banner Rotation</title>
    
    <style type="text/css">
    a img { border:none; color:#fff }
    </style>
    
    </head>
    
    <body topmargin="3" leftmargin="0" onload="dw_Rotator.start()">
    
    <script src="dw_rotator.js" type="text/javascript"></script>
    <script src="dw_random.js" type="text/javascript"></script>
    
    
    
    <script type="text/javascript">
    // rotation speed, path to images, linked (boolean), mouse events (boolean), target window name
    var rotator1 = new dw_RandRotator(9000, "", true, false, "adlink");
    var adimg1 = ("http://1.gif");
    var adimg2 = ("http://2.gif");
    var imgList = new Array(adimg1, adimg2);
    // images array, width and height of images, transition filter (boolean)
    rotator1.setUpImage(imgList, 400, 60, true);
    rotator1.addActions( "http://1.htm", "http://2.htm");
    </script>
    
    
    </body>
    
    </html>
    I'm only rotating two banners in the sample here, it may be 3-4 in the near future, but my immediate need was for 2. I can add more ad if and when I can get this stupid system to work.
    Want my help? Ask here! (not via PM!)
    FAQs: Best Blank DiscsBest TBCsBest VCRs for captureRestore VHS
    Quote Quote  
  12. Greetings Supreme2k's Avatar
    Join Date
    Feb 2003
    Location
    Right Here, Right Now
    Search Comp PM
    Is there any reason that you have to use Frontpage? I've found that it puts in way too much overhead for its worth (xml links, css for simple font color, etc).

    You may want to give mozilla composer a try, if WYSIWYG is all you need. Trellian is a good one too.
    Quote Quote  
  13. Video Restorer lordsmurf's Avatar
    Join Date
    Jun 2003
    Location
    dFAQ.us/lordsmurf
    Search Comp PM
    I have to use FrontPage because that's what it was made in. Trying to edit in WYSIWYG in anything else won't work.

    Mozilla/Netscape composer is far too limited.

    For now I have a rotation code that does what I need at minimum, which is rotate at reload. I'll have to forego the fancy rotate while loaded for now.
    Want my help? Ask here! (not via PM!)
    FAQs: Best Blank DiscsBest TBCsBest VCRs for captureRestore VHS
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!