DS Soft
+460
Репутация
4535
Рейтинг
// Регистрируем событие cmsActions::log('add_user', array( 'object' => '', 'user_id' => $new_user_id, 'object_url' => '', 'object_id' => $new_user_id, 'target' => '', 'target_url' => '', 'target_id' => 0, 'description' => '' )); $inPage->includeTemplateFile('special/regcomplete.php'); if ($cfg['send_greetmsg']){ $model->sendGreetsMessage($new_user_id, $cfg['greetmsg']); }$filename = md5($realfile . '-' . $new_user_id . '-' . time()).'.jpg'; $uploadfile = $uploaddir . $realfile; $uploadavatar = $uploaddir . $filename; $uploadthumb = $uploaddir . 'small/' . $filename; $source = $_FILES['picture']['tmp_name']; $errorCode = $_FILES['picture']['error']; if ($inCore->moveUploadedFile($source, $uploadfile, $errorCode)) { $cfg = $inCore->loadComponentConfig('users'); //CREATE THUMBNAIL if (isset($cfg['smallw'])) { $smallw = $cfg['smallw']; } else { $smallw = 64; } if (isset($cfg['medw'])) { $medw = $cfg['medw']; } else { $medw = 200; } if (isset($cfg['medh'])) { $medh = $cfg['medh']; } else { $medh = 200; } @img_resize($uploadfile, $uploadavatar, $medw, $medh); @img_resize($uploadfile, $uploadthumb, $smallw, $smallw); //DELETE ORIGINAL @unlink($uploadfile); //MODIFY PROFILE $sql = "UPDATE cms_user_profiles SET imageurl = '$filename' WHERE user_id = '$new_user_id' LIMIT 1"; $inDB->query($sql); }//Проверяем аватар if ($realfile) { if ($ext != 'jpg' and $ext != 'jpeg' and $ext != 'gif' and $ext != 'bmp' and $ext != 'png'){ $msg .= 'Ошибка! Разрещенные расширения для Аватара: <b>.jpg</b> <b>.jpeg</b> <b>.gif</b> <b>.bmp</b> <b>.png</b><br/>'; } }//Проверяем аватар if (!$realfile) { $msg .= 'Ошибка! Вы не выбрали <b>Аватар</b><br/>'; } if ($ext != 'jpg' and $ext != 'jpeg' and $ext != 'gif' and $ext != 'bmp' and $ext != 'png'){ $msg .= 'Ошибка! Разрещенные расширения для Аватара: <b>.jpg</b> <b>.jpeg</b> <b>.gif</b> <b>.bmp</b> <b>.png</b><br/>'; }$city = $inCore->request('city', 'str');if(!$city) { $msg .= 'Не указан <b>Город</b>!<br/>'; }Можешь посмотреть на http://даг05.рф/registration зарегистрируйся и зайди в свой профиль все работает.
.region, .city {display:none}strong {display:block;width:50px} div {margin-bottom:3px}