0) { $total = ($total - 1); } if ((!$image)||($image < 0)) { $image = 0; } elseif ($image > $total) { $image = $total; } $sql = 'SELECT ei.*, e.title, e.summary, e.parent_id, e2.title AS parent_title FROM event_images ei, events e LEFT JOIN events e2 ON e2.event_id = e.parent_id WHERE ei.event_id = e.event_id AND ei.event_id = '.number($event_id).' ORDER BY ei.event_id DESC, ei.sort_order ASC LIMIT '.$image.', 1'; $res = mysql_query($sql) or die(mysql_error()); if (mysql_num_rows($res) > 0) { $row = mysql_fetch_array($res); extract($row); if (!isEmpty($image_name) && is_file($_SERVER['DOCUMENT_ROOT'].'/images/events/'.$event_id.'/'.$image_name)) { $image_src_prev = 'images/events/'.$event_id.'/'.$image_name; } } else { Header('gallery.php?event_id='.$event_id); Exit(); } mysql_free_result($res); // GENERATE IMAGE PATH $img_path = 'images/events/'.$event_id.'/'.$prefix.$image_name; // GENERATE IMAGE TEXT $img_text = $title; if (!$main_sort_order) { $main_sort_order = 0; } $img_nav = ''; if ($image == 0) { $img_nav .= '<< Begin | '; $img_nav .= '< Prev | '; } else { $img_nav .= '<< Begin | '; $img_nav .= '< Prev | '; } if ($cat_url) { $cat_url = ''; } $cat_title = $parent_title; if ($cat_title) { $img_nav .= ''.$cat_title.' | '; } if ($image >= $total) { $img_nav .= 'Next > | '; $img_nav .= 'End >>'; } else { $next_url = ''; $img_nav .= ''.$next_url.'Next > | '; $img_nav .= 'End >>'; } $img_nav_size = ''; while(list($key,$val) = each($sizeArray)) { if ($img_nav_size) { $img_nav_size .= ' | '; } if ($size == $key) { $img_nav_size .= ucwords($val); } else { $img_nav_size .= ''.ucwords($val).''; } } $extracss[] = 'gallery'; if ($size >= 2) { $full_page = 1; $extracss[] = 'fullpage'; } else { $full_page = 0; } $pagetitle = $img_text.' Photo Gallery'; $section_id = 28; DisplayHeader(); echo ''; } if (isEmpty($image_caption)) { $image_alt = $cat_title.' - '.$img_text; } else { $image_alt = $image_caption; } echo '
'.$next_url.''.HTMLencode($image_alt).'
'; echo '
'; echo "You are viewing image ".($image + 1)." out of ".($total + 1)." in this gallery.

"; echo "Dimensions: ".$img_size[0]."x".$img_size[1].", File Size: ".round(shortfilesize($_SERVER['DOCUMENT_ROOT']."/".$img_path), 0)."kb"; echo '
'; } } echo '

'.$img_nav.'
'.$img_nav_size.'

'; } ?>