define(array( "common" => "common.tpl.html", "body" => "spec2.tpl.html" )); $tpl->define_dynamic( "row", "body" ); // get property info for the given ID $sql = " SELECT name, descr, type FROM properties WHERE id='$id' AND display='visible' "; $result = mysql_query( $sql ); if( mysql_num_rows($result) == 0 ){ echo "Invalid ID!"; exit; } $row = mysql_fetch_object($result); if( $row->type == 'progress' ) $typeText = 'Work in Progress'; else $typeText = 'Finished Projects'; $tpl->assign(array( "TOP_NAVIGATION" => "Home :: $typeText :: ".$row->name, "PROPERTY_DESCR" => nl2br($row->descr) )); // get the photos for this property $sql = "SELECT id,info FROM photos WHERE property_id='$id' ORDER BY pic_order"; $phresult = mysql_query( $sql ); while( $phrow1 = mysql_fetch_object($phresult) ){ $photo_id_1 = $phrow1->id; $photo_id_1_info = $phrow1->info; $tpl->assign(array( "PHOTO_1" => "", "PHOTO_1_info" => "$photo_id_1_info", "HR1" => "
" )); if( $phrow2 = mysql_fetch_object($phresult) ){ // even number of photos (last photo) $photo_id_2 = $phrow2->id; $photo_id_2_info = $phrow2->info; $tpl->assign(array( "PHOTO_2" => "", "PHOTO_2_info" => "$photo_id_2_info", "HR2" => "
" )); } else{ // odd number of photos (last photo) $tpl->assign(array( "PHOTO_2" => "", "PHOTO_2_info" => "", "HR2" => "" )); } $tpl->parse( ROWS, ".row" ); } // increase views, but only if not coming through the admin ($noviews only set for admin) if( !isSet($noviews) ) mysql_query( "UPDATE properties SET views=views+1 WHERE id='$id'"); // parse the contents and generate the web page $tpl->parse( "BODY", "body" ); $tpl->parse( "MAIN", "common" ); $tpl->FastPrint(); ?>