473,472 Members | 2,153 Online
Bytes | Software Development & Data Engineering Community
Create 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="pageContainer">
<!-- start middle content area -->
<div id="genericMiddle">

<div id="titleContainer">
<h1><%= requestItem.getFullName() %></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 2552
acoder
16,027 Recognized Expert Moderator MVP
Please use code tags when posting code:
[CODE=javascript]
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
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...
1
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...
2
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...
1
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...
4
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). ...
2
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,...
2
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...
1
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...
13
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
1
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
0
muto222
php
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.