47 $xoTheme->addStylesheet( XOOPS_URL .
'/modules/system/css/admin.css' );
48 $xoTheme->addScript(
'browse.php?Frameworks/jquery/jquery.js');
49 $xoTheme->addScript(
'modules/system/js/admin.js');
63 $savatar_count = $avt_handler->getCount(
new Criteria(
'avatar_type',
'S'));
64 $cavatar_count = $avt_handler->getCount(
new Criteria(
'avatar_type',
'C'));
67 $xoopsTpl->assign(
'count_system', $savatar_count );
68 $xoopsTpl->assign(
'count_custom', $cavatar_count );
70 $avatar = $avt_handler->create();
87 $xoTheme->addStylesheet( XOOPS_URL .
'/modules/system/css/admin.css');
89 $xoTheme->addScript(
'browse.php?Frameworks/jquery/jquery.js');
90 $xoTheme->addScript(
'modules/system/js/admin.js');
100 $savatar_count = $avt_handler->getCount(
new Criteria(
'avatar_type',
'S'));
101 $cavatar_count = $avt_handler->getCount(
new Criteria(
'avatar_type',
'C'));
104 $xoopsTpl->assign(
'count_system', $savatar_count );
105 $xoopsTpl->assign(
'count_custom', $cavatar_count );
108 $avtcount = $avt_handler->getCount(
$criteria);
112 $avatars = $avt_handler->getObjects(
$criteria,
true);
114 $avatar_list = array();
116 foreach (array_keys($avatars) as
$i) {
117 $avatar_list[
$i] = $avatars[
$i]->toArray();
118 $avatar_list[
$i][
'type'] =
$type;
119 $avatar_list[
$i][
'count'] = count($avt_handler->getUser($avatars[$i]));
121 $user = $avt_handler->getUser($avatars[$i]);
125 $xoopsTpl->assign(
'avatars_list', $avatar_list);
141 $xoTheme->addStylesheet( XOOPS_URL .
'/modules/system/css/admin.css');
153 if ( $avatar_id > 0 ) {
154 $avatar = $avt_handler->get( $avatar_id );
168 if ( !
$GLOBALS[
'xoopsSecurity']->check() ) {
175 include_once
$GLOBALS[
'xoops']->path(
'/class/uploader.php' );
182 if ( $avatar_id > 0 ) {
183 $avatar =& $avt_handler->get( $avatar_id );
185 $avatar =& $avt_handler->create();
188 if ($uploader->fetchMedia(
'avatar_file')) {
189 $uploader->setPrefix(
'savt');
190 if (!$uploader->upload()) {
191 $err[] = $uploader->getErrors();
194 $avatar->setVar(
'avatar_file',
'avatars/' . $uploader->getSavedFileName() );
195 $avatar->setVar(
'avatar_mimetype', $uploader->getMediaType());
196 $avatar->setVar(
'avatar_type',
's');
197 if (!$avt_handler->insert(
$avatar)) {
205 if (!$avt_handler->insert(
$avatar)) {
209 if (count($err) > 0) {
215 $xoTheme->addStylesheet( XOOPS_URL .
'/modules/system/css/admin.css' );
234 if ( $avatar_id > 0 ) {
236 $avatar =& $avt_handler->get( $avatar_id );
237 $old =
$avatar->getVar(
'avatar_display');
239 $avatar->setVar(
'avatar_display', !$old );
240 if (!$avt_handler->insert(
$avatar)) {
252 $xoTheme->addStylesheet( XOOPS_URL .
'/modules/system/css/admin.css');
263 if ( $avatar_id > 0 ) {
264 $avatar = $avt_handler->get($avatar_id);
267 xoops_confirm(array(
'op' =>
'delfileok',
'avatar_id' => $avatar_id,
'fct' =>
'avatars',
'user_id' =>
$user_id),
'admin.php',
$msg );
276 if (!
$GLOBALS[
'xoopsSecurity']->check()) {
280 if ($avatar_id <= 0) {
284 $avatar =& $avt_handler->get( $avatar_id );
288 if (!$avt_handler->delete(
$avatar )) {
304 $xoopsDB->query(
"UPDATE ".
$xoopsDB->prefix(
'users').
" SET user_avatar='blank.gif' WHERE user_avatar='".
$file.
"'");