All pastes #504939 Raw Edit

thumann

public php v1 · immutable
·published 2007-05-23 10:56 UTC
rendered paste body
<?php//db connection stuff removed.//Get the next 5 raids$colname_upcoming_raids = "-1";$query_upcoming_raids = sprintf("select raid_id,location,FROM_UNIXTIME(start_time) as start_time from phpraid_raids where DATE_SUB(CURDATE(), INTERVAL 0 DAY) <= FROM_UNIXTIME(invite_time) order by raid_id asc limit 5", $colname_upcoming_raids);$upcoming_raids = mysql_query($query_upcoming_raids, $link) or die(mysql_error());$row_upcoming_raids = mysql_fetch_assoc($upcoming_raids);$totalRows_upcoming_raids = mysql_num_rows($upcoming_raids);//Create user raids array.// This array contains all the raid_id's that the user has signed up for.$user_raids = array();$query_user_raids= "SELECT raid_id FROM phpraid_signups WHERE profile_id = '".$user_id."'";$rs_user_raids = mysql_query($query_user_raids, $link) or die(mysql_error());while($row=mysql_fetch_assoc($rs_user_raids)) {array_push($user_raids, $row);}echo '<head></head><html><body>';echo '<td width="50%" valign="top" class="windowbg2"><table width="400" border="0" cellspacing="0" cellpadding="0">  <tr>    <td><div align="center"><strong>Raid</strong></div></td>    <td><div align="center"><strong>Date</strong></div></td>  </tr>';do {echo '<tr>    <td><div align="center">';if (in_array($row_upcoming_raids['raid_id'],$user_raids)) { 	echo '<img src="'.$settings['images_url'].'/green-ball.gif" title="Signed up!" />';	}			echo '<a href="raid.php?raid_id='.$row_upcoming_raids['raid_id'].'">'.$row_upcoming_raids['location'].'</a></div></td>    <td><div align="center">'.$row_upcoming_raids['start_time'].'</div></td>  </tr>';  } while ($row_upcoming_raids = mysql_fetch_assoc($upcoming_raids));  echo '<tr><td colspan="2"><div align="center"><img src="'.$settings['images_url'].'/red-ball.gif" title="Not Signed up!" /><img src="'.$settings['images_url'].'/green-ball.gif" title="Signed up!" /></td></tr></table></td>';echo '</body></html>';?>