Archives pour la catégorie User Defined Tag (UDT)

UDT pour créer un répertoire FEU

1. Note: this UDT depends on modules CGExtentions and CMSMailer.

$gCms = cmsms(); //global $gCms;

$config = $gCms->GetConfig();


$subdir = ‘front_end_users’;

$user_dir = $params[‘username’];


$email = ‘admin@**************’; /*your mail address*/

/*sometimes it is better idea to create dir based on user id*/

/*$user_dir = $params[‘id’];*/


$destdir = cms_join_path($config[‘uploads_path’], $subdir, $user_dir);


cge_dir::mkdirr($destdir); /*this bit requires CGExtentions module*/


/*Error handling depends on CMSMailer module*/

if( !is_dir($destdir) ){

$body = ‘Directory « ‘.$destdir.' » was not created for user (‘

$body .= $params[‘id’].’) ‘.$params[‘username’];

$subject = $body;

$mail =& $gCms->modules[‘CMSMailer’][‘object’];

$mail->AddAddress( $email );

$mail->IsHTML( false );

$mail->SetBody( $body );

$mail->SetSubject( $subject );




viaUser Handbook/Admin Panel/Extensions/Event Manager – CMSMS.