view perl/make_gallery_js.pl @ 13:f16185fe9ed9 judyates

[svn r14]
author rlm
date Mon, 12 Apr 2010 03:30:00 -0400
parents 2f433df9b961
children b6ba604307fc
line wrap: on
line source
1 #!/usr/bin/perl
4 use File::Find;
5 use Set::Object;
6 use List::Util 'shuffle';
8 use Image::Size;
10 $header = <<HERE;
11 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
12 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
13 <head>
14 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
16 <title>Judy Yates - Prints</title>
19 <!--(E)2 Gallery Pro <head> Files-->
20 <!--(E)2 Gallery Config FIle-->
21 <!--End (E)2 Gallery Config FIle-->
22 <!--(E)2 Gallery Style Sheet Link-->
24 <link href="firetest.css" rel="stylesheet" type="text/css" />
26 <link href="e2gallerypro/design/e2gallerypro/design.css" rel="stylesheet" type="text/css" />
28 <script type="text/javascript">
29 //modify this path if needed ^ Correlates with Style Sheet Path above
30 var designPath="e2gallerypro/design/e2gallerypro/";
31 </script>
32 <!--End (E)2 Gallery Style Sheet Link-->
34 <!--Mootools-->
35 <script type="text/javascript" src="e2gallerypro/js/mootools-1.2-core.js"></script>
36 <script type="text/javascript" src="e2gallerypro/js/mootools-1.2-more.js"></script>
37 <!--End Mootools-->
38 <!--(E)2 Gallery Javascript-->
40 <script type="text/javascript" src="e2gallerypro/js/setupvars.js"></script>
41 <script type="text/javascript">
42 var imagesloaded = new Array();
43 var maingalleries = new Array();
44 <!--(E)2 Gallery Parse XML output Javascript-->
45 HERE
46 ;
49 $footer = <<HERE
50 <!--End (E)2 Gallery Parse XML output Javascript-->
51 </script> <script type="text/javascript" src="e2gallerypro/js/e2gallerypro.js"></script>
53 <!--End (E)2 Gallery Javascript-->
54 <!--End (E)2 Gallery Pro </head> Files-->
55 </head>
56 <body>
60 <Title>
61 Judy Yates -- Wildlife and Pets on Stone
62 </title>
64 <span>
65 <img src = "./album_pics/3_logo.jpg">
66 </span>
69 <div class = "menu">
70 <ul class = "menu">
71 <li class = "menu"><a class = "menu" href = "index.html">Home</a></li>
72 <li class = "menu"><a class = "menu" href = "gallery1.html">Gallery</a></li>
73 <li class = "menu"><a class = "menu" href = "recent_sales.html">Prints</a></li>
74 <li class = "menu"><a class = "menu" href = "feedback.html">Feedback</a></li>
75 <li class = "menu"><a class = "menu" href = "hto.html">Orders</a></li>
76 <li class = "menu"><a class = "menu" href = "pricing.html">Pricing</a></li>
77 <li class = "menu"><a class = "menu" href = "Meet the Artist2.html"> Meet the Artist</a></li>
78 <li class = "menu"><a class = "menu" href = "Contact.html"> Contact</a></li>
79 <li class = "menu"><a class = "menu" href = "pets1.html">Pets</a></li>
81 </ul>
82 </div>
84 <div class = "orangebox">
89 <!--(E)2 Gallery Pro HTML-->
90 <div id="gallerywrapper">
91 <div id="gallery">
92 <!--Loading Bar-->
93 <div id="loading">
94 <div id="loadingbar"><img src="e2gallerypro/design/e2gallerypro/loading_hill.gif" width="50" height="50" alt="" id="bar" /></div>
95 </div>
96 <!--End Loading Bar-->
97 <!--Previous Button Div-->
98 <div id="previous"></div>
100 <!--End Previous Button Div-->
101 <!--Next Button Div-->
102 <div id="next"></div>
103 <!--End Next Button Div-->
104 <!--Main Image Holder Div-->
105 <div id="images">
106 <div id="imagewrap">
107 <div id="imgloader"></div>
108 </div>
110 <div id="imageinfo">
111 <div id="infoloader"></div>
112 </div>
113 <div id="smallmessage"></div>
114 </div>
115 <!--End Main Image Holder Div-->
116 <!--Thumb Box Div-->
117 <div id="thumbbox">
118 <div id="thumbleft"></div>
120 <div id="thumbright"></div>
121 <div id="thumbnails">
122 <div id="thumbnailwrap"></div>
123 </div>
124 </div>
125 <!--End Thumb Box Div-->
126 <!--For Sale Box Div-->
127 <div id="fsbox"></div>
128 <!--End For Sale Box Div-->
130 <!--Galleries Holder Div-->
131 <div id="galleries">
132 <div id="controls">
133 <div class="right"><img src="./e2gallerypro/design/e2gallerypro/gallery_view.png" class="controls" rel=" " id="opengallery" title="View Galleries" border="0" /> <img src="e2gallerypro/design/e2gallerypro/infobox.png" id="showinfo" rel=" " class="controls" title="View Info" border="0" /> <img src="e2gallerypro/design/e2gallerypro/thumbbox.png" id="showthumbbox" title="Toggle Thumbs" class="controls" rel=" " border="0" /></div>
134 <span id="slideshow"><img src="e2gallerypro/design/e2gallerypro/play.png" title="Play Slideshow" border="0" align="absmiddle" class="controls" rel=" " /></span> | <span id="photoNum"></span><span id="flashNum"></span><span id="qtNum"></span></div>
135 <div id="galleryset"> </div>
137 </div>
138 <!--End Galleries Holder Div-->
139 <!--Thumbnail Pop Up Holder-->
140 <div id="thumbnailPopUp"></div>
141 <!--End Thumbnail Pop Up Holder-->
142 </div>
143 </div>
149 </div>
151 <div class = "menu">
152 <ul class = "menu">
153 <li class = "menu"><a class = "menu" href = "index.html">Home</a></li>
154 <li class = "menu"><a class = "menu" href = "gallery1.html">Gallery</a></li>
155 <li class = "menu"><a class = "menu" href = "recent_sales.html">Prints</a></li>
156 <li class = "menu"><a class = "menu" href = "feedback.html">Feedback</a></li>
157 <li class = "menu"><a class = "menu" href = "hto.html">Orders</a></li>
158 <li class = "menu"><a class = "menu" href = "pricing.html">Pricing</a></li>
159 <li class = "menu"><a class = "menu" href = "Meet the Artist2.html"> Meet the Artist</a></li>
160 <li class = "menu"><a class = "menu" href = "Contact.html"> Contact</a></li>
161 <li class = "menu"><a class = "menu" href = "pets1.html">Pets</a></li>
163 </ul>
164 </div>
167 <div class = "copyright"><br><br>Copyright &copy 2007 Robert McIntyre. All pictures Copyright &copy Judy Yates.<br>Special thanks to Dylan Holmes for designing the main banner.</div>
172 </body>
175 </html>
176 HERE
177 ;
181 $pics = Set::Object->new();
183 open PHOTOS, '>/home/r/Desktop/web/judyates/photos.html';
184 select PHOTOS;
187 @include =
188 (
189 '/home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/photos/large'
190 );
193 find(\&accept_type,@include); #grab all the jpeg files
195 @pics = $pics->elements();
197 #@pics = shuffle(@pics);
200 foreach $id(0..$#pics)
202 {
204 $pics[$id] =~ m/(.*\/)([^\/]*)$/;
205 $lrgpath = $1;
206 $src = $2;
207 $lrgpath =~ m/^(.*\/)[^\/]*\/$/;
208 $path = $1;
209 $thumbPath = $path."thumbs/";
210 $filetype = "image";
212 ($width, $height) = imgsize($path.$src);
214 ($lrgwidth, $lrgheight) = imgsize($lrgpath.$src);
217 $title = $src;
218 $author = 'Judy Yates';
219 $copyright = 'Copyright Judy Yates Artist 2010';
220 $description = $src;
221 $forsale = "true";
222 $paytype ='paypal';
223 $ButtonID = "RAYAWZUUTJ79E";
226 $numOfPrices = 3;
228 $price1 = '25';
229 $pricecurrency1 = 'USD';
230 $pricecurrencysymbol1 = '$';
231 $pricesize1 = '8&quot;x10&quot; Photo Print';
233 $price2 = '35';
234 $pricecurrency2 = 'USD';
235 $pricecurrencysymbol2 = '$';
236 $pricesize2 = '11&quot;x14&quot; Matted Print';
238 $price3 = '40';
239 $pricecurrency3 = 'USD';
240 $pricecurrencysymbol3 = '$';
241 $pricesize3 = '11&quot;x14&quot; Signed Matt';
247 $imgid = $id;
250 $megaString[$id]= "
252 {
253 'filetype' : '$filetype',
254 'ButtonID' : '$ButtonID',
255 'path' : '$path',
256 'src' : '$src',
257 'width' : '$width',
258 'height' : '$height',
259 'lrgwidth' : '$lrgwidth',
260 'lrgheight' : '$lrgheight',
261 'lrgpath' : '$lrgpath',
262 'title' : '$title',
263 'author' : '$author',
264 'copyright' : '$copyright',
265 'description' : '$description',
266 'forsale' : $forsale,
267 'paytype' : '$paytype',
268 'price1' : '$price1',
269 'pricecurrency1' : '$pricecurrency1',
270 'pricecurrencysymbol1' : '$pricecurrencysymbol1',
271 'pricesize1' : '$pricesize1',
273 'price2' : '$price2',
274 'pricecurrency2' : '$pricecurrency2',
275 'pricecurrencysymbol2' : '$pricecurrencysymbol2',
276 'pricesize2' : '$pricesize2',
278 'price3' : '$price3',
279 'pricecurrency3' : '$pricecurrency3',
280 'pricecurrencysymbol3' : '$pricecurrencysymbol3',
281 'pricesize3' : '$pricesize3',
284 'numOfPrices' : '$numOfPrices',
285 'imgid' : $imgid,
286 },
288 ";
290 #print "@megaString";
293 #`$command2`;
295 }
300 $maingalleries = "
301 maingalleries =
302 [
303 {'name':'Judy Yates Photos',
304 'imgpath': '$path',
305 'lrgpath': '$lrgpath',
306 'thumbpath': '$thumbPath',
307 'mainthumb': '$path',
308 'src':'mainthumb.jpg',
309 'description':'Awesome Photos From Judy Yates.',
310 'start':0, 'end':$imgid,
311 'gallerynum':1}
312 ];
315 var galleryimages = new Array();
317 ";
320 print $header;
323 $maingalleries =~ s#/home/r/Desktop/web/judyates/#./#g;
326 print $maingalleries."\n";
328 print "galleryimages = [\n";
330 for (@megaString) {
331 s#/home/r/Desktop/web/judyates/#./#g;
332 print;}
334 print "\n];\n";
336 print $footer;
344 sub accept_type
345 {
347 /.svn$/ and $File::Find::prune = 1;
349 /.jpg$/i and $pics->insert($File::Find::name);
354 }