This is an image gallery script that allows you to simply upload new full sized images in FTP and the script will automatically create the thumbnails for those images and add those images to a paged thumbnail gallery suitable for browsing.
Instructions:
First of you have to set the variables in the code below.
- Scroll down to about line 30 and look for $config['size']. Set this to the maximum width or height you want your image thumbnail to be.
- On the next line in the $config['imagequality'] set this to the JPEG quality you would like your thumbnails to be. I recommend you keep it set to 70.
- $config['rows'] and $config['cols'] are the number of rows and number of columns of thumbnail images you want shown on each page.
- $config['maxShow'] is the number of page numbers to show at one time. for instance if you have 100 pages of images, you can set this to only show the page numbers of the 10 pages close to where you currently are.
- $config['thumbs'] is the relative path to where you want the thumbnail images to be stored. Include the trailing slash.
File Permissions:
Changing the Look:
The entire gallery table is controlled by the CSS settings you'll find toward the bottom of the gallery.php file. I tried to comment each specific part of the CSS and what it controls so you can easily change the look of the gallery without actually having to actually edit any of the PHP.
Here is the Code:
You can download the gallery.php file from the following link.
http://www.ricocheting.com/scripts/gallery.html
Truncate a string in Smarty
Suppose you have a sentense in smarty that contains more characters and the rows of the table where you wants to show it will become wrap which sounds very bad. So you can use smarty variable modifier called 'truncate'.
How to use Truncate:
It has following syntaxes,
truncate:how_many_characters_to_show:what_characters_appear_at_end
truncate:int:int
lets,
http://www.smarty.net/manual/en/language.modifier.truncate.php
Special Thanks:
Ihsanuilah Khan
How to use Truncate:
It has following syntaxes,
truncate:how_many_characters_to_show:what_characters_appear_at_end
truncate:int:int
lets,
$yourString = "Hello World";
- {$yourString|truncate}//output// Hello World
- {$articleTitle|truncate:3}//output// Hel...
- {$articleTitle|truncate:3:""}//output// Hel
- {$articleTitle|truncate:3:"---"}//output// Hel---
http://www.smarty.net/manual/en/language.modifier.truncate.php
Special Thanks:
Ihsanuilah Khan
No comments:
Post a Comment