\n"; $spRow = "\t\n\t\n\t\n"; $event_query = "select ai.id, ai.img_thumb, au.user_name, au.user_dir, aio.thumb_w, aio.thumb_h, ae.event_dir, DATE_FORMAT(ae.event_date, '%m/%d/%y') event_date, ae.event_title, ae.event_location, ae.description from album_image ai, album_img_orientation aio, album_event ae, album_user au where ai.img_orientation = aio.id and ai.event_id = $eid and ai.event_id = ae.id and ae.user_id = au.id order by ai.id"; $rs = mysql_query($event_query); // check to see if there are diary entries for this album $diary_query = "select count(id) count from album.diary where event_id = $eid"; $diaryRs = mysql_query($diary_query); $diaryRow = mysql_fetch_row($diaryRs); $diaryCnt = $diaryRow[0]; if($diaryCnt > 0) { $hasDiary = true; } else { $hasDiary = false; } // end diary count $rowCnt = mysql_num_rows($rs); $pageCnt = ceil(((int)$rowCnt)/16); $pageLinks = ""; if ($pageCnt > 1) { for ($c=0; $c < $pageCnt; $c++) { $pageLinks = $pageLinks . "page " . ($c+1) . ""; if (($c+1) < $pageCnt) { $pageLinks = $pageLinks . " | "; } } } if($HTTP_GET_VARS["pindex"] == "") { $pindex = 0; } else { $pindex = $HTTP_GET_VARS["pindex"]; } $startNum = $pindex*16+1; $endNum = $startNum + 15; $picCnt = 1; while ($row = mysql_fetch_array($rs)) { // here set the event info if($picCnt == 1) { $event_location = $row["event_location"]; $event_desc = $row["description"]; $event_title = $row["event_title"]; $event_date = $row["event_date"]; } if($picCnt >= $startNum && $picCnt <= $endNum) { $img_id = $row["id"]; $img_dir = $row["event_dir"]; $img_thumb = $row["img_thumb"]; $thumb_w = $row["thumb_w"]; $thumb_h = $row["thumb_h"]; if ($i % 4 == 0 && $i > 1) { $tblRows = $tblRows . "\t\n" . $spRow . "\t\n"; } $tblRows = $tblRows . "\t\"$img_thumb\" \n"; if (($picCnt % 4 != 0)) { $tblRows .= "$spCell"; } $i++; } $picCnt++; } $event_info .= "$event_title"; $emptyCells = "\t \n"; if($i % 4 != 0) { for ($c = 0; $c < ($i % 4); $c++) { $i++; $tblRows .= "$emptyCells"; if($i % 4 != 0) { $tblRows .= "$spCell"; } } } $pgeContent = " $tblRows "; if (!empty($pageLinks)) { $pgeContent .= " "; } $diaryStr = "view journal"; if ($eid == 32) { $diaryStr .= " | view movies"; } if($hasDiary) { $pgeContent .= " "; } $pgeContent .= "
$event_info
(Click on title to edit event properties)

Edit Event Images
Click on any image to edit its properties.


$pageLinks
$diaryStr
"; // END EVENT THUMBNAIL CRAP } elseif(isset($usr_id)) { // QUERY FOR LIST OF EVENTS $uq = "select id, event_title, event_date from album_event where user_id = $usr_id order by event_date DESC"; $pgeContent = ""; $urs = mysql_query($uq); while($urow = mysql_fetch_array($urs)) { $event_id = $urow["id"]; $event_title = $urow["event_title"]; $event_date = $urow["event_date"]; $pgeContent .= "$event_title ($event_date)
"; } $pgeContent = "Click on the event title to edit properties.

" . $pgeContent; } else { // REDIRECT TO LOGIN header("Location: /user/login.php"); } mysql_close($li); include("$incrp/template.inc"); ?>