2011-12-28, 19:39:37
Hi Martin,
I've chosen to combine your idea
So automatically it will generate new thumb if not exist or old. SAme as you do in pic.php.
And the point at hostingsociety seems to be that it doesn't accept the huge number of calls of a php file.
This solution just works for the audience. The admin still have the problem that in edit or imagebrowser mode you're blind (just a few admin thumb are displayed). Not a big issue as I administrate my CMS locally.
Finally I think the only solution is to modify pic.php to make it a function and include pic.php only once woth a call to the function for each image/thumb.
This was not what was looking for. I need more different groups (like family, friends, team, colleagues, etc) with different permission. But no issue as I found my own solution.
I'll report my studies to the coder of hostingsociety. I'll keep you updated.
bydey
I've chosen to combine your idea
mvlcek Wrote:the thumbnail/image exists, link to the image file.with my previous
Code:
function i18n_gallery_thumb_link($gallery, $item=null, $echo=true) {
if (!is_array($item)) $item = @$gallery['items'][-intval($item)-1];
if (!$item) $item = @$gallery['items'][0];
$tw = @$gallery['thumbwidth'];
$th = @$gallery['thumbheight'];
$tc = @$gallery['thumbcrop'] && $tw && $th;
$infile = preg_replace('/\.+\//', '', $item['filename']);
$infile = str_replace("//","/",$infile);
$pos = strrpos($infile,'/');
if ($pos === false) $pos = -1;
$outfile = substr($infile, 0, $pos+1) . 'i18npic.' . ($tc ? 'C' : '') . ($tw ? $tw.'x' : '0x') . ($th ? $th.'.' : '0.') . substr($infile, $pos+1);
$outfile = substr($outfile, 0, strrpos($outfile,'.')) . '.jpg';
$thumbdir = './data/' . 'thumbs/';
$link = $thumbdir.$outfile;
if (!file_exists($thumbdir.$outfile) || @filemtime($thumbdir.$outfile) < @filemtime($imagedir.$infile) || isset($_GET['php'])){
$link = i18n_gallery_site_link().'plugins/i18n_gallery/browser/pic.php?g='.$gallery['name'].'&p='.urlencode($item['filename']).'&w='.$tw.'&h='.$th.($tc?'&c=1':'');}
if ($echo) echo str_replace('&','&',$link); else return $link;
}
And the point at hostingsociety seems to be that it doesn't accept the huge number of calls of a php file.
This solution just works for the audience. The admin still have the problem that in edit or imagebrowser mode you're blind (just a few admin thumb are displayed). Not a big issue as I administrate my CMS locally.
Finally I think the only solution is to modify pic.php to make it a function and include pic.php only once woth a call to the function for each image/thumb.
mvlcek Wrote:On request of the page with the gallery the plugin knows the sizes and could resize all images not yet resized and then output links to these resized images/thumbnails. However, for a gallery of more than a few images this would take to much time and would probably give you a timeout.As mentioned I've the feeling that the number of calls for the pic.php is the problem.
Quote:I have a not-yet-finished plugin similar to frontend-users, where you can define user groups based on the tags/keywords of pages and images, e.g. anonymous users see all pages/images tagged with "public", registered users get all pages/images unless tagged "private" and users in the group "friends" get all pages/images.
This was not what was looking for. I need more different groups (like family, friends, team, colleagues, etc) with different permission. But no issue as I found my own solution.
Quote:Telling the browser to cache images and just returning "Not Changed" instead of the image on a new request would lessen the load on the server and maybe partly solve the problem - if the image is already in the browser cache.Again. It seems to be the call of pic.php. So if you need to call pic.php to compare the cache it won't work. If the cache is that smart that it reduces really the number of calls fine.
I'll report my studies to the coder of hostingsociety. I'll keep you updated.
bydey
my getsimple page deynews.de