Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

supprime "size=100x50&" 09 Dec 2013 20:15 #11794

  • LJ01
  • LJ01's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 78
  • Thank you received: 2
Hi
to display image in the grid
src="/index.php?option=com_batenergie&task=file&size=100x50&path=[DIR_BATENERGIE_IMAGE]stade_clermont.jpg"
where this code are generated, because i want to supprime "size=100x50&"
thanks
LJ
Ce sont les fils qui font les cordes
ingall-niger.org

Please Log in or Create an account to join the conversation.

supprime "size=100x50&" 11 Dec 2013 21:45 #11797

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
What do you mean ?

You want still to resize it, but without the url param ?

Well this URL might be generated by JDom
Then, the component helper catch it and output the resized thumb thanks to the classes/file.php class

Do you want to access directly or indirectly ?
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

supprime "size=100x50&" 12 Dec 2013 15:06 #11798

  • LJ01
  • LJ01's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 78
  • Thank you received: 2
Hi
i want to delete it, because in a view this code prevents the display of the image ...
LJ
Ce sont les fils qui font les cordes
ingall-niger.org

Please Log in or Create an account to join the conversation.

supprime "size=100x50&" 12 Dec 2013 15:08 #11799

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
I don't understand what you want to remove ?
Please be more specific.
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

supprime "size=100x50&" 12 Dec 2013 19:35 #11800

  • LJ01
  • LJ01's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 78
  • Thank you received: 2
delete &size=100x50 in the url
Ce sont les fils qui font les cordes
ingall-niger.org

Please Log in or Create an account to join the conversation.

supprime "size=100x50&" 12 Dec 2013 19:42 #11801

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
If you look at you file class, you can see this function.
You can redefine you image thumb size there.
public static function returnFile($mode = null)
{
	$jinput = JFactory::getApplication()->input;
	$path = $jinput->get('path', null, 'STRING');
	$size = $jinput->get('size', null, 'CMD');
	$action = $jinput->get('action', null, 'CMD');
	$attrs = $jinput->get('attrs', null, 'STRING');

	$filePath = null;
	if (!$path)
	{
		// Read through database index
		$view = $jinput->get('view', null, 'CMD');
		$key = $jinput->get('key', null, 'CMD');
		$cid = $jinput->get('cid', null, 'INT');

		if ($view && $key && $cid)
			$path = self::getFromIndex($view, $key, $cid);

		//Fallback
		if (!$path)
			$filePath = DEMO120_IMAGES_FALLBACK_ROOT .DS. DEMO120_IMAGES_FALLBACK_NAME;
	}

	$options = null;
	if (!$filePath && $path)
		$filePath = self::getPhysical($path, $options);


	$ext = self::getExt($filePath);



	jimport('joomla.filesystem.file');

	$imagesExt = array('jpg', 'jpeg', 'gif', 'png', 'bmp');
	$mime = null;
	if ($action == 'download')
		$mime = 'application/force-download';  // OU    application/octet-stream
	else if (self::exists($filePath))
		$mime = self::getMime($filePath);


	//Is image ?
	if (($action != 'download') &&
	(in_array($ext, $imagesExt)		//Check on extension
	|| ($mime && preg_match("/^image/", $mime)))			//Check on mime
	)
	{
		require_once(JPATH_ADMIN_DEMO120 .DS. 'classes' .DS. 'images.php');
		$thumb = new Demo120Images($filePath, $mime);

		if ($attrs)
			$thumb->attrs($attrs);


		if ($size && preg_match("/([0-9]+)x([0-9]+)/", $size, $matches))
		{
			$thumb->width($matches[1]);
			$thumb->height($matches[2]);;
		}

		$thumb->get();

		exit();
	}
	else if (!JFile::exists($filePath))
	{
		$app = JFactory::getApplication();
		$msg = JText::sprintf( "DEMO120_UPLOAD_FILE_NOT_FOUND", $path);
		$app->enqueueMessage($msg, 'error');

		jexit();
	}

	//Non image and non outputable mimes : Force download
	if (!in_array($mime, array(
							'application/x-shockwave-flash'
						)))
	{
		header('Content-Description: File Transfer');
	    header("Content-Disposition: attachment; filename=\"".basename($filePath) . "\"");
	}

	//Read and return file contents with original mime header
	header('Content-Type: ' . $mime);
	header('Content-Transfer-Encoding: binary');
	header('Expires: 0');
	header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
	header('Pragma: public');
	header('Content-Length: ' . filesize($filePath));
	ob_clean();
	flush();

	readfile($filePath);

	jexit();
}

EDIT :


Here
classes/file/file.php
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

Last edit: by admin.

supprime "size=100x50&" 13 Dec 2013 11:42 #11802

  • LJ01
  • LJ01's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 78
  • Thank you received: 2
ok understand
now it's another problem deconnected the first
my miniatures aren't created with her extension -100x50.jpg when i load a image
i must create this manually ...
where look ?
LJ
Ce sont les fils qui font les cordes
ingall-niger.org

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.094 seconds

I jumped and started to work on a demo component... but 2 days later this demo component became the real component. I just showed today the end result to my customer and he turned to me and said... "this is more than I expected"... All of this is because Cook did cut about 70% of my work and provided me more ways to improve the usability of the component. The end result was 17 tables all related between than to generate a full dashboard for the travel agents. Thanks for Cook developers for such great tool. This component would not be possible to be done at short time with all the features in it
Griiettner (Forum)  

Get Started