GetSimple Support Forum

Full Version: I18N Gallery
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
stania Wrote:how to insert the gallery on the outside content. in header?

<div id="header">
<?php (% gallery name=glowna %); ?>
</div>
not working
You're mixing up how to include a gallery. In the plugin webpage for I18N Gallery it says

Quote:To add a gallery to your template, use

<?php get_i18n_gallery(array('name'=>'my-gallery-name')); ?>

Try that for better results. Smile
hi, are the thumbnails generated by plugin?
I want my thumbnails have fixed dimensions (150x100) without stretching the img. so I want an automatic crop within the script.

my actual situation is like this:
[Image: schermata20110629a19341.png]

here I only set maxWidth value (150).
I want all my thumbnails to have 150x100 dimension without stretch, but I can't find where's the function which creates them.

can you help me? thanks
I18N Gallery version 1.1:
  • Better support for multiple galleries on one page
  • Better support for galleries in the template (@stania)
  • output of links to galleries (@edwardloveall)

Use the following for galleries in the template (first line in the HTML header, second in body):
Code:
<?php get_i18n_gallery_header('my_gallery_name'); ?>
...
<?php get_i18n_gallery('my_gallery_name'); ?>

For links in the page content use (displays link as random thumbnail):
Code:
(% gallerylink name=my-gallery-name url=my-gallery-slug thumb=random %)
For links in the template use (displays link as gallery title):
Code:
<?php get_i18n_gallery_link('my-gallery-name',array('url'=>'my-gallery-slug')); ?>

For more information see here.
allienato Wrote:hi, are the thumbnails generated by plugin?
I want my thumbnails have fixed dimensions (150x100) without stretching the img. so I want an automatic crop within the script.

The thumbnails are created in plugins/i18n_gallery/browser/pic.php.
Only proportional resizing is supported, cropping is not supported (where should we crop anyway?).
If you specify both width and height, the image is proportionally scaled so that it fits within width/height.
Hi!
mvlcek Wrote:The thumbnails are created in plugins/i18n_gallery/browser/pic.php.
Only proportional resizing is supported, cropping is not supported (where should we crop anyway?).
It would be nice if I18N Gallery could create a square thumbnails (center crop image).
mvlcek Wrote:The thumbnails are created in plugins/i18n_gallery/browser/pic.php.
Only proportional resizing is supported, cropping is not supported (where should we crop anyway?).
If you specify both width and height, the image is proportionally scaled so that it fits within width/height.

i changed lines (30 and 31):

Code:
$width = imagesx($src);
$height = imagesy($src);

with

Code:
$width = 150;
$height = 100;

but nothing happens. wrong place?

y, I agree with xStranger, maybe center crop

EDIT: sorry, I just saw "Delete thumbnail and image cache" in administration. after clearing cache, it works. the problem now is this:

[Image: schermata20110630a10041.png]
ok, the problem above was caused by $width and $height values in function imagecopyresampled($dst, $src, 0, 0, $cx, $cy, $dwidth, $dheight, $width, $height)

it needs image source dimensions, not destination ones (I set $width = 150, height = 100).
so I added 2 more variables with imagesx and imagesy functions to get the dimensions of source image and used them in imagecopyresampled function. that's it.

but some thumbnails were stretched.
so I changed the code to make a crop (found a good example here: http://www.gidforums.com/t-21016.html)
and now is ok.

I should update the new code with the control on maxHeight / maxWidth, but I don't actually need it.
Alienate, can you show us new updated code? ( pic.php with crop function)
cyklades Wrote:Alienate, can you show us new updated code? ( pic.php with crop function)

starting from line 30...

Code:
$dwidth = 150; // width I want to use
$dheight = 100; // height I want to use
$width = imagesx($src);
$height = imagesy($src);
$ratiowidth = $width / $dwidth;
$ratioheight = $height / $dheight;
$cx = 0;
$cy = 0;
if($ratioheight < $ratiowidth) {
  $tempwidth = $width;
  $width = $dwidth * $ratioheight;
  $cx = ($tempwidth - $width) / 2;
}
if($ratiowidth < $ratioheight) {
  $tempheight = $height;
  $height = $dheight * $ratiowidth;
  $cy = ($tempheight - $height) / 2;
}
$dst = imagecreatetruecolor($dwidth, $dheight);
imagecopyresampled($dst, $src, 0, 0, $cx, $cy, $dwidth, $dheight, $width, $height);

there's no control on maxWidth and maxHeight, which I don't use
I18N Gallery version 1.2:
  • Cropping of thumbnails and images to e.g. support square thumbnails (@allienato, @xStranger, @cyklades)

If you enter both width and height (either thumbnail or image), you can choose to crop the image instead of just scaling it, e.g. original image is 800 x 600
  • max. thumbnail size 160 x 160, no cropping => thumbnail size 160 x 120
  • max. thumbnail size 160 x 160, cropping => thumbnail size 160 x 160 (left and right 100px of original image cropped)

For cycle and s3slider plugins cropping is always on (if both width and height is given).
For supersized plugin cropping is not supported, as the browser width to height ratio is not known before.
mvicek - I don't know why Smile but it works!
Thank you mvicek and alienato!
cool, thank you mvicek
My little suggestion for new version.

In new gallery: reading "Maximum thumbnail dimensions" and "yes/no crop" from settings for all galleries.
Now I have to remember this setting in each new gallery.
Thank you, mvlcek! Smile
Hi again mvlcek. I'm sure you're tired of hearing this, but I'm still having issues while trying add images and getting that Not logged in! message. I have GSCOOKIEISSITEWIDE set to true and uncommented and have tried resetting my own cookies many times. Sometimes, it seems to take. Most of the time, it doesn't.

Doing a little searching, it seems that this is a bug in GS 3.0 and that you've even tried to help fix it, and even included this work around. Alas, I still get the error. Any thoughts?

Thank you again for your work. I know this isn't your fault.
Quote:Use the following for galleries in the template (first line in the HTML header, second in body):
Code:
<?php get_i18n_gallery_header('my_gallery_name'); ?>
...
<?php get_i18n_gallery('my_gallery_name'); ?>

Sorry for bad english.
Galery name: 1

I want to insert cycle slider in div header.

template.php
Code:
<head>
<?php get_i18n_gallery_header('1'); ?>
      
        <title><?php get_page_clean_title(); ?> &lt; <?php get_site_name(); ?></title>
        <?php get_header(); ?>
        <link rel="stylesheet" type="text/css" href="<?php get_theme_url(); ?>/style.css" media="all" />
    </head>
<body id="<?php get_page_slug(); ?>" >
<div id="header">
      <?php get_i18n_gallery('1');
       ?>
</div> <!-- end div header -->
    </body>

Not working
function i18n_gallery_header not including files .js and .css
stania Wrote:Not working
function i18n_gallery_header not including files .js and .css

The code looks ok.
What are the general gallery settings?
What is the configuration of the "1" gallery?
What is the HTML output?
Do you have a link or is this a local site?
link:

http://stania.boo.pl/GetSimple_3.0/



full code template.php
Code:
<?php if(!defined('IN_GS')){ die('you cannot load this page directly.'); }
/****************************************************
*
* @File:             template.php
* @Package:        GetSimple
* @Action:        Cardinal theme for the GetSimple CMS
*
*****************************************************/
?>
<!DOCTYPE html>
<html>
<head>
<?php get_i18n_gallery_header('1'); ?>
    <!-- Site Title -->
    <title><?php get_page_clean_title(); ?> &lt; <?php get_site_name(); ?></title>
    <?php get_header(); ?>
    <meta name="robots" content="index, follow" />
    <link rel="stylesheet" type="text/css" href="<?php get_theme_url(); ?>/style.css" media="all" />

</head>
<body id="<?php get_page_slug(); ?>" >

<div id="wrapper">

    <div id="header">
        
        <ul id="nav">
            <?php get_navigation(return_page_slug()); ?>
        </ul>
        
        <?php get_i18n_gallery('1'); ?>

    </div><!-- end header -->
    
    <div id="content">
        <h1><?php get_page_title(); ?></h1>    
            <div id="page-content">
                <div class="page-text">
                    <?php get_page_content(); ?>
                    <p class="page-meta">Published on &nbsp;<span><?php get_page_date('F jS, Y'); ?></span></p>
                </div>
            </div>
    </div>    
        
    <div id="sidebar">
        <div class="section">
            <?php get_component('sidebar');    ?>
        </div>
        <div class="section credits">
            <p><?php echo date('Y'); ?> - <strong><?php get_site_name(); ?></strong></p>
            <p>
                Cardinal Theme by <a href="http://www.cagintranet.com" title="Pittsburgh Creative Agency" >Cagintranet</a><br />
                <?php get_site_credits(); ?>
            </p>
        </div>
    </div>
    
    <div class="clear"></div>
    
    <?php get_footer(); ?>
    
</div><!-- end wrapper -->
</body>
</html>


[Image: galery_config.jpg]
[Image: galery_config2.jpg]
admin:
stania Wrote:link:

http://stania.boo.pl/GetSimple_3.0/

You have to install at least version 1.1 (better the newest - 1.2) of I18N Gallery.
Never post passwords in the forum - rather send them by PM (private message).
mvlcek Wrote:
stania Wrote:link:

http://stania.boo.pl/GetSimple_3.0/

You have to install at least version 1.1 (better the newest - 1.2) of I18N Gallery.
Never post passwords in the forum - rather send them by PM (private message).

thank you, specific, fast, help
Hi getsimple team and forum,

first off all I like to say congratulation and thank you for a wonderful CMS with nice and working plug ins.
With I18N Gallery (1.2 on getsimple 3.0) there are two things that botheres me:

1. Style w/o javascript
the homepage style gets corrupt when JS is deactivated. Same for fancy and pretty. The JS scales anyhow the pictures size to the screen (view port) size. The max width setting is respected as well as the real size of the picture.
In case of deaktivated JS the real size of the picture is used or max width setting. And this corrupts the layout of the page if this resulting size of the pictures is larger than the container. But actually I would need different max width settings for with JS and w/o JS.
This url modification didn't change anything:
index.php?id=all-pics&width=250&pic=all:-2
index.php?id=all-pics&width=250
Any idea how to solve this?

2. supersized too big
Pictures in landscape doesn't fit into screen or view port. Portrait is calculated correctly.
The landscape is calculating by the width and doesn't respect the height and parts of the pictures at top and bottom become invisible. A scrollfunction is not given.
Portraits are not in the center but right aligned.
Any idea here?

Thanks for help

bydey
dey Wrote:1. Style w/o javascript
the homepage style gets corrupt when JS is deactivated. Same for fancy and pretty. The JS scales anyhow the pictures size to the screen (view port) size. The max width setting is respected as well as the real size of the picture.
In case of deaktivated JS the real size of the picture is used or max width setting. And this corrupts the layout of the page if this resulting size of the pictures is larger than the container. But actually I would need different max width settings for with JS and w/o JS.

Just add a new rule to your CSS like the following (it needs to be more specific than the generated ones; width/max-width is dependent on your layout):
Code:
body .gallery .gallery-image { max-width:600px; }

dey Wrote:2. supersized too big
Pictures in landscape doesn't fit into screen or view port. Portrait is calculated correctly.
The landscape is calculating by the width and doesn't respect the height and parts of the pictures at top and bottom become invisible. A scrollfunction is not given.
Portraits are not in the center but right aligned.
Any idea here?

Yes, I know - this is a "feature" of the supersized-script which I just included in the plugin. You are welcome to fix it, I haven't had time for it yet. If you do, please send me the correction so I can include it in the gallery.
mvlcek Wrote:Yes, I know - this is a "feature" of the supersized-script which I just included in the plugin. You are welcome to fix it, I haven't had time for it yet. If you do, please send me the correction so I can include it in the gallery.
Hi,

the script I downloaded with the I18N Gallery is totally unstructured, no breaks, nothing. Impossible to read, understand and modify. Do you have it anyhow structured?

bydey
dey Wrote:Hi,

the script I downloaded with the I18N Gallery is totally unstructured, no breaks, nothing. Impossible to read, understand and modify. Do you have it anyhow structured?

bydey

There is a link in the administration, when you select supersized: http://www.buildinternet.com/project/supersized/. You should be able to download the uncompressed version there.
mvlcek Wrote:Just add a new rule to your CSS like the following (it needs to be more specific than the generated ones; width/max-width is dependent on your layout):
Code:
body .gallery .gallery-image { max-width:600px; }
This didn't work but this:
Code:
body .gallery .gallery-image img{ max-width:900px; }

I wonder how many browser will ignore max-width!?

bydey