From: Jonny B. <jo...@ti...> - 2011-01-31 12:22:51
|
On 30 Jan 2011, at 22:47, Nyloth wrote: > Hi Sylvie ! > > I don't understand the purpose of this. In which case do you use it ? > Why not simply calling tiki-download_file.php?fileId={$thumbId}&thumbnail ? > > Cheers, > Nyloth And there's already a sefurl so you can just use /thumbnail42 (since Tiki 3 i think?) Or are you somehow now having a different thumbId for a file (different from the fileId)? Also not understanding... jb > > > 2010/10/18 <sy...@us...> > Revision: 30090 > http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=30090&view=rev > Author: sylvieg > Date: 2010-10-18 13:55:33 +0000 (Mon, 18 Oct 2010) > > Log Message: > ----------- > [NEW]img: url param thumbnail=fileId to download a different thumbnail for an image > > Modified Paths: > -------------- > trunk/tiki-download_file.php > > Modified: trunk/tiki-download_file.php > =================================================================== > --- trunk/tiki-download_file.php 2010-10-18 12:21:07 UTC (rev 30089) > +++ trunk/tiki-download_file.php 2010-10-18 13:55:33 UTC (rev 30090) > @@ -112,6 +112,15 @@ > $smarty->display('error.tpl'); > die; > } > + if ( isset($_GET['thumbnail']) && is_numeric($_GET['thumbnail'])) { //check also perms on thumb > + $info_thumb = $tikilib->get_file($_GET['thumbnail']); > + if ( !$zip && $tiki_p_admin_file_galleries != 'y' && !$userlib->user_has_perm_on_object($user, $info_thumb['galleryId'], 'file gallery', 'tiki_p_download_files') && !($info['backlinkPerms'] == 'y' && !$filegallib->hasOnlyPrivateBacklinks($info_thumb['fileId']))) { > + $smarty->assign('errortype', 401); > + $smarty->assign('msg', tra('Permission denied')); > + $smarty->display('error.tpl'); > + die; > + } > + } > } > > // Add hits ( if download or display only ) + lock if set > @@ -240,7 +249,7 @@ > if ($build_content) { > > // Modify the original image if needed > - if ( ! isset($_GET['display']) || isset($_GET['x']) || isset($_GET['y']) || isset($_GET['scale']) || isset($_GET['max']) || isset($_GET['format']) ) { > + if ( ! isset($_GET['display']) || isset($_GET['x']) || isset($_GET['y']) || isset($_GET['scale']) || isset($_GET['max']) || isset($_GET['format']) || isset($_GET['thumbnail']) ) { > > require_once('lib/images/images.php'); > if (!class_exists('Image')) die(); > @@ -299,6 +308,18 @@ > } > // We resize to a thumbnail size if needed > elseif ( isset($_GET['thumbnail']) ) { > + if (is_numeric($_GET['thumbnail'])) { > + if (empty($info_thumb)) { > + $info_thumb = $tikilib->get_file($_GET['thumbnail']); > + } > + if ( ! empty($info_thumb['path']) ) { > + $image = new Image($prefs['fgal_use_dir'].$info_thumb['path'], true); > + } else { > + $image = new Image($info_thumb['data']); > + $content = null; // Explicitely free memory before getting cache > + } > + if ( $image->is_empty() ) die; > + } > $image->resizethumb(); > } > // We resize to a preview size if needed > > > This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. > > ------------------------------------------------------------------------------ > Download new Adobe(R) Flash(R) Builder(TM) 4 > The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly > Flex(R) Builder(TM)) enable the development of rich applications that run > across multiple browsers and platforms. Download your free trials today! > http://p.sf.net/sfu/adobe-dev2dev > _______________________________________________ > Tikiwiki-cvs mailing list > Tik...@li... > https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs > > ------------------------------------------------------------------------------ > Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! > Finally, a world-class log management solution at an even better price-free! > Download using promo code Free_Logger_4_Dev2Dev. Offer expires > February 28th, so secure your free ArcSight Logger TODAY! > http://p.sf.net/sfu/arcsight-sfd2d_______________________________________________ > Tikiwiki-cvs mailing list > Tik...@li... > https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs |