473,729 Members | 2,340 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Setting up a rotating banner - help required

24 New Member
Hi
I want to set up a rotating banner. Not sure how to incorporate my rotating banner code into the code below. I want the rotating banner to be the main feature image? This is set up in mediasurface

My code is:

[HTML]<!-- start page container -->
<div id="pageContain er">
<!-- start middle content area -->
<div id="genericMidd le">

<div id="titleContai ner">
<h1><%= requestItem.get FullName() %></h1>
</div>
[/HTML]
Expand|Select|Wrap|Line Numbers
  1.     <%
  2.         String sImportantMessage = "";
  3.             try { 
  4.                 sImportantMessage = requestItem.getFieldValue( "sImportantMessage" ); 
  5.  
  6.             } catch ( Exception e ) { }
  7.  
  8.         if ( sImportantMessage == null ) { sImportantMessage = ""; }
  9.  
  10.         if ( ( ! sImportantMessage.equals( "" ) )  )
  11.         {
  12.             out.print("<div id='importantMssgTop'><span class='importantMssgHeader'>" + sImportantMessage + "</span></div>");
  13.         }
  14.  
  15.         String sIntroText = "";
  16.             try { 
  17.                 sIntroText = requestItem.getFieldValue( "sIntroText" ); 
  18.  
  19.             } catch ( Exception e ) { }
  20.  
  21.         if ( sIntroText == null ) { sIntroText = ""; }
  22.  
  23.         if ( ( ! sIntroText.equals( "" ) )  )
  24.         {
  25.             out.print("<div id='introductionText'>" + sIntroText + "</div>");
  26.         }
  27.      %>    
  28.         <!-- start column A-->
  29.         <div id="columnA">
  30.  
  31.     <%
  32.         String sMainFeatureTitle = "";
  33.             try { 
  34.                 sMainFeatureTitle = requestItem.getFieldValue( "sMainFeatureTitle" ); 
  35.  
  36.             } catch ( Exception e ) { }
  37.  
  38.         if ( sMainFeatureTitle == null ) { sMainFeatureTitle = ""; }
  39.  
  40.         if ( ( ! sMainFeatureTitle.equals( "" ) )  )
  41.         {
  42.     %>
  43.             <div id="mainFeatureBox">
  44.                 <div id="mainFeatureText">
  45.                     <a href="<%=requestItem.getFieldValue( "sMainFeatureURL" ) %>">
  46.                         <img src="<%=requestItem.getFieldValue( "sMainFeatureImage" ) %>" alt="<%=requestItem.getFieldValue( "sMainFeatureAlt" ) %>" class="mainFeaturePhoto" align="left" border="0">
  47.                     </a>
  48.                     <div id="featureHeadline">
  49.                           <h2><a href="<%=requestItem.getFieldValue( "sMainFeatureURL" ) %>"><%= sMainFeatureTitle %></a></h2>
  50.                     </div>
  51.                     <%=requestItem.getFieldValue( "sMainFeatureText" ) %>
  52.                 </div>
  53.             </div>
  54.  
  55.     <%    
  56.         }
  57.     %>
  58.  
  59.  
  60.            <div id="Column1">
  61.  
  62. <%
  63.     String sURL = ( "http://" + request.getServerName() + ":" + request.getServerPort() + requestItem.getFieldValue( "sURL" ) ); 
  64. %>    
  65.  
  66.     <ms:getItem id="oCurrentItem" url="<%=sURL%>" />
  67.  
  68. <%
  69.     XXX_ItemOrderList oItemOrderList = new XXX_ItemOrderList( ms, ctx, oCurrentItem.getFieldValue( "orderlist" ) , oCurrentItem );
  70.     IItem[] oChildItem = oItemOrderList.getItemLinks( );
  71.  
  72.     for ( int i = 0; i < oChildItem.length; i++ )
  73.         {
  74.             IItem oBoundItem   = null;
  75.             String sOutput = "";    
  76.             int j = 0;    
  77.  
  78.             IItem oItemChildren = ms.getItem( ctx, oChildItem[i].getUrl() );            
  79.  
  80.                 if (oChildItem[i].getFieldValue("sFlash").equals("N"))
  81.                     {
  82.                     out.print("<div id='secondaryFeatureText'><a href='" + oChildItem[i].getFieldValue("sURL") + "'><img src='" + oChildItem[i].getFieldValue("sImage") + "' alt='" + oChildItem[i].getFieldValue("sAlt") + "' class='featurePhotoSecondary' align='right' border='0' height='60' width='60'></a><h3><a href='"+ oChildItem[i].getFieldValue("sURL") +"'>" + oChildItem[i].getFieldValue("sTitle") + "</a></h3>" + oChildItem[i].getFieldValue("sText") + "</div>");
  83.                     }
  84.                 else
  85.                     {
  86.                     out.print("<div id='secondaryFeatureText'>" + oChildItem[i].getFieldValue("sImage") + "<h3><a href='"+ oChildItem[i].getFieldValue("sURL") +"'>" + oChildItem[i].getFieldValue("sTitle") + "</a></h3>" + oChildItem[i].getFieldValue("sText") + "</div>");
  87.                     }
  88.         }
  89.                 %>
  90.  
  91.  
  92.         </div>
  93.  
  94.  
  95.     <%
  96.         String sNewsArchiveKey = "";
  97.             try { 
  98.                 sNewsArchiveKey  = requestItem.getFieldValue( "sNewsArchiveKey" ); 
  99.  
  100.             } catch ( Exception e ) { }
  101.  
  102.         if ( sNewsArchiveKey == null ) { sNewsArchiveKey = ""; }
  103.  
  104.         if ( ( ! sNewsArchiveKey.equals( "" ) )  )
  105.         {
  106.     %>
Expand|Select|Wrap|Line Numbers
  1.             <div id="Column2">
  2.                 <jsp:include page="/WEB-INF/templates/components/body/Common/News/newsNewGeneric.jsp" flush="true">
  3.                        <jsp:param name="maxResults" value="<%=requestItem.getFieldValue( "sNewsMaxResults" ) %>" /> 
  4.                     <jsp:param name="TitleText" value="News" />
  5.                          <jsp:param name="archiveKey" value="<%=sNewsArchiveKey %>" /> 
  6.                 </jsp:include> 
  7.             </div>
Expand|Select|Wrap|Line Numbers
  1.     <%    
  2.         }
  3.     %>
  4.         </div>
  5.         <!-- end column A  -->
  6.  
  7.         <!-- start column 3-->
  8.         <div id="Column3">
  9.  
  10.  
  11.     <%
  12.         String sQuickLinks = "";
  13.             try { 
  14.                 sQuickLinks = requestItem.getFieldValue( "sQuickLinks" ); 
  15.  
  16.             } catch ( Exception e ) { }
  17.  
  18.         if ( sQuickLinks == null ) { sQuickLinks = ""; }
  19.  
  20.         if ( ( ! sQuickLinks.equals( "" ) )  )
  21.         {
  22.             out.print("<div id='linksRightTitle'><h3>Quick Links</h3></div>" + sQuickLinks);
  23.         }
  24.  
  25.         String sRelatedLinks = "";
  26.             try { 
  27.                 sRelatedLinks = requestItem.getFieldValue( "sRelatedLinks" ); 
  28.  
  29.             } catch ( Exception e ) { }
  30.  
  31.         if ( sRelatedLinks == null ) { sRelatedLinks = ""; }
  32.  
  33.         if ( ( ! sRelatedLinks.equals( "" ) )  )
  34.         {
  35.             out.print("<div id='linksRightSubSection'><h4>Related Intranet Links</h4>" + sRelatedLinks + "</div>");
  36.         }
  37.  
  38.  
  39.     String sInternetLinks = "";
  40.             try { 
  41.                 sInternetLinks = requestItem.getFieldValue( "sInternetLinks" ); 
  42.  
  43.             } catch ( Exception e ) { }
  44.  
  45.         if ( sInternetLinks == null ) { sInternetLinks = ""; }
  46.  
  47.         if ( ( ! sInternetLinks.equals( "" ) )  )
  48.         {
  49.             out.print("<div id='linksRightSubSection'><h4>Related Internet Links</h4>" + sInternetLinks + "</div>");
  50.         }
  51.     %>
Expand|Select|Wrap|Line Numbers
  1.         <div id="linksRightSubSection">
  2.         <h4>Page Tools</h4></div>    
  3.  
  4.         <a href="javascript:window.external.AddFavorite('<%= requestItem.getUrl() %>','<%= requestItem.getFullName() %>');" title="Bookmark This Page">Bookmark this page</a>
  5.         <a href="javascript:XXX_printSubSection( 'mainBody' )" alt="Print" title="Print">Print this page
  6.         </a><p>
  7.  
  8.         <div id="mainBody">
  9.         </div>        
  10.         </div>
  11.         <!-- end column 3-->
  12.  
  13.         <!-- start bottom promotion container -->
  14.         <div id="bottomPromoContainer">
  15.  
Expand|Select|Wrap|Line Numbers
  1.     <%                
  2.         String sBottomPromo1 = "";
  3.             try { 
  4.                 sBottomPromo1 = requestItem.getFieldValue( "sBottomPromo1" ); 
  5.  
  6.             } catch ( Exception e ) { }
  7.  
  8.         if ( sBottomPromo1 == null ) { sBottomPromo1 = ""; }
  9.  
  10.         if ( ( ! sBottomPromo1.equals( "" ) )  )
  11.         {
  12.             out.print("<div id='bottomPromo1'><div id='bottomFeatureText'>" + sBottomPromo1 + "</div></div>");
  13.         }
  14.  
  15.         String sBottomPromo2 = "";
  16.             try { 
  17.                 sBottomPromo2 = requestItem.getFieldValue( "sBottomPromo2" ); 
  18.  
  19.             } catch ( Exception e ) { }
  20.  
  21.         if ( sBottomPromo2 == null ) { sBottomPromo2 = ""; }
  22.  
  23.         if ( ( ! sBottomPromo2.equals( "" ) )  )
  24.         {
  25.             out.print("<div id='bottomPromo2'><div id='bottomFeatureText'>" + sBottomPromo2 + "</div></div>");
  26.         }
  27.  
  28.         String sBottomPromo3 = "";
  29.             try { 
  30.                 sBottomPromo3 = requestItem.getFieldValue( "sBottomPromo3" ); 
  31.  
  32.             } catch ( Exception e ) { }
  33.  
  34.         if ( sBottomPromo3 == null ) { sBottomPromo3 = ""; }
  35.  
  36.         if ( ( ! sBottomPromo3.equals( "" ) )  )
  37.         {
  38.             out.print("<div id='bottomPromo3'><div id='bottomFeatureText'>" + sBottomPromo3 + "</div></div>");
  39.         }
  40.     %>
Expand|Select|Wrap|Line Numbers
  1.         </div>
  2.         <!-- end bottom promotion container -->
  3.  
  4.       </div>
  5.     <!-- End middle content area -->
  6. </div>
  7. <!-- end page container -->
  8.  
*************** *************** *************** ********
My rotating banner code is:

Expand|Select|Wrap|Line Numbers
  1. String sBanner ="";
  2.                     String sBannerURL ="";
  3.  
  4.                     try {
  5.                         sBanner = oBoundItem.getFieldValue("sRotatingBanner");
  6.                         sBannerURL = oBoundItem.getPath();
  7.                     } catch( Exception e ) { }
  8.  
  9.                     out.print("<div id='secondaryFeatureText'>"); 
  10.  
  11.             %>
  12.  
Expand|Select|Wrap|Line Numbers
  1.                 <script language="JavaScript">
  2.  
  3.                     var sBanner = "<%=sBanner %>";
  4.                     var sBannerURL = "/ourcompany/1375787/";
  5.                     var maxAdNo = 7
  6.                     var adNo
  7.                     var myAd = new Array()
  8.  
  9.                     myAd[0] = sBanner1 = "<a href='" + sBannerURL  + "'><img border='0' src='" + sBanner + "1.jpg' align='right' class='featurePhotoSecondary' /></a>";
  10.                     myAd[1] = sBanner2 = "<a href='" + sBannerURL  + "'><img border='0' src='" + sBanner + "2.jpg' align='right' class='featurePhotoSecondary' /></a>";
  11.                     myAd[2] = sBanner3 = "<a href='" + sBannerURL  + "'><img border='0' src='" + sBanner + "3.jpg' align='right' class='featurePhotoSecondary' /></a>";
  12.                     myAd[3] = sBanner4 = "<a href='" + sBannerURL  + "'><img border='0' src='" + sBanner + "4.jpg' align='right' class='featurePhotoSecondary' /></a>";
  13.                     myAd[4] = sBanner5 = "<a href='" + sBannerURL  + "'><img border='0' src='" + sBanner + "5.jpg' align='right' class='featurePhotoSecondary' /></a>";
  14.                     myAd[5] = sBanner6 = "<a href='" + sBannerURL  + "'><img border='0' src='" + sBanner + "6.jpg' align='right' class='featurePhotoSecondary' /></a>";
  15.                     myAd[6] = sBanner7 = "<a href='" + sBannerURL  + "'><img border='0' src='" + sBanner + "7.jpg' align='right' class='featurePhotoSecondary' /></a>";
  16.                     myAd[7] = sBanner8 = "<a href='" + sBannerURL  + "'><img border='0' src='" + sBanner + "8.jpg' align='right' class='featurePhotoSecondary' /></a>";
  17.  
  18.                     adNo = Math.round(Math.random() * maxAdNo)
  19.                     document.write(myAd[adNo])
  20.  
  21.                     </script>
Oct 22 '07 #1
1 2568
acoder
16,027 Recognized Expert Moderator MVP
Please use code tags when posting code:
[CODE=javascrip t]
JavaScript code goes here...
[/code]
Oct 22 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
2409
by: Ian Hubling | last post by:
I'm trying to complete a rotating banner ad within a page I have. The rotating add has four images that rotate in three-second increments. I've got the images to rotate ok - but now I want to go one step further and can't figure out how to do it... I want to have it so that when the person clicks on the specific ad, they are taken to a URL that is unique to each ad. I presume I would have to surround the img tag with an href tag, but...
1
2105
by: Grunt | last post by:
Hi, I have been trying to put together a rotating banner. the code works but I am having a problem with the caching of the banner images. no matter what I try the page is constantly reloading the images, even worse they are not loading completely. This version includes a (vain) attempt at forcing the banner images to cache. Apart form the caching problem the scripting seems to work Any help welcomed:
2
2013
by: mikeoley | last post by:
Ok what I'm trying to do should be fairly simple. I have an image on a page that rotates with 4 other images. All I want to do is be able to link this images to different parts of the site when the user clicks on them. I can't figure out how to add the "HREF" tag in there to make it work though. It's the bottom left image that rotates. Thanks for any help or advice <a href="http://www.eg-designdev.com/aircylinders/index3.jsp">Air
1
1590
by: Gramps | last post by:
Hi, I have a simple ascx(Banner) that consists of an image a label and a public property, 'ThisTitle'. From a page I want to set the label via assignment to the property. The only way I can find to set this property is in the HTML of my page: <uc1:Banner id="Banner1" runat="server"
4
1965
by: Patrick Rouse | last post by:
Please point me to the correct newsgroup if this is the wrong place to post this question. My website is written in simple HTML and hosted on a windows server at secureserver.net (via GoDaddy). I use an ASP Web Stats program called Power-Stats to track my website traffic, search keywords... The data is stored in an Access Database hosted on my website. I'd like to be able to track how many clicks I get on each of my banner ads,...
2
2822
by: sgMuser | last post by:
Hi, I am not a good developer of Javascript codes. Needs this help to make some modification to this famous free javascript from Anarchos. i am using this in one of my webpage. What it does is, rotates banners with hyperlink specific to each image. it works just perfect but i need a simple modification. now I want to stop rotating the images when I mouseover on the image, and then continue once I move the cursor out of the banner image....
2
6546
by: mistral | last post by:
I want place custom text rotating around analogue clock. Here is javascript that is clise to my task: http://javascript.internet.com/time-date/mousetrailclock.html But it have a few unnecessary features which is difficult to alter. i want: 1. replace week/year/days in external circle with my custom text: 'My custom text'
1
1816
by: kennykenn | last post by:
Im having trouble startin to develop a rotating image banner, I have coded part of it (only pulling image from a db). My aim is to print an image to part of my web page, allow it to screen for x amout of time and then i need a function to show the image dissolving, flipping or an effect similar to then appear with the next image and so on. Could ne1 help?!?
13
2390
Death Slaught
by: Death Slaught | last post by:
I have my entire page in my "main" div. div.main { width: 100%; height: 100%; border: 1px solid gray; } on the left of the page I have a banner.
0
8921
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9284
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9202
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8151
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6722
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6022
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4528
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3238
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2683
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.