Created
July 26, 2012 19:42
-
-
Save pfactum/3184079 to your computer and use it in GitHub Desktop.
MiniGal Nano improvements, v3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -Naur MiniGal Nano 0.3.5/config.php newmg/config.php | |
--- MiniGal Nano 0.3.5/config.php 2010-12-06 11:43:00.000000000 +0200 | |
+++ newmg/config.php 2012-07-22 18:34:10.000000000 +0300 | |
@@ -16,28 +16,28 @@ | |
*/ | |
// EDIT SETTINGS BELOW TO CUSTOMIZE YOUR GALLERY | |
-$thumbs_pr_page = "28"; //Number of thumbnails on a single page | |
-$gallery_width = "900px"; //Gallery width. Eg: "500px" or "70%" | |
+$thumbs_pr_page = "21"; //Number of thumbnails on a single page | |
+$gallery_width = "90%"; //Gallery width. Eg: "500px" or "70%" | |
$backgroundcolor = "white"; //This provides a quick way to change your gallerys background to suit your website. Use either main colors like "black", "white", "yellow" etc. Or HEX colors, eg. "#AAAAAA" | |
$templatefile = "mano"; //Template filename (must be placed in 'templates' folder) | |
$folder_color = "black"; // Color of folder icons: blue / black / vista / purple / green / grey | |
-$sorting_folders = "name"; // Sort folders by: [name][date] | |
+$sorting_folders = "date"; // Sort folders by: [name][date] | |
$sorting_files = "name"; // Sort files by: [name][date][size] | |
-$sortdir_folders = "ASC"; // Sort direction of folders: [ASC][DESC] | |
+$sortdir_folders = "DESC"; // Sort direction of folders: [ASC][DESC] | |
$sortdir_files = "ASC"; // Sort direction of files: [ASC][DESC] | |
//LANGUAGE STRINGS | |
-$label_home = "Home"; //Name of home link in breadcrumb navigation | |
-$label_new = "New"; //Text to display for new images. Use with $display_new variable | |
-$label_page = "Page"; //Text used for page navigation | |
-$label_all = "All"; //Text used for link to display all images in one page | |
-$label_noimages = "No images"; //Empty folder text | |
-$label_loading = "Loading..."; //Thumbnail loading text | |
+$label_home = "Домашня"; //Name of home link in breadcrumb navigation | |
+$label_new = "Нове"; //Text to display for new images. Use with $display_new variable | |
+$label_page = "Сторінка"; //Text used for page navigation | |
+$label_all = "Усі"; //Text used for link to display all images in one page | |
+$label_noimages = "Немає зображень"; //Empty folder text | |
+$label_loading = "Триває завантаження…"; //Thumbnail loading text | |
//ADVANCED SETTINGS | |
$thumb_size = 120; //Thumbnail height/width (square thumbs). Changing this will most likely require manual altering of the template file to make it look properly! | |
-$label_max_length = 30; //Maximum chars of a folder name that will be displayed on the folder thumbnail | |
+$label_max_length = 256; //Maximum chars of a folder name that will be displayed on the folder thumbnail | |
$display_exif = 1; | |
-?> | |
\ Наприкінці файлу немає нового рядка | |
+?> | |
diff -Naur MiniGal Nano 0.3.5/css/mediaboxAdvBlack21.css newmg/css/mediaboxAdvBlack21.css | |
--- MiniGal Nano 0.3.5/css/mediaboxAdvBlack21.css 2010-11-29 11:38:00.000000000 +0200 | |
+++ newmg/css/mediaboxAdvBlack21.css 2012-07-26 21:18:33.000000000 +0300 | |
@@ -88,7 +88,7 @@ | |
padding: 0 10px 10px; | |
} | |
-#mbTitle, #mbPrevLink, #mbNextLink, #mbCloseLink { | |
+#mbTitle, #mbImageLink, #mbPrevLink, #mbNextLink, #mbCloseLink { | |
display: inline; | |
color: #fff; | |
font-weight: bold; | |
@@ -111,20 +111,20 @@ | |
font-size: 10px; | |
} | |
-#mbPrevLink, #mbNextLink, #mbCloseLink { | |
+#mbImageLink, #mbPrevLink, #mbNextLink, #mbCloseLink { | |
float: right; | |
outline: none; | |
margin: 0 0 0 10px; | |
font-weight: normal; | |
} | |
-#mbPrevLink b, #mbNextLink b, #mbCloseLink b { | |
+#mbImageLink b, #mbPrevLink b, #mbNextLink b, #mbCloseLink b { | |
color: #eee; | |
font-weight: bold; | |
text-decoration: underline; | |
} | |
-#mbPrevLink big, #mbNextLink big, #mbCloseLink big { | |
+#mbImageLink big, #mbPrevLink big, #mbNextLink big, #mbCloseLink big { | |
color: #eee; | |
font-size: 16px; | |
line-height: 14px; | |
@@ -164,4 +164,4 @@ | |
color: #d00; | |
font-weight: bold; | |
text-decoration: underline; | |
-} | |
\ Наприкінці файлу немає нового рядка | |
+} | |
diff -Naur MiniGal Nano 0.3.5/css/mediaboxAdvWhite.css newmg/css/mediaboxAdvWhite.css | |
--- MiniGal Nano 0.3.5/css/mediaboxAdvWhite.css 2010-11-29 01:24:00.000000000 +0200 | |
+++ newmg/css/mediaboxAdvWhite.css 2012-07-26 21:18:17.000000000 +0300 | |
@@ -88,7 +88,7 @@ | |
padding: 0 10px 10px; | |
} | |
-#mbTitle, #mbPrevLink, #mbNextLink, #mbCloseLink { | |
+#mbTitle, #mbImageLink, #mbPrevLink, #mbNextLink, #mbCloseLink { | |
display: inline; | |
color: #000; | |
font-weight: bold; | |
@@ -111,20 +111,20 @@ | |
font-size: 10px; | |
} | |
-#mbPrevLink, #mbNextLink, #mbCloseLink { | |
+#mbImageLink, #mbPrevLink, #mbNextLink, #mbCloseLink { | |
float: right; | |
outline: none; | |
margin: 0 0 0 10px; | |
font-weight: normal; | |
} | |
-#mbPrevLink b, #mbNextLink b, #mbCloseLink b { | |
+#mbImageLink b, #mbPrevLink b, #mbNextLink b, #mbCloseLink b { | |
color: #333; | |
font-weight: bold; | |
text-decoration: underline; | |
} | |
-#mbPrevLink big, #mbNextLink big, #mbCloseLink big { | |
+#mbImageLink big, #mbPrevLink big, #mbNextLink big, #mbCloseLink big { | |
color: #333; | |
font-size: 16px; | |
line-height: 14px; | |
@@ -164,4 +164,4 @@ | |
color: #d00; | |
font-weight: bold; | |
text-decoration: underline; | |
-} | |
\ Наприкінці файлу немає нового рядка | |
+} | |
diff -Naur MiniGal Nano 0.3.5/index.php newmg/index.php | |
--- MiniGal Nano 0.3.5/index.php 2010-12-06 11:22:00.000000000 +0200 | |
+++ newmg/index.php 2012-07-26 22:30:32.000000000 +0300 | |
@@ -46,6 +46,9 @@ | |
$images = ""; | |
$exif_data = ""; | |
$messages = ""; | |
+$album_geolocation = ""; | |
+$album_description = ""; | |
+$album_identifier = ""; | |
//----------------------- | |
// PHP ENVIRONMENT CHECK | |
@@ -200,6 +203,24 @@ | |
fclose($file_handle); | |
} | |
+// 2.5. LOAD ALBUM DESCRIPTION | |
+if (file_exists($currentdir ."/description.txt")) | |
+{ | |
+ $album_description = file_get_contents($currentdir ."/description.txt"); | |
+} | |
+ | |
+// 2.6. LOAD ALBUM GEOLOCATION | |
+if (file_exists($currentdir ."/geolocation.txt")) | |
+{ | |
+ $album_geolocation = file_get_contents($currentdir ."/geolocation.txt"); | |
+} | |
+ | |
+// 2.7. LOAD ALBUM IDENTIFIER | |
+if (file_exists($currentdir ."/identifier.txt")) | |
+{ | |
+ $album_identifier = trim(file_get_contents($currentdir ."/identifier.txt")); | |
+} | |
+ | |
// 3. LOAD FILES | |
if ($file != "." && $file != ".." && $file != "folder.jpg") | |
{ | |
@@ -393,6 +414,9 @@ | |
$template = preg_replace("/<% bgcolor %>/", "$backgroundcolor", $template); | |
$template = preg_replace("/<% gallery_width %>/", "$gallery_width", $template); | |
$template = preg_replace("/<% version %>/", "$version", $template); | |
+ $template = preg_replace("/<% geolocation %>/", $album_geolocation, $template); | |
+ $template = preg_replace("/<% description %>/", $album_description, $template); | |
+ $template = preg_replace("/<% album_identifier %>/", $album_identifier, $template); | |
echo "$template"; | |
} | |
diff -Naur MiniGal Nano 0.3.5/js/mediaboxAdv-1.3.4b.js newmg/js/mediaboxAdv-1.3.4b.js | |
--- MiniGal Nano 0.3.5/js/mediaboxAdv-1.3.4b.js 2010-11-04 21:51:00.000000000 +0200 | |
+++ newmg/js/mediaboxAdv-1.3.4b.js 2012-07-26 21:24:46.000000000 +0300 | |
@@ -13,7 +13,7 @@ | |
// Global variables, accessible to Mediabox only | |
var options, images, activeImage, prevImage, nextImage, top, mTop, left, mLeft, winWidth, winHeight, fx, preload, preloadPrev = new Image(), preloadNext = new Image(), foxfix = false, iefix = false, | |
// DOM elements | |
- overlay, center, image, bottom, captionSplit, title, caption, prevLink, number, nextLink, | |
+ overlay, center, image, bottom, captionSplit, title, caption, prevLink, number, nextLink, imgLink, | |
// Mediabox specific vars | |
URL, WH, WHL, elrel, mediaWidth, mediaHeight, mediaType = "none", mediaSplit, mediaId = "mediaBox", mediaFmt, margin; | |
@@ -33,6 +33,7 @@ | |
closeLink = new Element("a", {id: "mbCloseLink", href: "#"}).addEvent("click", close), | |
nextLink = new Element("a", {id: "mbNextLink", href: "#"}).addEvent("click", next), | |
prevLink = new Element("a", {id: "mbPrevLink", href: "#"}).addEvent("click", previous), | |
+ imgLink = new Element("a", {id: "mbImageLink", href: "#"}).addEvent("click", openImg), | |
title = new Element("div", {id: "mbTitle"}), | |
number = new Element("div", {id: "mbNumber"}), | |
caption = new Element("div", {id: "mbCaption"}) | |
@@ -54,7 +55,7 @@ | |
open: function(_images, startImage, _options) { | |
options = $extend({ | |
- text: ['<big>«</big>','<big>»</big>','<big>×</big>'], // Set "previous", "next", and "close" button content (HTML code should be written as entity codes or properly escaped) | |
+ text: ['<big>*</big>','<big>«</big>','<big>»</big>','<big>×</big>'], // Set "previous", "next", and "close" button content (HTML code should be written as entity codes or properly escaped) | |
// text: ['<big>«</big>','<big>»</big>','<big>×</big>'], // Set "previous", "next", and "close" button content (HTML code should be written as entity codes or properly escaped) | |
// example text: ['<b>P</b>rev','<b>N</b>ext','<b>C</b>lose'], | |
loop: true, // Allows to navigate between first and last images | |
@@ -136,9 +137,10 @@ | |
vmColor: 'ffffff' // Custom controller colors, hex value minus the # sign, defult is 5ca0b5 | |
}, _options || {}); | |
- prevLink.set('html', options.text[0]); | |
- nextLink.set('html', options.text[1]); | |
- closeLink.set('html', options.text[2]); | |
+ imgLink.set('html', options.text[0]); | |
+ prevLink.set('html', options.text[1]); | |
+ nextLink.set('html', options.text[2]); | |
+ closeLink.set('html', options.text[3]); | |
margin = center.getStyle('padding-left').toInt()+image.getStyle('margin-left').toInt()+image.getStyle('padding-left').toInt(); | |
@@ -290,6 +292,10 @@ | |
if (options.stopKey) { return false; }; | |
} | |
+ function openImg() { | |
+ window.open(URL); | |
+ } | |
+ | |
function previous() { | |
return changeImage(prevImage); | |
} | |
@@ -915,6 +921,7 @@ | |
function captionAnimate() { | |
center.className = ""; | |
+ imgLink.style.display = ""; | |
if (prevImage >= 0) prevLink.style.display = ""; | |
if (nextImage >= 0) nextLink.style.display = ""; | |
fx.bottom.start(1); | |
@@ -925,7 +932,7 @@ | |
fx.resize.cancel(); | |
fx.image.cancel().set(0); | |
fx.bottom.cancel().set(0); | |
- $$(prevLink, nextLink).setStyle("display", "none"); | |
+ $$(imgLink, prevLink, nextLink).setStyle("display", "none"); | |
} | |
function close() { | |
@@ -953,4 +960,4 @@ | |
return (this == el) || ((this.rel.length > 8) && el.rel.match(relsize[1])); | |
}); | |
}; | |
-window.addEvent("domready", Mediabox.scanPage); | |
\ Наприкінці файлу немає нового рядка | |
+window.addEvent("domready", Mediabox.scanPage); | |
diff -Naur MiniGal Nano 0.3.5/templates/mano.html newmg/templates/mano.html | |
--- MiniGal Nano 0.3.5/templates/mano.html 2010-12-06 00:36:00.000000000 +0200 | |
+++ newmg/templates/mano.html 2012-07-26 22:00:57.000000000 +0300 | |
@@ -68,6 +68,12 @@ | |
overflow: auto; | |
width: 100% | |
} | |
+#metadata { | |
+ border-left: 1px solid; | |
+ margin-top: 10px; | |
+ margin-bottom: 5px; | |
+ padding-left: 5px; | |
+} | |
.hidden { | |
visibility: hidden; | |
position:absolute; | |
@@ -108,7 +114,7 @@ | |
float: left; | |
position: relative; | |
width: 130px; | |
- height: 160px; | |
+ height: 200px; | |
overflow:hidden; | |
} | |
.gallery li:hover img { | |
@@ -152,6 +158,11 @@ | |
<p class="credits"><em>by: </em><% author %></p> | |
<span id="breadcrumb_nav"><% breadcrumb_navigation %></span> | |
<div id="container"> | |
+ <div id="metadata"> | |
+ Місце зйомки: <b><% geolocation %></b> | |
+ <br /><br /> | |
+ <% description %> | |
+ </div> | |
<ul class="gallery"> | |
<% thumbnails %> | |
</ul> | |
@@ -159,9 +170,37 @@ | |
<br /> | |
<div id="page_nav"><% page_navigation %></div> | |
<br /> | |
+<!-- DISQUS --> | |
+<div id="disqus_thread"></div> | |
+<script type="text/javascript"> | |
+ /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */ | |
+ var disqus_shortname = 'xxxxxxxxxxxxxxxxxxx'; // required: replace example with your forum shortname | |
+ var disqus_identifier = '<% album_identifier %>'; | |
+ | |
+ /* * * DON'T EDIT BELOW THIS LINE * * */ | |
+ (function() { | |
+ var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; | |
+ dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js'; | |
+ (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); | |
+ })(); | |
+</script> | |
+<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> | |
+<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a> | |
+<!-- END DISQUS --> | |
+<br /> | |
<!-- CREDITS - DO NOT REMOVE OR YOU WILL VOID MiniGal Nano TERMS OF USE --> | |
<hr id="bottom" /> | |
<div class="backlink" align="center"><a href="http://www.minigal.dk" title="Powered by MiniGal Nano" target="_blank">Powered by MiniGal Nano <% version %></a></div> | |
<br /><br /> | |
+<script type="text/javascript"> | |
+ var _gaq = _gaq || []; | |
+ _gaq.push(['_setAccount', 'XX-XXXXXXX-X']); | |
+ _gaq.push(['_trackPageview']); | |
+ (function() { | |
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; | |
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; | |
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); | |
+ })(); | |
+</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment