Source for file image_lookup_inc.php
Documentation is available at image_lookup_inc.php 
global $gContent, $gGallery;  
    // nothing to do. ::lookup will do a full load  
if( !empty( $_REQUEST['gallery_path'] ) ) {  
    $_REQUEST['gallery_path'] =  rtrim( $_REQUEST['gallery_path'], '/' );  
    $gContent->setGalleryPath( $_REQUEST['gallery_path'] );  
    $tail =  strrpos( $_REQUEST['gallery_path'], '/' );  
    $_REQUEST['gallery_id'] =  substr( $_REQUEST['gallery_path'], $tail +  1 );  
if( empty( $_REQUEST['gallery_id'] ) ) {  
    if( $parents =  $gContent->getParentGalleries() ) {  
        $gContent->setGalleryPath( '/'. $gal['gallery_id'] );  
        $_REQUEST['gallery_id'] =  $gal['gallery_id'];  
// the image is considered the primary content, however the gallery is useful  
if( !empty($_REQUEST['gallery_id']) &&  is_numeric($_REQUEST['gallery_id']) ) {  
    $gGallery =  new FisheyeGallery( $_REQUEST['gallery_id'], NULL, FALSE );  
    $gGallery->loadCurrentImage( $gContent->mImageId );  
    $gBitSmarty->assign_by_ref('gGallery', $gGallery);  
    $gBitSmarty->assign_by_ref('galleryId', $_REQUEST['gallery_id']);  
// This user does not own this gallery and they have not been granted the permission to edit this gallery  
$gContent->verifyViewPermission();  
$gBitSmarty->assign_by_ref('gContent', $gContent);  
$gBitSmarty->assign_by_ref('imageId', $gContent->mImageId );  
 
 
        
       |