Live Support, Chat and HTML Editor
Welcome to Support forums Sign in | Join | Help Messenger
Loading

CATEGORIES of pictures

Last post 09-09-2010, 2:47 AM by taipan666. 9 replies.
Sort Posts: Previous Next
  •  08-17-2010, 5:24 AM 63441

    CATEGORIES of pictures

       Good day,
     
       Is there a way to show the CATEGORIES of pictures in the different modes other than EXPLORER LAYOUT?
      I would like to use the SLIDESHOW LAYOUT but keeping showing & navigating through the differents CATEGORIES created before in order to go directly to a specific event/birthday and so on.
     
    Thank for the answer.
  •  08-17-2010, 10:43 AM 63444 in reply to 63441

    Re: CATEGORIES of pictures

    taipan666,
     
    We are investigating this issue and will get back to you as soon as possible.

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  08-18-2010, 3:55 AM 63470 in reply to 63444

    Re: CATEGORIES of pictures

    Thank you for your reply. The top of the top would be like the EXPLORER LAYOUT but displaying a random photo instead of a "folder look" and when going into it, displaying like the SLIDESHOW LAYOUT. I'm complicated! But thank you for your help however.
  •  08-22-2010, 11:57 PM 63554 in reply to 63470

    Re: CATEGORIES of pictures

    Hi taipan666,
     
    1. Open file "\phpgallery\resources\Layout\SlideShow\Code.js"
     
    2. Delete all the code and paste the code below into the file
     
    1.   
    2. function GalleryLayout(gb)   
    3. {   
    4.     this.Browser=gb;   
    5.        
    6.     this.TOOLBARHEIGHT=30;   
    7.     // unknown bug , do not use this.dng_toolbar.offsetHeight   
    8.        
    9.     this.dng_container=this.Browser.FindElement("dng_container");   
    10.        
    11.     this.dng_topinfo=this.Browser.FindElement("dng_topinfo");   
    12.     this.dng_topinfoname=this.Browser.FindElement("dng_topinfoname");   
    13.     this.dng_topinfoindex=this.Browser.FindElement("dng_topinfoindex");   
    14.        
    15.     this.dng_photo1=this.Browser.FindElement("dng_photo1");   
    16.     this.dng_photo2=this.Browser.FindElement("dng_photo2");   
    17.     this.dng_tabcontainer=this.Browser.FindElement("dng_tabcontainer");   
    18.        
    19.     this.dng_toolbar=this.Browser.FindElement("dng_toolbar");   
    20.        
    21.     this.dng_btn_config=this.Browser.FindElement("dng_btn_config");   
    22.     this.dng_btn_prev=this.Browser.FindElement("dng_btn_prev");   
    23.     this.dng_btn_next=this.Browser.FindElement("dng_btn_next");   
    24.     this.dng_btn_play=this.Browser.FindElement("dng_btn_play");   
    25.     this.dng_btn_slider=this.Browser.FindElement("dng_btn_slider");   
    26.        
    27.        
    28.     this.dng_btn_config.src=this.Browser.GetTheme("Images/standard-config.png");   
    29.     this.dng_btn_prev.src=this.Browser.GetTheme("Images/standard-pageprev.png");   
    30.     this.dng_btn_next.src=this.Browser.GetTheme("Images/standard-pagenext.png");   
    31.     this.dng_btn_play.src=this.Browser.GetTheme("Images/standard-slider-play.png");   
    32.     this.dng_btn_slider.src=this.Browser.GetTheme("Images/standard-slider.png");   
    33.        
    34.     //so the ToggleFullPage could be override.   
    35.     this.dng_btn_slider.onclick=ToDelegate(this,function(){ this.ToggleFullPage(); });   
    36.        
    37.     this.dng_btn_config.onclick=ToDelegate(this,this.ShowConfig);   
    38.     this.dng_btn_play.onclick=ToDelegate(this,this.TogglePlay);   
    39.        
    40.     this.dng_toolbar.onmouseover=ToDelegate(this,this.ToolbarMouseOver)   
    41.     this.dng_toolbar.onmouseout=ToDelegate(this,this.ToolbarMouseOut)   
    42.     this.dng_toolbar.onclick=function(e)   
    43.     {   
    44.         e=window.event||e;   
    45.         e.cancelBubble=true;   
    46.     }   
    47.        
    48.     this.dng_container.onclick=ToDelegate(this,this.LayoutClick);   
    49.     this.dng_container.onmousemove=ToDelegate(this,this.LayoutMouseMove);   
    50.     this.dng_container.onmouseout=ToDelegate(this,this.LayoutMouseOut);   
    51.   
    52.     var uploadercontainer=this.Browser.GetUploaderContainer();   
    53.     if(uploadercontainer)   
    54.     {   
    55.         uploadercontainer.style.display="none";   
    56.     }   
    57.        
    58.     this.playing=false;   
    59.     this._speed=5.0;   
    60.   
    61.     this._categories=this.Browser.GetCategories();   
    62.        
    63.   
    64.     function IsNotVisible(n)   
    65.     {   
    66.         if(window.getComputedStyle)   
    67.         {   
    68.             var s=window.getComputedStyle(n,null);   
    69.             if(s.getPropertyValue("display")=="none")   
    70.                 return true;   
    71.             if(s.getPropertyValue("visibility")=="hidden")   
    72.                 return true;   
    73.         }   
    74.         else  
    75.         {   
    76.             var s=n.currentStyle||n.style;   
    77.             if(s.display=="none")   
    78.                 return true;   
    79.             if(s.visibility=="hidden")   
    80.                 return true;   
    81.         }   
    82.         return false;   
    83.     }   
    84.        
    85.     var initfunc=ToDelegate(this,function(){   
    86.        
    87.         for(var vn=this.dng_container;vn&&vn.style;vn=vn.parentNode)   
    88.             if(IsNotVisible(vn))   
    89.                 return setTimeout(initfunc,100);   
    90.            
    91.         this.DrawUI();   
    92.        
    93.         var photos=[];   
    94.            
    95.     if(this._categories.length<GetCategoryNum()||isNaN(GetCategoryNum())||GetCategoryNum()<=0)   
    96.     {   
    97.     photos=photos.concat(this._categories[0].Photos);   
    98.     }   
    99.     else{   
    100.        
    101.      photos=photos.concat(this._categories[GetCategoryNum()].Photos);   
    102.     }   
    103.         if(photos.length>0)   
    104.         {   
    105.             this.TogglePlay();   
    106.                
    107.             this.ShowPhoto(photos[0]);   
    108.         }   
    109.            
    110.         var thisAdjustLayout=ToDelegate(this,this.AdjustLayout);   
    111.         function onwindowresize()   
    112.         {   
    113.             //need adjust twice..   
    114.             thisAdjustLayout();   
    115.             setTimeout(thisAdjustLayout,100);   
    116.         }   
    117.            
    118.         if(window.attachEvent)   
    119.         {   
    120.             window.attachEvent("onresize",onwindowresize);   
    121.             document.attachEvent("onkeydown",ToDelegate(this,this.HandleKeyDown));   
    122.         }   
    123.         else  
    124.         {   
    125.             window.addEventListener("resize",onwindowresize,false);   
    126.             document.addEventListener("keydown",ToDelegate(this,this.HandleKeyDown),false);   
    127.         }   
    128.            
    129.         this.AdjustLayout();   
    130.            
    131.     })   
    132.        
    133.     setTimeout(initfunc,100);   
    134. }   
    135. function GetCategoryNum()   
    136. {   
    137.   
    138.   var urlString = document.location.search;   
    139.     if(urlString != null)   
    140.  {   
    141.           var typeQu ="Category=";   
    142.           var urlEnd = urlString.indexOf(typeQu);   
    143.            
    144.             if(urlEnd != -1)   
    145.        {   
    146.                var paramsUrl = urlString.substring(urlEnd+typeQu.length);   
    147.                var isEnd =  paramsUrl.indexOf('&');   
    148.                if(isEnd != -1)   
    149.             {   
    150.                    return paramsUrl.substring(0, isEnd);   
    151.                                      
    152.             }   
    153.                 else  
    154.             {   
    155.                     return paramsUrl;   
    156.                    
    157.                 }   
    158.          }   
    159.          else    
    160.              
    161.              return 1;   
    162.     }   
    163.     else  
    164.          
    165.         return 1;   
    166. }   
    167. GalleryLayout.prototype.DrawUI=function _GalleryLayout_DrawUI()   
    168. {   
    169.     this.dng_tabcontainer.innerHTML="";   
    170.   
    171.     var div=document.createElement("DIV");   
    172.        
    173.     this._wheeldiv=div;   
    174.   
    175.     div.className="GalleryPhotoList";   
    176.     div.style.position="relative";   
    177.     div.style.overflow="hidden";   
    178.     div.style.width=this.dng_tabcontainer.offsetWidth-6+"px";   
    179.     div.style.height=this.dng_tabcontainer.offsetHeight-6+"px";   
    180.     //div.style.height="24px";   
    181.   
    182.     var photos=[];   
    183.   
    184.     if(this._categories.length<GetCategoryNum()||isNaN(GetCategoryNum())||GetCategoryNum()<=0)   
    185.     {   
    186.     photos=photos.concat(this._categories[0].Photos);   
    187.     }   
    188.     else{   
    189.        
    190.      photos=photos.concat(this._categories[GetCategoryNum()].Photos);   
    191.     }   
    192.     var nobr=document.createElement("NOBR");   
    193.     nobr.style.display="block";   
    194.     nobr.style.width=photos.length*40+"px";   
    195.     nobr.style.height="24px";   
    196.     div.appendChild(nobr);   
    197.   
    198.     this.items=[];   
    199.        
    200.     for(var i=0;i<photos.length;i++)   
    201.     {   
    202.         var photo=photos[i];   
    203.            
    204.         var item=document.createElement("DIV");   
    205.         item.dngphoto=photo;   
    206.   
    207.         item.style.height="24px";   
    208.         item.style.display="inline-block";   
    209.         item.style.verticalAlign="top";   
    210.            
    211.         //var scale = Math.min(48/photo.Width, 24/photo.Height);   
    212.         //var imgwidth=Math.floor(photo.Width * scale);   
    213.         //var imgheight=Math.floor(photo.Height * scale);   
    214.         var imgwidth=32;   
    215.         var imgheight=24;   
    216.            
    217.         var img=this.CreateItemThumb(photo.Thumbnail,imgwidth,imgheight);   
    218.            
    219.         item.style.paddingLeft="2px";   
    220.         item.style.paddingRight="2px";   
    221.         item.style.width=imgwidth+4+"px";   
    222.            
    223.         //if(imgheight<24)   
    224.         //{   
    225.         //  img.style.marginTop=Math.floor(12-imgheight/2)+"px";   
    226.         //}   
    227.         item.style.display="inline-block";   
    228.         item.style.position="relative";   
    229.         item.style.styleFloat="left";   
    230.         item.style["float"]="right";   
    231.            
    232.         item.appendChild(img);   
    233.            
    234.         this.AttachItemEvent(item);   
    235.            
    236.         nobr.appendChild(item);   
    237.            
    238.         this.items.push(item);   
    239.     }   
    240.        
    241.     this.dng_tabcontainer.appendChild(div);   
    242.        
    243.     if(div.scrollWidth > div.offsetWidth)   
    244.     {   
    245.         var widthfixer=document.createElement("DIV");   
    246.         widthfixer.style.position="absolute";   
    247.         widthfixer.style.top=widthfixer.style.width=widthfixer.style.height="1px";   
    248.         widthfixer.style.left=div.offsetWidth*Math.ceil(photos.length*40/div.offsetWidth)-4+"px";   
    249.         div.appendChild(widthfixer);   
    250.            
    251.         var scrollbar=document.createElement("DIV");   
    252.         this.scrollbar=scrollbar;   
    253.         scrollbar.style.position="absolute";   
    254.         scrollbar.style.height="1px";   
    255.         var sbimg=scrollbar.appendChild(document.createElement("IMG"));   
    256.         sbimg.style.display="none";   
    257.         sbimg.style.height="1px";   
    258.         scrollbar.style.width=Math.floor(div.offsetWidth*div.offsetWidth/div.scrollWidth)-4+"px";   
    259.         this.dng_tabcontainer.appendChild(scrollbar);   
    260.         var sbpos=CalcPosition(scrollbar,div);   
    261.         sbpos.top+=div.offsetHeight+3;   
    262.         scrollbar.style.top=sbpos.top+"px";   
    263.         scrollbar.style.left=sbpos.left+2+"px";   
    264.         scrollbar.className="BlackSliderScrollbar";   
    265.         this.SetScrollBarPos=ToDelegate(this,SetScrollBarPos);   
    266.     }   
    267.        
    268.     function SetScrollBarPos()   
    269.     {   
    270.         if(!scrollbar)return;   
    271.         if(this._isfullpage)   
    272.         {   
    273.             scrollbar.style.display="none";   
    274.             return;   
    275.         }   
    276.   
    277.         var sbpos=CalcPosition(scrollbar,div);   
    278.            
    279.         scrollbar.style.display="";   
    280.         sbpos.top+=div.offsetHeight+3;   
    281.         sbpos.left+=Math.floor(div.scrollLeft*div.offsetWidth/div.scrollWidth);   
    282.         scrollbar.style.top=sbpos.top+"px";   
    283.         scrollbar.style.left=sbpos.left+2+"px";   
    284.     }   
    285.        
    286.     if(this.nextScrollLeft)   
    287.     {   
    288.         div.scrollLeft=this.nextScrollLeft;   
    289.         SetScrollBarPos();   
    290.     }   
    291.            
    292.     this.nextScrollLeft=div.scrollLeft;   
    293.        
    294.     div.onmousewheel=ToDelegate(this,function(event)   
    295.     {   
    296.         event=window.event||event;   
    297.            
    298.         this.HandleWheel(event.wheelDelta*2);   
    299.            
    300.         if(event.preventDefault)event.preventDefault();   
    301.         return event.returnValue=false;   
    302.     });   
    303.     this.dng_btn_prev.onclick=ToDelegate(this,function(){   
    304.         this.HandleWheel(div.offsetWidth);   
    305.     });   
    306.     this.dng_btn_next.onclick=ToDelegate(this,function(){   
    307.         this.HandleWheel(-div.offsetWidth);   
    308.     });   
    309.   
    310.     clearTimeout(this.wheelTimerid);   
    311.        
    312. }   
    313. GalleryLayout.prototype.HandleWheel=function _GalleryLayout_HandleWheel(delta)   
    314. {   
    315.   
    316.     this.nextScrollLeft-=delta||0;   
    317.   
    318.     this.nextScrollLeft=Math.max(this.nextScrollLeft,0);   
    319.     this.nextScrollLeft=Math.min(this.nextScrollLeft,this._wheeldiv.scrollWidth-this._wheeldiv.offsetWidth);   
    320.   
    321.     //find the nearest item:   
    322.     if(this.items)   
    323.     {   
    324.         var nearLeft=-1;   
    325.         for(var i=0;i<this.items.length;i++)   
    326.         {   
    327.             var left=this.items[i].offsetLeft;   
    328.             if( Math.abs(left-this.nextScrollLeft) < Math.abs(nearLeft-this.nextScrollLeft) )   
    329.                 nearLeft=left;   
    330.         }   
    331.         if(nearLeft!=-1)   
    332.             this.nextScrollLeft=nearLeft;   
    333.     }   
    334.        
    335.     var ContinueMove=ToDelegate(this,function()   
    336.     {   
    337.         var miss=this.nextScrollLeft-this._wheeldiv.scrollLeft   
    338.         miss=Math.floor(miss*5/6-(miss>0?1:-1));   
    339.            
    340.         clearTimeout(this.wheelTimerid);   
    341.   
    342.         if(Math.abs(miss)<2)   
    343.         {   
    344.             this._wheeldiv.scrollLeft=this.nextScrollLeft;   
    345.         }   
    346.         else  
    347.         {   
    348.             this._wheeldiv.scrollLeft=this.nextScrollLeft-miss;   
    349.                
    350.             this.wheelTimerid=setTimeout(ContinueMove,50);   
    351.         }   
    352.         if(this.SetScrollBarPos)this.SetScrollBarPos();   
    353.     });   
    354.        
    355.     ContinueMove();   
    356.        
    357. }   
    358. GalleryLayout.prototype.CreateItemThumb=function(url,width,height)   
    359. {   
    360.     // return this.Browser.CreateThumbnail(url,width,height);   
    361.     var thumb=GalleryCreateThumbnail(url,width-2,height-2);   
    362.     thumb.style.margin="1px";   
    363.     var div=document.createElement("DIV");   
    364.     div.style.width=width+"px";   
    365.     div.style.height=height+"px";   
    366.     div.style.display="inline-block";   
    367.     div.style.position="relative";   
    368.     div.className="GalleryScrollItem";   
    369.     var tick=document.createElement("DIV");   
    370.     tick.className="GalleryScrollItemTick";   
    371.     tick.style.position="absolute";   
    372.     tick.style.width=width+"px";   
    373.     tick.style.height=height+"px";   
    374.     div.appendChild(tick);   
    375.     div.appendChild(thumb);   
    376.     return div;   
    377. }   
    378. GalleryLayout.prototype.CreateNewTooltip=function _GalleryLayout_CreateNewTooltip(item,delay)   
    379. {   
    380.     var tt={};   
    381.     var closed=false;   
    382.     var photo=item.dngphoto;   
    383.     var div=document.createElement("DIV");   
    384.        
    385.     var scale = Math.min(128/photo.Width, 128/photo.Height);   
    386.     var width=Math.floor(photo.Width * scale);   
    387.     var height=Math.floor(photo.Height * scale)   
    388.     var thumb=this.Browser.CreateThumbnail(photo.Thumbnail,width,height);   
    389.        
    390.     div.style.width=width+"px";   
    391.     div.style.height=height+3+"px";   
    392.        
    393.     div.appendChild(thumb);   
    394.        
    395.     div.className="ZINDEXTOOLTIP";   
    396.     div.style.position="absolute";   
    397.     div.style.display="none";   
    398.        
    399.     InsertToBody(div);   
    400.        
    401.     var pos=CalcPosition(div,item);   
    402.   
    403.     pos.top-=height+3;   
    404.     pos.left-=Math.floor((width-item.offsetWidth)/2);   
    405.        
    406.     div.style.top=pos.top+"px";   
    407.     div.style.left=pos.left+"px";   
    408.        
    409.     var itemisover=true;   
    410.     var divisover=false;   
    411.     var checkid;   
    412.     var outtime;   
    413.        
    414.            
    415.     setTimeout(ToDelegate(this,function(){   
    416.         if(closed)return;   
    417.         if(!itemisover)   
    418.         {   
    419.             tt.Close();   
    420.             return;   
    421.         }   
    422.            
    423.         div.style.display="";   
    424.            
    425.         for(var i=0;i<6;i++)   
    426.         {   
    427.             var line=document.createElement("DIV");   
    428.             line.style.position="absolute";   
    429.             line.style.backgroundColor="#CCCCCC";   
    430.             line.style.height="1px";   
    431.             line.style.width=i*2+1+"px";   
    432.             line.style.top=div.offsetHeight-i+"px";   
    433.             line.style.left=div.offsetWidth/2-i+"px";   
    434.             line.innerHTML="<img style='display:none;width:1px;height:1px;'/>";   
    435.             div.appendChild(line);   
    436.         }   
    437.            
    438.         checkid=setTimeout(ToDelegate(this,CheckState),100);   
    439.            
    440.     }),delay||600);   
    441.        
    442.     function CheckState()   
    443.     {   
    444.         checkid=setTimeout(ToDelegate(this,CheckState),10);   
    445.         if(itemisover||divisover)   
    446.         {   
    447.             outtime=null;   
    448.             return;   
    449.         }   
    450.            
    451.         if(!outtime)   
    452.         {   
    453.             outtime=new Date().getTime();   
    454.             return;   
    455.         }   
    456.            
    457.         if(new Date().getTime()-outtime>300)   
    458.         {   
    459.             tt.Close();   
    460.         }   
    461.     }   
    462.   
    463.        
    464.     div.onmouseover=function()   
    465.     {   
    466.         divisover=true;   
    467.     }   
    468.     div.onmouseout=function()   
    469.     {   
    470.         divisover=false;   
    471.     }   
    472.     div.style.cursor="hand";   
    473.     div.onclick=ToDelegate(this,function()   
    474.     {   
    475.         //this.ShowPhoto(photo);   
    476.         this.Browser.ShowViewer(photo);   
    477.         tt.Close();   
    478.     })   
    479.        
    480.     tt.Close=ToDelegate(this,function()   
    481.     {   
    482.         if(closed)return;   
    483.         closed=true;   
    484.            
    485.         clearTimeout(checkid);   
    486.            
    487.         document.body.removeChild(div);   
    488.            
    489.         this._currentTooltip=null;   
    490.     })   
    491.        
    492.     tt.OnItemOver=ToDelegate(this,function(anotheritem)   
    493.     {   
    494.         itemisover=true;   
    495.         if(anotheritem!=item)   
    496.         {   
    497.             tt.Close();   
    498.             this.CreateNewTooltip(anotheritem,10);   
    499.         }   
    500.     })   
    501.     tt.OnItemOut=ToDelegate(this,function(anotheritem)   
    502.     {   
    503.         itemisover=false;   
    504.     })   
    505.        
    506.        
    507.     this._currentTooltip=tt;   
    508. }   
    509.   
    510. GalleryLayout.prototype.AttachItemEvent=function _GalleryLayout_AttachItemEvent(div)   
    511. {   
    512.     div.onmouseover=ToDelegate(this,function()   
    513.     {   
    514.         if(this._currentTooltip)   
    515.             this._currentTooltip.OnItemOver(div);   
    516.         else  
    517.             this.CreateNewTooltip(div);   
    518.     });   
    519.     div.onmouseout=ToDelegate(this,function()   
    520.     {   
    521.         if(this._currentTooltip)   
    522.             this._currentTooltip.OnItemOut(div);   
    523.     });   
    524.     div.onmousedown=ToDelegate(this,function()   
    525.     {   
    526.         this.ShowPhoto(div.dngphoto);   
    527.     });   
    528.     div.oncontextmenu=ToDelegate(this,function(event)   
    529.     {   
    530.         event=event||window.event;   
    531.         this.Browser.ShowPhotoMenu(div.dngphoto,div,event,this);   
    532.         if(event.preventDefault)event.preventDefault();   
    533.         event.cancelBubble=true;   
    534.         return event.returnValue=false;   
    535.     });   
    536. }   
    537.   
    538.   
    539. GalleryLayout.prototype.SetPlayTimeout=function _GalleryLayout_SetTimeout(func,timeout,type)   
    540. {   
    541.     clearTimeout(this.playtimerid);   
    542.     this.playtimerid=setTimeout(ToDelegate(this,func),timeout);   
    543.     if(type)this.playtimertype=type;   
    544. }   
    545.   
    546.   
    547. GalleryLayout.prototype.TogglePlay=function _GalleryLayout_TogglePlay()   
    548. {   
    549.     if(this.playing)   
    550.     {   
    551.         this.playing=false;   
    552.         this.dng_btn_play.src=this.Browser.GetTheme("Images/standard-slider-play.png");   
    553.     }   
    554.     else  
    555.     {   
    556.         this.playing=true;   
    557.         this.SetPlayTimeout(this.PlayOnTimer,this._speed*1000,"PlayOnTimer");   
    558.         this.dng_btn_play.src=this.Browser.GetTheme("Images/standard-slider-pause.png");   
    559.     }   
    560. }   
    561.   
    562. GalleryLayout.prototype.GetPrevPhoto=function _GalleryLayout_GetPrevPhoto(photo)   
    563. {   
    564.     return this.GetNextPhoto(photo,true);   
    565. }   
    566. GalleryLayout.prototype.GetNextPhoto=function _GalleryLayout_GetNextPhoto(photo,backward)   
    567. {   
    568.     var photos=[];   
    569.     if(this._categories.length<GetCategoryNum()||isNaN(GetCategoryNum())||GetCategoryNum()<=0)   
    570.     {   
    571.     photos=photos.concat(this._categories[0].Photos);   
    572.     }   
    573.     else{   
    574.        
    575.      photos=photos.concat(this._categories[GetCategoryNum()].Photos);   
    576.     }   
    577.        
    578.     if(photos.length==0)   
    579.         return null;   
    580.        
    581.     var nextphoto;   
    582.     for(var i=0;i<photos.length;i++)   
    583.     {   
    584.         var p=photos[i];   
    585.         if(p.CategoryID==photo.CategoryID&&p.PhotoID==photo.PhotoID)   
    586.         {   
    587.             if(backward)   
    588.                 nextphoto=photos[i-1];   
    589.             else  
    590.                 nextphoto=photos[i+1];   
    591.             break;   
    592.         }   
    593.     }   
    594.     if(nextphoto)   
    595.         return nextphoto;   
    596.     if(backward)   
    597.         return photos[photos.length-1];   
    598.     return photos[0];   
    599. }   
    600.   
    601. GalleryLayout.prototype.PlayOnTimer=function _GalleryLayout_PlayOnTimer()   
    602. {   
    603.     if(!this.playing)return;   
    604.        
    605.     var floatingobj=GalleryHasFloatObject();   
    606.     if(floatingobj && floatingobj!=this )   
    607.     {   
    608.         this.SetPlayTimeout(this.PlayOnTimer,this._speed*1000);   
    609.         return;   
    610.     }   
    611.        
    612.     var nextphoto=this.GetNextPhoto(this._showingphoto);   
    613.        
    614.     if(nextphoto)   
    615.     {   
    616.         this.ShowPhoto(nextphoto,true);   
    617.     }   
    618.     else  
    619.     {   
    620.         this.TogglePlay();   
    621.     }   
    622. }   
    623.   
    624. GalleryLayout.prototype.FindItemOfPhoto=function _GalleryLayout_FindItemOfPhoto(photo)   
    625. {   
    626.     if(!photo)return null;   
    627.     if(!this.items)return null;   
    628.     for(var i=0;i<this.items.length;i++)   
    629.     {   
    630.         var item=this.items[i];   
    631.         var p=item.dngphoto;   
    632.         if(p.CategoryID==photo.CategoryID&&p.PhotoID==photo.PhotoID)   
    633.             return item;   
    634.     }   
    635. }   
    636.   
    637.   
    638. GalleryLayout.prototype.ShowPhoto=function _GalleryLayout_ShowPhoto(photo,animation)   
    639. {   
    640.     var previtem;   
    641.     var nextitem;   
    642.        
    643.     if(this.items)   
    644.     {   
    645.         for(var i=0;i<this.items.length;i++)   
    646.         {   
    647.             var item=this.items[i];   
    648.             var p=item.dngphoto;   
    649.             if(p.CategoryID==photo.CategoryID&&p.PhotoID==photo.PhotoID)   
    650.             {   
    651.                 nextitem=item;   
    652.                    
    653.                 this.dng_topinfoname.innerHTML=HtmlEncode(photo.Title +" ("+photo.Width+"x"+photo.Height+") "+(photo.Comment||""))   
    654.                 this.dng_topinfoindex.innerHTML=HtmlEncode("Image "+(i+1)+ " of "this.items.length)   
    655.             }   
    656.             if(this._showingphoto)   
    657.             {   
    658.                 if(p.CategoryID==this._showingphoto.CategoryID&&p.PhotoID==this._showingphoto.PhotoID)   
    659.                 {   
    660.                     previtem=item;   
    661.                 }   
    662.             }   
    663.         }   
    664.            
    665.   
    666.     }   
    667.        
    668.     this._showingphoto=photo;   
    669.        
    670.     if(previtem)   
    671.     {   
    672.         previtem.className="";   
    673.     }   
    674.   
    675.     if(nextitem)   
    676.     {   
    677.         nextitem.className="GallerySelectedItem";   
    678.            
    679.         if(previtem)   
    680.         {   
    681.             var rightpos=this.nextScrollLeft+this._wheeldiv.offsetWidth-20;   
    682.                
    683.             if(nextitem.offsetLeft>this.nextScrollLeft&&nextitem.offsetLeft<rightpos)   
    684.             {   
    685.                 //item is in the view..   
    686.             }   
    687.             else if(nextitem.offsetLeft>previtem.offsetLeft)   
    688.             {   
    689.                 if(previtem.offsetLeft <= rightpos && nextitem.offsetLeft >= rightpos)   
    690.                 {   
    691.                     this.HandleWheel(-this._wheeldiv.offsetWidth);   
    692.                 }   
    693.                    
    694.                 if(nextitem.offsetLeft-previtem.offsetLeft>this._wheeldiv.offsetWidth)   
    695.                 {   
    696.                     this.HandleWheel(-this._wheeldiv.scrollWidth);   
    697.                 }   
    698.             }   
    699.             else  
    700.             {   
    701.                 if(previtem.offsetLeft >= this.nextScrollLeft && nextitem.offsetLeft <= this.nextScrollLeft)   
    702.                 {   
    703.                     this.HandleWheel(this._wheeldiv.offsetWidth);   
    704.                 }   
    705.                    
    706.                 if(nextitem.offsetLeft<this.nextScrollLeft)   
    707.                 {   
    708.                     this.HandleWheel(this.nextScrollLeft);   
    709.                 }   
    710.             }   
    711.         }   
    712.     }   
    713.        
    714.     if(this.dng_photo2.style.display=="none")   
    715.     {   
    716.         this.dng_photo2.style.display="";   
    717.         this._showingdiv=this.dng_photo2;   
    718.         this.currentpdivbg=this.dng_photo1;   
    719.     }   
    720.     else  
    721.     {   
    722.         this.dng_photo1.style.display="";   
    723.         this._showingdiv=this.dng_photo1;   
    724.         this.currentpdivbg=this.dng_photo2;   
    725.     }   
    726.        
    727.     if(this._isfullpage)   
    728.     {   
    729.         var br=GetBodyRect();   
    730.         var cw=br.width;   
    731.         var ch=br.height;   
    732.     }   
    733.     else  
    734.     {   
    735.         var cw=this.Browser.Control.offsetWidth;   
    736.         var ch=this.dng_container.offsetHeight-this.TOOLBARHEIGHT;   
    737.     }   
    738.        
    739.     var scale=Math.min( cw / photo.Width , ch / photo.Height );   
    740.        
    741.     if(this._autoexpend)   
    742.     {   
    743.     }   
    744.     else  
    745.     {   
    746.         if(scale>1)   
    747.             scale=1;   
    748.     }   
    749.        
    750.     var imgwidth=Math.floor(scale*photo.Width);   
    751.     var imgheight=Math.floor(scale*photo.Height);   
    752.   
    753.     this._showingimg=this.Browser.CreatePhoto(photo.Url,imgwidth,imgheight);   
    754.   
    755.     this._showingdiv.innerHTML="";   
    756.        
    757.     this.prevbtn=document.createElement("DIV");   
    758.     this.prevbtn.className="SlideShowPrevBtn";   
    759.     this.prevbtn.style.display="none";   
    760.     this._showingdiv.appendChild(this.prevbtn);   
    761.        
    762.     this.nextbtn=document.createElement("DIV");   
    763.     this.nextbtn.className="SlideShowNextBtn";   
    764.     this.nextbtn.style.display="none";   
    765.     this._showingdiv.appendChild(this.nextbtn);   
    766.   
    767.   
    768.     var alpha=0;   
    769.   
    770.     ToDelegate(this,PlayAlpha)();   
    771.        
    772.     this._showingdiv.style.zIndex=0;   
    773.     this.currentpdivbg.style.zIndex=-1;   
    774.     this.currentpdivbg.style.display="none";   
    775.        
    776.     this._showingdiv.appendChild(this._showingimg);   
    777.     this._showingdiv.style.display="";   
    778.        
    779.     function PlayAlpha()   
    780.     {   
    781.         alpha+=10;   
    782.            
    783.         GallerySetOpacity(this._showingdiv,alpha);   
    784.   
    785.         if(alpha<100)   
    786.         {   
    787.             this.SetPlayTimeout(PlayAlpha,100,"PlayAlpha");   
    788.         }   
    789.         else  
    790.         {   
    791.             this.currentpdivbg.style.display="none";   
    792.                
    793.             if(this.playing)   
    794.             {   
    795.                 this.SetPlayTimeout(this.PlayOnTimer,this._speed*1000,"PlayOnTimer");   
    796.             }   
    797.         }   
    798.     }   
    799.   
    800.     this.AdjustLayout();   
    801.        
    802.        
    803.            
    804.     var nextphoto=this.GetNextPhoto(photo);   
    805.     if(nextphoto)   
    806.     {   
    807.         var nextimg=document.createElement("IMG");   
    808.         nextimg.style.position="absolute";   
    809.         nextimg.style.width="1px";   
    810.         nextimg.style.height="1px";   
    811.         nextimg.style.right="0px";   
    812.         nextimg.style.bottom="0px";   
    813.         nextimg.onload=function()   
    814.         {   
    815.             document.body.removeChild(nextimg);   
    816.         }   
    817.         nextimg.error=function()   
    818.         {   
    819.             document.body.removeChild(nextimg);   
    820.         }   
    821.         InsertToBody(nextimg);   
    822.         setTimeout(function(){   
    823.             nextimg.src=nextphoto.Url;   
    824.         },1000);   
    825.     }   
    826.        
    827. }   
    828.   
    829. GalleryLayout.prototype.LayoutMouseMove=function _GalleryLayout_LayoutMouseMove(e)   
    830. {   
    831.     e=window.event||e;   
    832.   
    833.     if(this.lastmoveclientx==e.clientX&&this.lastmoveclienty==e.clientY)return;   
    834.     this.lastmoveclientx=e.clientX;   
    835.     this.lastmoveclienty=e.clientY;   
    836.   
    837.     if(this.playing&&this.playtimertype=="PlayOnTimer")   
    838.     {   
    839.         this.SetPlayTimeout(this.PlayOnTimer,this._speed*1000,"PlayOnTimer");   
    840.     }   
    841.   
    842.     if(this.nextbtn)this.nextbtn.style.display="none";   
    843.     if(this.prevbtn)this.prevbtn.style.display="none";   
    844.   
    845.     var x=e.clientX-GetClientPosition(this._showingdiv).left;   
    846.     var y=e.clientY-GetClientPosition(this._showingdiv).top;   
    847.                
    848.     this.ActiveTopBottomInfo(y);   
    849.   
    850.     var cursor="hand";   
    851.     var cw=this.dng_container.clientWidth;   
    852.     if(x<cw*2/7)   
    853.     {   
    854.         this.divcursortype="Prev";   
    855.         if(this.prevbtn)this.prevbtn.style.display="";   
    856.         cursor="url("+this.Browser.Param.Folder+"Layout/"+this.Browser.Param.Layout+"/Images/showprev.cur)";   
    857.     }   
    858.     else if(x>cw*5/7)   
    859.     {   
    860.         this.divcursortype="Next";   
    861.         if(!this._isfullpage)   
    862.         {   
    863.             if(this.nextbtn)this.nextbtn.style.display="";   
    864.             cursor="url("+this.Browser.Param.Folder+"Layout/"+this.Browser.Param.Layout+"/Images/shownext.cur)";   
    865.         }   
    866.     }   
    867.     else  
    868.     {   
    869.         this.divcursortype="None";   
    870.         cursor="hand";   
    871.     }   
    872.     try  
    873.     {   
    874.         if(window.XMLHttpRequest)   
    875.         {   
    876.             img.style.cursor=cursor;   
    877.             this._showingdiv.style.cursor=cursor;   
    878.             this.currentpdivbg.style.cursor=cursor;   
    879.         }   
    880.     }   
    881.     catch(x)   
    882.     {   
    883.     }   
    884. }   
    885. GalleryLayout.prototype.LayoutClick=function _GalleryLayout_LayoutClick(e)   
    886. {   
    887.     this.LayoutMouseMove(e);   
    888.     switch(this.divcursortype)   
    889.     {   
    890.         case "Next":   
    891.             clearTimeout(this.playtimerid);   
    892.             this.ShowPhoto(this.GetNextPhoto(this._showingphoto));   
    893.             break;   
    894.         case "Prev":   
    895.             clearTimeout(this.playtimerid);   
    896.             this.ShowPhoto(this.GetPrevPhoto(this._showingphoto));   
    897.             break;   
    898.         case "Open":   
    899.         default:   
    900.             if(!this._isfullpage)   
    901.             {   
    902.                 this.Browser.ShowViewer(this._showingphoto);   
    903.             }   
    904.             else  
    905.             {   
    906.                 clearTimeout(this.playtimerid);   
    907.                 this.ShowPhoto(this.GetNextPhoto(this._showingphoto));   
    908.             }   
    909.             break;   
    910.     }   
    911. }   
    912. GalleryLayout.prototype.LayoutMouseOut=function _GalleryLayout_LayoutMouseOut(e)   
    913. {   
    914.     if(this.nextbtn)this.nextbtn.style.display="none";   
    915.     if(this.prevbtn)this.prevbtn.style.display="none";   
    916.        
    917.     clearTimeout(this.hidetopinfotimerid);   
    918.     this.hidetopinfotimerid=setTimeout(ToDelegate(this,this._ContinueHideTopInfo),100);   
    919. }   
    920.   
    921.   
    922.   
    923. GalleryLayout.prototype.SetSpeed=function _GalleryLayout_SetSpeed(spd)   
    924. {   
    925.     this._speed=spd;   
    926.     if(this.playtimertype=="PlayOnTimer"&&this.playing)   
    927.     {   
    928.         this.SetPlayTimeout(this.PlayOnTimer,this._speed*1000,"PlayOnTimer");   
    929.     }   
    930. }   
    931.   
    932. GalleryLayout.prototype.ShowConfig=function _GalleryLayout_ShowConfig()   
    933. {   
    934.     //this.dng_btn_config   
    935.        
    936.     GalleryHideTooltip();   
    937.        
    938.     var menu=CreateGalleryMenu(this.Browser.ThemeFolder);   
    939.        
    940.     var selimg=this.Browser.GetTheme("Images/standard-selected.png");   
    941.   
    942.     if(this.Browser.Param.AllowEdit)   
    943.     {   
    944.         menu.Add(1,GalleryLocalize.CLICK_SHOWEDITOR,null,ToDelegate(this,function Edit(){   
    945.             this.Browser.ShowEditor();   
    946.         }));   
    947.   
    948.         menu.AddSpliter();   
    949.     }   
    950.        
    951.     menu.Add(1,GalleryLocalize.CLICK_SHOWSLIDER,null,ToDelegate(this,function Slider(){   
    952.         this.Browser.ShowSlider()   
    953.         //this.ToggleFullPage();   
    954.     }));   
    955.   
    956.     menu.AddSpliter();   
    957.        
    958.        
    959.     menu.Add(1,"Faster",this._speed==2.0?selimg:null,ToDelegate(this,function(){   
    960.         this.SetSpeed(2.0);   
    961.     }));   
    962.     menu.Add(1,"Medium",this._speed==5.0?selimg:null,ToDelegate(this,function(){   
    963.         this.SetSpeed(5.0);   
    964.     }));   
    965.     menu.Add(1,"Slower",this._speed==8.0?selimg:null,ToDelegate(this,function(){   
    966.         this.SetSpeed(8.0);   
    967.     }));   
    968.        
    969.     menu.AddSpliter();   
    970.            
    971.     menu.Add(1,GalleryLocalize.TODO("Auto Expend"),this._autoexpend?selimg:null,ToDelegate(this,function Slider(){   
    972.         this._autoexpend=!this._autoexpend;   
    973.         if(this._showingphoto)   
    974.         {   
    975.             this.ShowPhoto(this._showingphoto);   
    976.         }   
    977.     }));   
    978.   
    979.     var pos=GetScrollPosition(this.dng_btn_config);   
    980.     menu.Show(this.dng_btn_config,0,this.dng_btn_config.offsetHeight,this.dng_btn_config);   
    981.        
    982. }   
    983.   
    984.   
    985. GalleryLayout.prototype.HandleKeyDown=function _GalleryLayout_HandleKeyDown(event)   
    986. {   
    987.     event=event||window.event;   
    988.        
    989.     if(event.keyCode==27)   //ESC   
    990.     {   
    991.         if(this._isfullpage)   
    992.         {   
    993.             this.ToggleFullPage();   
    994.         }   
    995.     }   
    996.     else if(event.keyCode==122) //F11   
    997.     {   
    998.         var br=GetBodyRect();   
    999.            
    1000.         var oldcwch=br.width+br.height;   
    1001.            
    1002.         var CheckFunc=ToDelegate(this,function(){   
    1003.             var br=GetBodyRect();   
    1004.                
    1005.             var newcwch=br.width+br.height;   
    1006.                
    1007.             if(newcwch-oldcwch>60)   
    1008.             {   
    1009.                 if(!this._isfullpage)   
    1010.                     this.ToggleFullPage();   
    1011.             }   
    1012.             else if(oldcwch-newcwch>60)   
    1013.             {   
    1014.                 if(this._isfullpage)   
    1015.                     this.ToggleFullPage();   
    1016.             }   
    1017.         });   
    1018.            
    1019.         setTimeout(CheckFunc,200)   
    1020.     }   
    1021. }   
    1022.   
    1023. GalleryLayout.prototype.ToolbarMouseOver=function _GalleryLayout_ToolbarMouseOver()   
    1024. {   
    1025.     this.toolbarisover=true;   
    1026.     clearTimeout(this.hidetoolbartimerid);   
    1027. }   
    1028. GalleryLayout.prototype.ToolbarMouseOut=function _GalleryLayout_ToolbarMouseOut()   
    1029. {   
    1030.     this.toolbarisover=false;   
    1031. }   
    1032.   
    1033. GalleryLayout.prototype._ContinueHideTopInfo=function _GalleryLayout_ContinueHideTopInfo()   
    1034. {   
    1035.     this.topinfoopacity-=10;   
    1036.     if(this.topinfoopacity<=0)   
    1037.     {   
    1038.         this.dng_topinfo.style.display="none";   
    1039.     }   
    1040.     else  
    1041.     {   
    1042.         GallerySetOpacity(this.dng_topinfo,this.topinfoopacity);   
    1043.         this.hidetopinfotimerid=setTimeout(ToDelegate(this,this._ContinueHideTopInfo),100);   
    1044.     }   
    1045. }   
    1046.   
    1047. GalleryLayout.prototype._ContinueHideToolbar=function _GalleryLayout_ContinueHideToolbar()   
    1048. {   
    1049.     if(!this._isfullpage)return;   
    1050.                
    1051.     this.toolbaropacity-=10;   
    1052.     if(this.toolbaropacity<=0)   
    1053.     {   
    1054.         this.dng_toolbar.style.display="none";   
    1055.     }   
    1056.     else  
    1057.     {   
    1058.         GallerySetOpacity(this.dng_toolbar,this.toolbaropacity);   
    1059.         this.hidetoolbartimerid=setTimeout(ToDelegate(this,this._ContinueHideToolbar),100);   
    1060.     }   
    1061. }   
    1062.   
    1063. GalleryLayout.prototype.ActiveTopBottomInfo=function _GalleryLayout_ActiveTopBottomInfo(offsetY)   
    1064. {   
    1065.     if(offsetY<this.dng_container.offsetHeight/3)   
    1066.     {   
    1067.         this.dng_topinfo.style.display="";   
    1068.         this.topinfoopacity=80;   
    1069.         GallerySetOpacity(this.dng_topinfo,this.topinfoopacity);   
    1070.         clearTimeout(this.hidetopinfotimerid);   
    1071.         this.hidetopinfotimerid=setTimeout(ToDelegate(this,this._ContinueHideTopInfo),this._speed*1000+2000);   
    1072.     }   
    1073.        
    1074.     if(this._isfullpage)   
    1075.     {   
    1076.         this.dng_toolbar.style.display="";   
    1077.         this.toolbaropacity=100;   
    1078.         GallerySetOpacity(this.dng_toolbar,this.toolbaropacity);   
    1079.         clearTimeout(this.hidetoolbartimerid);   
    1080.         this.hidetoolbartimerid=setTimeout(ToDelegate(this,this._ContinueHideToolbar),1000);   
    1081.     }   
    1082. }   
    1083.   
    1084. GalleryLayout.prototype.AdjustLayout=function _GalleryLayout_AdjustLayout()   
    1085. {   
    1086.     //TODO:improve this logic, should check the size of the this.Browser.Control   
    1087.     var br=GetBodyRect();   
    1088.   
    1089.     if(this._isfullpage)   
    1090.     {   
    1091.         var pos=CalcPosition(this.dng_container,document.body,true);   
    1092.         var style=this.dng_container.style;   
    1093.         if(style.position=="absolute")   
    1094.         {   
    1095.             style.left=br.left+pos.left+"px";   
    1096.             style.top=br.top+pos.top+"px";   
    1097.         }   
    1098.         else    //IE7   
    1099.         {   
    1100.             pos=GetScrollPosition(this.Browser.Control);   
    1101.             document.documentElement.scrollTop=pos.top;   
    1102.             document.documentElement.scrollLeft=pos.left;   
    1103.             this.Browser.Control.runtimeStyle.width=br.width+"px";   
    1104.             this.Browser.Control.runtimeStyle.height=br.height+"px";   
    1105.         }   
    1106.            
    1107.         style.width=br.width+"px";   
    1108.         style.height=br.height+"px";   
    1109.     }   
    1110.   
    1111.     if(this._isfullpage)   
    1112.     {   
    1113.         var cw=br.width;   
    1114.         var ch=br.height;   
    1115.   
    1116.         this.dng_toolbar.style.top=ch-this.TOOLBARHEIGHT+"px";   
    1117.     }   
    1118.     else  
    1119.     {   
    1120.         var cw=this.Browser.Control.offsetWidth;   
    1121.         var ch=this.Browser.Control.offsetHeight-this.TOOLBARHEIGHT;   
    1122.   
    1123.         this.dng_toolbar.style.top=ch+"px";   
    1124.     }   
    1125.        
    1126.     this.dng_toolbar.style.width=cw+"px";   
    1127.        
    1128.     this.dng_photo1.style.width=this.dng_photo2.style.width=cw+"px";   
    1129.     this.dng_photo1.style.height=this.dng_photo2.style.height=ch+"px";   
    1130.   
    1131.     if(this._showingimg)   
    1132.     {   
    1133.         var imgwidth=parseInt(this._showingimg.style.width)   
    1134.         var imgheight=parseInt(this._showingimg.style.height)   
    1135.         //this._showingdiv.style.paddingTop=Math.max(0,Math.floor(ch/2-imgheight/2))+"px";   
    1136.            
    1137.         this._showingimg.style.position="absolute";   
    1138.         this._showingimg.style.zIndex="-1";   
    1139.         this._showingimg.style.top=Math.max(0,Math.floor(ch/2-imgheight/2))+"px";   
    1140.         this._showingimg.style.left=Math.max(0,Math.floor(cw/2-imgwidth/2))+"px";   
    1141.            
    1142.         if(this.prevbtn)this.prevbtn.style.left=Math.max(0,Math.floor(cw/2-imgwidth/2))+"px";   
    1143.         if(this.prevbtn)this.nextbtn.style.right=Math.max(0,Math.floor(cw/2-imgwidth/2))+"px";   
    1144.     }   
    1145.   
    1146.   
    1147.     if(this.SetScrollBarPos)   
    1148.     {   
    1149.         this.SetScrollBarPos();   
    1150.     }   
    1151.   
    1152.     if(this.dng_tabcontainer.offsetWidth<10||!this._wheeldiv)   
    1153.         return;   
    1154.        
    1155.     if(   
    1156.         this._lastpw!=this.dng_photo1.offsetWidth   
    1157.         ||   
    1158.         Math.abs(this._wheeldiv.offsetWidth-this.dng_tabcontainer.offsetWidth)>10   
    1159.     ){   
    1160.         this._wheeldiv.style.width="1px";   
    1161.         this._wheeldiv.style.width=this.dng_tabcontainer.offsetWidth-6+"px";   
    1162.     }   
    1163.        
    1164.     this._lastpw=this.dng_photo1.offsetWidth;   
    1165.        
    1166. }   
    1167.   
    1168.   
    1169. GalleryLayout.prototype.ToggleFullPage=function _GalleryLayout_ToggleFullPage()   
    1170. {   
    1171.     var br=GetBodyRect();   
    1172.        
    1173.     var isie7=navigator.userAgent.indexOf("MSIE 7.")>-1;   
    1174.        
    1175.     if(!this._isfullpage)   
    1176.     {   
    1177.         this.save_autoexpend=this._autoexpend;   
    1178.         this._autoexpend=true;   
    1179.            
    1180.         this.bodyoverflow=document.body.style.overflow;   
    1181.         document.body.style.overflow="hidden";   
    1182.         document.documentElement.style.overflow="hidden";   
    1183.            
    1184.         if(isie7)   
    1185.         {   
    1186.         }   
    1187.         else  
    1188.         {   
    1189.             this.dng_container.style.position="absolute";   
    1190.         }   
    1191.   
    1192.         this.dng_container.className="ZINDEXSLIDER";   
    1193.         this.dng_container.style.borderWidth="0px";   
    1194.         this._isfullpage=true;   
    1195.            
    1196.         this.Browser.ShowF11KeyMessage();   
    1197.     }   
    1198.     else  
    1199.     {   
    1200.         this._autoexpend=this.save_autoexpend;   
    1201.            
    1202.         document.body.style.overflow=this.bodyoverflow||"";   
    1203.         document.documentElement.style.overflow="";   
    1204.            
    1205.         if(isie7)   
    1206.         {   
    1207.             this.Browser.Control.runtimeStyle.cssText="";   
    1208.         }   
    1209.         else  
    1210.         {   
    1211.             this.dng_container.style.position="relative";   
    1212.         }   
    1213.            
    1214.         this.dng_container.style.left="";   
    1215.         this.dng_container.style.top="";   
    1216.         this.dng_container.style.width="100%";   
    1217.         this.dng_container.style.height="100%";   
    1218.         this.dng_container.style.borderWidth="";   
    1219.         this.dng_container.className="";   
    1220.         this.dng_toolbar.style.display="";   
    1221.         GallerySetOpacity(this.dng_toolbar,100);   
    1222.         this._isfullpage=false;   
    1223.     }   
    1224.        
    1225.     if(this._showingphoto)   
    1226.     {   
    1227.         this.ShowPhoto(this._showingphoto);   
    1228.     }   
    1229.     else  
    1230.     {   
    1231.         this.AdjustLayout();   
    1232.     }   
    1233. }   
    1234.   
    1235.   
    1236. GalleryLayout.prototype.Ajax_Result=function _GalleryLayout_Ajax_Result(ret,param,method)   
    1237. {   
    1238.     if(method=="GetAllCategoryData"||method=="GetCategoryData")   
    1239.     {   
    1240.         this._categories=this.Browser.GetCategories();   
    1241.         this.DrawUI();   
    1242.     }   
    1243. }  
     
    3.  Create a page like below and test it.
     
    1. <?php require_once "phpgallery/include_phpgallery.php" ?>   
    2. <?php   
    3.   
    4. //must declare the gallery and set properties here! for ajax request   
    5. $gallery=new PhpGallery();   
    6.   
    7. $gallery->GalleryFolder="defaultalbum"//the path to the image directory   
    8. $gallery->AllowEdit=true;            //default is false   
    9. $gallery->AllowPostComment=true; //default is false   
    10. $gallery->AllowShowComment=true; //default is true;   
    11.   
    12. //set the user info for comment poster, if not set, the poster will save as guest   
    13. $gallery->LogonUserID="username@server.com";   
    14. $gallery->LogonUserName="UserName";   
    15.   
    16. //set the resource component option.   
    17. $gallery->Layout="SlideShow";   
    18. $gallery->Editor="Explorer";   
    19. $gallery->Slider="NewWin";   
    20. $gallery->Viewer="LightBox";   
    21. $gallery->Popup="Default";   
    22. $gallery->Theme="Classic";   
    23.   
    24. //handle the ajax request , if any   
    25. $gallery->ProcessAjaxPostback();   
    26.   
    27. ?>   
    28. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">   
    29. <html xmlns="http://www.w3.org/1999/xhtml">   
    30. <head>   
    31.     <title>SlideShow Layout - PHP Gallery</title>   
    32.     <link href="Sample.css" type="text/css" rel="stylesheet" />   
    33. </head>   
    34. <body>   
    35. <a href="#" onclick="thegallerybrowser.ShowEditor();return false;">Admin Console</a> |    
    36. <table>   
    37.     <tr>   
    38.         <td style="padding-right:30px"><a href="http://localhost/phpgallery/test.php?Category=1">category1</a></td>   
    39.         <td style="padding-right:30px"><a href="http://localhost/phpgallery/test.php?Category=2">category2</a></td>   
    40.         <td style="padding-right:30px"><a href="http://localhost/phpgallery/test.php?Category=3">category3</a></td>   
    41.     </tr>   
    42. </table>   
    43.   
    44.     <?php   
    45.         $gallery->Render();   
    46.     ?>   
    47.   
    48.   
    49. </body>   
    50. </html>  
    Regards,
     
    ken
  •  08-23-2010, 6:54 AM 63560 in reply to 63554

    Re: CATEGORIES of pictures

    Kenneth,
     
      Thank you so much for your help. Unfortunately, I seem to have  problems using the code above. IT doesn't work correctly.
     
      I'll try to send to you the FTP CODES in order to facilitate the resolution of the issue (if I can send you something via PRIVATE MESSAGE).
     
    Keep get in touch ! 
     
     
  •  08-27-2010, 11:34 AM 63696 in reply to 63560

    Re: CATEGORIES of pictures

    Hi,
     
      Still no news. Tell me if I'm asking too much. I won't be upset !
     
    Thanks.
  •  09-03-2010, 12:09 AM 63823 in reply to 63560

    Re: CATEGORIES of pictures

    thankz for the replies. . .
    orlando disney homes
  •  09-08-2010, 11:27 AM 63896 in reply to 63823

    Re: CATEGORIES of pictures

    Hi,
     
     Still no news. Can you help me?
     
    Thank you.
  •  09-08-2010, 8:42 PM 63902 in reply to 63896

    Re: CATEGORIES of pictures

    Hi taipan666,
     
    Please send the ftp information and your site url to Kenneth@CuteSoft.net. I will create the example for you.
     
    Regards,
     
    ken
  •  09-09-2010, 2:47 AM 63905 in reply to 63902

    Re: CATEGORIES of pictures

    Done. See you soon!
View as RSS news feed in XML