upstream patch by ian

This commit is contained in:
Garvin Hicking 2016-09-23 11:47:27 +02:00
parent 55875ff290
commit 50c0c00e59
12 changed files with 428 additions and 401 deletions

View file

@ -1,3 +1,18 @@
2.68:
----
* Optimize URI args load
2.67:
-----
* Add an option description for lightbox type
2.66:
-----
* Requirement and consistent changes
* Use load language API
* Added suboption types, to get where options have hidden suboptions
2.65:
-----
* Use native API method parseTemplate() for the tpl files

View file

@ -1,12 +1,12 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
@ -56,7 +56,7 @@ patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it

View file

@ -94,6 +94,7 @@
@define('PLUGIN_EVENT_USERGALLERY_SHOWLIGHTBOX_NAME', 'Nutze Lightbox Ausgabe');
@define('PLUGIN_EVENT_USERGALLERY_SHOWLIGHTBOX_DESC', 'Benötigt ein installiertes Lightbox-Plugin und obige Option: "Einzelbildanzeige" gesetzt als "In Seite einpassen"! Wenn das Lightbox Plugin nur für Usergalerieseiten benutzt werden soll, installiere und verschiebe es anschließend in der Pluginliste in das Inaktiv (hidden) event Feld!');
@define('PLUGIN_EVENT_USERGALLERY_LIGHTBOXTYPE_NAME', 'Wähle Lightbox-Plugin-Typ');
@define('PLUGIN_EVENT_USERGALLERY_LIGHTBOXTYPE_DESC', 'Wählen Sie den selben Typ wie im lightbox Plugin. Man kann kein anderes lightbox-widget hier anwählen.');
@define('PLUGIN_EVENT_USERGALLERY_SHOWOBJECTS_NAME', 'Zeige alle Nicht-Bild Dateien');
@define('PLUGIN_EVENT_USERGALLERY_SHOWOBJECTS_DESC', 'Erweitere das Galerie Array mit allen Nicht-Bild Dateien aus der Mediendatendank, zB. *.pdf Dateien.');

View file

@ -1,4 +1,4 @@
<?php #
<?php
/**
* @version
@ -6,25 +6,24 @@
* First public version: lang_tr.inc.php
*/
@define('PLUGIN_EVENT_USERGALLERY_TITLE', 'Galeri Gösterimi');
@define('PLUGIN_EVENT_USERGALLERY_DESC', 'Anonim kullanıcı-ziyaretçilerin Serendipity Medya Galerisini görmelerine izin verir');
@define('PLUGIN_EVENT_USERGALLERY_NUMCOLS_TWO', '2');
@define('PLUGIN_EVENT_USERGALLERY_NUMCOLS_THREE', '3');
@define('PLUGIN_EVENT_USERGALLERY_NUMCOLS_FOUR', '4');
@define('PLUGIN_EVENT_USERGALLERY_NUMCOLS_FIVE', '5');
@define('PLUGIN_EVENT_USERGALLERY_NUMCOLS_DESC', 'Galeride gösterilecek sütun sayısı');
@define('PLUGIN_EVENT_USERGALLERY_NUMCOLS_NAME', 'Sütunların sayısı');
@define('PLUGIN_EVENT_USERGALLERY_PERMALINK_NAME', 'Galeri görünümü için kalıcı bağlantı URL adresi');
@define('PLUGIN_EVENT_USERGALLERY_PERMALINK_DESC', 'Galeri erişiminde kullanılmak üzere benzesiz bir kalıcı bağlantı URL adresi yazın');
@define('PLUGIN_EVENT_USERGALLERY_SUBNAME_NAME', 'Galeri görünümü için altsayfa adı');
@define('PLUGIN_EVENT_USERGALLERY_SUBNAME_DESC', 'Galeri görünümü için kullanmak isteyeceğiniz benzersiz bir altsayfa adı yazın (galeri erişim adresi index.php?serendipity[subpage]=altsayfaismi şeklinde olacak.)');
@define('PLUGIN_EVENT_USERGALLERY_DIRECTORY_NAME', 'Öntanımlı Dizin Seçimi');
@define('PLUGIN_EVENT_USERGALLERY_DIRECTORY_DESC', 'Galeri fotolarının saklanması ve erişilmesinde kullanılacak Öntanımlı dizini belirtin. ');
@define('PLUGIN_EVENT_USERGALLERY_STYLE_NAME', 'Galeri Stili Seçin');
@define('PLUGIN_EVENT_USERGALLERY_STYLE_DESC', 'Kullanmak istediğiniz galeri stilini seçin. "Medya Kütüphanesi" dizinler arasında gezinmenize ve arama yapmanıza imkan verir, "Küçükresim Sayfası" dizindeki küçükresimlerin gösterilmesini sağlar ve tıklandığında resimler yeni bir pencerede açılır');
@define('PLUGIN_EVENT_USERGALLERY_STYLE_SERENDIPITY', 'Medya Kütüphanesi');
@define('PLUGIN_EVENT_USERGALLERY_STYLE_THUMBPAGE', 'Küçükresim Sayfası');
@define('PLUGIN_EVENT_USERGALLERY_PRETTY_NAME', 'Gösterim adı');
@define('PLUGIN_EVENT_USERGALLERY_PRETTY_DESC', 'Galeriyi tanımlamakta kullanacağınız başlığı seçin');
@define('PLUGIN_EVENT_USERGALLERY_TITLE', 'Galeri Gösterimi');
@define('PLUGIN_EVENT_USERGALLERY_DESC', 'Anonim kullanıcı-ziyaretçilerin Serendipity Medya Galerisini görmelerine izin verir');
@define('PLUGIN_EVENT_USERGALLERY_NUMCOLS_TWO', '2');
@define('PLUGIN_EVENT_USERGALLERY_NUMCOLS_THREE', '3');
@define('PLUGIN_EVENT_USERGALLERY_NUMCOLS_FOUR', '4');
@define('PLUGIN_EVENT_USERGALLERY_NUMCOLS_FIVE', '5');
@define('PLUGIN_EVENT_USERGALLERY_NUMCOLS_DESC', 'Galeride gösterilecek sütun sayısı');
@define('PLUGIN_EVENT_USERGALLERY_NUMCOLS_NAME', 'Sütunların sayısı');
@define('PLUGIN_EVENT_USERGALLERY_PERMALINK_NAME', 'Galeri görünümü için kalıcı bağlantı URL adresi');
@define('PLUGIN_EVENT_USERGALLERY_PERMALINK_DESC', 'Galeri erişiminde kullanılmak üzere benzesiz bir kalıcı bağlantı URL adresi yazın');
@define('PLUGIN_EVENT_USERGALLERY_SUBNAME_NAME', 'Galeri görünümü için altsayfa adı');
@define('PLUGIN_EVENT_USERGALLERY_SUBNAME_DESC', 'Galeri görünümü için kullanmak isteyeceğiniz benzersiz bir altsayfa adı yazın (galeri erişim adresi index.php?serendipity[subpage]=altsayfaismi şeklinde olacak.)');
@define('PLUGIN_EVENT_USERGALLERY_DIRECTORY_NAME', 'Öntanımlı Dizin Seçimi');
@define('PLUGIN_EVENT_USERGALLERY_DIRECTORY_DESC', 'Galeri fotolarının saklanması ve erişilmesinde kullanılacak Öntanımlı dizini belirtin. ');
@define('PLUGIN_EVENT_USERGALLERY_STYLE_NAME', 'Galeri Stili Seçin');
@define('PLUGIN_EVENT_USERGALLERY_STYLE_DESC', 'Kullanmak istediğiniz galeri stilini seçin. "Medya Kütüphanesi" dizinler arasında gezinmenize ve arama yapmanıza imkan verir, "Küçükresim Sayfası" dizindeki küçükresimlerin gösterilmesini sağlar ve tıklandığında resimler yeni bir pencerede açılır');
@define('PLUGIN_EVENT_USERGALLERY_STYLE_SERENDIPITY', 'Medya Kütüphanesi');
@define('PLUGIN_EVENT_USERGALLERY_STYLE_THUMBPAGE', 'Küçükresim Sayfası');
@define('PLUGIN_EVENT_USERGALLERY_PRETTY_NAME', 'Gösterim adı');
@define('PLUGIN_EVENT_USERGALLERY_PRETTY_DESC', 'Galeriyi tanımlamakta kullanacağınız başlığı seçin');
?>

View file

@ -95,4 +95,4 @@
@define('PLUGIN_EVENT_USERGALLERY_RSS_FEED_BODY', 'Použít originální formát příspěvku pro obrázek v RSS kanálu?');
@define('PLUGIN_EVENT_USERGALLERY_RSS_FEED_BODY_DESC', 'Pokud je povoleno, obrázek z knihovny médií, který byl použit v příspěvku na blogu, bude mít v RSS kanálu stejné tělo příspěvku jako příspěvek místo výchozího jednoduchého odkazu na příspěvek a původní umístění obrázku.');
?>

View file

@ -95,4 +95,4 @@
@define('PLUGIN_EVENT_USERGALLERY_RSS_FEED_BODY', 'Použít originální formát příspěvku pro obrázek v RSS kanálu?');
@define('PLUGIN_EVENT_USERGALLERY_RSS_FEED_BODY_DESC', 'Pokud je povoleno, obrázek z knihovny médií, který byl použit v příspěvku na blogu, bude mít v RSS kanálu stejné tělo příspěvku jako příspěvek místo výchozího jednoduchého odkazu na příspěvek a původní umístění obrázku.');
?>

View file

@ -93,6 +93,7 @@
@define('PLUGIN_EVENT_USERGALLERY_SHOWLIGHTBOX_NAME', 'Nutze Lightbox Ausgabe');
@define('PLUGIN_EVENT_USERGALLERY_SHOWLIGHTBOX_DESC', 'Benötigt ein installiertes Lightbox-Plugin und obige Option: "Einzelbildanzeige" gesetzt als "In Seite einpassen"! Wenn das Lightbox Plugin nur für Usergalerieseiten benutzt werden soll, installiere und verschiebe es anschließend in der Pluginliste in das Inaktiv (hidden) event Feld!');
@define('PLUGIN_EVENT_USERGALLERY_LIGHTBOXTYPE_NAME', 'Wähle Lightbox-Plugin-Typ');
@define('PLUGIN_EVENT_USERGALLERY_LIGHTBOXTYPE_DESC', 'Wählen Sie den selben Typ wie im lightbox Plugin. Man kann kein anderes lightbox-widget hier anwählen.');
@define('PLUGIN_EVENT_USERGALLERY_SHOWOBJECTS_NAME', 'Zeige alle Nicht-Bild Dateien');
@define('PLUGIN_EVENT_USERGALLERY_SHOWOBJECTS_DESC', 'Erweitere das Galerie Array mit allen Nicht-Bild Dateien aus der Mediendatendank, zB. *.pdf Dateien.');

View file

@ -1,4 +1,4 @@
<?php #
<?php
/**
* @version
@ -100,6 +100,7 @@
@define('PLUGIN_EVENT_USERGALLERY_SHOWLIGHTBOX_NAME', 'Use lightbox output');
@define('PLUGIN_EVENT_USERGALLERY_SHOWLIGHTBOX_DESC', 'Needs the lightbox-plugin installed and upper option "Display Single Image" set to "Scaled to fit"! When you want to use lightboxes only for Usergallery pages, install the lightbox plugin and move it into the hidden event field in your pluginlist!');
@define('PLUGIN_EVENT_USERGALLERY_LIGHTBOXTYPE_NAME', 'Use lightbox plugin type');
@define('PLUGIN_EVENT_USERGALLERY_LIGHTBOXTYPE_DESC', 'Choose the same as set in the lightbox plugin. Choosing another library will not work here.');
@define('PLUGIN_EVENT_USERGALLERY_SHOWOBJECTS_NAME', 'Show all Non-Image objects');
@define('PLUGIN_EVENT_USERGALLERY_SHOWOBJECTS_DESC', 'Include other media library object files to show up too, eg *.pdf application objects.');

View file

@ -1,4 +1,4 @@
<?php #
<?php
/**
* @version
@ -31,4 +31,4 @@
@define('PLUGIN_EVENT_USERGALLERY_FIXED_DESC', 'Sets the image height and width to a fixed proportion. Set to zero to use standard thumbnail.');
@define('PLUGIN_EVENT_USERGALLERY_FILESIZE', 'ファイルサイズ');
@define('PLUGIN_EVENT_USERGALLERY_DIMENSION', 'Dimension');
?>

View file

@ -1,4 +1,4 @@
<?php #
<?php
/**
* @version
@ -6,25 +6,24 @@
* First public version: lang_tr.inc.php
*/
@define('PLUGIN_EVENT_USERGALLERY_TITLE', 'Galeri Gösterimi');
@define('PLUGIN_EVENT_USERGALLERY_DESC', 'Anonim kullanıcı-ziyaretçilerin Serendipity Medya Galerisini görmelerine izin verir');
@define('PLUGIN_EVENT_USERGALLERY_NUMCOLS_TWO', '2');
@define('PLUGIN_EVENT_USERGALLERY_NUMCOLS_THREE', '3');
@define('PLUGIN_EVENT_USERGALLERY_NUMCOLS_FOUR', '4');
@define('PLUGIN_EVENT_USERGALLERY_NUMCOLS_FIVE', '5');
@define('PLUGIN_EVENT_USERGALLERY_NUMCOLS_DESC', 'Galeride gösterilecek sütun sayısı');
@define('PLUGIN_EVENT_USERGALLERY_NUMCOLS_NAME', 'Sütunların sayısı');
@define('PLUGIN_EVENT_USERGALLERY_PERMALINK_NAME', 'Galeri görünümü için kalıcı bağlantı URL adresi');
@define('PLUGIN_EVENT_USERGALLERY_PERMALINK_DESC', 'Galeri erişiminde kullanılmak üzere benzesiz bir kalıcı bağlantı URL adresi yazın');
@define('PLUGIN_EVENT_USERGALLERY_SUBNAME_NAME', 'Galeri görünümü için altsayfa adı');
@define('PLUGIN_EVENT_USERGALLERY_SUBNAME_DESC', 'Galeri görünümü için kullanmak isteyeceğiniz benzersiz bir altsayfa adı yazın (galeri erişim adresi index.php?serendipity[subpage]=altsayfaismi şeklinde olacak.)');
@define('PLUGIN_EVENT_USERGALLERY_DIRECTORY_NAME', 'Öntanımlı Dizin Seçimi');
@define('PLUGIN_EVENT_USERGALLERY_DIRECTORY_DESC', 'Galeri fotolarının saklanması ve erişilmesinde kullanılacak Öntanımlı dizini belirtin. ');
@define('PLUGIN_EVENT_USERGALLERY_STYLE_NAME', 'Galeri Stili Seçin');
@define('PLUGIN_EVENT_USERGALLERY_STYLE_DESC', 'Kullanmak istediğiniz galeri stilini seçin. "Medya Kütüphanesi" dizinler arasında gezinmenize ve arama yapmanıza imkan verir, "Küçükresim Sayfası" dizindeki küçükresimlerin gösterilmesini sağlar ve tıklandığında resimler yeni bir pencerede açılır');
@define('PLUGIN_EVENT_USERGALLERY_STYLE_SERENDIPITY', 'Medya Kütüphanesi');
@define('PLUGIN_EVENT_USERGALLERY_STYLE_THUMBPAGE', 'Küçükresim Sayfası');
@define('PLUGIN_EVENT_USERGALLERY_PRETTY_NAME', 'Gösterim adı');
@define('PLUGIN_EVENT_USERGALLERY_PRETTY_DESC', 'Galeriyi tanımlamakta kullanacağınız başlığı seçin');
@define('PLUGIN_EVENT_USERGALLERY_TITLE', 'Galeri Gösterimi');
@define('PLUGIN_EVENT_USERGALLERY_DESC', 'Anonim kullanıcı-ziyaretçilerin Serendipity Medya Galerisini görmelerine izin verir');
@define('PLUGIN_EVENT_USERGALLERY_NUMCOLS_TWO', '2');
@define('PLUGIN_EVENT_USERGALLERY_NUMCOLS_THREE', '3');
@define('PLUGIN_EVENT_USERGALLERY_NUMCOLS_FOUR', '4');
@define('PLUGIN_EVENT_USERGALLERY_NUMCOLS_FIVE', '5');
@define('PLUGIN_EVENT_USERGALLERY_NUMCOLS_DESC', 'Galeride gösterilecek sütun sayısı');
@define('PLUGIN_EVENT_USERGALLERY_NUMCOLS_NAME', 'Sütunların sayısı');
@define('PLUGIN_EVENT_USERGALLERY_PERMALINK_NAME', 'Galeri görünümü için kalıcı bağlantı URL adresi');
@define('PLUGIN_EVENT_USERGALLERY_PERMALINK_DESC', 'Galeri erişiminde kullanılmak üzere benzesiz bir kalıcı bağlantı URL adresi yazın');
@define('PLUGIN_EVENT_USERGALLERY_SUBNAME_NAME', 'Galeri görünümü için altsayfa adı');
@define('PLUGIN_EVENT_USERGALLERY_SUBNAME_DESC', 'Galeri görünümü için kullanmak isteyeceğiniz benzersiz bir altsayfa adı yazın (galeri erişim adresi index.php?serendipity[subpage]=altsayfaismi şeklinde olacak.)');
@define('PLUGIN_EVENT_USERGALLERY_DIRECTORY_NAME', 'Öntanımlı Dizin Seçimi');
@define('PLUGIN_EVENT_USERGALLERY_DIRECTORY_DESC', 'Galeri fotolarının saklanması ve erişilmesinde kullanılacak Öntanımlı dizini belirtin. ');
@define('PLUGIN_EVENT_USERGALLERY_STYLE_NAME', 'Galeri Stili Seçin');
@define('PLUGIN_EVENT_USERGALLERY_STYLE_DESC', 'Kullanmak istediğiniz galeri stilini seçin. "Medya Kütüphanesi" dizinler arasında gezinmenize ve arama yapmanıza imkan verir, "Küçükresim Sayfası" dizindeki küçükresimlerin gösterilmesini sağlar ve tıklandığında resimler yeni bir pencerede açılır');
@define('PLUGIN_EVENT_USERGALLERY_STYLE_SERENDIPITY', 'Medya Kütüphanesi');
@define('PLUGIN_EVENT_USERGALLERY_STYLE_THUMBPAGE', 'Küçükresim Sayfası');
@define('PLUGIN_EVENT_USERGALLERY_PRETTY_NAME', 'Gösterim adı');
@define('PLUGIN_EVENT_USERGALLERY_PRETTY_DESC', 'Galeriyi tanımlamakta kullanacağınız başlığı seçin');
?>

View file

@ -1,69 +1,69 @@
<script type="text/javascript">
<!--
function popImage(file_name,file_title,file_width,file_height) {ldelim}
if (parseInt(navigator.appVersion.charAt(0))>=4){ldelim}
var optBrowser='scrollbars=yes,width='+file_width+',height='+file_height+',toolbar=no,menubar=no,location=no,resize=1,resizable=0';
var imgWin=window.open('about:blank','',optBrowser);
with (imgWin.document){ldelim}
writeln('<html><head><title>Loading...</title>');
writeln('<style>body{ldelim}margin:0;padding:0;text-align:center;{rdelim} img{ldelim}border:0px;{rdelim}</style>');
writeln('</head>');
writeln('<sc'+'ript>');
writeln('function doTitle(){ldelim}document.title="'+file_title+'";{rdelim}');
writeln('</sc'+'ript>');
writeln('<body onload="self.focus();doTitle()">');
writeln('<a href="javascript:window.close()"><img src="'+file_name+'" width="'+file_width+'" height="'+file_height+'" alt=""/></a>');
writeln('</body></html>');
close();
{rdelim}
{rdelim}
if (parseInt(navigator.appVersion.charAt(0))>=4){ldelim}
var optBrowser='scrollbars=yes,width='+file_width+',height='+file_height+',toolbar=no,menubar=no,location=no,resize=1,resizable=0';
var imgWin=window.open('about:blank','',optBrowser);
with (imgWin.document){ldelim}
writeln('<html><head><title>Loading...</title>');
writeln('<style>body{ldelim}margin:0;padding:0;text-align:center;{rdelim} img{ldelim}border:0px;{rdelim}</style>');
writeln('</head>');
writeln('<sc'+'ript>');
writeln('function doTitle(){ldelim}document.title="'+file_title+'";{rdelim}');
writeln('</sc'+'ript>');
writeln('<body onload="self.focus();doTitle()">');
writeln('<a href="javascript:window.close()"><img src="'+file_name+'" width="'+file_width+'" height="'+file_height+'" alt=""/></a>');
writeln('</body></html>');
close();
{rdelim}
{rdelim}
{rdelim}
//-->
</script>
<div class="serendipity_Entry_Date serendipity_event_usergallery_image_display">
<div class="serendipity_entry">
<h3 class="serendipity_date">{$plugin_usergallery_title}</h3>
<h4 class="serendipity_title">{$plugin_usergallery_limit_directory}</h4>
<div class="serendipity_entry">
<h3 class="serendipity_date">{$plugin_usergallery_title}</h3>
<h4 class="serendipity_title">{$plugin_usergallery_limit_directory}</h4>
<div class="serendipity_gallery_navigation">
<!-- navigation -->
<a href="{$plugin_usergallery_httppath}">{$plugin_usergallery_title}</a>{foreach name="gallery" from=$plugin_usergallery_gallery_breadcrumb item="gallery"} &raquo; <a href="{$plugin_usergallery_httppath_extend}gallery={$gallery.path}">{$gallery.name}</a>{/foreach}
<div style="float: left;">
{if $plugin_usergallery_previousid != -1}
<a href="{$plugin_usergallery_httppath_extend}serendipity[image]={$plugin_usergallery_previousid}">&laquo; {$CONST.PREVIOUS}</a>
{/if}
</div>
<div style="float: right;">
{if $plugin_usergallery_nextid != -1}
<a href="{$plugin_usergallery_httppath_extend}serendipity[image]={$plugin_usergallery_nextid}">{$CONST.NEXT} &raquo;</a>
{/if}
</div>
<!-- end navigation -->
</div>
<div class="serendipity_gallery_navigation">
<!-- navigation -->
<a href="{$plugin_usergallery_httppath}">{$plugin_usergallery_title}</a>{foreach name="gallery" from=$plugin_usergallery_gallery_breadcrumb item="gallery"} &raquo; <a href="{$plugin_usergallery_httppath_extend}gallery={$gallery.path}">{$gallery.name}</a>{/foreach}
<div style="float: left;">
{if $plugin_usergallery_previousid != -1}
<a href="{$plugin_usergallery_httppath_extend}serendipity[image]={$plugin_usergallery_previousid}">&laquo; {$CONST.PREVIOUS}</a>
{/if}
</div>
<div style="float: right;">
{if $plugin_usergallery_nextid != -1}
<a href="{$plugin_usergallery_httppath_extend}serendipity[image]={$plugin_usergallery_nextid}">{$CONST.NEXT} &raquo;</a>
{/if}
</div>
<!-- end navigation -->
</div>
<div class="serendipity_gallery_entry">
<h4 class="serendipity_gallery_title">{$plugin_usergallery_file.title}</h4>
<h4 class="serendipity_gallery_title">{$plugin_usergallery_file.title}</h4>
{if $plugin_usergallery_file.is_image}
<!-- Popup -->
<!-- Popup -->
<a href="javascript:popImage('{$plugin_usergallery_file.link}','{$plugin_usergallery_file.name}','{$plugin_usergallery_file.dimensions_width}','{$plugin_usergallery_file.dimensions_height}')"><img class="gallery_thumb" width="{$plugin_usergallery_file.alt_width}px" height="{$plugin_usergallery_file.alt_height}px" src="{$plugin_usergallery_file.link}" alt="" /></a>
{else}
<!-- download link -->
<a href="{$plugin_usergallery_file.link}" alt="{$plugin_usergallery_file.name}" />{$CONST.USERGALLERY_DOWNLOAD_HERE}</a>
<a href="{$plugin_usergallery_file.link}" alt="{$plugin_usergallery_file.name}" />{$CONST.USERGALLERY_DOWNLOAD_HERE}</a>
{/if}
<!-- file information -->
<div class="serendipity_gallery_info">
<div>{$CONST.USERGALLERY_SEE_FULLSIZED}.</div>
{if count($plugin_usergallery_file.entries) > 0}
<h5>{$CONST.USERGALLERY_LINKED_ENTRIES}</h5>
<div class="serendipity_gallery_info">
<div>{$CONST.USERGALLERY_SEE_FULLSIZED}.</div>
{if count($plugin_usergallery_file.entries) > 0}
<h5>{$CONST.USERGALLERY_LINKED_ENTRIES}</h5>
<ol>
{foreach from=$plugin_usergallery_file.entries item="link"}
<li><a href="{$link.href}">{$link.title}</a></li>
{/foreach}
</ol>
<ol>
{foreach from=$plugin_usergallery_file.entries item="link"}
<li><a href="{$link.href}">{$link.title}</a></li>
{/foreach}
</ol>
{/if}
{if count($plugin_usergallery_file.staticpage_results) > 0}
<h5>{$CONST.USERGALLERY_LINKED_STATICPAGES}</h5>
{if count($plugin_usergallery_file.staticpage_results) > 0}
<h5>{$CONST.USERGALLERY_LINKED_STATICPAGES}</h5>
<ol>
{foreach from=$plugin_usergallery_file.staticpage_results item="result"}
@ -71,19 +71,19 @@ function popImage(file_name,file_title,file_width,file_height) {ldelim}
{/foreach}
</ol>
{/if}
<dl>
<dt>{$plugin_usergallery_file.name}.{$plugin_usergallery_file.extension}</dt>
<dd>{$const.filesize}: {$plugin_usergallery_file.size_txt} kb</dd>
{foreach name="info" from=$plugin_usergallery_extended_info item="entry"}
<dl>
<dt>{$plugin_usergallery_file.name}.{$plugin_usergallery_file.extension}</dt>
<dd>{$const.filesize}: {$plugin_usergallery_file.size_txt} kb</dd>
{foreach name="info" from=$plugin_usergallery_extended_info item="entry"}
<dd>{$entry.name}: {$entry.value}</dd>
{/foreach}
{if $plugin_usergallery_file.is_image}
{if $plugin_usergallery_xtra_info}
<dd>{$plugin_usergallery_xtra_info}</dd>
{/if}
{/if}
</dl>
</div>
{if $plugin_usergallery_file.is_image}
{if $plugin_usergallery_xtra_info}
<dd>{$plugin_usergallery_xtra_info}</dd>
{/if}
{/if}
</dl>
</div>
</div>
</div>
</div>
</div>

View file

@ -3,14 +3,22 @@
if (IN_serendipity !== true) {
die ("Don't hack!");
}
// todo: add config groups, aka freetag dev
// Probe for a language include with constants. Still include defines later on, if some constants were missing
$probelang = dirname(__FILE__) . '/' . $serendipity['charset'] . 'lang_' . $serendipity['lang'] . '.inc.php';
if (file_exists($probelang)) {
include $probelang;
if (!function_exists('array_combine')) {
function array_combine($a, $b) {
$c = array();
if (is_array($a) && is_array($b))
while (list(, $va) = each($a))
if (list(, $vb) = each($b))
$c[$va] = $vb;
else
break 1;
return $c;
}
}
include dirname(__FILE__) . '/lang_en.inc.php';
@serendipity_plugin_api::load_language(dirname(__FILE__));
class serendipity_event_usergallery extends serendipity_event
{
@ -23,7 +31,7 @@ class serendipity_event_usergallery extends serendipity_event
$propbag->add('description', PLUGIN_EVENT_USERGALLERY_DESC);
$propbag->add('stackable', true);
$propbag->add('author', 'Arnan de Gans, Matthew Groeninger, and Stefan Willoughby, Ian');
$propbag->add('version', '2.65');
$propbag->add('version', '2.68');
$propbag->add('requirements', array(
'serendipity' => '1.6',
'smarty' => '2.6.7',
@ -46,7 +54,12 @@ class serendipity_event_usergallery extends serendipity_event
function introspect_config_item($name, &$propbag)
{
global $serendipity;
switch ($name) {
case 'separator2':
case 'separator1':
$propbag->add('type', 'separator');
break;
case 'title':
$propbag->add('type', 'string');
@ -92,7 +105,7 @@ class serendipity_event_usergallery extends serendipity_event
'desc' => array(YES,NO)));
$propbag->add('radio_per_row', '2');
$propbag->add('default', 'no');
break;
break;
case 'base_directory':
if ($this->get_config('style') == "thumbpage") {
@ -105,21 +118,21 @@ class serendipity_event_usergallery extends serendipity_event
$propbag->add('name', PLUGIN_EVENT_USERGALLERY_DIRECTORY_NAME);
$propbag->add('description', PLUGIN_EVENT_USERGALLERY_DIRECTORY_DESC);
$propbag->add('select_values', $select);
}
} else $propbag->add('type', 'suboption');
break;
case 'style':
$select["serendipity"] = PLUGIN_EVENT_USERGALLERY_STYLE_SERENDIPITY;
$select["thumbpage"] = PLUGIN_EVENT_USERGALLERY_STYLE_THUMBPAGE;
$propbag->add('type', 'select');
$propbag->add('name', PLUGIN_EVENT_USERGALLERY_STYLE_NAME);
$propbag->add('description', PLUGIN_EVENT_USERGALLERY_STYLE_DESC);
$propbag->add('select_values', $select);
$propbag->add('default', 'thumbpage');
break;
$select["serendipity"] = PLUGIN_EVENT_USERGALLERY_STYLE_SERENDIPITY;
$select["thumbpage"] = PLUGIN_EVENT_USERGALLERY_STYLE_THUMBPAGE;
$propbag->add('type', 'select');
$propbag->add('name', PLUGIN_EVENT_USERGALLERY_STYLE_NAME);
$propbag->add('description', PLUGIN_EVENT_USERGALLERY_STYLE_DESC);
$propbag->add('select_values', $select);
$propbag->add('default', 'thumbpage');
break;
case 'dir_list':
if ($this->get_config('style') == 'thumbpage') {
if ($this->get_config('style') == 'thumbpage') {
$propbag->add('type', 'radio');
$propbag->add('name', PLUGIN_EVENT_USERGALLERY_DIRLIST_NAME);
$propbag->add('description', PLUGIN_EVENT_USERGALLERY_DIRLIST_DESC);
@ -127,47 +140,47 @@ class serendipity_event_usergallery extends serendipity_event
'desc' => array(YES,NO)));
$propbag->add('radio_per_row', '2');
$propbag->add('default', 'no');
}
break;
} else $propbag->add('type', 'suboption');
break;
case 'intro':
if ($this->get_config('style') == 'thumbpage') {
$propbag->add('type', 'html');
$propbag->add('name', PLUGIN_EVENT_USERGALLERY_INTRO);
$propbag->add('description', '');
$propbag->add('default', '');
}
break;
if ($this->get_config('style') == 'thumbpage') {
$propbag->add('type', 'html');
$propbag->add('name', PLUGIN_EVENT_USERGALLERY_INTRO);
$propbag->add('description', '');
$propbag->add('default', '');
} else $propbag->add('type', 'suboption');
break;
case 'fixed_width':
if ($this->get_config('style') == 'thumbpage') {
$propbag->add('type', 'string');
$propbag->add('name', PLUGIN_EVENT_USERGALLERY_FIXED_WIDTH);
$propbag->add('description', PLUGIN_EVENT_USERGALLERY_FIXED_DESC);
$propbag->add('default', '0');
}
break;
if ($this->get_config('style') == 'thumbpage') {
$propbag->add('type', 'string');
$propbag->add('name', PLUGIN_EVENT_USERGALLERY_FIXED_WIDTH);
$propbag->add('description', PLUGIN_EVENT_USERGALLERY_FIXED_DESC);
$propbag->add('default', '0');
} else $propbag->add('type', 'suboption');
break;
case 'image_width':
if ($this->get_config('image_display') == 'inpage') {
$propbag->add('type', 'string');
$propbag->add('name', PLUGIN_EVENT_USERGALLERY_IMAGE_WIDTH_NAME);
$propbag->add('description', PLUGIN_EVENT_USERGALLERY_IMAGE_WIDTH_DESC);
$propbag->add('default', '480');
}
break;
if ($this->get_config('image_display') == 'inpage') {
$propbag->add('type', 'string');
$propbag->add('name', PLUGIN_EVENT_USERGALLERY_IMAGE_WIDTH_NAME);
$propbag->add('description', PLUGIN_EVENT_USERGALLERY_IMAGE_WIDTH_DESC);
$propbag->add('default', '480');
} else $propbag->add('type', 'suboption');
break;
case 'image_display':
if ($this->get_config('style') == 'thumbpage') {
$select["inpage"] = PLUGIN_EVENT_USERGALLERY_IMAGEDISPLAY_INPAGE;
$select["popup"] = PLUGIN_EVENT_USERGALLERY_IMAGEDISPLAY_POPUP;
$propbag->add('type', 'select');
$propbag->add('name', PLUGIN_EVENT_USERGALLERY_IMAGEDISPLAY_NAME);
$propbag->add('description', PLUGIN_EVENT_USERGALLERY_IMAGEDISPLAY_DESC);
$propbag->add('select_values', $select);
$propbag->add('default', 'inpage');
}
break;
if ($this->get_config('style') == 'thumbpage') {
$select["inpage"] = PLUGIN_EVENT_USERGALLERY_IMAGEDISPLAY_INPAGE;
$select["popup"] = PLUGIN_EVENT_USERGALLERY_IMAGEDISPLAY_POPUP;
$propbag->add('type', 'select');
$propbag->add('name', PLUGIN_EVENT_USERGALLERY_IMAGEDISPLAY_NAME);
$propbag->add('description', PLUGIN_EVENT_USERGALLERY_IMAGEDISPLAY_DESC);
$propbag->add('select_values', $select);
$propbag->add('default', 'inpage');
} else $propbag->add('type', 'suboption');
break;
case 'show_lightbox':
$propbag->add('type', 'radio');
@ -186,7 +199,7 @@ class serendipity_event_usergallery extends serendipity_event
$select_type["magnific"] = 'Magnific-Popup';
$propbag->add('type', 'select');
$propbag->add('name', PLUGIN_EVENT_USERGALLERY_LIGHTBOXTYPE_NAME);
$propbag->add('description', '');
$propbag->add('description', PLUGIN_EVENT_USERGALLERY_LIGHTBOXTYPE_DESC);
$propbag->add('select_values', $select_type);
$propbag->add('default', 'lightbox');
break;
@ -208,7 +221,7 @@ class serendipity_event_usergallery extends serendipity_event
break;
case 'image_strict':
if ($this->get_config('style') == 'thumbpage') {
if ($this->get_config('style') == 'thumbpage') {
$propbag->add('type', 'radio');
$propbag->add('name', PLUGIN_EVENT_USERGALLERY_IMAGESTRICT_NAME);
$propbag->add('description', PLUGIN_EVENT_USERGALLERY_IMAGESTRICT_DESC);
@ -216,64 +229,64 @@ class serendipity_event_usergallery extends serendipity_event
'desc' => array(YES,NO)));
$propbag->add('radio_per_row', '2');
$propbag->add('default', 'yes');
}
break;
} else $propbag->add('type', 'suboption');
break;
case 'image_order':
if ($this->get_config('style') == 'thumbpage') {
$select["nameacs"] = PLUGIN_EVENT_USERGALLERY_IMAGEORDER_NAMEACS;
$select["namedesc"] = PLUGIN_EVENT_USERGALLERY_IMAGEORDER_NAMEDESC;
$select["dateacs"] = PLUGIN_EVENT_USERGALLERY_IMAGEORDER_DATEACS;
$select["datedesc"] = PLUGIN_EVENT_USERGALLERY_IMAGEORDER_DATEDESC;
$propbag->add('type', 'select');
$propbag->add('name', PLUGIN_EVENT_USERGALLERY_IMAGEORDER_NAME);
$propbag->add('description', PLUGIN_EVENT_USERGALLERY_IMAGEORDER_DESC);
$propbag->add('select_values', $select);
$propbag->add('default', 'nameacs');
}
break;
if ($this->get_config('style') == 'thumbpage') {
$select["nameacs"] = PLUGIN_EVENT_USERGALLERY_IMAGEORDER_NAMEACS;
$select["namedesc"] = PLUGIN_EVENT_USERGALLERY_IMAGEORDER_NAMEDESC;
$select["dateacs"] = PLUGIN_EVENT_USERGALLERY_IMAGEORDER_DATEACS;
$select["datedesc"] = PLUGIN_EVENT_USERGALLERY_IMAGEORDER_DATEDESC;
$propbag->add('type', 'select');
$propbag->add('name', PLUGIN_EVENT_USERGALLERY_IMAGEORDER_NAME);
$propbag->add('description', PLUGIN_EVENT_USERGALLERY_IMAGEORDER_DESC);
$propbag->add('select_values', $select);
$propbag->add('default', 'nameacs');
} else $propbag->add('type', 'suboption');
break;
case 'display_dir_tree':
if ($this->get_config('style') == 'thumbpage' && $this->get_config('dir_list') == 'yes') {
$propbag->add('type', 'radio');
$propbag->add('name', PLUGIN_EVENT_USERGALLERY_DISPLAYDIR_NAME);
$propbag->add('description', PLUGIN_EVENT_USERGALLERY_DISPLAYDIR_DESC);
$propbag->add('radio', array('value' => array('yes','no'),
if ($this->get_config('style') == 'thumbpage' && $this->get_config('dir_list') == 'yes') {
$propbag->add('type', 'radio');
$propbag->add('name', PLUGIN_EVENT_USERGALLERY_DISPLAYDIR_NAME);
$propbag->add('description', PLUGIN_EVENT_USERGALLERY_DISPLAYDIR_DESC);
$propbag->add('radio', array('value' => array('yes','no'),
'desc' => array(YES,NO)));
$propbag->add('radio_per_row', '2');
$propbag->add('default', 'no');
}
break;
$propbag->add('radio_per_row', '2');
$propbag->add('default', 'no');
} else $propbag->add('type', 'suboption');
break;
case 'dir_tab':
if ($this->get_config('style') == 'thumbpage' && $this->get_config('dir_list') == 'yes') {
$propbag->add('type', 'string');
$propbag->add('name', PLUGIN_EVENT_USERGALLERY_DIRTAB_NAME);
$propbag->add('description', PLUGIN_EVENT_USERGALLERY_DIRTAB_DESC);
$propbag->add('default', '10');
}
break;
if ($this->get_config('style') == 'thumbpage' && $this->get_config('dir_list') == 'yes') {
$propbag->add('type', 'string');
$propbag->add('name', PLUGIN_EVENT_USERGALLERY_DIRTAB_NAME);
$propbag->add('description', PLUGIN_EVENT_USERGALLERY_DIRTAB_DESC);
$propbag->add('default', '10');
} else $propbag->add('type', 'suboption');
break;
case 'show_1lvl_sub':
if ($this->get_config('style') == 'thumbpage' && $this->get_config('dir_list') == 'yes' && $this->get_config('display_dir_tree','no') == 'no') {
$propbag->add('type', 'radio');
$propbag->add('name', PLUGIN_EVENT_USERGALLERY_1SUBLVL_NAME);
$propbag->add('description', PLUGIN_EVENT_USERGALLERY_1SUBLVL_DESC);
$propbag->add('radio', array('value' => array('yes','no'),
'desc' => array(YES,NO)));
$propbag->add('radio_per_row', '2');
$propbag->add('default', 'no');
}
break;
if ($this->get_config('style') == 'thumbpage' && $this->get_config('dir_list') == 'yes' && $this->get_config('display_dir_tree','no') == 'no') {
$propbag->add('type', 'radio');
$propbag->add('name', PLUGIN_EVENT_USERGALLERY_1SUBLVL_NAME);
$propbag->add('description', PLUGIN_EVENT_USERGALLERY_1SUBLVL_DESC);
$propbag->add('radio', array('value' => array('yes','no'),
'desc' => array(YES,NO)));
$propbag->add('radio_per_row', '2');
$propbag->add('default', 'no');
} else $propbag->add('type', 'suboption');
break;
case 'images_per_page':
if ($this->get_config('style') == 'thumbpage') {
$propbag->add('type', 'string');
$propbag->add('name', PLUGIN_EVENT_USERGALLERY_IMAGESPERPAGE_NAME);
$propbag->add('description', PLUGIN_EVENT_USERGALLERY_IMAGESPERPAGE_DESC);
$propbag->add('default', '20');
}
break;
if ($this->get_config('style') == 'thumbpage') {
$propbag->add('type', 'string');
$propbag->add('name', PLUGIN_EVENT_USERGALLERY_IMAGESPERPAGE_NAME);
$propbag->add('description', PLUGIN_EVENT_USERGALLERY_IMAGESPERPAGE_DESC);
$propbag->add('default', '20');
}
break;
case 'exif_show_data':
$propbag->add('type', 'radio');
@ -291,7 +304,7 @@ class serendipity_event_usergallery extends serendipity_event
$propbag->add('name', PLUGIN_EVENT_USERGALLERY_DISPLAYDIR_NAME);
$propbag->add('description', PLUGIN_EVENT_USERGALLERY_DISPLAYDIR_DESC);
$propbag->add('default', '<table>' . $this->makeExifSelector() . '</table>');
}
} else $propbag->add('type', 'suboption');
break;
case 'feed_width':
@ -331,7 +344,7 @@ class serendipity_event_usergallery extends serendipity_event
$propbag->add('name', PLUGIN_EVENT_USERGALLERY_MEDIA_PROPERTIES_NAME);
$propbag->add('description', PLUGIN_EVENT_USERGALLERY_MEDIA_PROPERTIES_DESC);
$propbag->add('default', 'COPYRIGHT:Copyright;TITLE:Title;COMMENT2:Comment');
}
} else $propbag->add('type', 'suboption');
break;
case 'linked_entries':
@ -341,175 +354,19 @@ class serendipity_event_usergallery extends serendipity_event
$propbag->add('default', 'true');
break;
default:
return false;
}
return true;
}
function &makeExifSelector() {
global $serendipity;
#$selector .= "</td></tr>\n";
$selector .= '<tr><td style="vertical-align: top; width: 80%"><strong>'.PLUGIN_EVENT_USERGALLERY_EXIFDATA_NAME.'</strong></td>';
$selector .= '<td style="vertical-align: top"><strong>Options</strong></td></tr>'."\n";
$selector .= '<tr><td colspan="2"><span style="color: rgb(94, 122, 148); font-size: 8pt;">'.PLUGIN_EVENT_USERGALLERY_EXIFDATA_DESC.'</span><br />'."\n";
$selector .= '<span style="color: rgb(94, 122, 148); font-size: 8pt;">'.PLUGIN_EVENT_USERGALLERY_EXIFDATA_CAMERA.'</span></td></tr>'."\n";
if (is_array($serendipity['POST']['plugin']['exifdata'])) {
//create new array
$exif_array = array();
foreach($serendipity['POST']['plugin']['exifdata'] as $key => $value) {
$exif_array[$key] = $key.'-'.$value;
}
//build new optionstring and save it
$newexifstring = implode(',', array_values($exif_array));
$this->set_config('exif_data', $newexifstring);
//break down the array and rebuild for immediate recycling on the page
foreach($exif_array as $key => $value) {
list($newkey, $newvalue) = explode('-', $value);
$res1_exif_array[] = $newkey;
$res2_exif_array[] = $newvalue;
}
$exif_array = array_combine($res1_exif_array, $res2_exif_array);
} else {
//get the optionstring
$exifsettings = $this->get_config('exif_data','Copyright Notice-no,Camera Make-no,Camera Model-no,Orientation-no,Resolution Unit-no,X Resolution-no,Y Resolution-no,Date and Time-no,YCbCr Positioning-no,Exposure Time-no,Aperture-no,Exposure Program-no,ISO-no,Exif Version-no,Date (Original)-no,Date (Digitized)-no,APEX Exposure Bias-no,APEX Max Aperture-no,Metering Mode-no,Light Source-no,Flash-no,FocalLength-no,User Comment-no,FlashPix Version-no,Colour Space-no,Pixel X Dimension-no,Pixel Y Dimension-no,File Source-no,Special Processing-no,Exposure Mode-no,White Balance-no,Digital Zoom Ratio-no,Scene Capture Type-no,Gain Control-no,Contrast-no,Saturation-no,Sharpness-no,Components Config-no');
if (!$exifsettings) {
//return empty array if invalid or non-existant
$exifsettings = array();
$selector .= '<tr><td colspan="2" style="color: #f00;">
An error occured. Your website will function AS NORMAL. But EXIF tags cannot be shown.<br />
Error: $this->get_config(\'exif_data\') is not fetched from the database properly.
Please contact support at http://www.s9y.org/forums/.</td></tr>';
} else {
//split the string into options
$exifstring = explode(',', $exifsettings);
//split the options into name and value
foreach($exifstring as $key => $value) {
$display = explode('-', $exifstring[$key]);
$exif_array[$display[0]] = $display[1];
}
}
}
//output options
foreach($exif_array as $key => $value) {
$selector .= '<tr><td style="vertical-align: top">'.$key.'</td>';
$selector .= '<td><input name="serendipity[plugin][exifdata]['.$key.']" type="radio" value="yes"';
if ($value == "yes") {
$selector .= ' checked="checked"';
}
$selector .= '> ' . YES . ' <input name="serendipity[plugin][exifdata]['.$key.']" type="radio" value="no"';
if ($value == "no") {
$selector .= ' checked="checked"';
}
$selector .= '> ' . NO . '</td></tr>'."\n";
}
#$selector .= '<tr><td colspan="2" style="border-bottom: 1px solid #000;">&nbsp;</td></tr>';
return $selector;
}
function event_hook($event, &$bag, &$eventData, $addData = null) {
global $serendipity;
static $pluginDir = null;
$hooks = &$bag->get('event_hooks');
if (isset($hooks[$event])) {
if ($pluginDir === null) {
$pluginDir = $this->get_config('lightbox_path');
}
switch($event) {
case 'entry_display':
if ($this->selected()) {
if (is_array($eventData)) {
$eventData['clean_page'] = true; // This is important to not display an entry list!
} else {
$eventData = array('clean_page' => true);
}
}
return true;
break;
case 'entries_header':
if ($this->selected()) {
$this->show();
}
return true;
break;
case 'css':
// If you only want to determine if a particular needle occurs within haystack, use the faster and less memory intensive function strpos() instead.
if (strpos($eventData, '.exif_info') === false) {
$out = serendipity_getTemplateFile('serendipity_event_usergallery.css', 'serendipityPath');
if ($out && $out != 'serendipity_event_usergallery.css') {
$eventData .= file_get_contents($out);
// do not echo here and there, since this prevents the strpos check to work, which multiplies gallery css added to stream for multiple stacked galleries
} else {
$eventData .= file_get_contents(dirname(__FILE__) . '/serendipity_event_usergallery.css');
}
}
return true;
break;
case 'frontend_configure':
if (isset($_REQUEST['gallery'])) {
// Disallow RSS-caching, because the entry age that is used for caching does not apply here.
$_GET['nocache'] = $_REQUEST['nocache'] = true;
// We need to set this variable to circumvent FeedBurner relocation
$_GET['type'] = 'comments';
}
return true;
break;
case 'frontend_rss':
$this->showRSS($eventData);
return true;
break;
case 'genpage':
$args = implode('/', serendipity_getUriArguments($eventData, true));
if ((empty($args) || trim($args) == $serendipity['indexFile']) && empty($serendipity['GET']['subpage'])) {
if ($this->get_config('frontpage','no') == 'yes') {
$serendipity['GET']['subpage'] = $this->get_config('subpage');
}
}
if ($serendipity['rewrite'] != 'none') {
$nice_url = $serendipity['serendipityHTTPPath'] . $args;
} else {
$nice_url = $serendipity['serendipityHTTPPath'] . $serendipity['indexFile'] . '?/' . $args;
}
if (empty($serendipity['GET']['subpage'])) {
$serendipity['GET']['subpage'] = $nice_url;
}
if ($this->selected()) {
if ($this->get_config('base_directory') == 'gallery') {
// this is to avoid having the word "gallery" as blog title
$serendipity['head_title'] = preg_replace('@[^a-z0-9]@i', ' ',$this->get_config('title'));
} else {
$serendipity['head_title'] = preg_replace('@[^a-z0-9]@i', ' ',$this->get_config('base_directory'));
}
$serendipity['head_subtitle'] = $serendipity['blogTitle'];
}
return true;
break;
default:
return false;
break;
}
}
}
function generate_content(&$title) {
function generate_content(&$title)
{
$title = $this->get_config('title', PLUGIN_EVENT_USERGALLERY_TITLE);
}
function show() {
function show()
{
global $serendipity;
if (!headers_sent()) {
@ -760,7 +617,7 @@ class serendipity_event_usergallery extends serendipity_event
);
if ($this->get_config('image_strict') == 'yes') {
$images = serendipity_fetchImagesFromDatabase($lower_limit, $images_per_page, $total, $orderby, $order, $limit_images_directory,'','', array(), true);
$images = serendipity_fetchImagesFromDatabase($lower_limit, $images_per_page, $total, $orderby, $order, $limit_images_directory, '', '', array(), true);
} else {
$images = serendipity_fetchImagesFromDatabase($lower_limit, $images_per_page, $total, $orderby, $order, $limit_images_directory);
}
@ -848,7 +705,101 @@ class serendipity_event_usergallery extends serendipity_event
}
}
function setResData($res, $unit) {
function event_hook($event, &$bag, &$eventData, $addData = null)
{
global $serendipity;
static $pluginDir = null;
$hooks = &$bag->get('event_hooks');
if (isset($hooks[$event])) {
if ($pluginDir === null) {
$pluginDir = $this->get_config('lightbox_path');
}
switch($event) {
case 'entry_display':
if ($this->selected()) {
if (is_array($eventData)) {
$eventData['clean_page'] = true; // This is important to not display an entry list!
} else {
$eventData = array('clean_page' => true);
}
}
break;
case 'entries_header':
if ($this->selected()) {
$this->show();
}
break;
case 'css':
// CSS class does NOT exist by user customized template styles, include default
if (strpos($eventData, '.exif_info') === false) {
$out = serendipity_getTemplateFile('serendipity_event_usergallery.css', 'serendipityPath');
if ($out && $out != 'serendipity_event_usergallery.css') {
$eventData .= file_get_contents($out);
// do not echo here and there, since this prevents the strpos check to work, which multiplies gallery css added to stream for multiple stacked galleries
} else {
$eventData .= file_get_contents(dirname(__FILE__) . '/serendipity_event_usergallery.css');
}
}
break;
case 'frontend_configure':
if (isset($_REQUEST['gallery'])) {
// Disallow RSS-caching, because the entry age that is used for caching does not apply here.
$_GET['nocache'] = $_REQUEST['nocache'] = true;
// We need to set this variable to circumvent FeedBurner relocation
$_GET['type'] = 'comments';
}
break;
case 'frontend_rss':
$this->showRSS($eventData);
break;
case 'genpage':
if ((empty($addData['uriargs']) || trim($addData['uriargs']) == $serendipity['indexFile']) && empty($serendipity['GET']['subpage'])) {
if ($this->get_config('frontpage','no') == 'yes') {
$serendipity['GET']['subpage'] = $this->get_config('subpage');
}
}
if ($serendipity['rewrite'] != 'none') {
$nice_url = $serendipity['serendipityHTTPPath'] . $addData['uriargs'];
} else {
$nice_url = $serendipity['serendipityHTTPPath'] . $serendipity['indexFile'] . '?/' . $addData['uriargs'];
}
if (empty($serendipity['GET']['subpage'])) {
$serendipity['GET']['subpage'] = $nice_url;
}
if ($this->selected()) {
if ($this->get_config('base_directory') == 'gallery') {
// this is to avoid having the word "gallery" as blog title
$serendipity['head_title'] = preg_replace('@[^a-z0-9]@i', ' ',$this->get_config('title'));
} else {
$serendipity['head_title'] = preg_replace('@[^a-z0-9]@i', ' ',$this->get_config('base_directory'));
}
$serendipity['head_subtitle'] = $serendipity['blogTitle'];
}
break;
default:
return false;
}
return true;
} else {
return false;
}
}
function setResData($res, $unit)
{
$dir_arr = explode(' ', $res);
$dir_arr[1] = trim($dir_arr[1], '()');
$res_unit = rtrim($unit, 'es');
@ -856,7 +807,8 @@ class serendipity_event_usergallery extends serendipity_event
return($exif_res);
}
function changeExifDate($date) {
function changeExifDate($date)
{
$date = str_replace(array('-','T'),array(':',' '),preg_replace('/\+.*/', '', $date)); // sets a date string 2014-03-18T10:11:31+01:00 to (Format: YYYY:MM:DD HH:mm:SS)
#echo $date . ' ';
$dt_arr = explode(' ', $date);
@ -878,7 +830,8 @@ class serendipity_event_usergallery extends serendipity_event
return $exif_date;
}
function getExifTags($path, $name, $type) {
function getExifTags($path, $name, $type)
{
$exif_data = array();
// Display additonal exif information if allowed.
$JPEG_TOOLKIT = $serendipity['baseURL'].'plugins/serendipity_event_usergallery/JPEG_TOOLKIT/';
@ -976,7 +929,72 @@ class serendipity_event_usergallery extends serendipity_event
return($exif_data);
}
function displayImage($id, $orderby, $order) {
function &makeExifSelector() {
global $serendipity;
#$selector .= "</td></tr>\n";
$selector .= '<tr><td style="vertical-align: top; width: 80%"><strong>'.PLUGIN_EVENT_USERGALLERY_EXIFDATA_NAME.'</strong></td>';
$selector .= '<td style="vertical-align: top"><strong>Options</strong></td></tr>'."\n";
$selector .= '<tr><td colspan="2"><span style="color: rgb(94, 122, 148); font-size: 8pt;">'.PLUGIN_EVENT_USERGALLERY_EXIFDATA_DESC.'</span><br />'."\n";
$selector .= '<span style="color: rgb(94, 122, 148); font-size: 8pt;">'.PLUGIN_EVENT_USERGALLERY_EXIFDATA_CAMERA.'</span></td></tr>'."\n";
if (is_array($serendipity['POST']['plugin']['exifdata'])) {
//create new array
$exif_array = array();
foreach($serendipity['POST']['plugin']['exifdata'] as $key => $value) {
$exif_array[$key] = $key.'-'.$value;
}
//build new optionstring and save it
$newexifstring = implode(',', array_values($exif_array));
$this->set_config('exif_data', $newexifstring);
//break down the array and rebuild for immediate recycling on the page
foreach($exif_array as $key => $value) {
list($newkey, $newvalue) = explode('-', $value);
$res1_exif_array[] = $newkey;
$res2_exif_array[] = $newvalue;
}
$exif_array = array_combine($res1_exif_array, $res2_exif_array);
} else {
//get the optionstring
$exifsettings = $this->get_config('exif_data','Copyright Notice-no,Camera Make-no,Camera Model-no,Orientation-no,Resolution Unit-no,X Resolution-no,Y Resolution-no,Date and Time-no,YCbCr Positioning-no,Exposure Time-no,Aperture-no,Exposure Program-no,ISO-no,Exif Version-no,Date (Original)-no,Date (Digitized)-no,APEX Exposure Bias-no,APEX Max Aperture-no,Metering Mode-no,Light Source-no,Flash-no,FocalLength-no,User Comment-no,FlashPix Version-no,Colour Space-no,Pixel X Dimension-no,Pixel Y Dimension-no,File Source-no,Special Processing-no,Exposure Mode-no,White Balance-no,Digital Zoom Ratio-no,Scene Capture Type-no,Gain Control-no,Contrast-no,Saturation-no,Sharpness-no,Components Config-no');
if (!$exifsettings) {
//return empty array if invalid or non-existant
$exifsettings = array();
$selector .= '<tr><td colspan="2" style="color: #f00;">
An error occured. Your website will function AS NORMAL. But EXIF tags cannot be shown.<br />
Error: $this->get_config(\'exif_data\') is not fetched from the database properly.
Please contact support at http://www.s9y.org/forums/.</td></tr>';
} else {
//split the string into options
$exifstring = explode(',', $exifsettings);
//split the options into name and value
foreach($exifstring as $key => $value) {
$display = explode('-', $exifstring[$key]);
$exif_array[$display[0]] = $display[1];
}
}
}
//output options
foreach($exif_array as $key => $value) {
$selector .= '<tr><td style="vertical-align: top">'.$key.'</td>';
$selector .= '<td><input name="serendipity[plugin][exifdata]['.$key.']" type="radio" value="yes"';
if ($value == "yes") {
$selector .= ' checked="checked"';
}
$selector .= '> ' . YES . ' <input name="serendipity[plugin][exifdata]['.$key.']" type="radio" value="no"';
if ($value == "no") {
$selector .= ' checked="checked"';
}
$selector .= '> ' . NO . '</td></tr>'."\n";
}
#$selector .= '<tr><td colspan="2" style="border-bottom: 1px solid #000;">&nbsp;</td></tr>';
return $selector;
}
function displayImage($id, $orderby, $order)
{
global $serendipity;
$extended_data = array();
$base_directory = $this->get_config('base_directory');
@ -998,7 +1016,7 @@ class serendipity_event_usergallery extends serendipity_event
}
if ($this->get_config('image_strict') == 'yes') {
$images = serendipity_fetchImagesFromDatabase($lower_limit, $images_per_page, $total, $orderby, $order, $file['path'],'','', array(), true);
$images = serendipity_fetchImagesFromDatabase($lower_limit, $images_per_page, $total, $orderby, $order, $file['path'], '', '', array(), true);
} else {
$images = serendipity_fetchImagesFromDatabase($lower_limit, $images_per_page, $total, $orderby, $order, $file['path']);
}
@ -1144,7 +1162,8 @@ class serendipity_event_usergallery extends serendipity_event
}
}
function selected() {
function selected()
{
global $serendipity;
if ($serendipity['GET']['subpage'] == $this->get_config('subpage') || preg_match('@^' . preg_quote($this->get_config('permalink')) . '@i', $serendipity['GET']['subpage'])) {
return true;
@ -1153,7 +1172,8 @@ class serendipity_event_usergallery extends serendipity_event
}
// Fetches a list of referenced entries
function fetchLinkedEntries($id, $big, $thumb, $single = false, $getBody = false) {
function fetchLinkedEntries($id, $big, $thumb, $single = false, $getBody = false)
{
global $serendipity;
if (strtolower($serendipity['dbType']) != 'mysql' && strtolower($serendipity['dbType']) != 'mysqli') {
@ -1206,7 +1226,8 @@ class serendipity_event_usergallery extends serendipity_event
}
// Fetches a list of referenced static pages
function fetchStaticPages($id, $big, $thumb) {
function fetchStaticPages($id, $big, $thumb)
{
global $serendipity;
if (strtolower($serendipity['dbType']) != 'mysql' && strtolower($serendipity['dbType']) != 'mysqli') {
@ -1243,7 +1264,8 @@ class serendipity_event_usergallery extends serendipity_event
// B: Path to a picture directory to limit to
// C: Width of the thumbnail pictures. Takes precedence over configured thumbnail size in this plugin and globally
// D: If set, no titles will be shown in the RSS feed.
function showRSS(&$eventData, $offset = 0) {
function showRSS(&$eventData, $offset = 0)
{
global $serendipity;
static $entries = array();
@ -1343,16 +1365,5 @@ class serendipity_event_usergallery extends serendipity_event
}
}
if (!function_exists('array_combine')) {
function array_combine($a, $b) {
$c = array();
if (is_array($a) && is_array($b))
while (list(, $va) = each($a))
if (list(, $vb) = each($b))
$c[$va] = $vb;
else
break 1;
return $c;
}
}
/* vim: set sts=4 ts=4 expandtab : */
?>