-
Notifications
You must be signed in to change notification settings - Fork 4
/
RandomPhoto.ascx.vb
executable file
·1263 lines (1029 loc) · 83.9 KB
/
RandomPhoto.ascx.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
'
' Simple Gallery for DotNetNuke - http://www.dotnetnuke.com
' Copyright (c) 2002-2007
' by Ventrian ( [email protected] ) ( http://www.ventrian.com )
'
Imports DotNetNuke.Common
Imports DotNetNuke.Common.Utilities
Imports DotNetNuke.Entities.Modules
Imports DotNetNuke.Entities.Modules.Actions
Imports DotNetNuke.Security
Imports DotNetNuke.Services.Exceptions
Imports DotNetNuke.Services.Localization
Imports Ventrian.SimpleGallery.Common
Imports Ventrian.SimpleGallery.Entities
Namespace Ventrian.SimpleGallery
Partial Public Class RandomPhoto
Inherits SimpleGalleryBase
Implements IActionable
#Region " Private Members "
Private _pageID As Integer = Null.NullInteger
Private _moduleID As Integer = Null.NullInteger
Private _albumID As Integer = Null.NullInteger
Private _template As String = ""
Private _templateTokens As String()
Private _linkedGallerySettings As GallerySettings
Private _loadScripts As Boolean = False
#End Region
#Region " Private Properties "
Private ReadOnly Property LinkedGallerySettings(ByVal moduleID As Integer) As Entities.GallerySettings
Get
If (_linkedGallerySettings Is Nothing) Then
Dim objModuleController As New ModuleController
Dim settings As Hashtable = objModuleController.GetModuleSettings(_moduleID)
_linkedGallerySettings = New Entities.GallerySettings(settings)
End If
Return _linkedGallerySettings
End Get
End Property
#End Region
#Region " Private Methods "
Private Function GetAlbumCount(ByVal dataItem As Object) As String
Dim objAlbum As AlbumInfo = CType(dataItem, AlbumInfo)
If Not (objAlbum Is Nothing) Then
If (objAlbum.NumberOfAlbums > 0) Then
If (objAlbum.NumberOfAlbumPhotos > 0) Then
If (objAlbum.NumberOfAlbums = 1) Then
If (objAlbum.NumberOfAlbumPhotos = 1) Then
Return objAlbum.NumberOfAlbums.ToString() & " " & Localization.GetString("SubAlbum", Me.LocalResourceFile) & " (" & objAlbum.NumberOfAlbumPhotos.ToString() & " " & Localization.GetString("Photo", Me.LocalResourceFile) & ")"
Else
Return objAlbum.NumberOfAlbums.ToString() & " " & Localization.GetString("SubAlbum", Me.LocalResourceFile) & " (" & objAlbum.NumberOfAlbumPhotos.ToString() & " " & Localization.GetString("Photos", Me.LocalResourceFile) & ")"
End If
Else
If (objAlbum.NumberOfAlbumPhotos = 1) Then
Return objAlbum.NumberOfAlbums.ToString() & " " & Localization.GetString("SubAlbums", Me.LocalResourceFile) & " (" & objAlbum.NumberOfAlbumPhotos.ToString() & " " & Localization.GetString("Photo", Me.LocalResourceFile) & ")"
Else
Return objAlbum.NumberOfAlbums.ToString() & " " & Localization.GetString("SubAlbums", Me.LocalResourceFile) & " (" & objAlbum.NumberOfAlbumPhotos.ToString() & " " & Localization.GetString("Photos", Me.LocalResourceFile) & ")"
End If
End If
Else
If (objAlbum.NumberOfAlbums = 1) Then
Return objAlbum.NumberOfAlbums.ToString() & " " & Localization.GetString("SubAlbum", Me.LocalResourceFile)
Else
Return objAlbum.NumberOfAlbums.ToString() & " " & Localization.GetString("SubAlbums", Me.LocalResourceFile)
End If
End If
Else
Return ""
End If
Else
Return ""
End If
End Function
Private Function GetAlbumPath(ByVal albumID As String, ByVal moduleID As Integer, ByVal homeDirectory As String) As Hashtable
Dim objSettings As New Hashtable
Dim objPhotoController As New PhotoController
Dim objPhoto As PhotoInfo
objPhoto = objPhotoController.GetFirstFromAlbum(Convert.ToInt32(albumID), moduleID)
If Not (objPhoto Is Nothing) Then
Dim width As Integer
If (objPhoto.Width > GallerySettings.RandomWidth) Then
width = GallerySettings.RandomWidth
Else
width = objPhoto.Width
End If
Dim height As Integer = Convert.ToInt32(objPhoto.Height / (objPhoto.Width / width))
If (height > GallerySettings.RandomHeight) Then
height = GallerySettings.RandomHeight
width = Convert.ToInt32(objPhoto.Width / (objPhoto.Height / height))
End If
Dim square = ""
If (GallerySettings.RandomThumbnail = ThumbnailType.Square) Then
width = GallerySettings.RandomSquare
height = GallerySettings.RandomSquare
square = "&s=1"
End If
objSettings.Add("AlbumWidth", width.ToString())
objSettings.Add("AlbumHeight", height.ToString())
If (objPhoto.HomeDirectory = "") Then
If (LinkedGallerySettings(_moduleID).CompressionAlbum = CompressionType.MinSize) Then
objSettings.Add("AlbumPath", Me.ResolveUrl("../SimpleGallery/ImageHandler.ashx?width=" & width.ToString() & "&height=" & height.ToString() & "&HomeDirectory=" & System.Uri.EscapeDataString(Me.PortalSettings.HomeDirectory & homeDirectory) & "&fileName=" & System.Uri.EscapeDataString(objPhoto.FileName) & "&portalid=" & Me.PortalSettings.PortalId.ToString() & square))
Else
objSettings.Add("AlbumPath", Me.ResolveUrl("../SimpleGallery/ImageHandler.ashx?width=" & width.ToString() & "&height=" & height.ToString() & "&HomeDirectory=" & System.Uri.EscapeDataString(Me.PortalSettings.HomeDirectory & homeDirectory) & "&fileName=" & System.Uri.EscapeDataString(objPhoto.FileName) & "&portalid=" & Me.PortalSettings.PortalId.ToString() & "&q=1" & square))
End If
Else
If (LinkedGallerySettings(_moduleID).CompressionAlbum = CompressionType.MinSize) Then
objSettings.Add("AlbumPath", Me.ResolveUrl("../SimpleGallery/ImageHandler.ashx?width=" & width.ToString() & "&height=" & height.ToString() & "&HomeDirectory=" & System.Uri.EscapeDataString(Me.PortalSettings.HomeDirectory & objPhoto.HomeDirectory) & "&fileName=" & System.Uri.EscapeDataString(objPhoto.FileName) & "&portalid=" & Me.PortalSettings.PortalId.ToString() & square))
Else
objSettings.Add("AlbumPath", Me.ResolveUrl("../SimpleGallery/ImageHandler.ashx?width=" & width.ToString() & "&height=" & height.ToString() & "&HomeDirectory=" & System.Uri.EscapeDataString(Me.PortalSettings.HomeDirectory & objPhoto.HomeDirectory) & "&fileName=" & System.Uri.EscapeDataString(objPhoto.FileName) & "&portalid=" & Me.PortalSettings.PortalId.ToString() & "&q=1" & square))
End If
End If
Else
Dim width As Integer
If (600 > GallerySettings.RandomWidth) Then
width = GallerySettings.RandomWidth
Else
width = 600
End If
Dim height As Integer = Convert.ToInt32(450 / (600 / width))
If (height > GallerySettings.RandomHeight) Then
height = GallerySettings.RandomHeight
width = Convert.ToInt32(600 / (450 / height))
End If
Dim square = ""
If (GallerySettings.RandomThumbnail = ThumbnailType.Square) Then
width = GallerySettings.RandomSquare
height = GallerySettings.RandomSquare
square = "&s=1"
End If
objSettings.Add("AlbumWidth", width.ToString())
objSettings.Add("AlbumHeight", height.ToString())
If (LinkedGallerySettings(_moduleID).CompressionAlbum = CompressionType.MinSize) Then
objSettings.Add("AlbumPath", Me.ResolveUrl("../SimpleGallery/ImageHandler.ashx?width=" & width.ToString() & "&height=" & height.ToString() & "&fileName=" & System.Uri.EscapeDataString("placeholder-600.jpg") & "&portalid=" & Me.PortalSettings.PortalId.ToString() & square))
Else
objSettings.Add("AlbumPath", Me.ResolveUrl("../SimpleGallery/ImageHandler.ashx?width=" & width.ToString() & "&height=" & height.ToString() & "&fileName=" & System.Uri.EscapeDataString("placeholder-600.jpg") & "&portalid=" & Me.PortalSettings.PortalId.ToString()) & "&q=1" & square)
End If
End If
Return objSettings
End Function
Protected Function GetAlternateTextForAlbum(ByVal dataItem As Object) As String
Dim objAlbum As AlbumInfo = CType(dataItem, AlbumInfo)
If Not (objAlbum Is Nothing) Then
Return String.Format(Localization.GetString("AlternateText", Me.LocalResourceFile), objAlbum.Caption)
Else
Return ""
End If
End Function
Private Function GetDescription(ByVal dataItem As Object) As String
Dim objPhoto As PhotoInfo = CType(dataItem, PhotoInfo)
Return Server.HtmlEncode(objPhoto.Description).Replace(Chr(34), "")
End Function
Private Function GetPhotoCount(ByVal dataItem As Object) As String
Dim objAlbum As AlbumInfo = CType(dataItem, AlbumInfo)
If Not (objAlbum Is Nothing) Then
If (objAlbum.NumberOfPhotos > 0) Then
If (objAlbum.NumberOfPhotos = 1) Then
Return " (" & objAlbum.NumberOfPhotos.ToString() & " " & Localization.GetString("Photo", Me.LocalResourceFile) & ")"
Else
Return " (" & objAlbum.NumberOfPhotos.ToString() & " " & Localization.GetString("Photos", Me.LocalResourceFile) & ")"
End If
Else
Return ""
End If
Else
Return ""
End If
End Function
Private Function GetPhotoPathFull(ByVal objPhoto As PhotoInfo) As String
If (objPhoto.Width > LinkedGallerySettings(_moduleID).ImageWidth Or objPhoto.Height > LinkedGallerySettings(_moduleID).ImageHeight) Then
' Use Handler to Resize
Dim width As Integer = objPhoto.Width
Dim height As Integer = objPhoto.Height
If (width > LinkedGallerySettings(_moduleID).ImageWidth) Then
width = LinkedGallerySettings(_moduleID).ImageWidth
height = Convert.ToInt32(height / (objPhoto.Width / LinkedGallerySettings(_moduleID).ImageWidth))
End If
If (height > LinkedGallerySettings(_moduleID).ImageHeight) Then
height = LinkedGallerySettings(_moduleID).ImageHeight
width = Convert.ToInt32(objPhoto.Width / (objPhoto.Height / LinkedGallerySettings(_moduleID).ImageHeight))
End If
Return Me.ResolveUrl("../SimpleGallery/ImageHandler.ashx?width=" & width.ToString() & "&height=" & height.ToString() & "&HomeDirectory=" & System.Uri.EscapeDataString(PortalSettings.HomeDirectory & objPhoto.HomeDirectory) & "&fileName=" & System.Uri.EscapeDataString(objPhoto.FileName) & "&portalid=" & PortalId.ToString() & "&i=" & objPhoto.PhotoID & "&q=1")
Else
Return PortalSettings.HomeDirectory & objPhoto.HomeDirectory & "/" & objPhoto.FileName
End If
End Function
Private Function GetAlbumUrl(ByVal albumID As String) As String
Return NavigateURL(_pageID, Null.NullString, "AlbumID=" & _moduleID.ToString & "-" & albumID)
End Function
Private Function GetPhotoUrl(ByVal photoID As String) As String
If (LinkedGallerySettings(_moduleID).Slideshow = SlideshowType.Popup) Then
If (LinkedGallerySettings(_moduleID).Compression = CompressionType.MinSize) Then
Return "javascript:openScreenWin('smallscreen', '" & Me.ResolveUrl("../SimpleGallery/SlideShowPopup.aspx?PortalID=" & PortalId.ToString() & "&ItemID=" & photoID & "&Border=" & LinkedGallerySettings(_moduleID).BorderStyle & "&sb=" & LinkedGallerySettings(_moduleID).SortBy & "&sd=" & LinkedGallerySettings(_moduleID).SortDirection & "&tt=" & LinkedGallerySettings(_moduleID).EnableTooltip) & "', " & LinkedGallerySettings(_moduleID).PopupWidth.ToString() & ", " & LinkedGallerySettings(_moduleID).PopupHeight.ToString() & ");"
Else
Return "javascript:openScreenWin('smallscreen', '" & Me.ResolveUrl("../SimpleGallery/SlideShowPopup.aspx?PortalID=" & PortalId.ToString() & "&ItemID=" & photoID & "&Border=" & LinkedGallerySettings(_moduleID).BorderStyle & "&sb=" & LinkedGallerySettings(_moduleID).SortBy & "&sd=" & LinkedGallerySettings(_moduleID).SortDirection & "&tt=" & LinkedGallerySettings(_moduleID).EnableTooltip) & "', " & LinkedGallerySettings(_moduleID).PopupWidth.ToString() & ", " & LinkedGallerySettings(_moduleID).PopupHeight.ToString() & ");"
End If
Else
Return NavigateURL(_pageID, "", "galleryType=SlideShow", "ItemID=" & photoID)
End If
End Function
Private Sub InitializeTemplate()
Dim delimStr As String = "[]"
Dim delimiter As Char() = delimStr.ToCharArray()
If (GallerySettings.RandomDisplay = DisplayType.Album) Then
_template = Me.GallerySettings.RandomTemplateAlbum
_templateTokens = Me.GallerySettings.RandomTemplateAlbum.Split(delimiter)
Else
_template = Me.GallerySettings.RandomTemplate
_templateTokens = Me.GallerySettings.RandomTemplate.Split(delimiter)
End If
End Sub
Private Function RssUrl(ByVal albumID As String) As String
Dim objModuleController As New ModuleController
Dim objModule As ModuleInfo = objModuleController.GetModule(_moduleID, _pageID, False)
If Not (objModule Is Nothing) Then
Return Me.ResolveUrl("../SimpleGallery/RSS.aspx?t=" & _pageID.ToString() & "&m=" & _moduleID.ToString() & "&tm=" & objModule.TabModuleID & "&a=" & albumID & "&portalid=" & Me.PortalId)
Else
Return Me.ResolveUrl("../SimpleGallery/RSS.aspx?t=" & _pageID.ToString() & "&m=" & _moduleID.ToString() & "&tm=" & Me.TabModuleId & "&a=" & albumID & "&portalid=" & Me.PortalId)
End If
End Function
#End Region
#Region " Protected Methods "
Protected Overloads Function FormatBorderPath(ByVal image As String) As String
If (_moduleID <> Null.NullInteger) Then
Return Me.ResolveUrl("~/DesktopModules/SimpleGallery/Images/Borders/" & LinkedGallerySettings(_moduleID).BorderStyle & "/" & image).Replace(" ", "%20")
Else
Return ""
End If
End Function
Protected Function GetPhotoPath(ByVal dataItem As Object) As String
Dim square = ""
If (GallerySettings.RandomThumbnail = ThumbnailType.Square) Then
square = "&s=1"
End If
Dim objPhoto As PhotoInfo = CType(dataItem, PhotoInfo)
If Not (objPhoto Is Nothing) Then
If (GallerySettings.RandomCompression = CompressionType.MinSize) Then
Return Me.ResolveUrl("../SimpleGallery/ImageHandler.ashx?width=" & GetPhotoWidth(CType(objPhoto, Object)) & "&height=" & GetPhotoHeight(CType(objPhoto, Object)) & "&HomeDirectory=" & System.Uri.EscapeDataString(Me.PortalSettings.HomeDirectory & objPhoto.HomeDirectory) & "&fileName=" & System.Uri.EscapeDataString(objPhoto.FileName) & "&portalid=" & Me.PortalId.ToString() & square)
Else
Return Me.ResolveUrl("../SimpleGallery/ImageHandler.ashx?width=" & GetPhotoWidth(CType(objPhoto, Object)) & "&height=" & GetPhotoHeight(CType(objPhoto, Object)) & "&HomeDirectory=" & System.Uri.EscapeDataString(Me.PortalSettings.HomeDirectory & objPhoto.HomeDirectory) & "&fileName=" & System.Uri.EscapeDataString(objPhoto.FileName) & "&portalid=" & Me.PortalId.ToString() & "&q=1" & square)
End If
End If
Return ""
End Function
Protected Function GetPhotoWidth(ByVal dataItem As Object) As String
If (Me.GallerySettings.RandomThumbnail = ThumbnailType.Square) Then
Return GallerySettings.RandomSquare
End If
Dim objPhoto As PhotoInfo = CType(dataItem, PhotoInfo)
If Not (objPhoto Is Nothing) Then
Dim width As Integer
If (objPhoto.Width > Me.GallerySettings.RandomWidth) Then
width = Me.GallerySettings.RandomWidth
Else
width = objPhoto.Width
End If
Dim height As Integer = Convert.ToInt32(objPhoto.Height / (objPhoto.Width / width))
If (height > Me.GallerySettings.RandomHeight) Then
height = GallerySettings.RandomHeight
width = Convert.ToInt32(objPhoto.Width / (objPhoto.Height / height))
End If
Return width.ToString()
Else
Return Me.GallerySettings.RandomWidth.ToString()
End If
End Function
Protected Function GetPhotoHeight(ByVal dataItem As Object) As String
If (Me.GallerySettings.RandomThumbnail = ThumbnailType.Square) Then
Return GallerySettings.RandomSquare
End If
Dim objPhoto As PhotoInfo = CType(dataItem, PhotoInfo)
If Not (objPhoto Is Nothing) Then
Dim width As Integer
If (objPhoto.Width > Me.GallerySettings.RandomWidth) Then
width = Me.GallerySettings.RandomWidth
Else
width = objPhoto.Width
End If
Dim height As Integer = Convert.ToInt32(objPhoto.Height / (objPhoto.Width / width))
If (height > Me.GallerySettings.RandomHeight) Then
height = GallerySettings.RandomHeight
width = Convert.ToInt32(objPhoto.Width / (objPhoto.Height / height))
End If
Return height.ToString()
Else
Return Me.GallerySettings.RandomHeight.ToString()
End If
End Function
Protected Function GetAlternateText(ByVal dataItem As Object) As String
Dim objPhoto As PhotoInfo = CType(dataItem, PhotoInfo)
If (objPhoto.Description.Trim().Length > 0) Then
Return Server.HtmlEncode(objPhoto.Description).Replace(Chr(34), "")
Else
Return Server.HtmlEncode(objPhoto.Name).Replace(Chr(34), "")
End If
End Function
Protected Function GetTitle(ByVal dataItem As Object) As String
Dim objPhoto As PhotoInfo = CType(dataItem, PhotoInfo)
Return Server.HtmlEncode(objPhoto.Name).Replace(Chr(34), "")
End Function
#End Region
#Region " Event Handlers "
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
InitializeTemplate()
If (Settings.Contains(Constants.SETTING_RANDOM_PHOTO_TAB_ID)) Then
If (IsNumeric(Settings(Constants.SETTING_RANDOM_PHOTO_TAB_ID).ToString())) Then
_pageID = Convert.ToInt32(Settings(Constants.SETTING_RANDOM_PHOTO_TAB_ID).ToString())
End If
End If
If (Settings.Contains(Constants.SETTING_RANDOM_PHOTO_MODULE_ID)) Then
If (IsNumeric(Settings(Constants.SETTING_RANDOM_PHOTO_MODULE_ID).ToString())) Then
_moduleID = Convert.ToInt32(Settings(Constants.SETTING_RANDOM_PHOTO_MODULE_ID).ToString())
End If
End If
If (Settings.Contains(Constants.SETTING_RANDOM_PHOTO_ALBUM_ID)) Then
If (IsNumeric(Settings(Constants.SETTING_RANDOM_PHOTO_ALBUM_ID).ToString())) Then
_albumID = Convert.ToInt32(Settings(Constants.SETTING_RANDOM_PHOTO_ALBUM_ID).ToString())
End If
End If
If (_moduleID = Null.NullInteger) Then
phStyles.Visible = False
End If
dlGallery.RepeatDirection = Me.GallerySettings.RandomRepeatDirection
dlGallery.RepeatColumns = Me.GallerySettings.RandomRepeatColumns
If (Me.GallerySettings.RandomDisplay = DisplayType.Photo) Then
Dim objPhotoController As New PhotoController
Dim objPhotos As ArrayList
If (Me.GallerySettings.RandomMode = ModeType.Random) Then
objPhotos = objPhotoController.GetRandomPhoto(_moduleID, _albumID, Me.GallerySettings.RandomMaxCount, Me.GallerySettings.RandomTagFilter)
If (GallerySettings.RandomTemplateMode = TemplateModeType.Simple) Then
dlGallery.DataSource = objPhotos
dlGallery.DataBind()
Else
rptGallery.DataSource = objPhotos
rptGallery.DataBind()
End If
Else
If (Me.GallerySettings.RandomMode = ModeType.Latest) Then
objPhotos = objPhotoController.List(_moduleID, _albumID, True, Null.NullInteger, False, Me.GallerySettings.RandomTagFilter, Null.NullString(), Null.NullString, SortType.DateApproved, SortDirection.DESC)
Else
objPhotos = objPhotoController.List(_moduleID, _albumID, True, Null.NullInteger, False, Me.GallerySettings.RandomTagFilter, Null.NullString(), Null.NullString, SortType.Name, SortDirection.DESC)
End If
Dim objPagedDataSource As New PagedDataSource
objPagedDataSource.DataSource = objPhotos
objPagedDataSource.AllowPaging = True
objPagedDataSource.PageSize = Me.GallerySettings.RandomMaxCount
If (GallerySettings.RandomTemplateMode = TemplateModeType.Simple) Then
dlGallery.DataSource = objPagedDataSource
dlGallery.DataBind()
Else
rptGallery.DataSource = objPagedDataSource
rptGallery.DataBind()
End If
End If
If (GallerySettings.RandomLaunchSlideshow) Then
_loadScripts = True
End If
Else
Dim objAlbumController As New AlbumController
Dim objAlbums As New ArrayList
Select Case GallerySettings.RandomMode
Case ModeType.Latest
objAlbums = objAlbumController.List(_moduleID, _albumID, True, False, AlbumSortType.CreateDate, SortDirection.DESC)
Exit Select
Case ModeType.Random
objAlbums = objAlbumController.List(_moduleID, _albumID, True, False, AlbumSortType.Random, SortDirection.DESC)
Exit Select
Case ModeType.Caption
objAlbums = objAlbumController.List(_moduleID, _albumID, True, False, AlbumSortType.Caption, SortDirection.ASC)
Exit Select
End Select
Dim objPagedDataSource As New PagedDataSource
objPagedDataSource.DataSource = objAlbums
objPagedDataSource.AllowPaging = True
objPagedDataSource.PageSize = Me.GallerySettings.RandomMaxCount
If (GallerySettings.RandomTemplateMode = TemplateModeType.Simple) Then
dlGallery.DataSource = objPagedDataSource
dlGallery.DataBind()
Else
rptGallery.DataSource = objPagedDataSource
rptGallery.DataBind()
End If
End If
Catch exc As Exception
ProcessModuleLoadException(Me, exc)
End Try
End Sub
Private Sub Page_PreRender(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.PreRender
Try
If (_loadScripts) Then
If (HttpContext.Current.Items("SimpleGallery-ScriptsRegistered") Is Nothing) Then
If (HttpContext.Current.Items("jquery_registered") Is Nothing And HttpContext.Current.Items("jQueryRequested") Is Nothing And GallerySettings.RandomIncludeJQuery) Then
Dim litLink As New Literal
litLink.Text = "" & vbCrLf _
& "<script type=""text/javascript"" src='" & Page.ResolveUrl(GallerySettings.LightboxDefaultPath & "?v=" & GallerySettings.JavascriptVersion) & "'></script>" & vbCrLf
phjQueryScripts.Controls.Add(litLink)
Else
Dim litLink As New Literal
litLink.Text = "" & vbCrLf _
& "<script type=""text/javascript"" src='" & Page.ResolveUrl(GallerySettings.LightboxDefaultPath & "?v=" & GallerySettings.JavascriptVersion) & "'></script>" & vbCrLf
phjQueryScripts.Controls.Add(litLink)
End If
HttpContext.Current.Items.Add("SimpleGallery-ScriptsRegistered", "true")
End If
End If
If (GallerySettings.RandomLaunchSlideshow And GallerySettings.RandomAlbumSlideshow = False And GallerySettings.RandomDisplay = DisplayType.Photo) Then
Dim script As String = "" _
& "<script type=""text/javascript"">" & vbCrLf _
& "jQuery(function() {" & vbCrLf _
& "jQuery('a[rel*=lightbox" & TabModuleId.ToString() & "-" & ModuleId.ToString() & "]').lightBox({" & vbCrLf _
& "imageLoading: '" & Me.ResolveUrl("../simplegallery/images/lightbox/lightbox-ico-loading.gif") & "'," & vbCrLf _
& "imageBtnPrev: '" & Me.ResolveUrl("../simplegallery/images/lightbox/lightbox-btn-prev.gif") & "'," & vbCrLf _
& "imageBtnNext: '" & Me.ResolveUrl("../simplegallery/images/lightbox/lightbox-btn-next.gif") & "'," & vbCrLf _
& "imageBtnClose: '" & Me.ResolveUrl("../simplegallery/images/lightbox/lightbox-btn-close.gif") & "'," & vbCrLf _
& "imageBlank: '" & Page.ResolveUrl("~/images/spacer.gif") & "'," & vbCrLf _
& "txtImage: '" & Localization.GetString("Image", Me.LocalResourceFile) & "'," & vbCrLf _
& "txtOf: '" & Localization.GetString("Of", Me.LocalResourceFile) & "'," & vbCrLf _
& "next: '" & Localization.GetString("Next", Me.LocalResourceFile) & "'," & vbCrLf _
& "previous: '" & Localization.GetString("Previous", Me.LocalResourceFile) & "'," & vbCrLf _
& "close: '" & Localization.GetString("Close", Me.LocalResourceFile) & "'," & vbCrLf _
& "download: '" & Localization.GetString("Download", Me.LocalResourceFile) & "'," & vbCrLf _
& "txtPlay: '" & Localization.GetString("Play", Me.LocalResourceFile) & "'," & vbCrLf _
& "txtPause: '" & Localization.GetString("Pause", Me.LocalResourceFile) & "'," & vbCrLf _
& "keyToClose: '" & LinkedGallerySettings(_moduleID).LightboxCloseKey & "'," & vbCrLf _
& "keyToPrev: '" & LinkedGallerySettings(_moduleID).LightboxPreviousKey & "'," & vbCrLf _
& "keyToNext: '" & LinkedGallerySettings(_moduleID).LightboxNextKey & "'," & vbCrLf _
& "keyToDownload: '" & LinkedGallerySettings(_moduleID).LightboxDownloadKey & "'," & vbCrLf _
& "slideInterval: '" & (LinkedGallerySettings(_moduleID).LightboxSlideInterval * 1000).ToString() & "'," & vbCrLf _
& "hideTitle: " & LinkedGallerySettings(_moduleID).LightboxHideTitle.ToString().ToLower() & "," & vbCrLf _
& "hideDescription: " & LinkedGallerySettings(_moduleID).LightboxHideDescription.ToString().ToLower() & "," & vbCrLf _
& "hidePaging: " & LinkedGallerySettings(_moduleID).LightboxHidePaging.ToString().ToLower() & "," & vbCrLf _
& "hideTags: " & LinkedGallerySettings(_moduleID).LightboxHideTags.ToString().ToLower() & "," & vbCrLf _
& "hideDownload: " & LinkedGallerySettings(_moduleID).LightboxHideDownload.ToString().ToLower() & "," & vbCrLf _
& "downloadLink: '" & Page.ResolveUrl("~/DesktopModules/SimpleGallery/DownloadPhoto.ashx?PhotoID={0}") & "'" & vbCrLf _
& "});" & vbCrLf _
& "});" & vbCrLf _
& "</script>" & vbCrLf
Dim objScript As New Literal
objScript.Text = script
phLightboxTop.Controls.AddAt(0, objScript)
End If
Catch exc As Exception
ProcessModuleLoadException(Me, exc)
End Try
End Sub
Private Sub BindPhoto(ByVal phPhoto As PlaceHolder, ByVal objPhoto As PhotoInfo)
If (LinkedGallerySettings(_moduleID).Slideshow = SlideshowType.Lightbox) Then
If (GallerySettings.RandomLaunchSlideshow And GallerySettings.RandomAlbumSlideshow) Then
Dim objSortBy As SortType = LinkedGallerySettings(_moduleID).SortBy
Dim objSortDirection As SortDirection = LinkedGallerySettings(_moduleID).SortDirection
If (GallerySettings.RandomMode = ModeType.Latest) Then
objSortBy = SortType.DateApproved
objSortDirection = SortDirection.DESC
End If
Dim objPhotoController As New PhotoController
Dim objPhotoList As ArrayList = objPhotoController.List(_moduleID, objPhoto.AlbumID, True, Null.NullInteger, Null.NullBoolean, GallerySettings.RandomTagFilter, Null.NullString, Null.NullString, objSortBy, objSortDirection)
Dim isBefore As Boolean = True
For Each objPhotoSelected As PhotoInfo In objPhotoList
Dim tags As String = ""
If (objPhotoSelected.Tags <> "") Then
Dim objModuleController As New ModuleController
Dim objTabModules As Dictionary(Of Integer, ModuleInfo) = objModuleController.GetTabModules(_pageID)
Dim tabModuleID As Integer = Null.NullInteger
If (objTabModules.ContainsKey(_moduleID)) Then
tabModuleID = objTabModules(_moduleID).TabModuleID
End If
For Each tag As String In objPhotoSelected.Tags.Split(","c)
If (tags.Length = 0) Then
tags = "(" & Localization.GetString("Tags", Me.LocalResourceFile) & ": <a href='" & NavigateURL(_pageID, "", "tag=" & tag, "Tags=" & tabModuleID) & "'>" & tag & "</a>"
Else
tags = tags & ", <a href='" & NavigateURL(_pageID, "", "tag=" & tag, "Tags=" & tabModuleID) & "'>" & tag & "</a>"
End If
Next
If (tags.Length > 0) Then
tags = tags & ")"
End If
End If
If (objPhoto.PhotoID = objPhotoSelected.PhotoID) Then
isBefore = False
Else
Dim objLiteral As New Literal
objLiteral.Text = "<a href=""" & Me.GetPhotoPathFull(objPhotoSelected) & """ rel=""lightbox" & TabModuleId.ToString() & "-" & objPhoto.PhotoID.ToString() & """ title=""" & GetAlternateText(objPhotoSelected) & """ tags=""" & tags & """></a>"
If (isBefore) Then
phLightboxTop.Controls.Add(objLiteral)
Else
phLightboxBottom.Controls.Add(objLiteral)
End If
End If
Next
Dim script As String = "" _
& "<script type=""text/javascript"">" & vbCrLf _
& "jQuery(function() {" & vbCrLf _
& "jQuery('a[rel*=lightbox" & TabModuleId.ToString() & "-" & objPhoto.PhotoID.ToString() & "]').lightBox({" & vbCrLf _
& "imageLoading: '" & Me.ResolveUrl("../simplegallery/images/lightbox/lightbox-ico-loading.gif") & "'," & vbCrLf _
& "imageBtnPrev: '" & Me.ResolveUrl("../simplegallery/images/lightbox/lightbox-btn-prev.gif") & "'," & vbCrLf _
& "imageBtnNext: '" & Me.ResolveUrl("../simplegallery/images/lightbox/lightbox-btn-next.gif") & "'," & vbCrLf _
& "imageBtnClose: '" & Me.ResolveUrl("../simplegallery/images/lightbox/lightbox-btn-close.gif") & "'," & vbCrLf _
& "imageBlank: '" & Page.ResolveUrl("~/images/spacer.gif") & "'," & vbCrLf _
& "txtImage: '" & Localization.GetString("Image", Me.LocalResourceFile) & "'," & vbCrLf _
& "txtOf: '" & Localization.GetString("Of", Me.LocalResourceFile) & "'," & vbCrLf _
& "next: '" & Localization.GetString("Next", Me.LocalResourceFile) & "'," & vbCrLf _
& "previous: '" & Localization.GetString("Previous", Me.LocalResourceFile) & "'," & vbCrLf _
& "close: '" & Localization.GetString("Close", Me.LocalResourceFile) & "'," & vbCrLf _
& "download: '" & Localization.GetString("Download", Me.LocalResourceFile) & "'," & vbCrLf _
& "txtPlay: '" & Localization.GetString("Play", Me.LocalResourceFile) & "'," & vbCrLf _
& "txtPause: '" & Localization.GetString("Pause", Me.LocalResourceFile) & "'," & vbCrLf _
& "keyToClose: '" & LinkedGallerySettings(_moduleID).LightboxCloseKey & "'," & vbCrLf _
& "keyToPrev: '" & LinkedGallerySettings(_moduleID).LightboxPreviousKey & "'," & vbCrLf _
& "keyToNext: '" & LinkedGallerySettings(_moduleID).LightboxNextKey & "'," & vbCrLf _
& "keyToDownload: '" & LinkedGallerySettings(_moduleID).LightboxDownloadKey & "'," & vbCrLf _
& "slideInterval: '" & (LinkedGallerySettings(_moduleID).LightboxSlideInterval * 1000).ToString() & "'," & vbCrLf _
& "hideTitle: " & LinkedGallerySettings(_moduleID).LightboxHideTitle.ToString().ToLower() & "," & vbCrLf _
& "hideDescription: " & LinkedGallerySettings(_moduleID).LightboxHideDescription.ToString().ToLower() & "," & vbCrLf _
& "hidePaging: " & LinkedGallerySettings(_moduleID).LightboxHidePaging.ToString().ToLower() & "," & vbCrLf _
& "hideTags: " & LinkedGallerySettings(_moduleID).LightboxHideTags.ToString().ToLower() & "," & vbCrLf _
& "hideDownload: " & LinkedGallerySettings(_moduleID).LightboxHideDownload.ToString().ToLower() & "," & vbCrLf _
& "downloadLink: '" & Page.ResolveUrl("~/DesktopModules/SimpleGallery/DownloadPhoto.ashx?PhotoID={0}") & "'" & vbCrLf _
& "});" & vbCrLf _
& "});" & vbCrLf _
& "</script>" & vbCrLf
Dim objScript As New Literal
objScript.Text = script
phLightboxTop.Controls.AddAt(0, objScript)
End If
End If
For iPtr As Integer = 0 To _templateTokens.Length - 1 Step 2
phPhoto.Controls.Add(New LiteralControl(_templateTokens(iPtr).ToString()))
If iPtr < _templateTokens.Length - 1 Then
Select Case _templateTokens(iPtr + 1)
Case "ALBUMID"
Dim objLiteral As New Literal
objLiteral.ID = Globals.CreateValidID("Gallery" & objPhoto.PhotoID.ToString() & "-" & iPtr.ToString())
objLiteral.Text = objPhoto.AlbumID.ToString()
phPhoto.Controls.Add(objLiteral)
Case "ALBUMLINK"
Dim objLiteral As New Literal
objLiteral.ID = Globals.CreateValidID("Gallery" & objPhoto.PhotoID.ToString() & "-" & iPtr.ToString())
objLiteral.Text = Me.GetAlbumUrl(objPhoto.AlbumID.ToString())
phPhoto.Controls.Add(objLiteral)
Case "ALBUMNAME"
Dim objLiteral As New Literal
objLiteral.ID = Globals.CreateValidID("Gallery" & objPhoto.PhotoID.ToString() & "-" & iPtr.ToString())
objLiteral.Text = objPhoto.AlbumName
phPhoto.Controls.Add(objLiteral)
Case "AUTHORID"
Dim objLiteral As New Literal
objLiteral.ID = Globals.CreateValidID("Gallery" & objPhoto.PhotoID.ToString() & "-" & iPtr.ToString())
objLiteral.Text = objPhoto.AuthorID.ToString()
phPhoto.Controls.Add(objLiteral)
Case "AUTHORDISPLAYNAME"
Dim objLiteral As New Literal
objLiteral.ID = Globals.CreateValidID("Gallery" & objPhoto.PhotoID.ToString() & "-" & iPtr.ToString())
objLiteral.Text = objPhoto.AuthorDisplayName.ToString()
phPhoto.Controls.Add(objLiteral)
Case "AUTHORFIRSTNAME"
Dim objLiteral As New Literal
objLiteral.ID = Globals.CreateValidID("Gallery" & objPhoto.PhotoID.ToString() & "-" & iPtr.ToString())
objLiteral.Text = objPhoto.AuthorFirstName.ToString()
phPhoto.Controls.Add(objLiteral)
Case "AUTHORLASTNAME"
Dim objLiteral As New Literal
objLiteral.ID = Globals.CreateValidID("Gallery" & objPhoto.PhotoID.ToString() & "-" & iPtr.ToString())
objLiteral.Text = objPhoto.AuthorLastName.ToString()
phPhoto.Controls.Add(objLiteral)
Case "AUTHORUSERNAME"
Dim objLiteral As New Literal
objLiteral.ID = Globals.CreateValidID("Gallery" & objPhoto.PhotoID.ToString() & "-" & iPtr.ToString())
objLiteral.Text = objPhoto.AuthorUserName.ToString()
phPhoto.Controls.Add(objLiteral)
Case "APPROVERID"
Dim objLiteral As New Literal
objLiteral.ID = Globals.CreateValidID("Gallery" & objPhoto.PhotoID.ToString() & "-" & iPtr.ToString())
objLiteral.Text = objPhoto.ApproverID.ToString()
phPhoto.Controls.Add(objLiteral)
Case "APPROVERFIRSTNAME"
Dim objLiteral As New Literal
objLiteral.ID = Globals.CreateValidID("Gallery" & objPhoto.PhotoID.ToString() & "-" & iPtr.ToString())
objLiteral.Text = objPhoto.ApproverFirstName.ToString()
phPhoto.Controls.Add(objLiteral)
Case "APPROVERLASTNAMED"
Dim objLiteral As New Literal
objLiteral.ID = Globals.CreateValidID("Gallery" & objPhoto.PhotoID.ToString() & "-" & iPtr.ToString())
objLiteral.Text = objPhoto.ApproverLastName.ToString()
phPhoto.Controls.Add(objLiteral)
Case "APPROVERUSERNAME"
Dim objLiteral As New Literal
objLiteral.ID = Globals.CreateValidID("Gallery" & objPhoto.PhotoID.ToString() & "-" & iPtr.ToString())
objLiteral.Text = objPhoto.ApproverUserName.ToString()
phPhoto.Controls.Add(objLiteral)
Case "DATEAPPROVED"
Dim objLiteral As New Literal
objLiteral.ID = Globals.CreateValidID("Gallery" & objPhoto.PhotoID.ToString() & "-" & iPtr.ToString())
objLiteral.Text = objPhoto.DateApproved.ToString.ToString()
phPhoto.Controls.Add(objLiteral)
Case "DATECREATED"
Dim objLiteral As New Literal
objLiteral.ID = Globals.CreateValidID("Gallery" & objPhoto.PhotoID.ToString() & "-" & iPtr.ToString())
objLiteral.Text = objPhoto.DateCreated.ToString.ToString()
phPhoto.Controls.Add(objLiteral)
Case "DATEUPDATED"
Dim objLiteral As New Literal
objLiteral.ID = Globals.CreateValidID("Gallery" & objPhoto.PhotoID.ToString() & "-" & iPtr.ToString())
objLiteral.Text = objPhoto.DateUpdated.ToString.ToString()
phPhoto.Controls.Add(objLiteral)
Case "DESCRIPTION"
Dim objLiteral As New Literal
objLiteral.ID = Globals.CreateValidID("Gallery" & objPhoto.PhotoID.ToString() & "-" & iPtr.ToString())
objLiteral.Text = objPhoto.Description.ToString()
phPhoto.Controls.Add(objLiteral)
Case "DOWNLOADLINK"
Dim objLiteral As New Literal
objLiteral.ID = Globals.CreateValidID("Gallery" & objPhoto.PhotoID.ToString() & "-" & iPtr.ToString())
objLiteral.Text = Page.ResolveUrl("~/DesktopModules/SimpleGallery/DownloadPhoto.ashx?PhotoID=" & objPhoto.PhotoID.ToString())
phPhoto.Controls.Add(objLiteral)
Case "FILENAME"
Dim objLiteral As New Literal
objLiteral.ID = Globals.CreateValidID("Gallery" & objPhoto.PhotoID.ToString() & "-" & iPtr.ToString())
objLiteral.Text = objPhoto.FileName.ToString()
phPhoto.Controls.Add(objLiteral)
Case "HEIGHT"
Dim objLiteral As New Literal
objLiteral.ID = Globals.CreateValidID("Gallery" & objPhoto.PhotoID.ToString() & "-" & iPtr.ToString())
objLiteral.Text = objPhoto.Height.ToString()
phPhoto.Controls.Add(objLiteral)
Case "HOMEDIRECTORY"
Dim objLiteral As New Literal
objLiteral.ID = Globals.CreateValidID("Gallery" & objPhoto.PhotoID.ToString() & "-" & iPtr.ToString())
objLiteral.Text = objPhoto.HomeDirectory.ToString()
phPhoto.Controls.Add(objLiteral)
Case "PHOTO"
Dim objLiteral As New Literal
objLiteral.ID = Globals.CreateValidID("Gallery" & objPhoto.PhotoID.ToString() & "-" & iPtr.ToString())
objLiteral.Text = "<img src=""" & GetPhotoPath(objPhoto) & """ class=""photo_198"" width=""" & GetPhotoWidth(objPhoto) & """ height=""" & GetPhotoHeight(objPhoto) & """ alt=""" & GetAlternateText(objPhoto) & """>"
phPhoto.Controls.Add(objLiteral)
Case "PHOTOLINK"
Dim objLiteral As New Literal
objLiteral.ID = Globals.CreateValidID("Gallery" & objPhoto.AlbumID.ToString() & "-" & iPtr.ToString())
objLiteral.Text = GetPhotoPath(objPhoto)
phPhoto.Controls.Add(objLiteral)
Case "PHOTOWITHBORDER"
Dim objLiteral As New Literal
objLiteral.ID = Globals.CreateValidID("Gallery" & objPhoto.PhotoID.ToString() & "-" & iPtr.ToString())
Select Case LinkedGallerySettings(_moduleID).Slideshow
Case SlideshowType.Lightbox
Dim tags As String = ""
If (objPhoto.Tags <> "") Then
Dim objModuleController As New ModuleController
Dim objTabModules As Dictionary(Of Integer, ModuleInfo) = objModuleController.GetTabModules(_pageID)
Dim tabModuleID As Integer = Null.NullInteger
If (objTabModules.ContainsKey(_moduleID)) Then
tabModuleID = objTabModules(_moduleID).TabModuleID
End If
For Each tag As String In objPhoto.Tags.Split(","c)
If (tags.Length = 0) Then
tags = "(" & Localization.GetString("Tags", Me.LocalResourceFile) & ": <a href='" & NavigateURL(_pageID, "", "tag=" & tag, "Tags=" & tabModuleID) & "'>" & tag & "</a>"
Else
tags = tags & ", <a href='" & NavigateURL(_pageID, "", "tag=" & tag, "Tags=" & tabModuleID) & "'>" & tag & "</a>"
End If
Next
If (tags.Length > 0) Then
tags = tags & ")"
End If
End If
If (GallerySettings.RandomLaunchSlideshow) Then
If (GallerySettings.RandomAlbumSlideshow) Then
objLiteral.Text = "<table class=""photo-frame"">" _
& "<tr><td class=""topx--""></td><td class=""top-x-""></td><td class=""top--x""></td></tr>" _
& "<tr><td class=""midx--""></td><td valign=""top""><a href=""" & Me.GetPhotoPathFull(objPhoto) & """ rel=""lightbox" & TabModuleId.ToString() & "-" & objPhoto.PhotoID.ToString() & """ title=""" & GetTitle(objPhoto) & """ tags=""" & tags & """ description=""" & GetDescription(objPhoto) & """ pid=""" & objPhoto.PhotoID.ToString() & """><img src=""" & GetPhotoPath(objPhoto) & """ class=""photo_198"" width=""" & GetPhotoWidth(objPhoto) & """ height=""" & GetPhotoHeight(objPhoto) & """ alt=""" & GetAlternateText(objPhoto) & """></a></td><td class=""mid--x""></td></tr>" _
& "<tr><td class=""botx--""></td><td class=""bot-x-""></td><td class=""bot--x""></td></tr>" _
& "</table>"
Else
objLiteral.Text = "<table class=""photo-frame"">" _
& "<tr><td class=""topx--""></td><td class=""top-x-""></td><td class=""top--x""></td></tr>" _
& "<tr><td class=""midx--""></td><td valign=""top""><a href=""" & Me.GetPhotoPathFull(objPhoto) & """ rel=""lightbox" & TabModuleId.ToString() & "-" & ModuleId.ToString() & """ title=""" & GetTitle(objPhoto) & """ tags=""" & tags & """ description=""" & GetDescription(objPhoto) & """ pid=""" & objPhoto.PhotoID.ToString() & """><img src=""" & GetPhotoPath(objPhoto) & """ class=""photo_198"" width=""" & GetPhotoWidth(objPhoto) & """ height=""" & GetPhotoHeight(objPhoto) & """ alt=""" & GetAlternateText(objPhoto) & """></a></td><td class=""mid--x""></td></tr>" _
& "<tr><td class=""botx--""></td><td class=""bot-x-""></td><td class=""bot--x""></td></tr>" _
& "</table>"
End If
Else
objLiteral.Text = "<table class=""photo-frame"">" _
& "<tr><td class=""topx--""></td><td class=""top-x-""></td><td class=""top--x""></td></tr>" _
& "<tr><td class=""midx--""></td><td valign=""top""><a href=""" & Me.GetAlbumUrl(objPhoto.AlbumID.ToString()) & """><img src=""" & GetPhotoPath(objPhoto) & """ class=""photo_198"" width=""" & GetPhotoWidth(objPhoto) & """ height=""" & GetPhotoHeight(objPhoto) & """ alt=""" & GetAlternateText(objPhoto) & """></a></td><td class=""mid--x""></td></tr>" _
& "<tr><td class=""botx--""></td><td class=""bot-x-""></td><td class=""bot--x""></td></tr>" _
& "</table>"
End If
Case Else
If (GallerySettings.RandomLaunchSlideshow) Then
objLiteral.Text = "<table class=""photo-frame"">" _
& "<tr><td class=""topx--""></td><td class=""top-x-""></td><td class=""top--x""></td></tr>" _
& "<tr><td class=""midx--""></td><td valign=""top""><a href=""" & Me.GetPhotoUrl(objPhoto.PhotoID.ToString()) & """><img src=""" & GetPhotoPath(objPhoto) & """ class=""photo_198"" width=""" & GetPhotoWidth(objPhoto) & """ height=""" & GetPhotoHeight(objPhoto) & """ alt=""" & GetAlternateText(objPhoto) & """></a></td><td class=""mid--x""></td></tr>" _
& "<tr><td class=""botx--""></td><td class=""bot-x-""></td><td class=""bot--x""></td></tr>" _
& "</table>"
Else
objLiteral.Text = "<table class=""photo-frame"">" _
& "<tr><td class=""topx--""></td><td class=""top-x-""></td><td class=""top--x""></td></tr>" _
& "<tr><td class=""midx--""></td><td valign=""top""><a href=""" & Me.GetAlbumUrl(objPhoto.AlbumID.ToString()) & """><img src=""" & GetPhotoPath(objPhoto) & """ class=""photo_198"" width=""" & GetPhotoWidth(objPhoto) & """ height=""" & GetPhotoHeight(objPhoto) & """ alt=""" & GetAlternateText(objPhoto) & """></a></td><td class=""mid--x""></td></tr>" _
& "<tr><td class=""botx--""></td><td class=""bot-x-""></td><td class=""bot--x""></td></tr>" _
& "</table>"
End If
End Select
phPhoto.Controls.Add(objLiteral)
Case "PHOTOWITHBORDERNOALT"
Dim objLiteral As New Literal
objLiteral.ID = Globals.CreateValidID("Gallery" & objPhoto.PhotoID.ToString() & "-" & iPtr.ToString())
Select Case LinkedGallerySettings(_moduleID).Slideshow
Case SlideshowType.Lightbox
Dim tags As String = ""
If (objPhoto.Tags <> "") Then
Dim objModuleController As New ModuleController
Dim objTabModules As Dictionary(Of Integer, ModuleInfo) = objModuleController.GetTabModules(_pageID)
Dim tabModuleID As Integer = Null.NullInteger
If (objTabModules.ContainsKey(_moduleID)) Then
tabModuleID = objTabModules(_moduleID).TabModuleID
End If
For Each tag As String In objPhoto.Tags.Split(","c)
If (tags.Length = 0) Then
tags = "(" & Localization.GetString("Tags", Me.LocalResourceFile) & ": <a href='" & NavigateURL(_pageID, "", "tag=" & tag, "Tags=" & tabModuleID) & "'>" & tag & "</a>"
Else
tags = tags & ", <a href='" & NavigateURL(_pageID, "", "tag=" & tag, "Tags=" & tabModuleID) & "'>" & tag & "</a>"
End If
Next
If (tags.Length > 0) Then
tags = tags & ")"
End If
End If
If (GallerySettings.RandomLaunchSlideshow) Then
If (GallerySettings.RandomAlbumSlideshow) Then
objLiteral.Text = "<table class=""photo-frame"">" _
& "<tr><td class=""topx--""></td><td class=""top-x-""></td><td class=""top--x""></td></tr>" _
& "<tr><td class=""midx--""></td><td valign=""top""><a href=""" & Me.GetPhotoPathFull(objPhoto) & """ rel=""lightbox" & TabModuleId.ToString() & "-" & objPhoto.PhotoID.ToString() & """ tags=""" & tags & """ pid=""" & objPhoto.PhotoID.ToString() & """><img src=""" & GetPhotoPath(objPhoto) & """ class=""photo_198"" width=""" & GetPhotoWidth(objPhoto) & """ height=""" & GetPhotoHeight(objPhoto) & """></a></td><td class=""mid--x""></td></tr>" _
& "<tr><td class=""botx--""></td><td class=""bot-x-""></td><td class=""bot--x""></td></tr>" _
& "</table>"
Else
objLiteral.Text = "<table class=""photo-frame"">" _
& "<tr><td class=""topx--""></td><td class=""top-x-""></td><td class=""top--x""></td></tr>" _
& "<tr><td class=""midx--""></td><td valign=""top""><a href=""" & Me.GetPhotoPathFull(objPhoto) & """ rel=""lightbox" & TabModuleId.ToString() & "-" & ModuleId.ToString() & """ tags=""" & tags & """ pid=""" & objPhoto.PhotoID.ToString() & """><img src=""" & GetPhotoPath(objPhoto) & """ class=""photo_198"" width=""" & GetPhotoWidth(objPhoto) & """ height=""" & GetPhotoHeight(objPhoto) & """></a></td><td class=""mid--x""></td></tr>" _
& "<tr><td class=""botx--""></td><td class=""bot-x-""></td><td class=""bot--x""></td></tr>" _
& "</table>"
End If
Else
objLiteral.Text = "<table class=""photo-frame"">" _
& "<tr><td class=""topx--""></td><td class=""top-x-""></td><td class=""top--x""></td></tr>" _
& "<tr><td class=""midx--""></td><td valign=""top""><a href=""" & Me.GetAlbumUrl(objPhoto.AlbumID.ToString()) & """><img src=""" & GetPhotoPath(objPhoto) & """ class=""photo_198"" width=""" & GetPhotoWidth(objPhoto) & """ height=""" & GetPhotoHeight(objPhoto) & """></a></td><td class=""mid--x""></td></tr>" _
& "<tr><td class=""botx--""></td><td class=""bot-x-""></td><td class=""bot--x""></td></tr>" _
& "</table>"
End If
Case Else
If (GallerySettings.RandomLaunchSlideshow) Then
objLiteral.Text = "<table class=""photo-frame"">" _
& "<tr><td class=""topx--""></td><td class=""top-x-""></td><td class=""top--x""></td></tr>" _
& "<tr><td class=""midx--""></td><td valign=""top""><a href=""" & Me.GetPhotoUrl(objPhoto.PhotoID.ToString()) & """><img src=""" & GetPhotoPath(objPhoto) & """ class=""photo_198"" width=""" & GetPhotoWidth(objPhoto) & """ height=""" & GetPhotoHeight(objPhoto) & """></a></td><td class=""mid--x""></td></tr>" _
& "<tr><td class=""botx--""></td><td class=""bot-x-""></td><td class=""bot--x""></td></tr>" _
& "</table>"
Else
objLiteral.Text = "<table class=""photo-frame"">" _
& "<tr><td class=""topx--""></td><td class=""top-x-""></td><td class=""top--x""></td></tr>" _
& "<tr><td class=""midx--""></td><td valign=""top""><a href=""" & Me.GetAlbumUrl(objPhoto.AlbumID.ToString()) & """><img src=""" & GetPhotoPath(objPhoto) & """ class=""photo_198"" width=""" & GetPhotoWidth(objPhoto) & """ height=""" & GetPhotoHeight(objPhoto) & """></a></td><td class=""mid--x""></td></tr>" _
& "<tr><td class=""botx--""></td><td class=""bot-x-""></td><td class=""bot--x""></td></tr>" _
& "</table>"
End If
End Select
phPhoto.Controls.Add(objLiteral)
Case "PHOTOWITHBORDERNOLINK"
Dim objLiteral As New Literal
objLiteral.ID = Globals.CreateValidID("Gallery" & objPhoto.PhotoID.ToString() & "-" & iPtr.ToString())
objLiteral.Text = "<table class=""photo-frame"">" _
& "<tr><td class=""topx--""></td><td class=""top-x-""></td><td class=""top--x""></td></tr>" _
& "<tr><td class=""midx--""></td><td valign=""top""><img src=""" & GetPhotoPath(objPhoto) & """ class=""photo_198"" width=""" & GetPhotoWidth(objPhoto) & """ height=""" & GetPhotoHeight(objPhoto) & """ alt=""" & GetAlternateText(objPhoto) & """></td><td class=""mid--x""></td></tr>" _
& "<tr><td class=""botx--""></td><td class=""bot-x-""></td><td class=""bot--x""></td></tr>" _
& "</table>"
phPhoto.Controls.Add(objLiteral)
Case "PHOTOWITHOUTBORDER"
Dim objLiteral As New Literal
objLiteral.ID = Globals.CreateValidID("Gallery" & objPhoto.PhotoID.ToString() & "-" & iPtr.ToString())
Select Case LinkedGallerySettings(_moduleID).Slideshow
Case SlideshowType.Lightbox
Dim tags As String = ""
If (objPhoto.Tags <> "") Then
Dim objModuleController As New ModuleController
Dim objTabModules As Dictionary(Of Integer, ModuleInfo) = objModuleController.GetTabModules(_pageID)
Dim tabModuleID As Integer = Null.NullInteger
If (objTabModules.ContainsKey(_moduleID)) Then
tabModuleID = objTabModules(_moduleID).TabModuleID
End If
For Each tag As String In objPhoto.Tags.Split(","c)
If (tags.Length = 0) Then
tags = "(" & Localization.GetString("Tags", Me.LocalResourceFile) & ": <a href='" & NavigateURL(_pageID, "", "tag=" & tag, "Tags=" & tabModuleID) & "'>" & tag & "</a>"
Else
tags = tags & ", <a href='" & NavigateURL(_pageID, "", "tag=" & tag, "Tags=" & tabModuleID) & "'>" & tag & "</a>"
End If
Next
If (tags.Length > 0) Then
tags = tags & ")"
End If
End If
If (GallerySettings.RandomLaunchSlideshow) Then
If (GallerySettings.RandomAlbumSlideshow) Then
objLiteral.Text = "<a href=""" & Me.GetPhotoPathFull(objPhoto) & """ rel=""lightbox" & TabModuleId.ToString() & "-" & objPhoto.PhotoID.ToString() & """ title=""" & GetAlternateText(objPhoto) & """ tags=""" & tags & """ description=""" & GetDescription(objPhoto) & """ pid=""" & objPhoto.PhotoID.ToString() & """><img src=""" & GetPhotoPath(objPhoto) & """ class=""photo_198"" width=""" & GetPhotoWidth(objPhoto) & """ height=""" & GetPhotoHeight(objPhoto) & """ alt=""" & GetAlternateText(objPhoto) & """></a>"
Else
objLiteral.Text = "<a href=""" & Me.GetPhotoPathFull(objPhoto) & """ rel=""lightbox" & TabModuleId.ToString() & "-" & ModuleId.ToString() & """ title=""" & GetAlternateText(objPhoto) & """ tags=""" & tags & """ description=""" & GetDescription(objPhoto) & """ pid=""" & objPhoto.PhotoID.ToString() & """><img src=""" & GetPhotoPath(objPhoto) & """ class=""photo_198"" width=""" & GetPhotoWidth(objPhoto) & """ height=""" & GetPhotoHeight(objPhoto) & """ alt=""" & GetAlternateText(objPhoto) & """></a>"
End If
Else
objLiteral.Text = "<a href=""" & Me.GetAlbumUrl(objPhoto.AlbumID.ToString()) & """><img src=""" & GetPhotoPath(objPhoto) & """ class=""photo_198"" width=""" & GetPhotoWidth(objPhoto) & """ height=""" & GetPhotoHeight(objPhoto) & """ alt=""" & GetAlternateText(objPhoto) & """></a>"
End If
Case Else
If (GallerySettings.RandomLaunchSlideshow) Then
objLiteral.Text = "<a href=""" & Me.GetPhotoUrl(objPhoto.PhotoID.ToString()) & """><img src=""" & GetPhotoPath(objPhoto) & """ class=""photo_198"" width=""" & GetPhotoWidth(objPhoto) & """ height=""" & GetPhotoHeight(objPhoto) & """ alt=""" & GetAlternateText(objPhoto) & """></a>"