swinz wrote:i want to add a gallery for all registered members (my whole website works with the phpbb system).
with every user that opens a profile i want to make a folder within profiles with their userid (example http://domain.nl/profiles/2/ )
i only want them to upload pictures (no flash/other files) in the base map (no need for subfolder images/)
define('IN_PHPBB', true);
//set this to your path to phpbb
$phpbb_root_path = '../../../../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
/**
* This function must check the user session to be sure that he/she is
* authorized to upload and access files in the File Browser.
*
* @return boolean
*/
function CheckAuthentication()
{
global $user;
return (!empty($user->data['user_id']) && $user->data['user_id']>1);
}
if this would work, how do i get/read the $finder->userid back in the configfile??
Could you explain what exactly do you want to achieve because I don't understand what do you mean? Do you want to use different user_id than user_id that is assigned to currently logged user? You may try to pass dynamic variables to config.php using sessions... I need more information to help you.
edit:
another question:
is it possible to set an amount of pictures to be uploaded? i want to have a maximum of 12 pictures for each user!
At this moment, the only way to achieve this is to modify CKFinder connector. It's not a very hard task, but try to keep your modifications clean so that you could re-apply them when you update CKFinder in the future (e.g. keep your custom code inside of a function, or comment your changes).
Take a look into core\connector\php\phpX\CommandHandler\FileUpload.php, resource type settings are available here:
Re: How to use with membersgallery
define('IN_PHPBB', true); //set this to your path to phpbb $phpbb_root_path = '../../../../'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include($phpbb_root_path . 'common.' . $phpEx); // Start session management $user->session_begin(); $auth->acl($user->data); $user->setup(); /** * This function must check the user session to be sure that he/she is * authorized to upload and access files in the File Browser. * * @return boolean */ function CheckAuthentication() { global $user; return (!empty($user->data['user_id']) && $user->data['user_id']>1); }########################################################## ## MOD Title: Sample CKFinder integration ## MOD Description: Adds link to CKFinder in User Control Panel / Profile ## ## MOD Version: 0.1 ## ## Installation Level: Easy ## Installation Time: ~5 Minutes ## ## Files to edit: ## styles/prosilver/template/overall_header.html ## styles/prosilver/template/user_profile_profile_info.html ## ########################################################## # #--[ OPEN ]-- # styles/prosilver/template/overall_header.html # #--[ FIND ]-- # <script type="text/javascript"> # #--[ BEFORE, ADD ]-- # <script type="text/javascript" src="ckfinder/ckfinder.js"></script> # #--[ OPEN ]-- # styles/prosilver/template/user_profile_profile_info.html # #--[ FIND ]-- # <fieldset> <!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF --> # #--[ AFTER, ADD ]-- # <dl> <dt><label for="gallery">Gallery:</label></dt> <dd> <script type="text/javascript"> function BrowseServer() { CKFinder.Popup( '/ckfinder/' ) ; } </script> <input type="button" value="Browse Server" onclick="BrowseServer();" /> </dd> </dl> # #-[ SAVE/CLOSE ALL FILES ]-- #Wiktor Walc
CTO, CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+
Re: How to use with membersgallery
Re: How to use with membersgallery
http://domain.nl/ck/profielen/2/test.jpg
http://domain.nl/profielen/2/test.jpg
http://sub.domain.nl/c/profielen/2/test.jpg
http://sub.domain.nl/profielen/2/test.jpg
Re: How to use with membersgallery
Wiktor Walc
CTO, CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+
Re: How to use with membersgallery
$finder->userid = $user->data('user_id');edit:
Re: How to use with membersgallery
Could you explain what exactly do you want to achieve because I don't understand what do you mean?
Do you want to use different user_id than user_id that is assigned to currently logged user?
You may try to pass dynamic variables to config.php using sessions... I need more information to help you.
At this moment, the only way to achieve this is to modify CKFinder connector. It's not a very hard task, but try to keep your modifications clean so that you could re-apply them when you update CKFinder in the future (e.g. keep your custom code inside of a function, or comment your changes).
Take a look into core\connector\php\phpX\CommandHandler\FileUpload.php, resource type settings are available here:
you have add code that scans this directory and rejects uploading if directory contains more than 12 files:
Wiktor Walc
CTO, CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+