I have multiple admins for the joomla site. When any admin tries to upload a new file, I want "Uploaded By" should automatically pick the Logged in user id.
Please let me know how to achieve it in phoca download and what all the files needs to be modified
Uploaded By should be the login name
- Jan
- Phoca Hero
- Posts: 48566
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Uploaded By should be the login name
Hi, the user id, who uploads the file is set there. 
Jan

Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Member
- Posts: 11
- Joined: 07 Jan 2016, 14:05
Re: Uploaded By should be the login name
No, It asks to browse and select the user. Instead of that, I want it to automatically take.
I can get it from Joomla using the below code:
$user =& JFactory::getUser();
$userId = $user->get( 'id' );
echo '<input type="hidden" name="user_id" value="' . $userId . '" />';
But I am not getting how to assign it to Uploaded by field.
I can get it from Joomla using the below code:
$user =& JFactory::getUser();
$userId = $user->get( 'id' );
echo '<input type="hidden" name="user_id" value="' . $userId . '" />';
But I am not getting how to assign it to Uploaded by field.
-
- Phoca Member
- Posts: 11
- Joined: 07 Jan 2016, 14:05
-
- Phoca Member
- Posts: 11
- Joined: 07 Jan 2016, 14:05
Re: Uploaded By should be the login name
can anybody please help on this
-
- Phoca Member
- Posts: 11
- Joined: 07 Jan 2016, 14:05
Re: Uploaded By should be the login name
Hi Jan,
can you please help me on this. Can u tell me which file is used to fetch the user inputs from the new file page and store the data to the database.
I know how to get the user ID now I want to assign it to uploaded by field and store to database'.
Regards,
Karjol
can you please help me on this. Can u tell me which file is used to fetch the user inputs from the new file page and store the data to the database.
I know how to get the user ID now I want to assign it to uploaded by field and store to database'.
Regards,
Karjol
- Jan
- Phoca Hero
- Posts: 48566
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Uploaded By should be the login name
Hi, when you run the upload form, it is stored here:
components\com_phocadownload\views\file\tmpl\default.php
Then it is managed in controller and data is stored in database:
components\com_phocadownload\controllers\user.php
components\com_phocadownload\models\user.php
Jan
components\com_phocadownload\views\file\tmpl\default.php
Then it is managed in controller and data is stored in database:
components\com_phocadownload\controllers\user.php
components\com_phocadownload\models\user.php
Jan
If you find Phoca extensions useful, please support the project