1. Список говнокодов пользователя pravka

    Всего: 1

  2. PHP / Говнокод #20944

    +491

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    app::storage()->setUserUploadDir('public');
            app::storage()->avatar = 'profile/avatars';
            app::storage()->background = 'profile/background';
            app::storage()->audioFile = 'music';
            app::storage()->videoFile = 'video/file';
            app::storage()->videoScreen = 'video/screen';
            app::storage()->forum = 'forum';
            app::storage()->systemImages = 'system/images';
            app::storage()->tmpUpload('upload');
     
     
            app::storage()->registerMethod('avatar', function($id, $type = false)
            {
     
                if($type==true){
                    return app::storage()->fileExists(app::storage()->path('avatar').'/'.$id.'.png') ?  '/'.app::storage()->path('avatar').'/'.$id.'.png' : null;
     
                }else{
                    return '/'.app::storage()->path('avatar').'/'.$id.'.png';
     
                }
            } );
     
            app::storage()->registerMethod('defaultAvatar', function()
            {
     
                    return '/'.app::storage()->path('systemImages').'/noavatar.png';
     
            } );

    Загрузка файлов от программиста с двадцатилетним стажем.

    pravka, 24 Августа 2016

    Комментарии (7)