Page 1 of 1
Uploaded By should be the login name
Posted: 07 Jan 2016, 14:20
by karjol
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
Re: Uploaded By should be the login name
Posted: 07 Jan 2016, 15:17
by Jan
Hi, the user id, who uploads the file is set there.
Jan
Re: Uploaded By should be the login name
Posted: 07 Jan 2016, 17:02
by karjol
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.
Re: Uploaded By should be the login name
Posted: 07 Jan 2016, 18:41
by karjol
Re: Uploaded By should be the login name
Posted: 08 Jan 2016, 09:09
by karjol
can anybody please help on this
Re: Uploaded By should be the login name
Posted: 12 Jan 2016, 13:42
by karjol
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
Re: Uploaded By should be the login name
Posted: 15 Jan 2016, 00:03
by Jan
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