我正在開發一個Facebook應用程序,我想在其中顯示我的朋友的照片以及他的出生日期。例如,今天是4月26日;如果我的任何朋友的生日的今天,他/她的照片應該在26日的日曆顯示時隙等如何在日曆中顯示我的Facebook朋友的照片
這裏是到目前爲止我的查詢:
$dt = "April 12";
$fql1 = "SELECT uid,pic_big,pic,pic_small,name
FROM user
WHERE birthday='".$dt."' AND
uid IN (SELECT uid2 FROM friend WHERE uid1= $user)";
我希望能夠同時處理完整日期(即1986年4月12日)和部分日期(4月12日)。
這是我的日曆代碼
<table width="100%" cellpadding="0" cellspacing="0" height="400" align="center" style="border:1px solid #cccccc;">
<tr><td colspan="3" align="center" class="viewlink"><?php echo $msg;?></td></tr>
<tr >
<td width="120" colspan="1" >
<input type="button" value=" < " onClick="goLastMonth(<?php echo $month . ", " . $year; ?>);">
</td>
<td colspan="5" width="610" align="center">
<span class="title"><?php echo $monthName . " " . $year; ?></span><br>
</td>
<td width="120" colspan="1" align="right" style="padding-right:2px;">
<input type="button" value=" > " onClick="goNextMonth(<?php echo $month . ", " . $year; ?>);">
</td>
</tr>
<tr>
<th>Sunday</td>
<th width="45">Mondy</th>
<th width="89">Tuesday</th>
<th width="126">Wednesday</th>
<th width="98">Thursday</th>
<th width="69">Friday</th>
<th>Saturday</th>
</tr>
<tr>
<?php
for($i = 1; $i < $numDays+1; $i++, $counter++){
$dateToCompare = $month . '-' . $i . '-' . $year;
$timeStamp = strtotime("$year-$month-$i");
//echo $timeStamp . '<br/>';
if($i == 1){
// Workout when the first day of the month is
$firstDay = date("w", $timeStamp);
for($j = 0; $j < $firstDay; $j++, $counter++){
echo "<td> </td>";
}
}
if($counter % 7 == 0){
?>
</tr><tr>
<?php
}
$pdate=strlen($i);
if($pdate==1)
{
$day="0".$i;
}
else
{
$day=$i;
}
$pmonth=strlen($month);
if($pmonth==1)
{
$mon="0".$month;
}
else
{
$mon=$month;
}
?>
<!--right here--><td width="323" <?=hiLightEvt($month,$i,$year);?> valign="top" style="font-family:Verdana, Geneva, sans-serif; font-size:12px; color:#960; text-align:center; padding:10px; margin:0; border:1px dotted #cccccc;" class="viewlink" ><?=$i;?><br />
<?php
**/////////////////////////////Here I want to display friends picture whose birthday at relevant date//////////////////////**
}
>
你可以嘗試格式化你的代碼,所以的編輯似乎有點堅果最近,但我實在看不出。你的代碼是幹什麼的,因爲它沒有格式化,字符也不存在 – 2011-05-02 03:10:09