How-to's für TWG

Die Nummerierung der Howto's entspricht der Reihenfolge der Entstehung. Ich kann sie jedoch nicht einfach ändern, da es Links von älteren TWG Installationen gibt, welche darauf verweisen. Ich habe dafür jeden Abschnitt der Wichtigkeit der Howto's nach sortiert.

  Übersichts Howto - Zuerst lesen!

 Sicherheit & Optimierung

 Integration of TWG / Random image

 Installation & Advanced Setup help

 Overview and thumbnail page settings

 Detail page settings

 Big navigation settings

 Video

 Global stuff

 Layout and colors

 FAQ questions & problems




 Übersichts Howto

Da TWG keine Datenbank besitzt, kann vieles an Einstellungen durch das simple Hinzufügen von Dateien dort erfolgen wo das Feature gewünscht ist, z.B.: das Hinzufügen einer Ordnerbeschreibung oder eines Hintergundbildes. Dieses Howto ist eine kurze Zusammenfassung was möglich ist (eine bessere Beschreibung findet sich jeweils in den richtigen Howtos!):
  • private.txt - schütze Deine Galerie, der Dateiname kann in der config.php geändert werden - wobei mehr als eine Kennwort möglich ist - siehe how-to 12
  • private.png - Bild für einen passwortgeschützen Ordner - siehe how-to 12
  • folder.txt / folder_<sprache>.txt - Beschreibung eines Ordners welche auf der Übersichtsseite und wenn aktviert auf der Bilderseite angezeigt wird - siehe how-to 7
  • image.txt (php) / image_<sprache>.txt - ein mächtiger Weg um Text auf der Bilderseite einzubinden (sogar dynamisch) - siehe how-to 28
  • foldername.txt / foldername_<sprache>.txt - Der angezeigte Name eines Ordners - dieser wird anstelle des Namens im Dateisystem gezeigt. Sehr hilfreich für eine individuelle Sortierung der Alben! - siehe how-to 6
  • albumr/l.txt / albumr/l<sprache>.txt - Album Beschreibung wie auf der ersten Seite der Ajax Demo - siehe how-to 32
  • folder.png - ein Bild welches anstelle des ersten/Zufalls/Collage Bild eines Ordners gezeigt wird - siehe how-to 5
  • watermark.txt - der Wasserzeichen Text - siehe how-to 13
  • watermark.png / watermark_big.png - Das Wasserzeichen Bild für die Bildanzeige / Original - siehe how-to 13
  • link.txt - wenn Du zu einer Webseite verlinken willst anstatt das Originalbild herunterzuladen wenn das Bild angeklickt wird setze ein <a > tag in diese Datei. - siehe how-to 16
  • root.txt - Du kannst einen Link z.B. zu Deiner Homepage setzen. Wenn diese Datei existiert erhälst Du einen home Link (oder Icon) in der linken oberen Ecke! Du kannst den Text in der Sprachdatei definieren: $lang_back_link. Falls dies nicht gesetzt ist wird ein Icon angezeigt! + Du kannst mit dieser Datei unabhängige Untergalerien anlegen - siehe how-to 21
  • url.txt - Link zu einem entferneten http Verzeichnis. fsocksopen muss verfügbar sein. Die Url muss mit http:// beginnen und mit einem / aufhören sowie direkt auf den Ort verweisen wo dieBilder sind. - siehe how-to 20
  • back.png - Das Hintergrundbild von dem Ordner wo es gespeichert ist - siehe how-to 22
  • <ordnername>.zip - Ein Archiv welches den gesamten Inhalt des Ordners zum herunterladen enthält - siehe how-to 19
  • style.css – Du kannst ein individuelles Stylesheet für jeden Ordner anlegen - siehe how-to 9
  • config.php / config_<sprache>.php - kann in jedem Ordner für individuelle Einstellungen angelegt werden, welche nur dort angewendet werden - siehe how-to 17
  • config_sort.php - kann für die individuelle Sortierungsart von Unterverzeichnissen genutzt werden - siehe how-to 6
  • header.htm, top.htm - Eine header Datei welche eingebunden wird - das enthaltene HTML wird innerhalb von <td></td> dargestellt - siehe how-to 3
  • footer.htm, bottom.htm - Eine footer Datei welche eingebunden wird - das enthaltene HTML wird innerhalb von <td></td> dargestellt - siehe how-to 3
  • left.htm - Eine Datei welche auf der linken Seite eingebunden wird - Du kannst dort Deine eigene Navigation darstellen - das enthaltene HTML wird innerhalb von <td></td> dargestellt - siehe how-to 3
  • overview.htm/thumb.htm/image.htm - HTML welches auf der Übersichts/Thumb/Bild Seite gezeigt wird - seit 1.7 auch sprachabhängig! - siehe how-to 3
  • folderlink.txt - Durch das anlegen dieser Datei in einem Ordner kannst z.B. zu einer anderen Galerie verlinken, wenn man dann auf den Übersichtlink klickt - setzte ein <a> tag in diese Datei z.B.: <a href="http://www.spiegel.de">
  • video.php - sehr wichtige Datei wenn Du Videos oder Mp3's nutzen willst- siehe howto 34 für Details!
  • menu.htm - (neu 1.7) Du kannst das Menü in der rechten oberen Seite beliebig erweitern. Lege einfach eine Datei menu.htm mit Deinen Menüpunkten im Hauptverzeichnis an.

Bitte beachten: Bitte nutzt die HTML Kennzeichnung von Sonderzeichen in den .txt Dateien: ä -> &auml; (Ausnahme: watermark.txt !).

Seit TWG 1.6: Bitte speichert alle Eure Text Dateien in UTF-8! Dann werden Sonderzeichen korrekt dargestellt!

Das war's ;)

Viel Spaß!

 1. Wie schützt man seine TWG Daten

Wenn Du TWG wie auf der Installationsseite beschrieben installierst, läuft es sehr schnell auf allen Systemen. TWG selbst ist abgesichert gegen externe Attacken (wie Cross-Site Scripting) weil alle Eingabe Parameter überprüft werden und nur korrekte Daten verarbeitet werden.
Jedoch können Eure Daten wie Beschreibungen, Kommentare und Zähler ausgelesen werden, wenn man den Dateinamen weis (was kein wirkliches Problem ist, da die Daten sowieso auf der Webseite dargestellt werden ;)). Ich habe ein paar index.htm Seiten in allen Verzeichnissen beigefügt, welche eine Verzeichnisauflistung verhindern. Wenn Du jedoch Deine Daten vor dem auslesen schützen willst, lese weiter. Die meisten dieser Einstellungen (3-6) sind für die erweiterten Funktionen und werden gesetzt wenn Du diese verwendest:

  1. Nutze die .htaccess Datei aus der htaccess.zip im Hauptordner der TWG. Dies schützt alle xml und txt Dateien vor direktem Zugriff aus dem Internet. Es ist Dir freigestellt dort weitere Erweiterungen einzutragen. Wenn Du keine .htaccess Datei nutzen kannst setzte das counter und xml Verzeichnis mit chmod (in Deinem Ftp Programm) auf 700 (770 wenn zu sehr eingeschränkt, 777 wenn zu sehr eingeschränkt). Niemand muss diese Verzeichnisse von außerhalb lesen können.
  2. Setze das cache Verzeichnis mit chmod auf 744 (774 wenn zu sehr eingeschränkt, 777 wenn zu sehr eingeschränkt). Das cache Verzeichnis muss von überall erreichbar, aber nicht auflistbar sein! Platziere dort keine .htaccess Datei, da TWG direkt in dieses Verzeichnis verlinkt!
  3. Wenn Du private Ordner nutzt: Wenn Du private Ordner nutzt verwende die .htaccess von 1. oder ändere den Namen der Passwort Datei (config.php: $password_file) auf .htprivate (".ht" ist der wichtige Teil!). Wenn Du ein Unix/Linux System mit einem Apache Webserver nutzt, sind alle mit .ht beginnenden Dateien standardmäßig geschützt. Du kannst jede Erweiterung verwenden wobei der Webserver diese Dateien nicht darstellen wird!
  4. Wenn Du private Ordner nutzt oder den Download von Bildern unterbinden willst und Du möchtest dass 100%ig niemand auf die Bilder direkt zugreifen kann, ändere die Zugriffsrechte des Bildverzeichnisses. Setze den pictures Ordner und alle Unterordner auf 770 ODER Du platzierst eine .htaccess Datei in diese Ordner. Nutze die .htaccess aus dem inc Ordner. Diese verbietet jeden Zugriff aus dem Web. $enable_direct_download kann auf false gesetzt werden, damit alle Downloads durch den Aufruf von image.php stattfinden!
    Um die Bilder im cache Ordner zu schützen muss man noch $disable_direct_thumbs_access=true; und $use_direct_small=false; setzen.Dann kann man den cache Ordner wie den pictures Ordner mit einer .htaccess schützen.
  5. Wenn Du e-mail Benachrichtigungen nutzt: Stelle sicher das die e-mail Verschlüsselung in der config.php aktiviert ist - encrypt_emails=true. Dies ist NICHT Standard. Bitte ändere den Verschlüsselungschlüssel $encrypt_emails_key. Wenn Du diesen nicht änderst kann jeder der TWG herunterlädt mit dem Standardschlüssel Deine emails durch debuggen der TWG entschlüsseln!
  6. Wenn Du externes Login nutzt: Stelle sicher dass das externe Login in der config.php deaktviert ist - $enable_external_privategal_login=false. Dies ist Standard. Aktiviere dies nur wenn Du es benötigst und Du verschlüsselte Passwörter nutzt:
    Setze den Eintrag $encrypt_passwords auf true. Wähle eine Verschlüsselungsmethode SHA1 oder SHA256 (sicherer aber langsamer) mit $use_sha1_for_password. SHA1 ist ausreichend wenn Du PHP > 4.3 installiert hast. Ansonsten wird SHA256 der TWG benutzt. Rufe die password.php aus dem Hauptverzeichnis auf um Passwörter zu erzeugen! Du musst dieses Passwort entweder in Deiner 'private.txt' Datei oder als Standardpasswort in der config.php bei $privatepassword eintragen. Nutze das verschlüsselte Passwort nur für $privatepassword - die anderen sind nicht verschlüsselt wenn Du $encrypt_passwords auf true setzt!
  7. Das war's :).

Wenn Du andere Einstellungen kennst um TWG sicherer zu machen, lasse es mich wissen.

 2. How to include TWG into php sites or a cms system (like mambo, phpnuke).

It is now possible to integrate TWG into existing php sites in different ways: You could include TWG by using an extra frame or an iframe. If you want to do this please check the example_i_frame_include.htm. This is the way that works for sure ;).

1. iframe include

All browser handle iframe include a little bit different and I want to tell you the problems that can show up:
If you include TWG in an iframe it's normally shown very nice in Firefox (1.x, 2.x, 3.x), Opera (8.x, 9.x) and Safari. You can simply use e.g.

<td width="100%"><iframe name="twg" FRAMEBORDER="0" src="twg/index.php" width="100%" height="100%"></iframe></td>

to include TWG in a table cell of you page. Scrollbars are shown nice and work well.

Check your gallery now. If it's displaying fine in all browsers don't continue to read because it might only confuses you ;). I like to have it perfect. If you like it too continue to read ;).

The problems does occur with IE (6.x and 7). For an optimal integration only scrollbars should be shown if they are really needed. And here IE has a problem. He reserves the space for the scrollbar and this is not very nice. And here is the tradeoff: You can force IE to either

  • Reserve the scrollbar area (in the background color of your site) and handle scrolling very nice.
  • Don't reserve the scrollbar area but then the scrolling is not really working anymore because the content is not updated and only a blank area is shown.

But there are solutions ;):

If you have setup your gallery that everything (detail page - top x...) fits into the iframe (=iframe is big enough) then you should do the following:

  1. Add scrolling="no" to your iframe - this is the easiest way and if look optimal in all browsers!

If you want that your iframe can scroll properly and everything looks perfect you have to do the following:

  1. Set iframe include to false ($iframe_include in the my_config.php or in the administration) = default
  2. The color of the reserved space could be different and can be seen. Set the following styles (in your my_style.css or the <skin>.css):
    1. body.twg { background-color to the background color of your site - transparent is a color too if you like the background of your site!
    2. td.twg_info { background-color to the color you like in the inner area - transparent is a color too if you like the background of your site!
    3. Don't use a background image inside TWG - set allowtransparency="true" in your iframe and use the background of your site because you cannot set the color of the reserved space seperately.
    4. I always recommend to make it in the background color of your website. Then no one will see it. And turn the border off - gives you alittle bit more space for the images.
  3. Check the layout in the iframe if ie. As you see you now have a ~ 15px space on the left side which IE reserves for the scrollbar. If you have done the color corrections it should be in the background of your site. If this does not bother you - fine. If it does bother you: Create a file called left.htm in the main folder of TWG and copy the following into it: <?php if ($msie) echo '&nbsp;&nbsp;&nbsp;'; ?> or make a 15px margin in the left side of the iframe. Then the margin is equal on both sides.

I hope this made everything a little bit clearer and does not confuse you even more (please blame Microsoft for not sticking to the w3c standard).
If you think this howto can be improved - please tell me.

2. php include

TWG can be included directly in existing php sites or cms systems. If you want to use 'include index.php' (see example_php_include.php) you have to set the following 2 settings:

  • $php_include=true;
  • $install_dir="<relative (!) path to the twg installation>/"; - The / at the end is important! If you e.g. have twg installed in the directory twg relative to your mina file then use $install_dir="twg/". If you have installed TWG in a parallel directoy you have e.g. to use $install_dir="../twg/".

All parameters that don't belong to TWG are added again to the url! If your main php file (e.g. gallery.php) has the parameter &id=3 this parameter is added to all links of TWG and all links from TWG use gallery.php instead index.php. If you open the gallery in a new window the standalone modus ia activated again!
If some parameters should not be added to a link in TWG enter these parameters in the config.php: $ignore_parameter

Please note:

  • If the gallery does not work properly most of the time the doctype is the problem - please remove the one from the calling page and use
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    If the cmotion gallery on the image page does not work: this is the problem. If you have spaces in the collage in Firefox: this is the problem ;)
  • Chck the iframes. If they are not at the right position the Javascript cannot analyse your design right. There are the following things you can do:
    • If you use div's please make sure that you have a simple surrounding div with width,height=100%
    • Add style="padding:0;margin:0;" to your body tag. IE does not return this values properly and a small offset will exist.
    • You can adjust the position of the iframes from version 1.5.3 with the parameters $iframe_xoffset and $iframe_yoffset in the config. This only works fine if you have a layout that is not browser size dependant.
    • If this does not help: set $disable_frame_adjustment_ie=true. Then the iframes are not automatically positioned. If this is the case the language dropdown is at the wrong position. You can either set $show_languages_as_dropdown=false; and remove the languages you don't like from the language folder or modify the offset of the dropdown with $lang_xpos_lang_dropdown which you find at the bottom of each language file because for each language this will be different.
  • Round corners are not supported because IE does not support this properly in this mode. I maybe try to get this to work in one of the next versions! Right now round corners are disabled automatically if $php_include=true;
  • If the bottom part seems to be cut of, your surrounding environment has most likely set a table to a fixed height but no height in the cell where the TWG is integrated. Please add the missing height (in pixel not %) to this <td> in your template.
  • Check the text in $default_text and $email_bottomtext - there is a %s where the link to the gallery is inserted by default. If you use php include this link is wrong (admin does not know your main page) - you have to insert the right link instead of the %s
  • If you use a char set: use UTF-8 to have a consistent system. Since TWG 1.6 all language files and used char sets are in UTF-8! If you want to change the charset to TWG please change it in the language files - it's definded at the very top.
  • If you use php include no body tags are written by TWG - This means no style from the body (background!) is used! The background from your main site is used then!

I have only done basic tests on cms systems - if you have any problems - please let me know !

1.4.1 has an enhanced keyboard navigation (t opens title, c opens comments ... - see user help). If you include TWG and you have an input filed on the page too you should set $disable_enhanced_keybord_navigation to true.

 3. Wie man eigenen HTML Code in die TWG Galerie integrieren kann

Du kannst HTML in viele Bereiche von TWG einfügen. Wenn Du TWG nicht in eine bestehende Webseite integrieren möchtest, aber zusätzlich zum Beispiel einen Header oder Footer haben möchtest, kannst Du die unten beschriebenen Dateien benutzen.

Dateiname Ausdruck Speicherort Beschreibung
header.htm twg_headerhtml TWG Ordner Wird im Kopfbereich eingefügt
top.htm twg_tophtml TWG Ordner Wird direkt über der TWG eingefügt (vor TWG 1.7.8 top.htm war header.htm - Seht unten in der Übersicht was der Unterschied ist!).
bootom.htm twg_bottomhtml TWG Ordner Wird direkt unter der TWG eingefügt (vor TWG 1.7.8 bootom.htm war footer.htm - Seht unten in der Übersicht was der Unterschied ist!).
footer.htm twg_footerhtml TWG Ordner Wird im Fussbereich eingefügt
left.htm twg_left TWG Ordner Wird im linken Bereich eingefügt. $left_htm_width definiert die Spaltenbreite
right.htm twg_right TWG Ordner Wird im rechten Bereich eingefügt.
overview.htm twg_overviewhtml TWG Ordner Wird unter den Alben auf der Hauptseite eingefügt
thumb.htm twg_thumbhtml TWG Ordner Wird im Bereich unter den Vorschaubildern auf der Vorschauseite eingefügt. $thumbnail_offset_y definiert die Höhe des Inhalts, der eingefügt werden soll. Damit arbeitet die automatische Erkennung der Vorschau perfekt - ;).
image.htm twg_imagehtml TWG Ordner Wird auf der Bilderseite unter dem Detailbild eingefügt
topx.htm twg_overviewhtml TWG Ordner Wird auf der TopX Seite unter der Vorschau eingefügt
thumb.htm twg_thumbhtml subfolders Thumb.htm kann im Hauptordner und jedem anderen Ordner eingefügt werden. Damit kann zum Beispiel ein Link auf einen Ordner oder ein Download generiert werden.

Übersicht:

header.htm
left.htm
top.htm
right.htm




overview.htm, thumb.htm, image.htm, topx.htm
bottom.htm
footer.htm

TWG folder is where the index.php and config.php is located. All files are included in a <tr><td> </td></tr> therefore this are no compete pages! Only put the stuff in there you want to display!

ALL files can be language dependent: E.g. overview_de.htm, thumb_de.htm, topx_de.htm, image_de.htm

Since TWG 1.6: Please store all your text files in UTF-8! Then special characters are displayed properly!

 4. How to setup a random image of topx image on a different site/frame

You can setup a random or topx image on an other web site which links to your gallery. The following two lines show the image and the link tag:

The image:
<img src="image.php?twg_album=xxx&twg_random=1&twg_type=random&twg_random_size=200">

The link with image:
<a href ='index.php?twg_random=1'>
<img src="image.php?twg_album=xxx|zzz&twg_random=1&twg_type=random&twg_random_size=200">
</a>

  • twg_type - you can set this value to random or top. random shows a random image, top shows the most viewed image of a folder (or the subtree if twg_random_subdir=true)
  • twg_album - Change the album to the album where the image should be picked! (has to be url encoded - go inside the gallery and copy it from the url there!). you can add several albums by separating them with an |
  • twg_random - Number has to be unique for one page (it is possible to have more than one random image on a page!) - simply start with one and count ... - read the special setting if you set twg_type=top
  • twg_random_size - Size of the image max x or max y value! - please keep in mind that vertical or horizontal images could be chosen and therefore your layout of the page where the image is show should be able to show this nicely.
  • twg_random_subdir=true - All unprotected albums below twg_album are integrated.
  • twg_random_display=true - New 1.8 - If you add this to the link (href='...') with index.php then the link does go directly to the displayed image and not to the album. If you use image.php the original image is opened directly. This can e.g. be used to open the random image in a lightbox. image.php can only be used if twg_random_display=true!
    This parameter is set at the 'Example random image' while at the 'Example TopX' it is not.

You have to add the path to the image.php and index.php to the example e.g. http://www.mygallery.com/tinywebgallery/index.php

NEW 1.6: TWG can now go recursively through your directories! Simply add &twg_random_subdir=true to the img part e.g.:

<img src="image.php?twg_album=&twg_random=1&twg_type=random&twg_random_size=200&twg_random_subdir=true">

Then you don't even have to specify an album. Without album the random images starts from the root! Please note: Only unprotected galleries are included in the search.

NEW 1.7: You can show the most viewed images as well now! set twg_type=top in the url above. If you use twg_random=1 then the most viewed image of the folder is shown. twg_random=2 shows the 2nd most viewed image and so on ;). You should use &twg_random_subdir=true to get the most viewed image of a sub tree and not only of this folder. Please only specify one folder at twg_album. If you leave twg_album empty then the most viewed image of the whole site is shown!
If you would like to show the most viewed images of e.g. 2 different folders on one external site please set twg_random to the value of twg_album. Then always the most viewed image of each folder is picked.

Example random image
Example TopX - most views

 

 5. Wie man ein Bild für ein Album definiert

Wenn Du keine Bilder im Album (oder nur in anderen Alben) hast oder nicht möchtest, dass ein Bild aus dem Album angezeigt wird, kannst ein Bild für jedes Album anlegen. Man brauchst nur ein beliebiges PNG Bild, das man 'folder.png' nennst in den Album-Ordner zu legen. Ein JPG Bild benennst man einfach von .jpg nach .png um.
Wichtig: Es wird hierbei die Originalgröße der Bilder verwendet! Das macht es zum Beispiel möglich grosse Bilder auf der Haupt-Albumseite und kleinere auf den Unter-Albumseiten darzustellen. Wenn die Alben geschützt sind muss man 'private.pnp' statt 'folder.png' verwenden.

 6. How to set a gallery name different from the folder name (e.g. for enhanced sorting)

You can change the name that is displayed for a directory. By default the directory name is used. But sometimes it makes sense to change this:

  • You want to sort the directories in a way you like and add e.g. 1,2,3 at each directory to get the sorting you like but that does not look good.
  • You want to use a image or a different font for a folder

Create a file named foldername.txt in the folder you want a different folder name. Then put the text or html for an image into this file. The text can be any valid HTML and is inserted in a <span></span>. See the demo 1 where I have set an image for a folder!

The name can be language dependant as well! By adding the language to the filename you can provide extra translations. e.g. for German: foldername.txt -> foldername_de.txt.

Please note: Please use the html representation in the files for special characters: ä -> &auml;

Since 1.6 you can simply use a sorting prefix for the directory name on your hard disk as well. If you use a prefix in the following format then this is automatically removed: 001___ 002___ .... Important is that the prefix has 6 characters and the chars 4,5,6 are underscores. You don't need a foldername.txt if this is enough for you.

Since 1.7.4 you can use a file called config_sort.php. This makes it possible to sort a sub directory different then the rest. You only can place the following parameters to this file: $sort_images_ascending, $sort_by_date, $sort_by_filedate, $sort_albums, $sort_albums_ascending, $sort_album_by_date. This file works for image sorting as well. Don't use a custom folder config.php for sorting because settings in there would overwrite settings global during caching. If you use private galleries you have create a config_sort.php in the pictures folder as well. There you store the sorting of the main folder!

Since TWG 1.6: Please store all your text files in UTF-8! Then special characters are displayed properly!

 7. How to add a folder description (shown below the gallery name) or an image "header"

To create an additional text below the bold folder name you have to create a file named folder.txt in the folder the text should appear. Then put the text into this file. The text can be any valid HTML and is inserted in a <span></span>. The style class is twg_folderdescription and can be found in the style.css. The folder description can be shown on the image page as well. By turning the switch $enable_dir_description_on_image to true this description is shown there as well! For different text on the image page image.txt can be used - see howto 28.

The description can be language dependent! By adding the language to the filename you can provide extra translations. e.g. for German: folder.txt -> folder_de.txt.

If you use language dependant versions this is only shown if the language can be detected. If the language version does not exists the normal description is used - if this is not present nothing is displayed!

Please note: Please use the html representation in the description files for special characters: ä -> &auml;

Since TWG 1.6: Please store all your text files in UTF-8! Then special characters are displayed properly!

 8. How to create a language file

  • Since TWG 1.8: TWG is now using sprites which means that one image has all flags and not each image is loaded separately.
    1. Translate one of the existing language files to your language and save it as language/language_<lang>php. Then copy the entires in language_default.php to your language file and translate them too.
    2. Open language/language_text.php and add your language the same way as the other languages are defined.
    3. Now you need a flag in the size 16x10 and add this with an image program at the end of language_flags.gif in the black area. Then add your new flag to language_flags.css the same way the others are defined. Simply add 16 to the position there.
      If you have any problems with this please send me the translated language files. I will integrate it and send you everything back.
  • Before TWG 1.8:
    To add a new language you have to translate one of the existing language file (e. g. language/language_de.php - the name of the needed flag is language/language_de.gif) and copy it in the 'language' directory (+ the flag). If you provide a file language/language_<lang>.txt you can specify the tooltip. Please write the language in English and then in the language of the country in Brackets e.g. Germany (Deutschland). If you need a flag - please send me an e-mail.

Please send me the language files if you want to support TWG. Please make sure to use the latest version of TWG and "Welcome to the TinyWebGallery" as title. Please make sure to translate the latest version of a language file.

Since TWG 1.6: Please store all your text files in UTF-8! Then special characters are displayed properly!
Use $charset = "UTF-8"; for the language file!

Please note:
Please use the html representation in the language files for special characters: ä -> &auml; I use a nice macro "HTML Encoder" for Textpad. Just google for it if you want to save yourself some time ;). Since TWG 1.6 this is not really needed anymore because UTF-8 is used almost everywhere.

 9. How to change colors of TWG

All main style settings are located in the style.css. This file is well documented. Every area has its own part in the style sheet. If you change or insert a color and nothing is changing be sure that you define the settings for a link as well! To search for a certain style install the web developer toolbar extension for Firefox!

The color manager in the TWG Admin should help you to configure the colors of TWG. You can

  • Convert hex in decimal colors and the other way around
  • Select a color from the color map and click on the preview on the right side to see how it looks
  • Create a style sheet from your setup and save it al my_style.css

You can select transparent as color for the background of your areas. I have provided a couple of example background images that become visible if you click on transparent and then on one of the background areas of the preview. You have to provide your own background images! Read how-to 22 and 25 for some help.
After creating the style sheet you have to copy the content and save if like described before!

If you create the style sheet with the color manager you get some additional styles for the hovering effect if you use a background color - Please read how-to 27 for details about this!

I recommend not to make any changes in the style.css. Save this settings in the my_style.css.
This makes it easier for you to keep track of your changes and if you update TWG. All changes in my_style do override the settings in style.css. Remove this file if you don't use it because otherwise its transferred to the server! The settings of my_style.css are valid for all galleries.
To change the background and the color of the iframes (login, comments ...) go to i_frame/iframe.css.
Please note - you can only have one style of the iframes. If you use different styles for different folders please select colors that fit to all of them!

Please read how-to 22 if you only want to change the background of a gallery. The borders of the gallery are in the framestyle.css!

Summary - This is the order the styles are loaded:

  • style.css (main folder) in the main folder is the default style sheet.
  • framestyle.css (main folder) is the style sheet where the right/left/bottom frame colors are defined.
  • my_style.css (main folder) is the style sheet where you can put your changes to style.css
  • If you select a skin (see howto 25) then this style sheet is loaded now.
  • style.css (album folders) is the style sheet which can be different for each folder. You can define a different style for each folder! If you use different backgrounds you should also create a config.php in this folder where you define the backgrounds of this folder - see howto 25.

If a album folder is read protected from the web you have to use a different way: It is also possible to place the style sheet in the cache folder (and sometimes mandatory if you have directory names with characters that have to be encoded). Create a style sheet named <url encoded folder name>_style.css. If you are using recursive folders the folders have to be separated with an _. The easiest way to name the file is to go into the cache folder and look for the folder name at an image (It is url encoded!: e.g. Usa (+ü$§!%&-;) -> Usa+%28%2B%FC%24%A7%21%25%26-%3B%29) . Copy the folder name part and add the _style.css to the style sheet name.

 10. Wie man die PHP Version seines Servers feststellt und, ob dieser TWG unterstützt

Es gibt eine Datei 'info.php' im Hauptordner von TWG. Wenn Du diese Datei statt der 'index.php' im Browser aufrufst, prüft TWG die Anforderungen und gibt sie aus. Das hilft Dir, falls TWG bei Dir nicht richtig läuft oder nicht alle Eigenschaften zur Verfügung stehen. Bei den TWG HowTo /FAQ findest Du Erläuterungen und einige bereits gelöste Probleme dazu. In der TWG Administration (unter 'Info') sind weitere Hilfen, wie zum Beispiel die notwendigen Datei und Ordner Attribute zu finden.

 11. Wie verlinkt man direkt in eine mit Kennwort geschützte Galerie

Es ist möglich in eine Galerie oder ein einzelnes Bild zu verlinken. Kopiere einfach den Link in der URL! Die funktioniert aber nicht mit Kennwort geschützten Galerien! Um direkt in einen geschützten Ordner zu verlinken, kopiere die URL von der Galerie zu der Du verlinken willst. Du musst Dich anmelden um diese URL zu erhalten! Danach musst Du folgenden Parameter an die URL anhägen: &twg_private_login=<Galerie Kennwort> . Bitte beachte: das Kennwort ist nicht verschlüsselt. Dieses Feature wird zu einer der nächsten Administration hinzugefügt (hoffe ich ;)). Wenn Du verschlüsselte Kennwörter nutzt (siehe How-To 1.7) musst Du das verschlüsselte Kennwort anhängen!!
Der Parameter $enable_external_privategal_login muss auf true gesetzt werden um diese Art des Logins zu aktivieren. Standard ist false!

 12. Wie schützt man eine Galerie (und wie setzt man mehrere Passwörter für eine Galerie und warum ;))

Um eine Galerie mit einem Passwort zu schützen musst Du eine leere Datei mit dem Namen 'private.txt' (oder was auch immer Du als Passwort Datei in der Konfiguration definiert hast) in dem zu schützenden Verzeichnis erstellen. Wenn die Datei leer ist wird das Passwort aus der Konfiguration ($privatepassword) verwendet. Wenn Du eine Galerie mit einem anderen Passwort schützen möchtest, musst Du das Passwort in die 'private.txt' datei eintragen.

Bitte lest howto 1 um eure Daten vor direktem Zugriff zu schützen!

Dies ist die Beschreibung aus der config.php. Ich möchte ein paar mehr Kommentare zu diesem Punkt geben, da mehrere Leute danach fragten:

  • Der Name der Passwort Datei kann in der config.php ($password_file) geändert werden oder frage Deinen Galerie Administrator ob er dies geändert hat (eventuell aus Sicherheitsgründen - siehe how-to 1
  • Passwörter können verschlüsselt sein - siehe how-to 1 für Details!
  • Wichtig: private.txt Dateien wirken NICHT rekursiv (bis zu 1.7.4)- dies bedeutet dass Du eine private.txt Datei in alle Ordner platzieren musst, welche Du schützen willst! Dies wurde in TWG 1.7.5 geändert! Nun WIRKT die private.txt rekursiv!

Du kannst verschiedene Passwörter für jedes Verzeicnis verwenden. Erstelle einfach eine Passwort Datei und trenne die unterschiedlichen Passwörter mit einem ','. z.B. test,test2,test3. Stelle sicher dass keine Leerzeichen zwischen den Kommas und Passwörtern sind. Wenn $encrypt_passwords=true ist musst Du das generierte Passwort nutzen!

Durch die Verwendung von mehreren Passwörtern kannst Du Freunden Zugriff auf einige Verzeichnisse geben und z.B. Deiner Familie Zugriff auf andere Verzeichnisse. Der Vorteil ist nun das zwei Gruppen auf dieselben Verzeichnisse zugreifen können! Oder Du kannst alle Galerien mit einer Art "Super Passwort" schützen und ein paar Verzeichnisse mit einem 2ten Passwort um nur Zugriff auf diesen Bereich zu gewähren.

Bitte beachten: Wenn ihr Galerien mit einem Passwort schützt verwendet bitte nicht das Popup auf der Detailseite, da der dort verwendete Link nicht geschützt ist und kopiert werden könnte. Verwendet bitte den Fullscreen Modus oder die Lightbox wenn eure Bilder 100% sicher sein müssen.

Ordner Bild für geschützte Galerien

Du kannst auch Dein individuelles Bild für eine mit einen Passwort geschützte Galerie verwenden. Erstelle eine Datei mit dem Namen private.png und platziere es in dem geschützten Ordner. Die Größe sollte der in der config.php eingetragenen entsprechen (Standard ist 120 x 120). Seit 1.6 wird ein Bild automatisch erzeugt wenn $autogenerate_private_png = true; (=Standard) gesetzt ist. Die private.png Dateien werden immer von den automatisch erzeugten überschrieben!
Wichtig: Wenn Du eine andere als in der config.php angegebene Größe verwendest wird die Original Größe benutzt - Dies begründet sich darin, daß Du individuelle Ordner Bilder nutzen kannst, welche das gleiche Verhalten haben.

Neu 1.7: Du kannst eine private.txt im Hauptordner verwenden! Dann erscheint ein globales Login Fenster.
Neu 1.7.5: private.txt wirkt nun rekursiv und schützt alle Unterordner mit.

Neu 1.7.6: Nutzer basierte Galerien

Seit 1.7.6 ist es möglich zu einem anderen Schutzmodus zu wechseln. Um eine geschützte Galerie zu betreten nutzt Du dann Dein TWG Login/Passwort. In der private.txt trägst Du die Login(s) ein, welche Zugriff auf dieses Album haben sollen.
Die folgenden zwei Parameter sind verfügbar:

  • $user_login_mode - Wenn dies auf true gesetzt ist, werden die Nutzer basiert geschützten Galerien aktiviert. Wenn Du Dich anmeldest werden alle Galerien freigegeben für die dieses Login angebenen wurde. Jeder Nutzer welcher Zugriff bekommen soll benötigt einen Account.
  • $user_login_mode_hide_gal - Wenn dies auf true gesetzt ist, werden geschützte Galerien komplett versteckt solange man nicht angemeldet ist.

Warum gibt es nun 2 Arten? Es ist abhängig davon, was Du benötigst und bevorzugst.
Dies sind die Vor- und Nachteile der Nutzer basiert geschützten Galerien:

+ Deine Nutzer haben alle nur jeweils ein Login um auf all Ihre Galerien zuzugreifen
+ Geschützte Galerien sind komplett versteckt, das die Anmeldung durch das normale Login erfolgt
+ Du musst keine Passwörter mit e-mails zu Deinen Nutzern verschickena (Irgendwie musst Du sie dennoch informieren)
+ Du kannst einen einzelnen Nutzer deaktivieren indem dessen Login entfernt wird. Das entfernen des Passwortes in dem anderen Modus würde alle anderen Nutzer ebendfalls betreffen.
- Du musst alle Nutzer welche Zugriff bekommen sollen in die private.txt eintragen. Im Passwort Modus hast Du nur ein Kennwort in dieser Datei.
- Meiner Meinung nach haben die Nutzer basiert geschützten Galerien ein größeren Administrationsaufwand.
- Du benötigst einen Account für jeden Nutzer.

Nun wähle den Modus welchen Du bevorzugst ...

 

 13. How to configure watermarks and text on an image

The description at the watermark section is a little bit short in the config.php file. Therefore I will give some additional explanations:

  • Read the watermark section in the config.php! There are all settings available. The important ones are already in the administration (in my_config.php too if you don't use the backend)
  • Text on images and watermarks can be set independent of each other - you can use none, one or both.
  • Make sure that you have set $enable_direct_download=false if you want some watermarks on the originals!
  • If you use a random image: The watermark is only printed if the size is < 200 px and the watermark fits on the image!
  • The text is always on the left bottom corner - the watermark image can have 9 positions!
  • Your watermark image should have a solid outline and the background color should surround this for best results. See the buttons/watermark.png I use for the demo.

You can use individual watermarks for each folder! You can do this by creating the following files:

  • watermark.txt - The watermark text
  • watermark.png - The watermark image for the image view
  • watermark_big.png - The watermark image for the originals

PLEASE NOTE: There is a flag called $resize_only_if_too_big - If you have images smaller than the small_pic_size and this flag to true no small images are created and the originals are used instead! As a consequence no watermarks are printed on these images. You have either to add the watermark by yourself or set this flag to false. But then you images are enlarged to the small picture size.

IMPORTANT: If you make any changes to the watermarks you have to delete the images from the cache directory because the watermarks are already added to the thumbs and small images!

Since TWG 1.6: Please store all your text files in UTF-8! Then special characters are displayed properly!

 14. How to track errors if TWG does not work on your system.

  1. Check if you done all the installation steps (rights and so on...).
  2. Check the FAQ below!
  3. Check the debug file - The location is defined in the config.php and is counter/_mydebug.out by default. Many problems are reported there.
  4. Delete the content of the cache, xml and counter directory
  5. Call the file info.php in the TWG main directory or in the administration - on the top are some internal twg tests. Maybe this helps already :). Below is the php_info call where your php info are show. Interesting are the installed modules like gd (with freetype), and memory limits (see 1st faq). If you get errors in the _mydebug.out: most of the time the php configuration/version makes the problem!
  6. Check the forum
  7. If you have problems with the flash! Read the FAQ for the flash in the TWG Flash Uploader section - There almost all problems are covered!
  8. Contact me. Via forum is preferred because if I answer your problem, there is maybe someone else get help there too. But still feel free to contact me directly!

 15. How to change or extend the smilies

TWG shows smilies in comments and captions if the flag $enable_smily_support is set in config.php (=default).
I have only provided a couple of smilies. But you can add your own set or extend the existing set by yourself. Maybe you want to change their size if you changed some fonts ...

The smilies are in the directory <installdir>/buttons/smilies.
All smilies which are copied in this directory are available in TWG. TWG reads the whole directory and matches the filenames with the characters you normally would enter for a smilie - e.g. ;) -> ;).gif. There are some characters that are not allowed on he file system which are heavily used. I have mapped the following:

: -> a
\ -> b
/ -> c
* -> d

e.g. :) is the file a).gif !

If you have a nice set of smilies and want to share them with others please sent them to me. Thanks.

 16. Linking to a web site instead of downloading a file

If you have some pictures e.g. from a remote site and want to link to this site if someone wants to download the image you can create a file named link.txt in this directory (Check the Beauties folder of the demo!). The file has to contain the starting <a> tag with the id='adefaultslide' . e.g.

<a href="<your url>" id='adefaultslide'>

The link is valid for all images of this directory! - please don't forget the id - javascript will fail if this is missing!

 17. How to use a directory based config.php

You can use a config.php in every folder! This makes is possible to have different configurations in every folder. I do this for all the demo folders. You can even use language dependant configurations like config_de.php

 18. How to enable e-mail notification

By default e-mail notification is turned off and sending of emails is disabled. In the config file are two main parameters you have to change: $show_email_notification and $enable_email_sending!

To configure your e-mail set the $show_email_notification and $enable_email_sending to true. If you go to the overview page you can now register and un register on the right upper menu.
E-mail can be sent from the TWG Admin!

Now set the config.php to the following settings:
$encrypt_emails = false ; // for testing!
$youremail="<your e-mail>"; - This is the from e-mail address of the registration!
$default_subject, $default_text and $email_bottomtext are the defaults for the "send emails" screen. You can change them how you like.

Register yourself on the web site and check if you get the registration e-mail - Then login and send a notification message!
go to the counter/subscriber.xml - your e-mail address should be in there. Delete this file and set the following switches in the config.php:
$encrypt_emails=true;
$encrypt_emails_key="A random string- the longer the better - NO special characters here";

Make sure that the counter folder and the subscriber.xml cannot be read from the web (chmod 700 or 770 if possible). You find more information about the parameters on the installation page or in the config.php. If your php does require that 777 is used please use a .htaccess file to protect your folder. The minimum protection is to enable encryption for the stored emails!

You can be notified if someone enters a comment or vote for an image. Enter the e-mail where the notification should be sent to and enable the comment or rating notification. One mail is send for each entered comment or vote!

 19. How to enable download of a whole directory

You can provide a .zip file that the user can download instead of viewing/downloading a single image. Create a .zip file with the images you want your users to download. Store it in the directory where the images are located. The file name are the directory names with .zip as extension. e.g. Mexico -> Mexico.zip. Please use folder names without special characters. Some web servers don't allow direct links to this kind of files.
Important: If you are in a subdirectory like pictures/Mexico/Palenque the name of the zip/txt file is not the last directory only. They have to be connected with an _. In the example here this would be Mexico_Palenque.zip!

You have to activate the download in the config.php (default is enabled). If no archive can be found the normal settings for viewing/downloading of an image is used.

If you don't have that much space on your web space (like on funpic where the file limit is only 1 MB) you can create a file <foldername>.txt and put the url to your zip file in there. In the example this would be Mexico.zip. You don't need the Mexico.zip anymore!

 20. How to link to pictures in a remote http directory

This a really nice feature. You can link to images which are located on a remote web server. You have to have two things:

  • The images are located on a remote http server where the directory can be listed
  • fsocksopen() has to be enabled on your php installation (www.funpic.de does not - therefore I cannot show this in the demo).

The directory structure of the images has to be on the local web server. Inside the directory have to specify a file called url.txt where the url of the remote images are stored. Make sure that the url starts with http:// and ends with an /. Inside the local directory you can use all the other settings like described in how-to 17. Even private works but is not really save because the images on the remote directory have to be available (but if no one knows :) ...). This does not work recursive! If you have different directory levels on the remote server you have to create a url.txt for each directory. If you have a space in the path to the images please replace this with an %20. The best way is to navigate with the browser to the directory and copy the url. If you have black images then please check your image names - special characters do not work on all web server (on most they do not!).

e.g. http://<your domain>/<your directories>/

A running example can be found here:

http://mdempfle.md.funpic.de/pictures/2006_06_boas/

simply put it in an url.txt - You can try the url first in the browser. You should get a nice listing there.

The thumbnails and the small web images are still stored in the cache to provide a performance which is only slow at the first access and in full screen mode! Special characters are not supported to be displayed properly as captions because I don't know the encoding on the remote server.

You can now link different images galleries together into a single one :).

If you want to add custom configuration files like config.php or style.css: They have to be in the local directory where the url.txt is. Remote configuration files are not supported.

NEW 1.5 - Now you can provide a page by yourself (e.g. an index.htm in a folder) that has only full links (e.g. http://www.123.com/images/image1.jpg) to your images. TWG does detect full links and fetches the images from there. This makes it possible to link to any image you like and put them together in one directory!

NEW 1.7.7 - You can use relative links! This means you can link to directories that are not below the pictures directory. Enter the relative path in the url.txt. The path has to be relative to the main directory of TWG + you have to add one ../ in the front! Only images, external videos like yotube and flv are supported. WMP and DIVX are not supported!
Example: if TWG is installed in the directory /twg and your image folder is at /images/myalbum then you have to add ../../images/myalbum/ in url.txt.

 21. How to add a "home" link to the gallery and how to create independant sub galleries

NEW 1.7.0.6 - I have rewritten the implementation of root.txt to make it easier to handle! The howto is only valid from this version and above.

A root.txt can be used for 2 things:

  • Adding a "Home" link to a gallery - If you like to make a link back to e.g your homepage. This adds a new link on the left upper corner on the main page. Please add $lang_back_link to your language file. I only have added this to German and English. For all other languages a "home" icon is shown! Please add e.g. $lang_back_link = "Home |"; to your language file if you like! The root.txt has to contain a link like http:// ....
    The root.txt can be in 3 places:
    • main folder of TWG: The "Home | " link is added too ALL breadcrumbs!
    • pictures folder of TWG: The "Home | " link is only added to the album overview page
    • sub directory: The "Home | " link is added to the directory where the root.txt is + to all sub directories. This file can be empty too - please read the next part because here the file does a little bit more!
  • Create sub galleries that look like independant galleries - a root.txt defines your new root if you use this file in a sub directory. No path to upper directories are shown then. This file works now recursive. You don't have to define this in sub directories of you new root. If you lease the root.txt empty it simly looks like the root. If you add an URL in this file starting with http:// then the "Home" link is shown too!

New 1.7.6 - Multi root mode. If you only want to have independant galleries this is maybe the easier solution for you. See howto 52 for details.

 22. How to use a different background image for each folder

You can use an individual background image for each sub folder. Simply place a png called back.png in the folder where the background should be different. That's it.

If you want to save some disk space and make your gallery a little bit faster - use a jpg as background an rename it to png!
You can turn off background images in the config.php with $show_background_images. There is also a switch called $low_show_background_images that is used in low bandwidth mode. By default background images are not shown in low bandwidth mode.

Please note: TWG does dynamic resizing of your background images unless you disable this in the config - see $use_dynamic_background and $use_resized_background!

 23. How to upgrade from older versions from TWG

Deutsche Version siehe weiter unten!

If you want to upgrade from an older version than 1.4 you can still use your counters, captions and comments. But don't use any of the other files. Please make a clean install!

You should use a file called my_config.php! Put your changes you want to make in config.php into this file. They overwrite all variables from the config.php. I you want to upgrade to a new version or just want to install TWG somewhere else you have all your changes in one nice small file!

If you want to use the installer for updating please read how-to 31

UPDATE TO 1.6:

I recommend that you make a clean installation if you want to update to version 1.6!

  1. Backup my_config.php, my_style.css, the counter, xml and your pictures folder to the new installation. admin/.config/.htusers.php can be copied too but you should check your users afterward because TWG 1.6 has some new user rights that are set to default for old users.
  2. Install TWG 1.6
  3. Copy the saved files my_config.php, my_style.css, counter and pictures back to their old place. admin/.config/.htusers.php goes to admin/_config/.htusers.php. Open the files my_config.php and .htusers.php with a textedit and save them as UTF-8 files! (save as .. and then most editors give the option to store as utf-8. Or use the TWGXplorer - it stores files in utf-8 too.)
  4. The xml files have still the same format but special characters like äöü from xml's of version 1.5 are not encoded properly anymore. You have 3 choices:
    1. If you don't have many comments and/or captions recommend not to use these files and let TWG generate new ones!
    2. Only special characters are not displayed properly - If you don't have e.g. German chars like öäü. No problem
    3. If you want to keep the comments/captions you can change TWG back to the mode used in TWG 1.5! Open the language files your are using in the language folder and remove the $charset="utf-8"; at the top of each language file + change the encoding in the language files of admin/_lang to $GLOBALS["charset"] = "iso-8859-1";
      Then TWG works like it did in 1.5 - If you do this - please do not edit any files like folder.txt in the TWGXplorer because they are stored in UTF-8 (or use e.g. &uuml; instead of ü).
    if you choose 2 or 3 you can copy the xml files back in the xml folder.
  5. TWG 1.6 is now using UTF-8 everywhere. (if you have not changed it in 4-3)
    Please store all your text files (like folder.txt, foldername.txt) in UTF-8! Then special characters are displayed properly!
  6. Make sure to set the permissions of the files of the counter and xml folders that php can write them again - on most servers 777 is needed!

UTF-8 should be the preferred encoding because TWG is now available in over 20 languages and this is the only way to have a consistent system that works all over the world!

UPDATE 1.6 TO 1.7.x:

Here no big structure change was done! Backup my_config.php, my_style.css, admin/.config/.htusers.php, the counter, xml and your pictures folder to the new installation. Simply overwrite the other files! I have added a new function (edit/view) of files. There is a new right in the backend. Check if the permissions are still o.k.

On the download page is a patch file where you can simply overwrite all existing files!

Deutsch:

Da Updaten wohl sehr wichtig ist, gibts dieses howto auch mal in Deutsch ;). (Übersetzer für den Rest gesucht ;)).

Um auf 1.6 zu aktualisieren empfehle ich eine Neuinstallation, da sich auch Verzeichnisse geändert haben.

  1. Sichert my_config.php, my_style.css, admin/.config/.htusers.php das counter,xml und euer Bilderverzeichnis. Wenn ihr Änderungen in der config.php habt: Bitte in die my_config.php übernehmen bzw. im TWG Admin eintragen!
  2. Installiert TWG 1.6.
  3. Nun könnt ihr my_config.php, my_style.css, counter und pictures einfach wieder einspielen. admin/.config/.htusers.php kommt nach admin/_config/.htusers.php. Öffnet die beiden Dateien my_config.php und .htusers.php mit einem Textedit und speichert diese als UTF-8! (Speichern unter ... und dann bieten die meisten Editoren an, die Datei auch in UTF-8 zu speichern. Oder verwendet den TWGXploer - der speichert auch alle Dateien in UTF-8)
  4. Das xml Verzeichnis ist etwas komplizierter, da TWG jetzt überall utf-8 verwendet aber z.B. die Kommentare nicht mehr korrekt angezeigt werden, weil die nicht so gespeichert wurden.
    Ihr habt nun 3 Möglichkeiten:
    1. Schmeist eure alten Kommentare weg.
    2. Lebt damit, das Umlaute etwas unschön dargestellt werden.
    3. Stellt TWG wieder von UTF-8 auf den Stand von 1.5 zurück. Dafür müst ihr einfach aus den Sprachdateien (Verzeichnis language/), die ihr verwendet die Zeile
      $charset="utf-8"; entfernen + ändert das Encoding in den Sprachdateien in admin/_lang in $GLOBALS["charset"] = "iso-8859-1";
      Bitte verwendet jedoch nicht mehr den internen Editor vom TWG Admin, da dieser alles in utf-8 speichert.
    Bei 2 und 3 könnt ihr dann die gesicherten Dateien aus dem xml Verzeichnis wieder einspielen.
  5. Speichert Dateien wie folder.txt, foldername.txt in utf-8 - Die meisten Editoren bieten dies bei "Speichern unter " an.
  6. Setzt die Rechte in den Verzeichnissen counter und xml. Es müssen auch die Rechte der Dateien selbst so gesetzt werden, dass php diese wieder schreiben kann. 777 für alle Dateien reicht hier meistens ;).

Der Umstieg zu utf-8 war notwendig, das TWG jetzt in über 20 Sprachen verfügbar ist und nur so ein konsistentes System möglich ist.

UPDATE 1.6 nach 1.7.x:

In dieser Version gibt es keine Strukturänderungen. Sichert my_config.php, my_style.css, admin/.config/.htusers.php das counter, xml und euer Bilderverzeichnis. Überschreibt die anderen Dateien: Fertig! Es gibt ein neues Recht in der Administration (editieren von Textdateien). Bitte überprüft, ob die Rechte für euch weiterhin in Ordnung sind.

Auf der Downloadseite gibt es ein patch file, wo man einfach alle Dateien überschreiben kann.

 24. How to show more images in the DHTML thumbnail strip

If you scroll in the DHTML thumbnail strip you can set the numbers displayed at a time with $numberofpics.

But here I want to "remove" the green arrows at the end of the thumbnail strip. The problem here is that all pictures have to be loaded until the strip is moving. To decrease the waiting time I have set a limit of the number of images which are displayed with the following two parameters:

$cmotion_gallery_limit_ie=40;
$cmotion_gallery_limit_firefox=20;

This is the max number of images that are shown in one cmotion gallery. At the end there will be a small arrow to go to the next x images :).

But why are the numbers different? All browsers except IE don't allow to exchange images in this strip on the fly. Therefore an optimization for IE exists: $enable_optimize_cmotion_gallery_limit_ie. If you set this to true only 5 images are loaded each side and all the remaining ones are white first. Because IE does allow me to exchange these images I can do some nice background exchanging of this images - The big advantage: The gallery is moving if the 1st set of images is loaded.

Sometimes some images don't show up in the optimized version. Most of the time this is because the thumbnail had to be generated and was not available in time when IE requested it. If all thumbnails are created this is no problem anymore. (You can use the search to create all thumbnails quickly -> search -> file name -> . -> All). So if you want to reduce the green arrows: increase this values but not that a lot of data is loaded. There are low_ values for this two settings as well!

 25. How to use and make a skin!

Using a skin is easy. Look in the skins folder which .css files do exist and use the name of the css (without the .css) in the config.php at $skin like $skin="winter";. If you download one from the forum extract it into the skins folder and enter the skin name like before in the config.php - be sure not to create a subdirectory. The skin files have to be in the skins folder.

Please read how-to 9 about colors in TWG!

Making a skin is actually easy too ;). The skin can have 3 components:

  • a style sheet called <skin name>.css - This is like the my_style.css in the main folder - you can enter all styles TWG known in there! You can use the color manager to create one.
  • a php file called <skin name>.php - Here are the config.php settings for this skin. Normally you place here if you use dynamic background and the colors of the background of the slide show. You can also disable e.g. the optimized slide show because it does no look that good if you have a background image. Check the elements of he skin section - it makes sense to adopt them for a skin
  • a background image called <skin name>.jpg - This image has to be entered as the background image in the <skin name>.php. I recommend to use a resolution not larger then 1024x768 and set he dynamic background to true - otherwise the loading time for the background is maybe too long for some users. Like with the back.png the background image is not shown if a slow connection is detected - Therefore always define a background color too.

That's it. If you want to share your skin please check the "Skins" section in the forum. You should provide a screen shot and a zip file with the 3 files in it there. I have provided a template there how a entry in the skin section should look like.

Please don't use special characters or spaces for the skin names. Most web server don't work well with style sheets that contain those characters.

Since TWG 1.6: Please store all your text files in UTF-8! Then special characters are displayed properly!

 26. How to include different file formats like avi, mpg ...

You can now include other file formats like mpg, avi, mp3... into TWG like you can see in the demos. TWG does not include the files directly but can provide a download for this files.
If you want e.g. include an avi you have to do the following steps:

  1. Provide a jpg file that should be used as preview image for your avi file.
  2. Rename the two files that way that they have the same file name but with the extension jpg and avi. e.g. mymovie.jpg and mymovie.avi - don't use special characters here because TWG provides a direct download to this file and not all web servers work properly with special characters.
  3. Check the config.php if your extension is already supported: There is an array $other_file_formats where the file extension and an image is defined.
  4. The image that is defined is rendered a watermark on your preview image! You can add file formats or change the watermark in the buttons folder! You can select the position and the transparency of the watermark.
  5. Copy the two files to your web server ;).

If you change a watermark image or any setting for it you have to delete the cache! If you want to use embedded video or mp3 - please read howto 34

 27. How to configure the hover effects for ie properly

Internet Explorer 6 (IE 7 is fine) has a problem with the style for a transparent border. Therefore you have to provide a background color if you like a hover effect around the thumbs on the details page. By default the border color for Firefox is transparent and for Internet Explorer it is set to none! If you use a background image I recommend not o use the hover effect but otherwise you should set the following 4 styles!

td.navicon a img{
}

td.html_side_default a img{
}

td.html_side_left a img {
}

td.html_side_right a img{
}

to e.g.

td.navicon a img{
border: 1px solid #0000ff;
}

The color manager provide this settings in the css if you don't use transparent for the main body!

 28. How to use the image.txt

Please note:
image.txt is intended to add additional and maybe complex data to each image. It should NOT be used to create a caption below the image. TWG has the caption functionality for this. To add a simple caption below the image login in the right upper corner and on the image page you get the additional menu item 'Caption'. There you can easily enter a caption for each image. You can also add the captions right to your images and extreact them in TWG. Please read howto 38 about IPTC data for details.

The image.txt can be used to provide additional data in the detail page. Since 1.6 are 3 different "modes" possible. Before 1.6 only mode 1 and 2 are possible! Everything below works with the language dependent versions of the files as well - using e.g. image_de.txt, image_en.txt.

  1. Simple text include: The image.txt can be included in 3 positions: $image_txt_position does define it - Possible values are: "top","bottom" and "side". top and bottom are obvious. "side" does include an image.txt and an image2.txt. The image.txt is included on the left side - image2.txt is included on the right side! Be careful about the code you want to show. image.txt and image2.txt should "need" the same amount of space to keep the image centered! Furthermore I recommend to use a div with a fixed width because IE does sometimes bad rendering and moves the image to the left! The "exif" example on the Ajax demo shows this simple include with position = top.
  2. Include as php file: You can change the $image_file_extension in the config to php. Than you can include everything you like in this file - tables or even php code! You can get the image name by using the variable $image! This makes it possible e.g. to include a different file for each image or create a dynamic link to a shopping cart! The "USA 2005" folder from the Ajax demo shows how this is used. Only the english part uses this ways - the german description uses method 3. I only mixed this in the example - normally you only use method 2 or 3 ;).

    IMPORTANT:
    If you use image.php like in the examples folder you have to protect this file by the following line:
    defined( '_VALID_TWG' ) or die( 'Direct Access to this location is not allowed.' );
  3. Since 1.6 it is possible to use the image.txt like a properties file. This means you can have one line of text for each image in this file.
    e.g.
    image1.jpg=This is the description for image 1
    image2.jpg=This is the description for image 2

    To enable this mode you have to set $image_file_is_multi = true;
    The German (!) example "USA 2005" folder from the Ajax demo shows how this is used (config_de.php + image_de.php + image2_de.php - the php extension is only used because I mix mode 2 and 3 in the example - normally you can use txt files here!).

    PLEASE NOTE: If you only want to display a caption simply use the build in caption feature - login at the right upper corner - then you get a menu item call "Caption" and then you can enter a caption for each image! image.txt is intended to display additionally data like I did in the example!

Which mode to choose: If you only want to display a static text for all images - use mode 1. If you need the image name dynamically but the rest is static - use mode 2. If you want to display a different additional text for each picture (not only captions) use mode 3.

Since TWG 1.6: Please store all your text files in UTF-8! Then special characters are displayed properly!

 29. How to configure the HTML_SIDE big navigation

If you want to display the thumbs on the image page right and left to the main image you can use the new HTML_SIDE navigation.

Just set $default_big_navigation="HTML_SIDE";

There are 4 more parameter where you can configure the display of this style: $numberofpics_html_side, $disable_nav_big_sel, $html_side_break, $html_side_space_optimization and
$html_side_show_dividor. Please read the documentation behind this settings to configure HTML_SIDE.

If you have $numberofpics_html_side-1 images in a directory a special mode is enabled. e.g. if this is set to 9 4 images are shown on each side! to make this style look good the 8 thumbs are static! The actual thumb that is displayed is only marked by a thin border! (style:html_side_mark)

 30. How to use the TWGXplorer and what is the safe mode any why is this a problem ;)

One of the main things of the backend is the TWGXplorer. You can upload, rename, delete, manage the files create users and gives them some rights .....
If the files have the permissions that you can access them with the user php is running you can do many of this things. If not you have to change the file permissions with an ftp program. Most of the time you need 777 for a file or directory you want the edit. This is because php is most of the time not running as your ftp user but a different user (apache, www-run ...)!
Please read the 2nd part about safe mode too - Quite interesting if you are not 100% clear about permissions and restrictions ...

I think this is not problem to understand ;). But there are 2 things I want to mention when using TWGXplorer: user management and restrictions because of the save mode!

  1. User management: You can create users and give them certain rights! If you want someone to be able to upload you should give him at least modify rights! Important is the main directory of the user. You should only use . for administrators because this makes it possible even to modify TWG itself! Normally it is enough to use the pictures directory or a subdirectory of it for the user.
  2. Safe-Mode: "When safe_mode is on, PHP checks to see if the owner of the current script matches the owner of the file to be operated on by a file function or its directory.".
    This is the very short description from the php manual but I want to explain this in a little bit more detail ;):
    If a php script is executed it is either done by the owner of the script (the ftp user) or the php user like "www-run" or "apache". If the script is executed by the owner the safe-mode is no problem - but most web hosters don't even know how to configure their system this way. Therefore php is normally run by a user like "www-run" or "apache". And if this is the case you have the "www-run" problem. This means that if you want to edit your files or upload files to a directory with the TWGXplorer the permissions have to be set to 777 because the owner of the file is not the same as the one who runs the script! And that means that everyone (who can run a script on this server) can access this files.

    And now the safe-mode restrictions apply! Lets assume you upload TWG to a directory on your web server. Then you change the permissions that the TWGXplorer can create a directory below the pictures folder (pictures folder has to be set to 777). This is possible because the main directory belongs to the owner of the script. But if you now try to create a file in this directory this would lead to an error because the directory belongs to the owner "www-run" or "apache" while the script does belong to your ftp user!
    TWG tries to detect many of this situations and this is why you cannot create or upload everywhere. But what is the solution?
    • If you don't have the "www-run" problem - everything is fine - you can check the user by moving the mouse over the ? next to the owner in the header line - if the user is the same for the ftp and files created by twg admin you are fine - don't care about the safe-mode. Most likely your php is running with phpsuexec (check the last entry of the TWG Admin on the info page - it tries to detect if php is running this way)
    • If safe-mode is off and you have the "www-run" problem you can set the permissions to 777 and work with your files almost without restrictions. But you should protect your files with a .htaccess file (there is an example in the configs_demo) if you want to have private albums.
    • If safe-mode is on and you have the "www-run" problem you can:
      1. Ask your ISP if he turns off safe-mode (mine did!)
      2. Ask your ISP if he can configure php that way that the www-run problem does not happen - I googled a little bit an this can be done by running php not as module but by including it with cgi (running phpsuexec! - more and more provider do this!)
      3. Some ISP have the possibility in the web interface that you can change the owner of your files to the php owner - but be care full - If you do this you maybe cannot manage your files with your FTP program anymore.
      4. Ask your ISP if he changes the owner for you! (FTP problem like described at 3 can happen!)


If non of this solutions work I do recommend not to upload or edit files with the TWGXplorer and to use a FTP program. TWG does not detect all restrictions of the safe-mode and therefore it is sometimes possible to delete a file or folder even if the actions on the right do not allow this. You can select the checkbox on the left and use one of the commands on the top and try if it works.

Please read this if you want to use the installer version of TWG AND safe mode is on:
The installer version of TWG can be installed only in a subdirectory that is created by TWG. You have full rights with the TWGXplorer. But the safe mode does not allow you to access pictures you have uploaded with your FTP program! Therefore you have to decide what you want! Upload with the TWGXplorer or FTP. If you want to upload your files with an FTP and have safe mode on please use the normal version of TWG (or simply extract the twg_install.zip and upload everything with your FTP program)

If you have read this and have still no idea what i'm talking about please let me know - I want to make this quite hard topic as understandable as possible.

 31. How to update TWG with the installer

If you want to update TWG to the latest version you have to have TWG 1.4.x installed already. It is not possible to use the installer if you use an older version. I also recommend not to update any 1.4.x or 1.5.x version to 1.6 with the installer because I have changed some directory structures and your install would get messy! + you have to copy admin/.config/.htusers.php manually to admin/_conifg/.htusers.php.

Then you have to have all your changes to TWG either in the my_config.php, the my_style.css or of course inside the pictures folder! If you have made modification e.g. in the config.php - move them to the my_config.php and do the same with style.css and my_style.css.

And Safe Mode should be off. If it is on the installer will tell and warn you! If you have done the installation with the installer before - go on. If not TWG will not update but install TWG into the sub folder twg. I think you don't like that! Please use the normal zip version then.

Updating itself is very easy

  1. Upload the 3 files from the download that start with 'install'
  2. Check if the twg folder has 777 as permissions - if not please change that!
  3. Start install.php - - READ if anything is red!
  4. Click update an you are done - the installer will keep your pictures folder and the my_config.php and my_style.css. It make a backup if the config.php too. You can delete this after the update! I only make this of security issues because I think there will be some people around who forget to store everything in my_config.php ;).
  5. Save files like folder.txt, foldername.txt .. in utf-8 if you have special characters like öäü!

I have tested the installer on many systems and I never had any data loss (either it worked of it was not working at all because of php security settings!) but I always recommend to make a backup! On some servers the unzip does not overwrite existing files! If your update does not work: use the zip version and make a manual update.

Have fun updating TWG!

 32. How to add big folder descriptions like in the AJAX demo - registered version only

You can add folder descriptions to the left and right of the folder images/collage. You can use two files where you can put your html - albuml.txt (for left) and albumr.txt (for right). The files are included in a <td class="albumtxt"> ... </td> tag. You can use a div inside to get a nice layout. You can use language dependant files too like albumr_de.txt.

e.g. <div style="width:250px;text-align:right;padding-right:20px;"> your text </div>

If you want to link from your text to the album like before you have to manually add the link to your text (copy it from the link from the images).
You have to set $menu_x to 1 or 2. If you use album.txt files the normal folder description is not displayed anymore!

Since TWG 1.6: Please store all your text files in UTF-8! Then special characters are displayed properly!

 33. How to use the lightbox feature (new 1.4.2)- registered version only

TWG has integrated the lighbox script and lytebox script (since 1.7.4) for registered users. This feature can be activated at 3 points:

  • On the thumbnail page
    • $activate_lightbox_thumb=true; - activates this feature on the thumbnail page.
    • $activate_lightbox_thumb_full=false; - if true the whole thumbnail activates the lighbox script. It's then not possible to get on the image page anymore. If false, there is a small zoom icon in the left upper corner of each thumbnail. If you click on this the lighbox image is shown.
    • $use_original_on_thumbspage=false; - Normally the detail image is used on the thumb page for the lightbox - but you can use the original too if you like! Just set the parameter to true! Settings this to true makes everything a little bit slower but the images displayed optimized to the browser resolution
  • On the TopX page
    • $activate_lightbox_topx=true; - activates this feature on the TopX page.
    • $activate_lightbox_topx_full=false; - if true the whole thumbnail activates the lighbox script. It's then not possible to get on the detail page anymore. If false, there is a small zoom icon in the left upper corner of each thumbnail. If you click on this the lighbox image is shown.
    • $use_original_on_topxpage=false; - like $use_original_on_thumbspage only for the topX page
  • On the image page
    • $activate_lightbox_image=true; - if true clicking on the detail images does not open the image in a new window or a popup but in the lightbox. Download has to be activated to use this feature + you cannot download the lighbox image with "right click -> save image".

      On the image page you cannot go to the next image in the lightbox. But actually there is a better way to do this. If you go to "Option -> Maximized view" you can enable the fullscreen mode of TWG. You can automatically use this instead of the lightbox with the following settings:
      $activate_lightbox_image=false;
      $open_as_popup=false;
      $open_in_maximized_view=true;

You can set this parameters in the my_config.php (copy them from config.php) or add them in the additional tab of the TWG Admin configuration. Please do not modify my_config.php if you want to manage TWG with the TWG Admin because otherwise you settings get overwritten! If you want to change the colors of the lightbox script please change the lighbox/css/lightbox.css.

Thanks to Lokesh Dhakar for the Lighbox script + the users from the blog that added some nice features to it (+ me who added some more features ;)).
Since 1.7.4 the lytebox script is the default lightbox because it supports if you have TWG in an iframe.

To use the lytebox in an iframe you have to include the lightbox/lytebox.css into the head section of your main page with e.g.

<link rel="stylesheet" href="twg/lightbox/lytebox.css" type="text/css" media="screen">

if TWG is installed in the directory "twg".

Have fun using the lytebox.

 34. How to use embedded video support (new 1.5 + extended in 1.6 + reworked in 1.7)

The new big feature in 1.5 is the support for embedded video and audio. If you see the demos there is a folder multimedia with many different ways to embed a player in TWG. There are 7 different basic approaches how this is done:
  1. Embed a streamed video with a flash player that comes from a remote site like youtube.com or video.google.com
  2. Embed a streamed video with the Divx Web Player
  3. Embed a video with the Windows Media Player
  4. Integrate wmp streams like webradio and video streams. (new 1.6)
  5. Embed a flash video with the local flv player (new 1.6)
  6. Embed a quicktime video with the Quicktime player (new 1.6)
  7. Embed streamed mp3's with the flash player that comes with TWG

To enable embeded video you have to create a file called video.php in the folder where the videos are or should be shown! If the file video.php is empty then the default settings in the config file is used. You can put the settings for this folder in the video.php file too (<?php [your settings] ?>). In the sections below you can see examples settings for each type.

Thumbnails:

You have to have a preview image for each video in the folder! They are needed for the autodetection mode as well!
The name of the thumbnail file is different depending which type your are using (See below). But most of the time it has the same name like the video and instead the extension of the video the needed extension is jpg. You can prodvide this the following ways:

  • Manually: Create a preview image of the video and put it in the folder with the video.
  • Generate with ffmpeg: See howto 47.
  • Generate with a dummy: See howto 41.

Without thumbnail your video will not be shown!

New 1.7: Autodetection - Please read this part first!

I reworked the video detection for local videos! It is now possible for TWG to auto detect local videos like flv, divx, mov, avi, mpg, wmv!
You have 2 options:

  1. Not using a video.php at all! You have to set $video_autodetect = true; (=default). Then $video_php_x_default and $video_php_y_default are used as width and height!
  2. Using a video.php where $video_player="AUTO";
    <?php
    $video_size_x=320;
    $video_size_y=310;
    $video_player="AUTO";
    $video_autostart=true; // or false - depending what you want
    $video_show_dl_link=false; // true or false works
    $show_slideshow = false;
    $default_big_navigation="HTML"; // should be set if you have images and videos in one folder!
    ?>

Solution 1 and 2 are treated almost identical internally. Solution 2 is a little bit more flexible because you can do some extra settings like disabling the slideshow.

Using the auto detection makes it possible to mix videos AND images in one folder if the videos are local. Read Howto 39 if you don't have local videos!
You have to use solution 2 and set $default_big_navigation="HTML"; in the video.php!

Since 1.7 it is also possible to generate a video.php and a preview image during the upload of a video! Even automatic conversion toflv is possible. Check $use_ffmpeg and $autogenerate_video_php_at_upload and the settings below. This makes it possible that users can upload a video and everything needed is generated automatically. This feature is only available if you have ffmpeg available (check info.php). Please read howto 47 if you want to use this feature!

The disadvantage of the auto detection is that the HTML mode has to be used because different video types can be in one folder and each type needs a different treatment.
The best video inclusion can still be achieved by using specialized video.php's like described below because there you can control everything and it's possible to use the DHTML (=Ajax) mode.

Since TWG 1.6: Please store all your text files in UTF-8! Then special characters are displayed properly!


1. Embed a streamed video with a flash player

If you want to use this solution the video is not stored on your web space but on one of the video sites below. You have to create an account there and then upload your file. Then you can directly view your video on this site. Depending on the site the video is then available for all other users of the site too. Some of this sites provide private access as well (see below for details). TWG does then embed the video directly from this site and provides the flash player that does support streaming. TWG can mark your thumbnails with an watermark - to make this work for this solution simply create a file with the same name as the thumbnail and with the extension of your video (e.g. .avi see howto 26 how this works).

Advantage:
   - You don't need your own web space
   - You get a streamed video - this means that the video has not downloaded completely before the playback starts.
   - The video is converted by the uploaded site in the needed format.
Disadvantage:
   - On most of this providers your video is visible to all.
   - You have to upload the video to this providers first.
   - You cannot provide a download link - the setting $video_show_dl_link has to be set to false.

  1. video.google.com
    If you upload your video (or just want to embed one of the existing) you have an url like
    http://video.google.com/videoplay?docid=3892003977065756728
    The interesting part is the value of the docid. To include this video into TWG you have to use the value of the docid for the thumbnail e.g. 3892003977065756728.jpg.
    The video.php should look like this:
    <?php
    $video_size_x=320; // google says 400x326 but most videos fit in the values I set!
    $video_size_y=267;
    $video_player="GOOGLE";
    $video_flash_site = "http://video.google.com/googleplayer.swf?docId=";
    $video_autostart=true; // or false - depending what you want
    $video_show_dl_link=false;
    ?>

    You can of course use video.google.de as well. Google does support autoplay!
  2. www.youtube.com
    If you upload your video (or just want to embed one of the existing) you have an url like
    http://www.youtube.com/watch?v=qMSrpZi_6WM&search=josh%20blue
    The interesting part is the value of the v. To include this video into TWG you have to use the value of v for the thumbnail e.g. qMSrpZi_6WM.jpg. You have to make your video public that TWG can access the video. If you want private videos you should use the internal FLV player of TWG (see 5.).
    The video.php should look like this:
    <?php
    $video_size_x=425;
    $video_size_y=350;
    $video_player="FLASH";
    $video_autostart=true; // or false - depending what you want
    $video_show_dl_link=false;
    $video_flash_site="http://www.youtube.com/v/";
    $video_autostart_parameter="&autoplay=1";
    ?>

    youtube does support autoplay!
  3. www.myvideo.de
    This a very good german site with los of german clips and is quite fast too. myvideo.de does NOT support autoplay - therefore you have to click on the play button of he flash after you select the video!
    If you upload your video (or just want to embed one of the existing) you have an url like
    http://www.myvideo.de/watch/10235
    The interesting part is the value after the watch/. To include this video into TWG you have to use the value after the watch/ for the thumbnail e.g. 10235.jpg.
    The video.php should look like this:
    <?php
    $video_size_x=470;
    $video_size_y=406;
    $video_player="FLASH";
    $video_autostart=false; // true does not work for myvideo.de!
    $video_flash_site="http://www.myvideo.de/movie/";
    $video_autostart_parameter="";
    ?>

    myvideo does not support autoplay!
  4. www.dailymotion.com
    I don't have big experience with this site. It has many french clips and work fine with TWG ;). dailymotion.com does NOT support autoplay - therefore you have to click on the play button of he flash after you select the video!
    If you upload your video (or just want to embed one of the existing) you have an url like
    http://www.dailymotion.com/swf/sD4zsqKE0tdFuXZ9
    The interesting part is the value after the swf/. To include this video into TWG you have to use the value after the swf/ for the thumbnail e.g. sD4zsqKE0tdFuXZ9.jpg.
    The video.php should look like this:
    <?php
    $video_size_x=400;
    $video_size_y=316;
    $video_player="FLASH";
    $video_autostart=false; // true does not work
    $video_flash_site="http://www.dailymotion.com/swf/";
    $video_autostart_parameter="";
    ?>

    dailymotion does not support autoplay!
  5. www.metacafe.com
    This is a little bit different than other sites because they have a folder structure to navigate to the pictures. e.g. a video link looks like this:
       http://www.metacafe.com/watch/504296/belly_dancers_man_vs_woman/

    The interesting part is the value after the watch/. To include this video into TWG you have to use the value after the watch/ for the thumbnail AND replace the first / with ___ (since 1.7.5 _S_) and remove the 2nd / e.g. 504296___belly_dancers_man_vs_woman.jpg (since 1.7.5 504296_S_belly_dancers_man_vs_woman.jpg)
    The video.php should look like this:
    <?php
    $video_size_x=464;
    $video_size_y=380;
    $video_player="FLASH";
    $video_flash_site ="http://www.metacafe.com/fplayer/";
    $video_autostart_parameter=".swf";
    $video_autostart=true; // important - autostart has to be added the .swf?... if possible
    $video_show_dl_link=false;
    $show_rotation_buttons=false;
    ?>

    metacafe does not support autoplay! The video_autostart has to be true because the auto start parameter ".swf" has to be added to the generated url.

SORTING: I have included a solution to sort this videos. Because the names are given by the web sites you can use a prefix for the thumbnails. The prefix has 3 numbers + 3 underscored (___) .e.g. 001___<imagename>.jpg

  1. Embed your own swf's
    It is also possible that you can simply embed your own swf's! If you want to do this you have to have the swf's in the directory where they should be displayed. As example you have a flash called test.swf. Then you have to provide a thumbnail called test.swf.jpg!
    Then you have to put a video.php like this into this directory:
    <?php
    $video_size_x=425;
    $video_size_y=350;
    $video_player="FLASH";
    $video_flash_site="http://localhost/TinyWebGallery/pictures/Multimedia/009_swf/";
    $video_autostart_parameter="";
    $video_show_dl_link=true; // true or false works!
    ?>

    The important setting is the $video_flash_site - This is the directory where the flash is located. If you make this static you have to change the url if you copy the folder e.g. from your local server to your destination in the web! In the example above this is my local setting!

2. Embed a streamed video with the Divx Web Player

Another nice solution is to use the Divx Web Player plugin. The viewer of the gallery has only to download the plugin to view the videos. If you check the demo you find one folder where you can see this working. The nice thing about doing this is if you use this plugin and tell divx about this you get a free licence for the divx creator ;). Most likely this is the solution with the best video quality.
TWG will mark your thumbnails with an watermark because the .divx extension is already a know extension (see howto 26 how this works). The videos are stored at the same web space as TWG and the Divx player does nice streaming of this video too.

Advantages:
   - The player streams the video from your web space without a streaming server - this means that the video has not downloaded completely before the playback starts.
   - The videos are not converted somehow and located on your web space.
   - You control the quality of the video.
   - You can provide a download link if you like
   - You can use autostart or not!

Disadvantage:
   - The Divx Web Player plugin has to be installed (available for Windows and Mac)
   - You need quite some web space if you store the videos.
   - Opera 9 does no support the dynamic switching between the videos. Therefore you have to use HTML or HTML_SIDE if you want to support all browsers

To use the Divx plugin you have to provide a thumbnail jpeg. The image has to have the same name as the divx video. And the divx video has to have the extension .divx. Simply put them in the same directory.

You have to provide a video.php that looks like this (change the sizes):

<?php
$video_size_x=425;
$video_size_y=350;
$video_player="DIVX";
$video_autostart=true; // true or false works!
$video_show_dl_link=true; // true or false works
?>

3. Embed a video with the Windows Media Player

You can simply use the windows media player to play embeded video. You can play any file type hat can be played with the WMP (avi, wmv, mp3 ...). The big disadvantage is that the video is not streamed by most servers. I have implemented a solution that works with play list files (movie.wvx). I have found many web sites where they say that the wmp does then stream when this play list file is used. But on my local system it does not :(.

Advantages:
- Because most users still have windows many people don't have to download an extra player
- The videos are not converted somehow and located on your web space.
- You control the quality of the video.
- You can provide a download link if you like.
- You can use autostart or not!

Disadvantage:
- You can not enlage the videos! The player should have the size like the videos. IE works fine but Firefox not. Therefore I disabled the resite for IE to get the same display for the main browsers! If you don't want this you should use the FLV player.
- You are using the Windows Media Player and I think most users have to download the video first before they can watch it : means no streaming!
- Only systems where the WMP is available can play the videos (= Windows!). But users already reported that they got this working on Linux too ;).
- You need quite some web space. if you store the videos.
- On browsers where the WMP Plugin does not work properly the videos don't play - I have never made it to get Opera 9 to load the plugin. You can e.g. try on www.orschlurch.de. They have lots of videos embedded with the WMP. If your browser does not work there it won't play it on TWG either.

To use the WMP you have to provide a thumbnail jpeg. The file name is the one of the video. If you have a thumbnail called xxx.jpg the video name has to be xxx.wmv. Simply put them in the same directory ;).

You have to provide a video.php that looks like this (change the sizes):

<?php
$video_size_x=320;
$video_size_y=300;
$video_player="WMP";
$video_autostart=true; // true or false works!
$video_show_dl_link=true; // true or false works
?>
Since 1.5.1 there is an additional flag $linktowvx. There you can decide if you want to use the wvx files or link directly to the movie. Linking directly has the advantage that no wvx files are created - means the pictures folder does not have to be writeable. On the other hand stream will not be supported at all. The default is true (= a wvx file is created!)

4. Integrate wmp streams like web radio and video streams. (new 1.6)

You can simply use the windows media player to play external video streams and web radios. The only thing you need is the url to the stream itself. As an example I use the stream of the german radio swf3. The steam is

http://lsd.newmedia.tiscali-business.com/bb/redirect.lsc?stream=swr3/livestream.wma&content=live&media=ms

To include this stream you have to provide a preview image and follow the following rules:

  1. remove the http://
  2. replace / with ___ (Since 1.7.5 _S_ because ___ is used as sorting prefix as well and now both can be used)
  3. replace ? with _Q_
  4. replace : with _C_ (works till 1.7.7 - can be used if a port does exist)

In the example above this is:

lsd.newmedia.tiscali-business.com___bb___redirect.lsc_Q_stream=swr3___livestream.wma&content=live&media=ms.jpg

Since 1.7.5: lsd.newmedia.tiscali-business.com_S_bb_S_redirect.lsc_Q_stream=swr3_S_livestream.wma&content=live&media=ms.jpg

You have to provide a video.php that looks like this (change the sizes):

<?php
$video_size_x=320;
$video_size_y=300;
$video_player="WMP";
$video_flash_site="http://";
$video_show_dl_link=false;
?>

In the demo gallery there is a folder that shows a couple of streams ;).

The folder where this streams are shown have to be writable by php because the wmp is saving a play list file (wvx) to this directory.

5. Embed a flash video with the local flv player (new 1.6)

TWG does now support the direct usage of the original flash player (flvplayer) that is used by youtube.com and many other video sites as well. This makes it possible that you don't have to upload your videos to e.g. youtube.com or myvideo.de but have it stored on your own web space. On the other hand you have to create the needed flv videos by yourself! An excellent free encoder for this is the RivaEncoder (download it here).

The setup of the filenames is very easy. For a video called video.flv you have to provide a file called video.jpg (please note that the TWG Admin can create default images for this type of video). Make sure that the file extension .flv is lowercase!

Advantage:
   - You get a streamed video - this means that the video has not downloaded completely before the playback starts.
   - The video are locally stored.
   - The video does play on every platform where flash is available
   - You can provide a download link if you like
   - You can use autostart or not!

Disadvantage:
   - You have to convert your videos to the flv player. I alway use the freeware 'Riva FLV Encoder'.
   - The player is not part of TWG. I have only integrated it! It is free for non commercial use - if you want to use it for commercial use you have to register the flash separately at www.jeroenwijering.com. If you register the flash please add a note to the registration that you where using the player in TWG (+send an e-mail to me) - If more users do register the flash I maybe buy a unlimited license for TWG and include it for everyone!

You have to provide a video.php that looks like this (change the sizes):

<?php
$video_size_x=300;
$video_size_y=170;
$video_player="FLV";
$video_flash_site = "";
$video_autostart=true; // true and false works
$video_show_dl_link=false; // true and false works
$video_flv_buffer=2; // this is the buffer is s that is filled before the video starts - This parameter is new in 1.7.8.1!
?>

Remote flashes are not supported here - use one of the flash solution before if you like to do this!

6. Embed a quicktime (.mov) video with the Quicktime player (new 1.6)

You can include Apple Quicktime movies in TWG now as well. You only need the installed Quicktime player installed.

The setup of the filenames is very easy. For a video called video.mov you have to provide a file called video.jpg (please note that the TWG Admin can create default images for this type of video). Make sure that the file extension .mov is lowercase!

Advantage:
   - The video are locally stored.
   - The video does play on every platform where quicktime is available
   - You can provide a download link if you like
   - You can use autostart or not!

Disadvantage:
   - You need .mov files of course ;).
   - The videos are not streamed right now - quicktime would support this if you have a streaming server for quicktime.
     I don't have this server - therefore you have to change the code by yourself in inc/videostreaming.inc.php
   - Javascript is needed - there is no non Javascript fallback right now
   - Only a white background is possible on all browsers if the resolution of the video is smaller than the size of the player!
     I have set the style class .transparent but this setting only works in Firefox.

You have to provide a video.php that looks like this (change the sizes):

<?php
$video_size_x=320;
$video_size_y=210;
$video_player="QT";
$video_show_dl_link=true;
$video_autostart=true; // true and false works
// extra settings to make it look nicer
$show_rotation_buttons=false;
$small_pic_size = 220;
?>

7. Embed streamed mp3's with the flash player that comes with TWG

If you want to embed mp3's I recommend to use my steaming flash mp3 player that comes with TWG. The player is a modified version of the FX-player where I have removed the stuff that is not needed by TWG and changed the layout a little bit. Many thanks to the authors of this great free player.

Advantages:
- You get a streamed mp3 - this means that the video has not to be downloaded completely before the playback starts.
- The mp3's are not converted somehow and located on your web space.
- You control the quality of the mp3's.
- You can provide a download link if you like.
- The player is very small, quick and good looking ;).
- You can use autostart or not!
- You can store the mp3 on another web space.

Disadvantage:
- You need quite some web space. if you store the mp3 local (but you can store them remote too ;)).

To use the mp3's you have to provide a thumbnail jpeg. The image has to have the same name as the mp3. Simply put them in the same directory ;).
If you set $video_flash_site to the location of your mp3's you can even store the mp3 somewhere else. If the mp3 is on http://www.example.com/mp3/mysong.mp3 then $video_flash_site has to be set to "http://www.example.com/mp3/". The url has to start with http!

Please note: It is not allowed to have special characters (like äü ...) in the path and filenames of the mp3's - the flash player does not handle them properly. btw. spaces or () are fine!!

You have to provide a video.php that looks like this:

<?php
$video_player="MP3";
$video_autostart=true; // true or false works!
$video_show_dl_link=true; // true or false works
$video_flash_site=""; // if you store your mp3's local - if you put an url base here you can even link remote
?>

Additionally you can provide the $video_flash_site on am remote server. Then you can use something like that:

$video_flash_site="http://brain-on-a-stick.de/download_extern.php?file=";

The provided filename will then be added to this url. Download does work as well for remote mp3's.
You can even mix local and remote mp3's. Provide the remote link to the mp3's - and then put your local files to the folder like normal. For the remote file you provide an empty file with the correct naming.

SORTING: I have included a solution to sort mp3's. You can use a prefix for the thumbnails. The prefix has 3 numbers + 3 underscored (___) .e.g. 001___<imagename>.jpg and then the mp3 is 001___<imagename>.mp3. If you use external mp3's this mp3's don't have this sorting prefix!

PHP INCLUDE : If you use php include you have to copy the twg_audiolist.php into the folder where the file you include twg is located. Then you have to edit twg_audiolist.php and edit the parameter $xmlfilename that it points to the cache folder (adding the parameter of $install_dir). In newer versions of TWG you don't have to edit twg_audiolist.php anymore. So please try without this modification first.

What should I use?

Now you have many ways to provide multimedia content - which one should you use? I think you can use all ways and still be happy. I think first it depends which video source you have. Then if streaming is important for you - if you have bigger videos I would only choose a streaming solution!

You can actually include most of the video sites available. Simply check the url's they use and then use the dynamic part of the url as file name of the preview jpg.

And now have fun using TWG and videos!

 35. How to choose the right storage location for your xml files

Since 1.5 the xml files (where the comments, captions and counters are stored) can be saved into the album where they belong to. Before 1.5 all xml files where only stored in the xml folder. By default the xml folder is still used because you should read this howto before to make this work ;).

1. Storage in the xml folder
By default the xml files are stored in the xml folder. The advantage is that only the xml folder has to be writable and all xml files can be found at one place. The big disadvantage is that if you move or rename a folder the xml file names have to be changed manually to keep the data.
Since TWG 1.7.7 you can create a text file called folder.id with a unique id in your image folder. Then the unique id is used as prefix in the xml folder and not the album name. If you do this you can then move or rename your albums without any problems. Just be aware that this files has to be created when you create the directory. There is no migration if you create it later!
Since TWG 1.7.8 you can TWG let create the folder.id automatically - set $autocreate_folder_id = true; Currently this is not set as default. In one of the next versions I will change this. Make sure that the folders below the pictures folders are writable.

2. Storage in the album folders
If you store the xml files in each album the albums have to be writable! This can be a problem because many folder have to have the right permissions (not only one like in the xml folder). The big advantage is that you can rename and move albums and still keep the data. And it's much easier to find the right xml file if you want to change one manually

The info in the TWG Admin does always show you if all directories are writable and if not lists the directories that have to make writable. If you change from the xml storage to the album storage the xml files from the xml folder are automatically transferred in the album folder. But there is not transfer back!!!
IMPORTANT: It's a step by step process - it's transferred when an xml is modified! Therefore it's moved when you change a caption of an comment of a folder (then all xml's for a folder are moved! (1.6 it's different!))

And now the important switch: $store_xml_in_picfolders

NEW 1.6: In 1.6 I have reworked this part because migration could take very long this way. I have now added this functionality to the pre caching of the xml's. This mean you have to do the following steps to migrate:

  1. Make a backup of the xml folder
  2. Set $store_xml_in_picfolders=true AND turn off the session cache! (the icon "No cache" is shown then).
  3. Simply close the browser and open it again - after 5 sec the pre caching in the background is started and moves the counter, captions and comment files.
    Only 50 dirs are done in one row (because pre caching is limited to 50 dirs at once). If you have more directories - simply redo this step.
  4. Log into TWG Admin - Extract IPTC Data - Then the xml's for the tags are moved.
  5. Done ;).

 36. How to uninstall TWG if you cannot simply delete it

Because of safe mode restrictions if is possible to set the permissions of directories that way that you cannot change it back and this can lead to the problem you cannot delete your TWG installation anymore. This can happen quite easily if you use the TWGXplorer or the installer and some directories or files are deletable by php but not by you ftp program. Therefore I implemented a small uninstaller.

To uninstall TWG ONLY if you cannot simply delete it with FTP do the following:

  1. Extract the file uninstall.php from the file uninstall.zip in the uninstall directory and copy it to the main directory of TWG. If you have used the installer and safe mode was active twg was installed in the directory twg - if this is the case please copy the uninstall.php to the directory where the folder twg is in (=the directory one above where the config.php is).
  2. Call uninstall.php - the uninstaller create a file called uninstall.sm.php (The file uninstall.sm.php is now owned by the php user and can delete files and folders even when safe mode is on!)
  3. Call uninstall.sm.php (Deletes everything where the safe mode restrictions apply)
  4. Call uninstall.php (Delete the remaining files if still some left ;)).
  5. The directory should now be empty except any directories you have created by yourself!

 37. How to use the new backend rights

You can now give the users different rights. Please note that the rights always depend on the home directory of the user. The default should be the pictures directory! It's not possible to have more than one main pictures folder (of course as many sub folders ;)). Therefore you always should start at least with "pictures" as main directory for all users that should not access the TWG installation itself!

There are now 4 rights available:

  • Frontend Edit = Login at the front end to enter captions, tags, delete comments and rotate images permanently.
  • Frontend Upload = Login at the front end to upload files below the home directory with the Flash Uploader.
  • Backend Modify = Upload and modify files with the TWGXplorer in the TWG Admin below the home directory.
  • Administrator = Full access to all areas of TWG Admin

The big difference to 1.5 is that there is not a simple password in the front end where you could enter captions ... anymore. Now it's possible to create a user and give them specified rights to specific directories. A special feature is that if a user has "Frontend Upload" rights. Then he gets a new menu item "Upload" when he is in a directory where he has the rights to upload. Then this user can access the TWG Upload Flash with the rights you gave him ;). In the frontend no html upload is possible.

This new user management makes it possible that you can have one gallery that is filled with content from different people where everyone can only access his area.

 38. How to use ITPC data in TWG

TWG does now read of IPTC data from the images. This is meta information that you can easily add to your images. Good programs to add/edit ITPC data are:

  • PixVue (free) - It's an explorer extension - it's actually not longer supported but you will find it somewhere for sure ;)
  • MS Photo Info (free) - It's an explorer extension too - The good thing is that you can edit several images at once.
  • XNView (free) - You can add/edit the metadata - but you have to open each image first and then select metadata in the menu.
  • Almost every image software (Photoshop, Paint Phop Pro ...) - but they are not free ;).

. TWG uses this information at several places:

  • Tags
  • Caption
  • Info screen

To avoid reading this info every time a picture is displayed (which would be quite slow) this reading is done when:

  • You enter tags - for image tags the keywords are used (see $iptc_fields_for_imagetags) and for the directory tags the sub-categories (see $iptc_fields_for_dirtags) - This data is automatically entered when you open the enter tags panel.
  • You start the IPTC extraction in the TWG Admin - The tags and captions (see $iptc_fields_for_caption) for ALL images that don't have any info in the xml file are extracted and stored in the xml files. This means that the generation only works for images that are new. If you use dir tags please note that only the directory tag from the first file of a directory that has a dir tag is extracted. All other existing dir tags are ignored. Therefore you should actually add dir tags only to one image in your external tool!
  • You upload images with the TWG Flash Uploader (see $add_iptc_at_upload)
  • You show the info panel - There are all defined and available IPTC data is shown. The data that is read can be defined in the language file $lang_iptc_info - This makes it possible that you define your own metadata and display what you want ;). You can read more than one field in the $lang_iptc_info. Simply define another field - see e.g. Author

The IPTC data fields are tested with Photoshop and XnView. But if you have a different tool where my offsets (the one I have chosen are the most common ones e.g. 2#120 for Description) do not work you can simply change the offsets in the config ;).

Almost all images in the Ajax demo contain IPTC data! If you download the examples and go to the TWG Admin and extract the IPTC data you get a lot of tags and captions already ;).

Exif for caption

You can use Exif information for caption too. This is quite uncommon but e.g. the software "Exifer" and Photoshop Album 2.0 (someone told me) stores e.g. an image description in the exif data. By default reading this info is disabled because it is really slow (about 10 times slower than reading IPTC data). To enable reading data and use this as caption you have to set $exif_field_for_caption to the exif key in the config. "imageDesc" is the key where the image description is saved often.
To find out which keys are in your images you can make a dump of the exif data. Open inc/exif.inc.php, search for "print_r", remove the // at the beginning of this line and store the file again. Then go to the gallery and open the info of an image. Then check the counter/_mydebug.out. There you find a list of all exif keys. Simply use the one you want to extract and don't forget to restore the exif.inc.php.

New 1.7: you can extract a 2nd exif field for the caption - check the parameter $iptc_fields_for_caption_add

 39. How to mix images and videos in one folder

Since 1.6 you can have one type of video and images in one folder! This only works in the HTML and HTML_SIDE mode - If you set this to true then DHTML mode is switched to HTML mode! Therefore I recommend to set this to true this ONLY in the video.php!

Add $mixed_video_image_content=true; to your video file to enable the mixed mode!

If you set this to true you have too add v___ (3x _) at the front of the filename of the video (this is prefix is use by TWG to detect that this is a video). This prefix is removed when a caption is displayed! e.g. 123345.jpg -> v___123345.jpg. a sorting prefix goes BEFORE this 123345.jpg -> 123___v___123345.jpg.

There are 2 example folders in the Multimedia album of the Ajax Demo.

New 1.7: You can use the auto detection of videos instead using the description above if you have local videos. Please go to howto 34 and read the section about auto detection!

 40. How to include PNG's and GIF's

This a quite easy howto:

  1. gif: is supported by default since 1.6 - simply copy your images to the folder like any jpg image.
    PLEASE NOTE: If you use gifs you should use image magick! GD-Lib (=default) has a very bad quality when it resizes gifs!
  2. png: Only check that your images does not have the name of one of the internal used files - see howto 0.

 41. How to generate preview images for extra file types! - registered version only

Before TWG 1.6 you have to provide a preview image for every extra file type like wmv, pdf, flv. Since 1.6 you can generate default preview images in the TWG Admin.

All images that get a default preview image that are defined in the array $other_file_formats_previews.

Right now the following file types are defined: avi, mpg,mpeg,pdf,mp3,divx,wmv,wma,flv,mov.
They all have the preview: buttons/border.jpg.

Because these types are all defined in $other_file_formats they will get a watermark! You can change the watermark in the array or define no watermark

New 1.7: for video files it's possible to use ffmpeg to generate thumbnails out of the video - see how-to 47.

 42. How to check and enable file splitting (new 1.6)

I have tested the TWG Upload Flash and the TFU File Split Applet on several systems and not all servers do support this kind of upload (e.g. funpic.de does not - my TWG server does). The test is quite simple - you have to upload a file bigger than your file upload limit and TWG has to be able to process it. I have written a small howto with the steps you have to do:

  1. Find your server limits - Open info.php or the Info page in the TWG Admin - it tells you the php upload limit and the php memory limit.
  2. You can do the ftp or/and the image test.
    If you want to do the image test please create an image with a image software that is bigger then your php upload limit
    Using png's with 16 Million colors are quite big ;). Normally these programs tell you what the uncompressed size of this image is.

    I have created 4 images you can use for testing:
    4000x3000_10MB_(75MB).png (Resolution 4000x3000, Size: 10 MB, needed php memory to process this file properly ~ 75 MB)
    3000x2250_6MB_(40MB).png
    2500x1875_3_5MB_(26MB).png
    2000x1500_3MB_(16MB).png

    For the ftp test you simply need any file that is bigger than your upload limit!
  3. Split this file with the File Split Applet (use the size closest to your upload limit). Use part as split prefix
  4. Enable support of splitted files in the TWG Admin - set "Enable support for splitted files" and "File split was tested on the server" to true in the TWG Admin
  5. Make sure if you do the ftp test that the file you have selected is in the $allowed_file_extensions list of tfu_config.php
  6. Upload all parts of the splitted file.
  7. The file should now be merged and be visible as one file on the left side.
  8. FTP test: Open your ftp and download this file. Check if this file is o.k. - At this point some server already have restrictions! They don't allow to process any files bigger than the upload limit. If the download works and the file is o.k. then normally you can use the Flash splitting capability!
  9. Image test: Select the file (that is an image) and a preview of this image should appear or the flash tells you that the flash cannot be processed (it detects that the memory is too little but if this can be detected the file can be read - php needs~ 2x the uncompressed size of the image to process it ) - if not php is can not load this files - means images bigger than the upload limit cannot be processed - if you check the tfu.log (only exists if an error happens and the tfu main dir is writable) in the tfu directory of the server you should see an error message that the file is not valid (because php could only load a par of it) - if this is the case you cannot use the Flash splitting capability!

 43. Wie funktioniert der Cache in TWG

TWG cacht eine Menge um die Galerie zu beschleunigen. Es gibt verschiedene Levels des Cachings:

  1. Bilder Caching - Alle erzeugten Bilder sind im Cache Ordner gespeichert. Dies müssen nur einmal erzeugt werden (Die Erzeugung ist sehr langsam!). Wenn Du irgendwas in der Konfiguration änderst was mit den Bilder zu tun hat (Bild Größe, Wasserzeichen ...) muss dieser Cache gelöscht werden - Du kannst dies in der TWG Administration tun. Dieser Cache ist immer aktiv!
  2. 1 Tages Caching (neu 1.6) - Einiges wird einmal am Tag generiert. Dieses sind der Albumbaum und der Zähler wieviele Bilder in einem Ordner sind. Da diese Funktionen alle Ordner und Bilder betreffen, sind sie sehr langsam bei großen Galerien. Dieser Cache beschleunigt den 1. Zugriff auf die Galerie enorm! Diese Einstellungen sind in Dateien im Cache Ordner gespeichert und werden einmal am Tag erneuert. cache_dirs muss auf true gesetzt sein um dieses Cache zu aktivieren! Dieser Cache wird einmal am Tag erneuert - der erste Nutzer welcher nach Mitternacht die Galerie besucht startet diesen Vorgang (und muss z.B. 2 Sekunden länger warten)
  3. X Stunden Caching (neu 1.7) - Seit 1.7 ist es möglich einen Cache für die TopX ($precache_main_top_x) und die Verzeichnisstruktur ($serialize_dir_data) zu erzeugen. Dieser Cache wird entweder im Hintergrund (topx) erzeugt oder gespeichert wenn wichtige Sitzungsdaten erzeugt werden. Diese Daten können mehrmals am Tag aktualisiert werden! Mit $precache_main_top_x_interval kannst Du das Aktualisierungs Interval festlegen. Diese 2 Caches beschleunigen das Betrachten der Topx und den ersten Aufruf der Galerie sehr stark. Denke daran dass die TopX nur alle x Stunden erzeugt werden!
    Seit 1.7.1 TWG nutzt Zeitstempel in den Cache Dateien - dadurch werden neue/gelöschte Bilder richtig erkannt. Der 1 Tages Cache und der X Stunden Cache werden ebenfalls erneuert.
  4. Sitzungs Caching. Jedes mal wenn Du den Browser öffnest und zur Galerie gehts, startest Du eine neue Sitzung. Diese Sitzung existiert so lange der Browser geöffnet ist (oder sie abgelaufen ist). In dieser Sitzung werden Sachen gespeichert welche nicht mehrmals gelesen werden sollen. Wie: lesen der Verzeichnisse, Dateien wie folder.txt, foldername.txt, xml Dateien, Sprachen... . Dies ist der Grund warum Du nicht immer sofort neue Verzeichnisse siehst welche Du mit Deinem FTP Programm hochgeladen hast. cache_dirs muss auf true gesetzt werden um diesen Cache zu aktivieren!
    Du kannst diesen Cache, den X Stunden Cache und den 1 Tages Cache im TWG Admin löschen.

Bitte beachte: Wenn Du auf das Bandbreiten Icon klickst, werden die Daten des 1 Tages Cache, des X Stunden Caches und die Sitzung gelöscht! Wenn der Cache nicht aktiviert ist, kannst Du diesen durch einen Klick auf "No Cache" für diese Sitzung aktivieren! Dann kannst Du sehen um wieviel schneller die Galerie angezeigt wird ;).

Zusammenfassung:

Während der normalen Nutzung solltest Du den Cache immer aktivieren, da ansonsten der Server vielmehr zusätzlich zu arbeiten hat. Nach der Installation ist der Cache deaktviert (man sieht es in der rechten unteren Ecke) da man während der Einrichtung Änderungen in den TopX auch sofort sehen möchte. Sobald dies abgeschlossen ist: aktiviere den Cache. Hochladen von Bildern mit dem Flash Uploader aktualisiert automatisch diese Caches!

 44. How to enable url rewrite

If you want to link directly to albums or directory you can copy the link in the browser. But this link is not very nice and user friendly. If you want to provide nicer url's you can use url rewrite to do this. Rewrite is done by using a .htaccess in the main folder of TWG. In the examples folder is a zip called url_rewrite.zip. There you find an .htaccess with a simple rewrite rule. You can then link to a gallery by using e.g.

http://www.tinywebgallery.com/demo/twg_album/05_exif
instead of
http://www.tinywebgallery.com/demo/index.php?twg_album=05_exif

or to an image by using

http://www.tinywebgallery.com/demo/twg_image/05_exif/1.jpg
instead of
http://www.tinywebgallery.com/demo/index.php?twg_album=05_exif&twg_show=1.jpg

All the example above to work! I have added a .htaccess file like described below to the AJAX demo of TWG

The template in the .htaccess is:

RewriteEngine on
Options +FollowSymlinks
RewriteBase /
RewriteRule ^(.*)twg_album/(.*)$ $1twg/index.php?twg_album=$2 [L,R]
RewriteRule ^(.*)twg_image/(.*)/(.*)$ $1twg/index.php?twg_album=$2&twg_show=$3 [L,R]
You have to change the path depending to you installation! If TWG is e.g. installed on www.yourserver.com/gallery/twg then you have to modify the file like this:
RewriteEngine on
Options +FollowSymlinks
RewriteBase /
RewriteRule ^(.*)twg_album/(.*)$ $1gallery/twg/index.php?twg_album=$2 [L,R]
RewriteRule ^(.*)twg_image/(.*)/(.*)$ $1gallery/twg/index.php?twg_album=$2&twg_show=$3 [L,R]

Thanks to Miguel for this!

 45. Wie wird die Galerie auf Geschwindkeit optimiert

Standardmäßig sind die meisten Features der TWG aktiviert. Wie Du Dir denken kannst sieht das so am besten aus, ist jedoch nicht auf Geschwindigkeit optimierte. Diese kleine Howto zeigt Dir wie man mit einigen Parametern die TWG optimieren kann wenn D denkst das 95% cool sind und TWG zu langsam ist ;). Bitte beachte - TWG nutzt eine Bandbreiten Erkennung. Wenn eine langsame Verbindung erkannt wird werden generell die low_ Einträge der Konfiguration benutzt. Dieser Modus deaktviert einige Features welche wirklich viel Bandbreite benötigen (wie die Collage, feste Anzahl der Thumbnails, verstecken der großen Navigation ...).

  • Aktviere den Cache nach der Einrichtung - Dies ermöglicht Dir 100% der Features und ist die wichtigste Sache die Du tun kannst - siehe Howto 43 für Details! Teste erneut nach der Aktivierung des Caches - Du wirst einen großen Unterschied feststellen ;). Dies ist sehr wichtig für registrierte Nutzer, weil der Album Baum ständig aufgebaut wird!
  • Der 1 Tages Cache kann seit 1.6.1 dauerhaft gemacht werden - wenn Du $remove_1_day_data=false setzt, wird der 1 Tages Cache nur entfernt wenn Du die .tmp Dateien im Cache löschst, Du ein Bild mir dem TFU hochlädst, Du auf das Bandbreiten Icon klickst oder Du twg_reset_bandwidth=true als Parameter an die Url anhängst ;).
  • NEU 1.7 - TWG macht cacht nun mehr durch das Erzeugen von bsw. de TopX im Hintergrund nur alle X Stunden! Überprüfe die Einstellung $precache_background und die Einträge darunter. Du kannst den Wert ändern wenn Du zum Beispiel kürzere Auffrischungintervalle möchtest! Standardmäß ist dieser Cache aktiviert jedoch nur aktiv wenn Du mehr als $precache_main_top_x_limit Bilder hast (500 ist Standard)!
  • NEU 1.7 - serialize_dir_data! Das ist das höchste Level des Caching welche Du aktivieren kannst. Wenn Du dies auf true setzt dann wird der Verzeichnis Cache welcher in der Session gespeichert ist im Cache Verzeichnis abgelegt und nur alle paar Stunden aktualisiert (precache_main_top_x_interval). Normalerweise wird dieser Cache für jeden Nutzer erzeugt wenn dieser zum ersten Mal die Galerie betritt. Wenn dieser bereits existiert muss er nur geladen werden. Das ist weitaus schneller als die gesamte Verzeichnisstruktur zu einzulesen! Der erste Zugriff auf meine private Galerie (~3000 Bilder) verringerte sich von 5 Sekunden auf weniger als eine Sekunde! Standardmäßig ist dieser Cache aktiviert! Er ist nur aktiv wenn cache_dirs UND serialize_dir_data auf true gesetzt ist!
  • Setze $cache_time=-1; Dies deaktviert die Überprüfung der Bilder im Cache Ordner ob diese noch genutzt werden! Normalerweise geschieht dies einmal jeden Tag. Ungenutzte Cache Bilder werden dann nicht mehr gelöscht! (Standard ist 42)
  • Erzeuge alle Vorschaubilder in der TWG Administration - TWG erzeugt diese nur wenn sie benötigt werden, jedoch ist es ein besserer erster Eindruck wenn der Cache bereits generiert wurde ;). Wenn Du Bilder mit dem TWG Flash Uploader hochlädst werden die Cache Bilder seit 1.6.1 automatisch erzeugt
  • Deaktviere die zufälligen Ordner Bilder - jedes Mal wenn das Album gezeigt wird, wird ein neues Set an Bildern geladen - wenn Du dies deaktivierst wird immer dasselbe geladen und der Browser kann es aus seinem internen Cache nehmen - Parameter: $use_random_image_for_folder
  • Deaktviere die Collage der Ordner - dann lädsts Du nur 1 Bild (~3k) anstatt vier (~12k) - rechne selbst ;) - Parameter: $show_colage;
  • Nutze eine feste Anzahl an Vorschaubildern - TWG nutzt eine Autoerkennung und zeigt so viele Vorschaubilder wie möglich auf der Seite. Du kannst TWG eine feste Anzahl vorgeben. Dies ist empfehlenswert wenn Du ein festes Layout nutzen willst - Parameter: $autodetect_maximum_thumbnails
  • Nutze "fade" als Ordner Effekt (=standard). "change" würde ein anderes Bild laden wenn Du mit der Maus rüberfährst. Parameter: $folder_effect
  • Wenn Du wirklich viele Bilder hast und der erste Zugriff auf die Galerie sehr lange dauert liegt die meistens am zählen aller Bilder für den "Anzahl der Bilder" Zähler. Dieses zählen wird zwischengespeichert, aber der 1. Aufruf kann ein Timeout bekommen wenn die Servereinstellungen zu klein sind. Du solltest dann $show_counter_in_jstree=false und $show_number_of_pic=false; setzen. Der Zähler wird dann nicht mehr gezeigt. Für die nächste Version habe ich geplant dies im Hintergrund zu erledigen.

Dies ist derzeit alles wo ich meine das dies einen Unterschied ausmacht. Du kannst noch eine Menge anderes tunen jedoch glaube ich nicht dass Du einen Geschwindigkeitsunterschied merken wirst wenn Du dies tust. Wenn dir langweilig ist: schaue einfach in die config.php und Du kannst was Du alles in der TWG konfigurieren kannst wenn Du magst ;).

 46. How to use image magick (New 1.7)

Since 1.7 TWG does support image magick for:

  • Thumbnails
  • Detail images
  • Upload

This are the files that are actually written to the hard disk. Image magic is not used for the slideshow, random and all maximized images. This calculations are still done with gdlib.

You can check if you can use image magick by calling the info.php page. If there is not support you have to install image magick. Ask your hoster or google (if you can install software on your server!) how to do this ;).

Using image magick has the advantage that is needs less memory than gdlib and produces a better quality (but the difference is not very big as far as I can say). If your images are very big and you don't have much php memory than you should try to use image magick. You can enable image magick by setting $use_image_magic=true;

If image magick does not work error images are shown. You have to delete the image cache after changing image magick settings or if you turn the support off when it does not work.

 47. How to use ffmpeg (New 1.7)

ffmpeg is a very powerful tool to convert videos and to extract thumbnails from videos. TWG can use ffmpeg to:

  • extract thumbnails from videos
    • during upload
    • in the backend at "Generate preview images" (registered version only)
  • convert uploaded videos to flv.

First you should check if ffmpeg is available by calling the info.php page. If it is available you can use all the settings below $use_ffmpeg. Please read the documentation in the config.php in the details. There you can specify the extensions, the time where the thumbnail is extracted and a couple of other settings for ffmpeg.

If you don't have ffmpeg installed but you want to use ffmpeg you normally need a private or a virtual server because I don't know a hosters that install ffmpeg on a shared server (If you find one - tell me). Under Linux the install is not very easy. I had to install 12 rpm's under fedora 4. But check your distribution first. Maybe the auto installer can install all dependent rpms (I have read that debian does this). Under windows a native port does exist. It's only one exe file and a dll. Really easy to use ;).

 48. How to use self registration (New 1.7)

Since 1.7 you can allow people to create a frontend account for TWG. This user get a directory and can upload the images there. Only usernames with [a-z,A-Z,0-9,- and _] are allowed because of security reasons - please note: You are responsible for the stuff your users upload!

The following settings are available to configure self registration:

  • $enable_selfregistration - (true/false) You can enable self registration here. In the login window then a link where you can register appears.
  • $enable_id_registration - (true/false) If you enter an id here than this id is needed on the registration page to register. You can e.g. send this to all users of a mailing list and thn only this people can register and not everyone!
  • $self_registration_security_image - (true/false) You can enable/disable that users need to enter a security image. This should be enabled to prevent robots to register automatically.
  • $self_registration_basedir - (String) The directory where the user folders are generated - $basedir = maindir - add e.g an upload dir with : $basedir . "/upload" - the dir upload has to exist!
  • $self_registration_functions - (String) The default rights of an user - can be changed in the administration: possible values:
    • "15" = manage dirs + edit files (if registered) + delete + upload
    • "7" = edit files (if registered) + delete + upload
    • "3" = delete + upload
    • "1" = upload only
      Other values would be possible but in the backend only this 4 settings are configured!

Right now only English and Geman translations are available. If you use this function please translate it and send me the translations.

 49. How to use the thumbnail flash (New 1.7.3)

Since 1.7.3 there is the new thubnail flash available. To enable the flash you have to either select "Flash" in the Administration -> Configure TWG -> Functionality -> Default big navigation or set $default_big_navigation="FLASH" in my_config.php. Additonally there are the following options are available:

  • $flash_nav_reflection='on'; // You can turn the reflection of the thumbnailflash on/off. valid entries: 'on', 'off'
  • $flash_nav_reflection_bg_color='FFFFFF'; // This is the background color of the reflection. Set this to your background color if you turn reflection on
  • $flash_hide_scrollbar='false'; // You can hide the scrollbar by setting this parameter to 'true'. Valid settings are 'true','false'. You should enable autoscrolling if you hide the scrollbar!
  • $flash_enable_autoscroll='false'; //You can enable autoscrolling when you move the mouse to the left and to the right. Valid settings are 'true','false'.
  • $flash_border_color=''; // You can add a 1 px border around the images in the flash. You have to specify the color in the format FFFFFF. Empty means no boarder! The boarder does not look 100% because it's rendered be the flash and this looses some quality.

You can copy them to the free text field in the administation or in my_config.php

Have fun ;).

 50. How to make round corners (New 1.7.5)

Since 1.7.5 TWG gives you the possibility to have round corners around the image area. This is completely done by Javascript. You don't have to create any extra images for this!

An example how this looks like is shown in the admin skin. To enable this you have the following settings in the config (copy changes to my_config.php (or the freetext field in the administration) as always):

  • $use_round_corners = true; // You can enable round borders for the gallery. Check the settings below AND the css settings that are needed!
  • $use_round_corners_size = 12; // The radius of the corners. 1-32 are fine. If you use corners > 32 the calculation take quite long and does not look good anymore...
  • $use_round_corners_border = 1; // The size of the border. 1 or 2 are good values.

Known restrictions:

  • IE: If you use php include this feature is not supported right now because IE does not render the corners properly. You would have to make the corners with background imags then! I hopefully find a solution in the next build.
  • IE: If you set $iframe_include to true again IE does not do it right. I'll show the version without round corners then. See howto 2 for details about this.
  • Opera: does not render the collage properly when round corners are enabled. Therefore the round corners are disabled there too and the normal version is used.
  • Firefox: The ajax thumbnail strip is not very smooth - This does NOT affect the thumbnail flash.
  • Firefox: The rating image always highlights 5 stars if you hovering of the image.
Supported skins: The skins admin, black and white do support round corners. You only have to enable this by setting $use_round_corners = true; in the php file of the skin in the skins folder! I recommend to use the flash thumbnailstrip with round corners. Then everything looks quite nice.

I'm looking if I do find a better solution without the restrictions. But if you don't use php include the fallbacks do look like before and if it is supported it looks better.

Now you have to set the styles for the corners. Simply create a file called <skin>_round.css and put in the settings below and adopt the colors as described:

/* Please set the color for the background of the inner area */
#content_div, #content_div .sb-inner {
height:100%;
background-color:#f1f1f1;
}

/* Set the color of the border */
#content_div .sb-border {
background-color:#ccc;
}

/* Disables the old border AND set the color to the color of the border of TWG (the background of the header part. ) */
td.twg_info { border: none; background-color: #fff; }

You find working examples in the skin folder. You should always make a skin if you want to use it because e.g. for Opera I disable this feature.

Now you should have nice round borders around TWG ;).

Have fun ;).

 51. How to add captions to an image

If finally wrote this small howto because too many users asked me how to add captions to an image. There are the following ways:

  1. Name your images. By default the image name is used as caption. Only be aware that TWG only shows the image name is a certain number of numbers are not reached. This is done because only the camera name does normally not make sense. You can set the limit of numbers by setting the parameter: $autodetect_filenames_as_captions_number. There are a couple of more options in config.php. Search for $show_captions in config.php and read the sub setting too. Make sure to store this changes in the administration or directly in my_config.php (as explained on the configuration page).
  2. Login in the right upper corner. On the image detail page you get the new menu item 'Caption' where you can simply enter the captions. Even smilies are supported. Your captions are then stored as xml in the xml folder.
  3. Enter the caption as IPTC data offline to your images and let TWG extract them. Read howto 38 for details. Once the data is extracted you can still modify it like described in 2. This is a very flexible way because if you move from one gallery to another some galleries can extract this data too.
  4. Use image.txt to add additional data for the image. This is no real caption but you are more flexible to place your output. image.txt data is not shown during a slideshow. Therefore for captions you should use 1. or 2. An example how image.txt can be used is shown here.

 52. How to use the multi root mode (new 1.7.6)

This mode can be used if you like independant galleries in one TWG install where each subtree should look like it's own gallery. Before you could do this by creating a root.txt in each folder. But this had some restrictions which don't exist now anymore:

  • In this mode you can not go to the main page and find out which other galleries do exist. An album parameter is always required.
  • You don't have to create root.txt files.
  • The album tree does now work and show the subtree only.
  • You can protect access by a session variable which e.g. can be set by Joomla (see the example below).

You can enable the mode by setting
$multi_root_mode=true;

You the have to link directly to the album with: <path to the TWG install>/index.php?twg_album=<your foldername>

Without a folder you get an error message that you are not allowed to see the root.
If you want to secure this directory then you have to do the same like described below in the JFU + TWG scenario.

JFU + TWG

An interesting combination is to use JFU with the module of TWG. In JFU you can create profiles for your users (or use a master profile with the login name as sub directory name) and point the directory to the pictures directory of TWG.

The module of TWG (it's in the joomla-mambo directory) does set the current login of Joomla to the session variable 's_user' and you can enable in the module that the login is automatically added as twg_album parameter. Then the user directory is shown in the module. Finally you have to set the parameter
$multi_root_mode_login='';
to
$multi_root_mode_login='s_user';

in the configuration of TWG. By doing this setup every user get's his own little gallery nicely included in Joomla.
If you leave $multi_root_mode_login=''; no session check is made. Then you can access an album by knowing the url. If you want to give the user the posibility to share their images without login this is usefull.

If you don't use the multi root mode you can still use the TWG module to make a direct link to the users directory.

About including a module in the content area: If you don't have a module position where you can include TWG you can include it by following this tutorial of loadposition. For 1.0.x users: google for mosmodul.

 53. Howto configure your server to run TWG properly

Iit's quite important how you configure your server to get TWG working properly. On the configuration page the first thing I tell you is the call info.php. And this is the howto how to change this settings.

So first call info.php and check the settings you see there. This are the settings you have set on your server in your php.ini.

The php.ini is your php configuration file of your server. It's not part of TWG/TFU/JFU and you have to make changes there to increase the limits. There are several locations where the php.ini files is/can be.

  • Private hosting: In the config directory of your web server. For apache this is e.g. in the apache\bin folder. The locations below should work too.
  • Shared hosting: If you are on shared hosting you normally cannot change the php.ini directly. But most hosters allow to have a custom php.ini in the root directory or even in a sub directory. Therefore you should try to place your php.ini in the root folder and/or the tfu folder (JFU: administrator/components/com_joomla_flash_uploader/tfu/).
    If this does not work you have to ask your hoster!

The usage is really simple. You overwrite the settings from the default php.ini with the settings you set in your custom php.ini

This are the most interesting settings:

TWG:

  • memory_limit: This is the most important setting for TWG. If images are not shown or TWG does seem to load for ever you should check and increase this value if needed. info.php shows you your current settings + the maximum image size that can be processed. The debug file (counter/_mydebug.out) should give you additional details if you have not enough memory to resize images.
  • session_save path: Very seldom this variable is not set properly or the directory not writeable. If this is the case you are logged out right after a login. Set this variable to a writeable directory. You find message in the log file if the session_save_path is not writable or not set if this is the case.

Upload in TWG/TFU/JFU:

  • post_max_size, upload_max_filesize... Please go to howto 4 of the TFU howtos for details

A simple example for a custom php.ini for TFU would look like this.

memory_limit=64M
upload_max_filesize = 20M
post_max_size = 20M
max_input_time=1800
max_execution_time=1800
default_socket_timeout=1800

This defines a 20 MB upload limit, php memory of 64MB and timeouts of 30 min. There are most of the time maximum limits by your hoster you cannot exceed. Therefore you have to ask your hoster if you cannot increase the limits to the value you need..

For a complete list of settings that you may configure in the php.ini file, please refer to the PHP manual page found at http://www.php.net/manual/en/ini.list.php. Please be informed that the php.ini file does not require all of these settings; only enter the line that you wish to change from the default value.

When changing the maximum file upload size, please ensure you have changed both the upload_max_filesize and post_max_size configuration together.  The two settings should share the same value.

If you have an ISS as webserver please read this post: http://www.tinywebgallery.com/forum/viewtopic.php?t=2295

 54. How to set a background image

There are a couple of ways how to define background images in TWG. TWG does also support dynamic background images which means that the background images gets resized dynamically to the browser dimensions.

  • Fixed global image:
    • Define the background image in the style sheet. e.g. in my_style.css -> body { background-image: url('<your image>') }
      Make sure that you have not selected a skin or the transparent skin.
    • OR: Specify the image by setting $background_default_image='<your image>'; . To have a static background you have to set then $use_dynamic_background=false;
      Enter this setting in the the extra tab in the TWG administration.
  • Dynamic global image:
    • Specify the image by setting $background_default_image='<your image>'; . To have a dynamic background you have to set then $use_dynamic_background=true; (=default)
      Enter this setting in the the extra tab in the TWG administration. There are additional options available ($use_resized_background, $resized_background_tolerance, $resize_only_if_too_small). Take a look at the description in config.php for more details.
  • Individual folder image:

If you use the color manager you can select different example images. Make sure to use the 'color' transparent for the areas you want to see the background images. The background image cannot be defined directly in the color manager and has to be set like described above.

 

FAQ (English only!)

 I'm using TWG 1.5 and my cmotion thumb strip is not moving anymore!

Before 1.5 the cmotion gallery was always moving if you had dhtml mode enabled - since 1.5 this is not the case anymore! this can have one of the following reasons:

  • $autodetect_noscoll=true; - If you have less then $numberofpics images you don't need to scroll at all - if you set this to true the thumbs below are static no mater which one you select (the actual thumb in not below the image anymore!)
  • $use_nonscrolling_dhtml=true; - This is a mode where the strip does not move by moving the mouse but by clicking on the thumbs - This looks like the html solution but is much nicer because no reload is done and lots of precaching can be done either

FAQ (English only!)

 I'm using TWG 1.5 and my cmotion thumb strip is not moving anymore!

Before 1.5 the cmotion gallery was always moving if you had dhtml mode enabled - since 1.5 this is not the case anymore! this can have one of the following reasons:

  • $autodetect_noscoll=true; - If you have less then $numberofpics images you don't need to scroll at all - if you set this to true the thumbs below are static no mater which one you select (the actual thumb in not below the image anymore!)
  • $use_nonscrolling_dhtml=true; - This is a mode where the strip does not move by moving the mouse but by clicking on the thumbs - This looks like the html solution but is much nicer because no reload is done and lots of precaching can be done either

 TWG Admin does not work and all iframes are white

If all iframes are white and the TWG Admin does not work then most likely a basedir restriction of your php installation is the problem. If you can speak german you can check the following thread in the forum: http://tinywebgallery.com/forum/viewtopic.php?t=399.

To make find out if this is the case add

ini_set("display_errors",1);
error_reporting(E_ALL);

to your index.php if no errors are shown in the debug file.

If you find something like that:

Warning: main(): open_basedir restriction in effect. File(./../config.php) is not within the allowed path(s): (/serv/www/data:.:/tmp/) in /home/gf1491/public_html/twg/admin/index.php on line 61

Warning: main(./../config.php): failed to open stream: Not owner in /home/gf1491/public_html/twg/admin/index.php on line 61

Then you have the basedir restriction. This means that you are not allowed to access a file from an upper directory. Please ask your admins to loosen this restriction because otherwise TWG won't work.

 The images/directories are not shown at all or only some are shown

If you have set the right file permissions there can be a problem with your php memory limit. If you have original images with ~ 1MB the needed intern memory is ~10MB (Open a jpg e.g. in Paint Shop Pro or Photoshop and check the memory usage of your image). Call the file info.php in the TWG main directory. It shows you the php-settings of your system. If your memory limit is lower than the limit you need for your pictures you have to increase this limit or make your images smaller.

OR - If all images are missing: Have you enabled the "text on image" feature. If yes maybe the FreeType lib isn't installed on your system (call info.php section gd). Set $print_text to false and retry - If the images are shown please use the $print_watermark switch. I will try to detect if the print_text does not work in one of the next releases.

OR - TWG is caching everything from the file system in the session - close your browser and try again! Since 1.7.1 this cache checks itself if it needs changes!

 Some of the images are completely black on the thumbnail view

You have maybe opened the gallery during uploading the images. Just delete the cache folder and retry. Or the images cannot be read by the php library. I know some cameras that create jpg's that are not readable by the gdlib! If you can you should update your php installation > 5.1.3 - From there on corrupt images can be read much better - TWG sets all the flags that are needed to process these images!

 Deleting the cache

Deleting the cache does not mean to delete all the files which are in there. It means to delete all the images that are in there! There are also .rot files where the rotation of images are stored :). If you want to remove stupid rotations - delete all files in this folder except the index.htm! Use the administration to delete the different levels of the caching!

 You wrote that you removed all the cookies - but when I go to the gallery a cookie is set!

That's right - TWG does not use any cookies to store information by itself but php does to track your session. If you don't allow this cookie you can't login or change any settings. But you can refuse this cookie and still use everything of TWG. TWG is designed to run without cookies if the php installation is setting a parameter in the php.ini. If the administrator of the gallery is able to set the flag 'session.use_trans_sid = 1' the urls get a sessionid. Then you can refuse the cookie and still use the whole functionality. If not you should allow your browser to accept this one cookie.

 I want to sort my images by the date the picture is taken (using exif data) - what do I have to set on my server?

TWG tries so sort your images after the time the picture is taken. Therefore it need to read exif information from the image. This function is only available in PHP 4 compiled using --enable- exif (call the info.php of TWG and check your php settings). Its functionality and behavior has changed in PHP 4.2. Earlier versions are very unstable. There are a couple of libraries in the www that can read the information without --enable- exif but I have tried some and didn't get better results reading the time the picture was taken (my own camera does not have exif data I can use :(). If no proper data can be read the file time is used. If --enable-exif is not set the file time is used as well.

 How can I reset/change the image view counter/caption/comments?

Maybe you want to reset/change the image view counter. The counter files are stored in the xml directory and have the format <twg_album>_image_counter.xml. Each directory has its own counter file. If you remove the file a new one is created the next time a picture of the twg_album is called. You can also modify it with a text editor to maybe reduce a stupid counter value.
The xml directory does also hold the captions (<twg_album>_image_text.xml) and the comments (<twg_album>_album_kommentar.xml). You can delete this files if you want to reset the entries. If you modify something with a text editor there please be careful because the text is stored encoded there (xml does not like something like & ;)).

 I want to test TinyWebGallery at my system at home. Is there a easy way to do this?

Yes there is. There is a great project called xampp that has a ready to go package of an actual Apache with installed PHP (and much more). Just go to http://www.apachefriends.org/de/xampp-windows.html and download the package. You have only to execute a batch file to start the Webserver (if you download the zip file!). Simply unpack the TWG into the htdocs directory of xampp and you are ready to go.

 Exif information is not shown in TWG but the Windows Explorer does. Why?

Exif information is stored differently by each camera type. The exif reader that is used is looking at a defined set of offsets and tries to extract the information. Windows explorer (and other tools) do just know more offsets than the small php class ;). I have this problem too depending which program I use to process my images. If the images don't work download the freeware version of cam2pc (http://www.nabocorp.com) and resize the image with the flag "copy metadata" set. Use as size a size bigger than your images if you don't want to resize! This nice tool copies the exif data to a place the exif reader con find it ;).

The exif reader is the same coppermine gallery uses. Therefore I want to thank coppermine programmers and the initial developer of the exif class who released this under the GNU General Public License!

 Known restrictions

Opera:

  • The album explorer does not open with Javascript. The layout is not displayed properly if this is done. Therefore a reload is done for displaying it.
  • When the album exploer is open then sometimes the footer does no stay at the bottom. It jumps dynamically and I haven't found a way to fix this. The html is w3c conform but Opera still acts very weired. Therefore the album tree is always closed automatically by default when you click on it - there is no pin where you can make the explorer album sticky like in the other supported browsers.
  • Opera opens the popup in a new tab by default and this cannot be resized - therefore the remaining space is black.
  • Round corners are not supported. The fallback without round corners is used.