Welcome, Guest
Username: Password: Remember me

TOPIC: [SOLVED] configuration path.

[SOLVED] configuration path. 07 Jun 2012 05:40 #2497

  • liubov
  • liubov's Avatar
  • Offline
  • Elite Member
  • (=) 10 mn and it's ready!
  • Posts: 278
  • Thank you received: 35
  • Karma: 22
Hi Admin,

I have 3 directories for uploaded images, and I have chosen [IMAGES]/pedigrees_photo in the component parameters.
Configuration says that [IMAGES] is 'site images root', but images are uploaded as [COM_SITE] in :
my_component/files/pedigrees_photo.

I would like to get them in /images/pedigrees_photo ...

Thx,

Marc
Last Edit: 07 Jun 2012 05:42 by liubov.
The administrator has disabled public write access.

Re: [IMAGES] configuration path. 07 Jun 2012 08:26 #2499

  • liubov
  • liubov's Avatar
  • Offline
  • Elite Member
  • (=) 10 mn and it's ready!
  • Posts: 278
  • Thank you received: 35
  • Karma: 22
Ok, I know what happens, now !
return array(
			'DIR_PEDIGREES_PHOTO' => $config->get("upload_dir_pedigrees_photo", "[COM_SITE]" .DS. "files" .DS. "pedigrees_photo") .DS,
			'DIR_PEDIGREES_LOGO' => $config->get("upload_dir_pedigrees_logo", "[COM_SITE]" .DS. "files" .DS. "pedigrees_logo") .DS,
			'DIR_PORTEES_PHOTO_CHIOTS' => $config->get("upload_dir_portees_photo_chiots", "[COM_SITE]" .DS. "files" .DS. "portees_photo_chiots") .DS,
			'DIR_ACTUALITES_PHOTO' => $config->get("upload_dir_actualites_photo", "[COM_SITE]" .DS. "files" .DS. "actualites_photo") .DS,
			'DIR__TRASH' => $config->get("trash_dir", JPATH_ADMIN_JBREEDM .DS. "images" . DS . "trash") .DS,

			'COM_ADMIN' => JPATH_ADMIN_JBREEDM,
			'ADMIN' => JPATH_ADMINISTRATOR,
			'COM_SITE' => JPATH_SITE_JBREEDM,
			'IMAGES' => JPATH_SITE .DS. $config->get('image_path', 'images')  .DS,
			'MEDIAS' => JPATH_SITE .DS. $configMedias->get('file_path', 'images') .DS,
			'ROOT' => JPATH_SITE
		);

	}

When the code is generate, the images DIR is writed in the code (classes/file.php), and in the config.xml file.
The problem :
The user has the possibility to rename the images DIR with the Params Button (Component configuration).
In that case, the call to
$config->get("upload_dir_pedigrees_photo" ...)
returns the default value [COM_SITE] ...
Last Edit: 07 Jun 2012 08:29 by liubov.
The administrator has disabled public write access.

Re: [IMAGES] configuration path. 07 Jun 2012 10:02 #2502

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
Well,

Is it still an issue for you ?
I can't understand if you solved it or no ?
Coding is now a piece of cake
The administrator has disabled public write access.

Re: [IMAGES] configuration path. 07 Jun 2012 10:27 #2504

  • liubov
  • liubov's Avatar
  • Offline
  • Elite Member
  • (=) 10 mn and it's ready!
  • Posts: 278
  • Thank you received: 35
  • Karma: 22
Yes, this ticket is solved for me, because I know how it works ... U can close it.

But note that you write 'DIR_name_photo' as variable in the code (classes/file.php) but the user can change the name of this Directory (Params).

In that case, Images will be uploaded in the default Directory [COM_SITE], cause the variables won't match.

That's all.

Marc
Last Edit: 07 Jun 2012 10:29 by liubov.
The administrator has disabled public write access.
Time to create page: 0.093 seconds

Get Started