...

View Full Version : using count



Switch17
04-14-2004, 12:09 AM
I'm working on putting a javascript scroller (its the ProHTML scroller) into a template. The template will loop through itself to get the current NFL schedule and provide the weather for that city. And I'm trying to understand how I can change the id to count up. The template code looks like this:
<div id="dropmsg0" class="dropcontent">
<div class="progame">
<img class="proteam"
src="./images/nflicons/{NFL_Schedule_Excerpt.Week.Games.AWAY_TEAM_ABBREVIATION}.gif"
alt="{NFL_Schedule_Excerpt.Week.Games.AWAY_TEAM_LOCATION} {NFL_Schedule_Excerpt.Week.Games.AWAY_TEAM_MASCOT}">
<div class="at">at</div>
<img class="proteam"
src="./images/nflicons/{NFL_Schedule_Excerpt.Week.Games.HOME_TEAM_ABBREVIATION}.gif"
alt="{NFL_Schedule_Excerpt.Week.Games.HOME_TEAM_LOCATION} {NFL_Schedule_Excerpt.Week.Games.HOME_TEAM_MASCOT}"
onclick="showWeatherPic('{NFL_Schedule_Excerpt.Week.Games.HOME_TEAM_ABBREVIATION}')">
<div class="gametime">{NFL_Schedule_Excerpt.Week.Games.GAME_TIME}</div>
<div id="{NFL_Schedule_Excerpt.Week.Games.HOME_TEAM_ABBREVIATION}forecast" class="weather">
<?php echo $aAllCities['{NFL_Schedule_Excerpt.Week.Games.HOME_TEAM_ABBREVIATION}']; ?>
</div>
</div>
</div>

I'm trying to have the id="dropmsg0" count up by one each time the template loop through. The scroller looks to that id to move to the next item.

Hawkmoon
04-14-2004, 05:24 AM
Wouldn't the following work?



$totalLoops = 10;
for($int=0;$int<$totalLoops; $int++) {
?>

<div id="dropmsg<? echo($int) ?>" class="dropcontent">
<div class="progame">
<img class="proteam"
src="./images/nflicons/{NFL_Schedule_Excerpt.Week.Games.AWAY_TEAM_ABBREVIATION}.gif"
alt="{NFL_Schedule_Excerpt.Week.Games.AWAY_TEAM_LOCATION} {NFL_Schedule_Excerpt.Week.Games.AWAY_TEAM_MASCOT}">
<div class="at">at</div>
<img class="proteam"
src="./images/nflicons/{NFL_Schedule_Excerpt.Week.Games.HOME_TEAM_ABBREVIATION}.gif"
alt="{NFL_Schedule_Excerpt.Week.Games.HOME_TEAM_LOCATION} {NFL_Schedule_Excerpt.Week.Games.HOME_TEAM_MASCOT}"
onclick="showWeatherPic('{NFL_Schedule_Excerpt.Week.Games.HOME_TEAM_ABBREVIATION}')">
<div class="gametime">{NFL_Schedule_Excerpt.Week.Games.GAME_TIME}</div>
<div id="{NFL_Schedule_Excerpt.Week.Games.HOME_TEAM_ABBREVIATION}forecast" class="weather">
<?php echo $aAllCities['{NFL_Schedule_Excerpt.Week.Games.HOME_TEAM_ABBREVIATION}']; ?>
</div>
</div>
</div>
<?
}
?>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum