<% require("/var/www/webhosts-script/www.tartanowners.org/private/phpheaders/main.phtml"); # search term highlighter mod function highlight($search, $text_in, $hl_start='', $hl_end=''){ $subject = TONETextDisplay($text_in, true, false); $search = TONETextDisplay($search, false, false); $srchlen = strlen($search); if ($srchlen < 4 || strlen($subject) <= $srchlen){ $text_out = $subject; } else { $text_out = ''; $find = $subject; while ($find = stristr($find,$search)){ $hits++; $srchtxt = substr($find,0,$srchlen); $text_out .= substr($subject,0,strlen($subject)-strlen($find)) . $hl_start . $srchtxt . $hl_end; $find = substr($find,$srchlen); $subject = $find; } $text_out .= $subject; } return array($hits, $text_out); } if (!isset($id)){ if ($ord == 'date'){ $num = 6; $order['owner_image.record_creation'] = $gTONEDBSortDesc; $intro = 'The newest photos submitted by our members are shown below.'; $option = 'View a Different Selection'; } elseif ($action == 'search_gen'){ $num = 99; $order['owner_image.record_creation'] = $gTONEDBSortDesc; $intro = 'The photos found by your search are shown highlighted below.'; $option = 'View the Newest Photos'; } else { $num = 12; $order['rand()'] = ''; $intro = 'A random selection of photos submitted by our members.'; $option = 'View the Newest Photos'; } $where['owner_image.active']=array('op' => '=', 'val' => 'Y'); $result_ownerimage = TONEOwnerImageGetResult('', $order, $where); } else { $result_ownerimage = TONEOwnerImageGetResult($id); if( !($result_ownerimage < 0) ) { $the_ownerimage = mysql_fetch_object($result_ownerimage); $found = $shown = 1; } } if($debug) $url_forward[] ='debug=' . $debug; if(count($url_forward)) $forward = TONETextMakeFromList($url_forward, '', '&', false, '', false); %> Featured Photos
<% include("/var/www/webhosts-script/www.tartanowners.org/private/menu/menu.html"); %>
<% if(isset($id)): %>

<%=TONETextDisplay($the_ownerimage->title, true, true);%>

<%=TONEImageGetTagIMG($the_ownerimage->image_id);%>

<%=TONETextDisplay($the_ownerimage->description, true, true);%>

<% else: %>

Feature photos

<%=$intro;%> Click on any thumbnail to view a larger sized pop-up.

  • Find photos by owner or boat name:
 
<% while($num-- && $the_ownerimage = mysql_fetch_object($result_ownerimage)): $description = $the_ownerimage->description; if ($action == 'search_gen'){ list($hits, $description) = highlight($val, $description); } else{ $description = TONETextDisplay($description, true, true); $hits = 1; } if ($hits): $found += $hits; $shown++; %> <% endif; endwhile; %>
Description/Owner Picture
<%=$description;%>  <%=TONEImageGetTagIMG($the_ownerimage->imagepre_id);%>
<% endif; %>