Пример #1
0
                 }
                 if (file_exists($fileLocation_l)) {
                     CKunenaFile::delete($fileLocation_l);
                 }
                 CKunenaFile::copy($src_file, $fileLocation);
                 break;
         }
         // delete original file
         unlink($src_file);
         $kunena_db->setQuery("UPDATE #__fb_users SET avatar='{$newFileName}' WHERE userid={$kunena_my->id}");
         $kunena_db->query() or trigger_dberror("Unable to update avatar.");
         $app->redirect(JRoute::_(KUNENA_LIVEURLREL . '&func=myprofile'), _UPLOAD_UPLOADED);
     case 'gallery':
         require_once KUNENA_PATH_LIB . DS . 'kunena.helpers.php';
         $newAvatar = JRequest::getVar('newAvatar', '');
         $newAvatar = CKunenaTools::fbRemoveXSS($newAvatar);
         if ($newAvatar == '') {
             $app->enqueueMessage(_UPLOAD_ERROR_CHOOSE, 'notice');
             $app->redirect(JRoute::_(KUNENA_LIVEURLREL . '&func=myprofile&do=avatar'));
         }
         $kunena_db->setQuery("UPDATE #__fb_users SET avatar='{$kunena_db->getEscaped($newAvatar)}' WHERE userid={$kunena_my->id}");
         $kunena_db->query() or trigger_dberror("Unable to update user avatar.");
         $app->redirect(JRoute::_(KUNENA_LIVEURLREL . '&func=myprofile'), _UPLOAD_UPLOADED);
         break;
 }
 if ($task == 'default') {
     if ($fbConfig->allowavatar) {
         ?>
     <td class = "fb_myprofile_right" valign = "top">
         <!-- B:My Profile Right -->
         <!-- B: My AVATAR -->