|
How-to's for TWGThe numbers of the howto's are the order I have created them. I simply could not change them because there are deeplinks from older TWG installs to this page. I have ordered each section how I think how important the howto is.
|
File name | Style (css) | Location | Description |
---|---|---|---|
header.htm | twg_headerhtml | TWG folder | Is included above TWG. |
top.htm | twg_tophtml | TWG folder | Is included on the top of TWG (before TWG 1.7.8 top.htm was called header.htm - see below for the small difference!). |
bottom.htm | twg_bottomhtml | Is included on the bottom of TWG (before TWG 1.7.8 bottom.htm was called footer.htm - see below for the small difference!). | |
footer.htm | twg_footerhtml | TWG folder | Is included below TWG. |
left.htm | twg_left | TWG folder | Is included on the left side - $left_htm_width defines the width of the column |
right.htm | twg_right | TWG folder | Is included on the right side. Can only be used if you have a left.htm. If you need only a right.htm create a left.htm leave it empty and set $left_htm_width=0. |
overview.htm | twg_overviewhtml | TWG folder | Is included below the albums on the main page |
thumb.htm | twg_thumbhtml | TWG folder | Is included below the thumbnails on the thumbnail page. You should set $thumbnail_offset_y to the heigt of the conent you include. Then the autodetection of thumbs works perfect ;). |
image.htm | twg_imagehtml | TWG folder | Is included below the detail image on the image page |
topx.htm | twg_overviewhtml | TWG folder | Is included below the thumbnails on the topx page |
thumb.htm | twg_thumbhtml | subfolders | thumb.htm can be in the main folder AND in each folder. Makes it possible to e.g. show a pdf download link depending on the folder. |
Location overview:
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 and therefore this are no compete pages! Only put the stuff in there you want to display!
MOST files can be language dependent: overview_de.htm, thumb_de.htm, topx_de.htm, image_de.htm, topx_de.htm
Don't use header.htm, bottom.htm oder footer.htm when using iframe include because IE does sometimes not render this properly. Normally this is not needed because when using iframe include your content should be places outside the iframe.
Since TWG 1.6: Please store all your text files in UTF-8! Then special characters are displayed properly!
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>
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 |
If you don't have any images in a folder (only other directories) or you don't want that images from this folder are displayed you can set a folder image for each folder. Simply put a png image called folder.png in the directory. Simply rename a jpg to png ;).
If you use a lot of folder images and you don't have specialy caracters please set $direct_folderpng = true; for better performance.
Important: The original size of the image is used here! This makes it possible e.g. to use really big images on the 1st page and for subdirectories smaller ones! If you have protected galleries you have to use a private.png
There are also the following 2 options:
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:
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: ä -> ä
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!
New 1.8.5: You can edit foldername.txt direktly in TWG. If you are logged in and you have at least the right "upload" you will get on the detail page the menu "Edit". There you can set the gallery name. Please note that you can only edit the language independent version!
Since TWG 1.6: Please store all your text files in UTF-8! Then special characters are displayed properly!
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: ä -> ä
New 1.8.5: You can edit folder.txt directly in TWG. If you are logged in and you have at least the right "upload" you will get on the main page and the detail page the menu "Edit". There you can set the gallery name. Please note that you can only edit the language independent version!
Since TWG 1.6: Please store all your text files in UTF-8! Then special characters are displayed properly!
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: ä -> ä 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.
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
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:
If a album folder is read protected from the web you have to use at least TWG 1.8.8 and enable optimized css because this generates only one css which is stored in the cache folder.
There is a file called info.php in the main directory of TWG. If you call this file instead of index.php TWG is checking some requirements and is printing the php info. If TWG is not running properly or not all features are available it is always nice to take a look there. Then check the FAQ - there are some memory issues already covered.
In the TWG Admin is an enhanced info! It tells you even more about which permissions are needed for which file/folder.
It is possible to link into a gallery or to a image. Simple copy the link in the URL! But this does not work with password protected galleries! To link directly into protected folders you have to copy the URL from the gallery you want to link to. You have to login to get this URL! After that you have to add the parameter &twg_private_login=<gallery password> to the URL. Please note: the password is not encrypted. This feature will be added by the administration which is coming soon (I hope ;)). If you use encrypted password (see how-to 1.7) you have to add the encrypted password!!
The parameter $enable_external_privategal_login has to be set to true to enable this kind of login. The default is false!
To protect a gallery with a password you have to create a empty file with the name 'private.txt' (or whatever you have set you password file in the config) in the directory you want to protect. If the file is empty the password from the config ($privatepassword) is used. If you want to protect a gallery with a different password you have to enter the password in the 'private.txt' file.
Please read howto 1 how to secure direct access to your data!
This is the description from the config.php. I want to make some more comments at this point because some people asked:
You can now use several passwords for each directory. Simply create a normal password file and separate the different passwords with a ','. e.g. test,test2,test3. Make sure that there are no spaces between the commas and the passwords. If $encrypt_passwords=true you have to use the generated password!
By using multiple passwords you can give some friends access to some directories and e.g. your family access to other directories. The advantage is now that these two groups can now have access to the same galleries as well! Or you can protect all galleries with a kind of "super password" and a couple of directories with a 2nd password for access of only an area.
Please note: If you use passoword protected directories please don't use the popup on the detail page because the link in the popup is not protected. Use the fullscreen mode or the lighbox if you images have to be 100% protected.
Folder image for protected galleries
You can also set your individual image for a password protected gallery. Create a file named private.png and place it in the protected folder. The size should be the size you have set in the config.php (default is 120 x 120). Since 1.6 an image is autogenerated if $autogenerate_private_png = true; (=default). private.png files always overwrite a autogenerated one!
Important: If you use another size than the one in the config.php the original size is used - This is because you can use individual folder images which have the same behavior.
New 1.7: You can use a private.txt in the 'pictures' folder! Then a global login window is shown. You have to place all passwords (users for user based galleries) that have to have access in this file.
New 1.7.5: private.txt does now work recursive and protects all subfolders as well.
New 1.8.5: You can now use a private.png in the pictures folder. If you have defined a private.txt in this folder you can use a big image which covers the whole browser. You can create a nice entry page for your protected gallery this way.
New 1.7.6: User based galleries
Since 1.7.6 it is possible that you can switch to a different protection mode. To unlock a protected gallery you can to use your TWG login/password then. In the private.txt you enter the login(s) comma seperated which should have access to this album.
The following two parameters are available:
So why are there 2 modes? It depends what you need and what you prefer.
These are the pros and cons of the user based protected galleries:
+ Your users have only one login to access all their galleries
+ Protected galleries can be completely hidden because the login is done through the normal login
+ You don't have to send e-mails with passwords to your users (But you still have to inform them somehow)
+ You can disallow access for a single users by removing the login. Removing a password in the other mode would affect other users as well.
- You have to add all users that should have access to the private.txt. In password mode you only have one password in the file.
- In my opinion the user based protected galleries have more administration overhead.
- You need an account for each user.
So pick the mode you like more ...
Basic:
To configure the watermarks please go to the administration of TWG and select "Configure TWG". Go to the tab "watermark". If you make any changes there you have to refresh the image cache ("Clean Cache" -> Clean image cache). Please clean the browser cache then. Otherwise the old images from the browser cache are used and you don't see any changes.
Advanced:
The description at the watermark section is a little bit short in the config.php file. Therefore I will give some additional explanations:
You can use individual watermarks for each folder! You can do this by creating the following files:
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!
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.
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!
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!
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!
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 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.
If a listing is not possible
You can provide a page by yourself (e.g. an index.htm in a folder) that has only full links (e.g. <a href="http://www.123.com/images/image1.jpg">image1.jpg</a>) to your images. It is important that you use the html link syntax because the server does deliver the directory listing in the same way. 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.
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:
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.
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!
Deutsche Version -> Deutsche FAQ
You should use the file my_config.php for your configuration or use the administration - For details see here! Save your changes you want to make in config.php to 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! config.php is overwritten by the patch because new parameters are defined here!
If you want to use the installer for updating please read how-to 31
UPDATE TWG 1.6 or newer:
Since TWG 1.6 the structure has not changed. On the download page is a patch file available where you can simply overwrite all existing files! Your settings and your data are not overwritten.
For a transfer (or a backup) of your setup and data move my_config.php, my_style.css, admin/.config/.htusers.php, the counter, xml and your pictures folder to the new installation. Make sure that the files in the xml and counter folder are writeable!
UPDATE TWG before 1.6:
I recommend that you make a clean installation if you want to update a version before 1.6!
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!
If you scroll in the DHTML thumbnail strip you can set the numbers displayed at a time with $numberofpics.
You can also configure when the the green arrows at the end of the thumbnail strip appear. 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!
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 website 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:
That's it. If you want to share your skin please check the "Skins" section on the website. You should provide a screen shot and a zip file with the 3 files in it there.
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!
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:
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
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!
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.
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!
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)
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!
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.
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
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!
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="albumtxtleft"> ... </td> or <td class="albumtxtright"> ... </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 1.8.2:
You can use 3 variables which are replaced in the file:
Since TWG 1.6: Please store all your text files in UTF-8! Then special characters are displayed properly!
TWG has integrated the lighbox script and lytebox script (since 1.7.4) for registered users. This feature can be activated at 3 points:
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".
Please note that the litebox only works for the parent and the gallery is on the same domain because of the same origin policy.
Have fun using the lytebox.
To enable embedded 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:
Without thumbnail your video will not be shown!
Watermarks on the preview images of videos: By default a watermark is rendered on the thumbnails of videos. They are defined in the variable $other_file_formats. So if you want to change the watermark you can change it there. You can disable this feature by setting $overlays_for_other_file_formats= false; Make sure to clean the image cache after you change this setting.
Autodetection - Please read this part first!
You have 2 options:
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 to mp4 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 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.
Please store all your text files in UTF-8! Then special characters are displayed properly!
1. Embed HTML5 videos (mp4)
HTML5 videos are the way to go right now. TWG uses the video.js HTML5 player which does play mp4 videos directly.
In the demo you see all possible setups of HTML5 videos:
Advantage:
- Works on almost all devices
- Responsive videos are available. Videos do scale to your device size!
- 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
- The video are locally stored or even on a different server!
- You can provide a download link if you like
- You can use autostart or not!.
Local videos
The easiest way is to use the auto detection and store the videos on your server. Set everything in your my_config.php. E.G.
Upload your videos with a thumbnail and you are done. Use it together with then new responsive features of TWG and your videos should be displayed the best way on all devices.
TWG does also support the automatic conversion of videos and the auto generation of thumbnails. Please see howto 47 for details.<?php
$video_size_x=425;
$video_size_y=350;
$video_player="AUTO";
$video_autostart=true; // or false - depending what you want
$video_show_dl_link=true;
$video_autostart_parameter="&autoplay=1";
?>
Remote HTML5 videos
You can also store the videos on a remote site. This setup is a little bit more complicated because you still need a dummy mp4 file on the local server. So you need a thumbnail and a empty video file. Than you need to set
$video_flash_site = "https://...";
to the directory where the real videos are. In the demo example this is $video_flash_site = "https://www.mdempfle.de/html5/";
HTML5 videos and images
If you want to mix videos and images you can enable the mixed mode like described in howto 39. Simply set $mixed_video_image_content=true; in the video.php. And if you use $video_player="AUTO"; which is default right now you only have to enable the HTML navigation with $default_big_navigation='HTML';
Please check the HTML 5 videos in the demo. They can be found in the multimedia album and in the resopnsive album .
2. Embed a streamed video like youtube
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.
Please note that you can append all possible youtube parameters in the parameter video_autostart_parameter. You can find a full list here: https://developers.google.com/youtube/player_parameters
Youtube does support autoplay! If you open the TWG page with the video directly autoplay is not supported by many browsers anymore. It will only autoplay if you clicked on that page before.
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
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. The new HTML5 player is the one you should use if you also want to support smartphones and tablets where no extra plugin is available. It also 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!
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:
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:
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 5 rights available:
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.
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 IPTC data are:
. TWG uses this information at several places:
To avoid reading this info every time a picture is displayed (which would be quite slow) this reading is done when:
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
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.php 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!
New 2.2: You don't need a sorting prefix only to sort videos back into their normal order of the images. v___ is ignored for sorting now!
This a quite easy howto:
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.
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:
TWG does a lot of caching to speed up the gallery. These are the different levels of caching:
Please note: When you click on the bandwidth icon the data from the 1 day caching, X hours caching and the session is deleted! If the cache is not active you can activate it by clicking on the "No Cache" for this session! Then you can see how much faster the gallery is displayed ;).
Summary:
During normal use you should always turn the cache on because otherwise the server has to do a lot of additional work. After the installation the cache is turned off (as you see in the right bottom corner) because during setup you want to see changes even in the topx right away. But once this is done: turn it on. Uploading with the Flash Uploader does automatically update these caches!
New TWG 2.0!
SEO friendly urls for TWG are now available! The new urls of an album do now look like this:
http://www.tinywebgallery.com/demo/twg_album/05_exif
instead of
http://www.tinywebgallery.com/demo/index.php?twg_album=05_exif
or on the image page:
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
Quickstart guide
Detailed description
Extract the .htaccess from htaccess_url_rewrite.zip to the root of your gallery. The template in the .htaccess is:
RewriteEngine on
Options +FollowSymlinks
RewriteBase /twg2/
RewriteRule ^(.*)twg_album/(.*)$ $1index.php?twg_album=$2 [L]
RewriteRule ^(.*)twg_image/(.*)/(.*)$ $1index.php?twg_album=$2&twg_show=$3 [L]
RewriteRule ^(.*)twg_show/(.*)$ $1index.php?twg_album=&twg_show=$2 [L]
You have to change the RewriteBase depending to you installation! Make sure that the RewriteBase ends with /. If TWG is in the main directory simply use /.
If TWG is e.g. installed on www.yourserver.com/gallery/twg then you have to modify the file like this:
By default ~ is now used instead of / as album seperator. This was done because an / needs to be encoded and is %2F in the url which is not very nice and because of the rewrite is has to be encoded again. Encoded / also have problems with the google boots ans some apache settings (causes 404 errors) and therefore the new way should be used. If you want to switch back to the old encoding $use_old_seo_slash_encoding=false;
You can also set the album seperator character with $album_sub_url_seo_character="~"; Only make sure that the seperator char is not used for folder names. This way you are able to create quite nice urls for the albums as well.
Finally you have to enable in TWG that this kind of urls are generated by TWG. Set
"Enable SEO urls" in the Adminstration of TWG
or
$enable_basic_seo=true; in the my_config.php.
Have fun using TWG
By default most of the features of TWG are enabled. As you can think this looks best but is not optimized for speed. This small howto tells you a few parameter how you can optimize TWG a little bit if you think TWG is too slow ;). But remember - TWG does a bandwidth detection. If it detects a slow connection already the low_ from the config are used. This mode does disable some features that really use much bandwidth (like the colage, fixed number of thumbnails, hides the big navigation ...).
This is actually everything where I think this really makes a difference. You can of course tune much more but I don't think you will notice a difference in speed if you do this. If you are bored: simply take a look in config.php and you see what you can configure in TWG if you like ;).
Since 1.7 TWG does support image magick for:
These 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.
ffmpeg is a very powerful tool to convert videos and to extract thumbnails from videos. TWG can use ffmpeg to:
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 should ask your hoster or most of the time you can also install it by yourself. Under many Linux distributions you can install it though the package managemente.g. apt-get install ffmpeg. Also static builds on www.ffmpeg.org/download.html are available. You can upload them to your webspace and set this in the config at $ffmpeg_path. Under windows a native port does exist. It's only one exe file and a dll. Really easy to use ;).
You can also use avconv/libav. Than you have tu set this at $ffmpeg_path and check the command string at $ffmpeg_convert_command.
Depending on your input file the provided command in $ffmpeg_convert_command or $ffmpeg_convert_command_mp4 maybe needs different settings. To find the right/best command simply try the command on the console until you get the result you like. Google is also a good help to find the best settings for your input file.
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:
Right now only English and Geman translations are available. If you use this function please translate it and send me the translations.
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:
You can copy them to the free text field in the administation or in my_config.php
Have fun ;).
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):
Known restrictions:
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:
/* 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 ;).
If finally wrote this small howto because too many users asked me how to add captions to an image. There are the following ways:
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:
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.
New 1.8:
It is now possible to automatically log in a user to his folder. You can enable that a user can edit or upload. The parameters you have to use for this is
$multi_root_mode=true;
$multi_root_mode_login='<session variable with the folder e.g. s_user>'
$multi_root_mode_permissions='<'', 'edit', or upload. >';
$multi_root_mode_permissions is an extension of the JFU+TWG setup which you can also do without Joomla. Simply set the folder name to the session in . If you set $multi_root_mode_permissions = ''; then the handling like above in the JFU+TWG setup. If you set it to 'edit' or 'upload' then the user gets automatically logged in with edit or upload rights. If someone accesses the gallery without the right session variable then he can only view the gallery. Be aware that this is the difference to the JFU+TWG setup. If you set the $multi_root_mode_login there you need the session variable to access the gallery while with multi_root_mode_permissions set you can access the album without login.
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. These 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.
The usage is really simple. You overwrite the settings from the default php.ini with the settings you set in your custom php.ini
These are the most interesting settings:
TWG:
Upload in TWG/TFU/JFU:
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
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.
IMPORTANT
SINCE 1.8.8:
For optimal display for round corners the css styles #twg_info and #twg_content_div have now background colors. You have to overwrite them if you define a background image by setting
#twg_info { background-color:transparent }
#twg_content_div { background-color:transparent }
in my_style.css or use the 'transparent' skin! Then the image is visible in the conent area.
This styles are needed for all options below if not specified differently.
These are the different options you have:
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. Wenn Sie das für den inneren Bereich machen brauchen die oben beschriebenen Styles nicht überschieben werden. Dies erledigt der Farbenmanger bereits. The background image cannot be defined directly in the color manager and has to be set like described above.
Since TWG 1.8 the main buttons are not single images anymore but are all one one images which saves a lot of requests and speeds up TWG again.
To create your own icon set you can use one of the existing ones in the buttons/iconset folders as template and e.g. just color it the way you like. You can also exchange the images if you like to stick to the same size. If you want to fully create your own iconset please do the following:
Test the icon set and send it back to me if you like. I will add it to the download section. If you like you can even write a small script that will create everything automatically. I just don't have the time to do this right now by myself ;).
TWG has a lot of internal links which point to the same pages but with different urls because of different parameters. This leads to a lot of duplicate pages which are bad for googel ranking. Since TWG 2.0 the gallery is optimized as good as it is possible right now. So since 2.0 the following things are done:
So please update to TWG 2.0 to optimze your gallery. Furthmore you should register your site at the google webmaster tools: https://www.google.com/webmasters/tools. There you can check at Diagnose -> HTML suggestions about potential issues Google found when crawling and indexing your site. Simply look before updating TWG and after (it takes a few weeks/months until google has updated the index).
Additional go to Website Configuration -> Url-Parameter and tell Google that all parameters except twg_album and twg_show should be used for crawling. For all other parameters starting with twg_ please set that this parameter should not be used. There are some paraleters start with amp and have a twg_ also. Please disallow theses as well.
Wait a few weeks and you will see the results ;).
Since TWG 2.2 it is possible to make TWG responsive. This means that depending on the screen size the images do float or the image/video does scale. You can enable/disable this setting for the following pages: main page, thumbnail page and the detail page. Before TWG 2.2 the thumbnail page and the TopX where already optimizing the number of images depending on the screensize if the screensize was measured in the request before.
See a working example in the Ajax demo and click on the TWG responsive folder.
The settings are disabled by default because it also means that if you update to this version your gallery would look a little bit different than before. So you can now decide if you want to go responsive. The following settings are available:
Please note that TWG has a bandwidth detection ($test_client_connection and the $low_* settings in config_internal.php) and a mobile mode ($enable_mobile_detection and the $twg_mobile_* settings in config_internal.php) that can e.g. change the default number of albums on the overview of which navigation elements are shown.
Have fun using TWG,
Michael
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:
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.
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!
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 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!
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.
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.
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 & ;)).
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 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!
Opera: