Forums

Unfortunately no one can be told what FluxBB is - you have to see it for yourself.

You are not logged in.

#1 2011-02-28 08:27:13

Visman
Member
From: Siberia
Registered: 2010-07-10
Posts: 1,129

[MOD] Upload Mod - 2.0.1

Users can upload files and pictures on a forum directly in post.

Thanks to bagu for "Uploadile".

http://fluxbb.org/resources/mods/upload-mod/
----------------------
Language: Russian/English/French/German
Administrators have no restrictions on volume of loaded files (It is limited by server/PHP options).
Moderators have one limit, users - another.
It is possible to set extensions of the files to uploading. I don't recommend to upload flash!!!
Strictly forbidden (in code) files with extensions phtml, php, php3, php4, php5, php6, phps, cgi, exe, pl, asp, aspx, shtml, shtm, fcgi, fpl, jsp, htm, html, wml, htaccess.
For pictures of formats gif, jpeg, jpg, png, bmp, wbmp, xbm the preview (if library GD works) can be created.
All files after uploading are scanned on keywords in order to avoid XSS attacks.
For names of files there is transliteration to Latin.
Check conformity between extension and file format for picture and swf.

v 1.2
French is added. Thanks to Bloody.
Added management of uploaded files in Profile.

v 1.3.0
For FluxBB v.1.5.0
German is added. Thanks to cyberman.
Settings for each group of users.
Administration of files is changed.

v 1.3.2
Fix AP_Upload.php for FluxBB v.1.5.1.

242647bf9a3cdaa4fdcc3a3a955619d2.jpg 54bdf4163a782b04ad8da91b0f800b51.jpg 74d392ec4c2a2583423a30c8063a25b0.jpg 88a8591536af09e7ba1c361bde340fb8.jpg 07be917bb8272438c44707ac96686ed8.jpg cdd376d971ba6a39caf2b974208c2d52.jpg 39badb35916d3b0b55f58cd70fab70af.jpg 00b17ac4110aa146d9e2f14cbc8024d3.jpg b6ef4441ce2d24fc8e74782d30ff8521.jpg

v 2.0 beta
New type of the list of the uploaded files.
New javascipts.
New style.

524b92e4fcd3641c98fea6b7b6d00e1e.jpg 1a82513f256dcbafc0e6078dfeb4ae3f.jpg 658c947feb78289217d3568ce44e2409.jpg dbf52770d709ae74294ae4d81dd87efa.jpg

v 2.0.1
Fix AP_Upload.php. Thanks to Quy.

Last edited by Visman (2013-11-26 04:29:18)


My modification of FluxBB 1.5.10 - rev.77 * Parserus - BBCode parser
I speak only Russian  tongue

Offline

#2 2011-02-28 09:55:14

cyberman
Member
From: Germany
Registered: 2010-01-11
Posts: 296
Website

Re: [MOD] Upload Mod - 2.0.1

Many thanx - want to ask you (in the past) if we will see this mod outside your special FluxBB version smile.

Am I right this mod works without plugile?

Offline

#3 2011-02-28 10:53:39

Visman
Member
From: Siberia
Registered: 2010-07-10
Posts: 1,129

Re: [MOD] Upload Mod - 2.0.1

cyberman wrote:

Am I right this mod works without plugile?

Yes.
"Plugile" it is necessary to remove. Folder img/members/ not to delete!


My modification of FluxBB 1.5.10 - rev.77 * Parserus - BBCode parser
I speak only Russian  tongue

Offline

#4 2011-03-11 13:21:46

alexzut
Member
Registered: 2011-03-10
Posts: 10

Re: [MOD] Upload Mod - 2.0.1

upload does not work,
work

not work in 1.4.4, or i have a problem with server

using server with linux, need set a permission ?

Offline

#5 2011-03-11 14:01:14

Visman
Member
From: Siberia
Registered: 2010-07-10
Posts: 1,129

Re: [MOD] Upload Mod - 2.0.1

Function move_uploaded_file can't move the uploaded file.
There is a folder img/members/[number of the user]/ ?


My modification of FluxBB 1.5.10 - rev.77 * Parserus - BBCode parser
I speak only Russian  tongue

Offline

#6 2011-03-11 21:41:13

alexzut
Member
Registered: 2011-03-10
Posts: 10

Re: [MOD] Upload Mod - 2.0.1

no

Offline

#7 2011-03-11 22:12:45

Bloody
Member
From: French Strawberries Fields
Registered: 2008-11-29
Posts: 43
Website

Re: [MOD] Upload Mod - 2.0.1

Thanks Visman, wink

The plugin works fine for me. Very easy to install it. tongue

I've give you my lang file french translation. smile

<?php

$lang_up = array(
'err_1'                                => 'Pas de fichiers téléchargés actuellement.',
'err_2'                                => 'Pas de téléchargement.',
'err_3'                                => 'Impossible d\'insérer dans la table %s',
'err_4'                                => 'Erreur pendant le téléchargement',
'err_insert'                        => 'Erreur pendant la mise à jour de la base de données',
'err_size'                            => 'Erreur : Le fichier est trop gros pour être téléchargé, essayez à nouveau.',
'err_extension'                        => 'Erreur : Ce n\'est pas une extension autorisée, essayez à nouveau.',
'err_extension_multiple'            => 'Erreur : Veuillez, mettre aucun point (.) dans le nom de votre fichier, et essayez à nouveau.',
'err_noExtension'                    => 'Erreur : vous devez préciser l\'extension du fichier lorsque vous modifiez son nom, et essayez à nouveau.',
'err_espace'                        => 'Erreur : Vous avez dépassé votre espace de stockage autorisé. Supprimez des fichiers et essayez à nouveau.',
'err_delete'                        => 'Erreur pendant lors de la supression du fichier, essayez à nouveau.',
'err_Move failed'                    => 'Erreur : Le serveur n\'a pas pu enregistrer le fichier uploadé.',
'err_image'                            => 'Erreur : Format invalide d\'image. Ou le serveur ne supporte pas le traitement d\'images.',
'err_image2'                        => 'Erreur : L\'image a été endommagée pendant la mise à jour.',
'err_open'                            => 'Erreur : Le fichier téléchargé ne s\'ouvre pas.',
'err_str'                            => 'Erreur lors du téléchargement. Compressez ce fichier et essayez à nouveau ou contacter à l\'administrateur.',

'installation_info'                    => 'Préparation de la base de données et du cache pour l\'installation Uploadile.',
'installation'                        => 'Installer',
'installation_success'                => 'Votre base de données a été correctement préparés pour Uploadile. Consulter le fichier read_me.txt pour plus de précisions.',

'update_info'                        => 'Mise à jour. (valeurs par défauts) <br />',
'update'                            => 'Mis à jour',
'update_success'                     => 'Votre base de données a été actualisée avec succès pour Uploadile.',

'restore_info'                        => 'Restauration la base de données et mise à jour du cache pour la désinstallation d\'Uploadile.',
'restore'                            => 'Désinstaller',
'restore_success'                    => 'Restauration d\'Uploadile (Base de données et cache) réussie.',

'configuration'                        => 'Configuration',
'plugin_desc'                        => 'Ce plugin permet de configurer les fonctions d\'Uploadile dont vous avez besoin.',
'legend_2'                            => 'Choisisser vos options',
'laws'                                => 'Types de fichier autorisés',
'laws_info'                            => 'Séparer avec des virgules (,)',
'thumb'                                => 'Activer les miniatures',
'thumb_size'                        => 'Taille de la miniature: ',
'quality'                            => 'Qualité: ',
'maxsize_member'                    => 'La taille maximum que les membres peuvent télécharger.',
'maxsize_modo'                        => 'La taille maximum que les modérateurs peuvent télécharger.',
'maxsize_info'                        => '<br />Votre serveur a une limite par défaut.',
'limit_member'                        => 'Espace alloué aux membres',
'limit_modo'                        => 'Espace alloué aux modérateurs',
'oui'                                => 'Oui',
'non'                                => 'Non',
'px'                                => 'Pixel',
'bytes'                                => 'Bytes',
'pictures'                            => 'Images',
'for pictures'                        => 'Pour une image en poids, c\'est plus',
'Install quality'                    => 'Qualité de l\'image:',
'Size not more'                        => 'Taille pas plus grande (HxL):',
'to jpeg'                            => 'Convertir en jpeg',

'delete_success'                    => 'Fichier(s) supprimé(s) avec succés!',
'modif_success'                        => 'Fichier téléchargé!',

'uploadile'                            => 'Mes téléchargements',
'titre_2'                            => 'Télécharger un fichier',
'titre_4'                            => 'Mes téléchargements',
'popup_title'                        => 'Gestion des fichiers',

'info_2'                            => '/!\ Votre fichier ne doit dépasser la taille %s et doit faire  %s.',
'info_2_admi'                        => '/!\ L\'extension de votre fichier doit être <strong>%s</strong> .',
'info_4'                            => '<div style="border:1px solid #4E642D; width:12em;"><div style="border-right: 2px solid #4E642D; background-color: #6C8A3F; text-align:right; width:%s%s;">%s%s</div></div><p><strong>Espace de stockage utilisé :</strong> %s en %s.</p>',
'legend'                            => 'Sélectionner un fichier et envoyer le :',
'fichier'                            => 'Sélectionner un fichier',

'th0'                                => 'Nom',
'th'                                => 'Url du fichier',
'th2'                                => 'Prévisualiser',
'no_preview'                        => 'Aucune',
'fichier_membre'                    => 'Fichiers des membres (nouveaux ci-dessus)',

'legend_1'                            => 'Conversion',
'convert'                              => 'Convertir',
'mo'                                => 'Valeur en MB',
'ko'                                => 'Valeur en KB',
'o'                                    => 'Valeur en B',
'texte'                                => 'Placer votre texte ici',
'submit'                            => 'Envoyer',
'delete'                            => 'Supprimer',
'insert'                            => 'Insérer',
'insert_thumbnail'                    => 'Insérer une miniature',
'update_thumb'                        => 'Mettre à jour les miniatures',

'upfiles'                            => '<b>Téléchargements</b>',
);

?>

Don't you think it could be a good thing to put an access to the profil panel, to manage files uploaded ?


Regards,
Benoît V.
Watermelon -pixels - French front-end webdesigner - PluXml is a simple, light and easy to use blog engine.

Offline

#8 2011-03-12 03:48:50

Visman
Member
From: Siberia
Registered: 2010-07-10
Posts: 1,129

Re: [MOD] Upload Mod - 2.0.1

alexzut wrote:

no

Go to Administration -> Admin menu "Index" -> Show info

safe_mode = ON ???

disable_functions = ???


My modification of FluxBB 1.5.10 - rev.77 * Parserus - BBCode parser
I speak only Russian  tongue

Offline

#9 2011-03-12 03:51:59

Visman
Member
From: Siberia
Registered: 2010-07-10
Posts: 1,129

Re: [MOD] Upload Mod - 2.0.1

Bloody wrote:

Don't you think it could be a good thing to put an access to the profil panel, to manage files uploaded ?

It necessarily is required?
What for users to access to files from a profile?


My modification of FluxBB 1.5.10 - rev.77 * Parserus - BBCode parser
I speak only Russian  tongue

Offline

#10 2011-03-12 10:10:14

Bloody
Member
From: French Strawberries Fields
Registered: 2008-11-29
Posts: 43
Website

Re: [MOD] Upload Mod - 2.0.1

Visman wrote:

What for users to access to files from a profile?

As I said, it's easier for user to manage uploads in its profile panel than manage them only on the topic view : like delete files for example.

Visman wrote:

It necessarily is required?

Twice are usable. The link in the view topic is required, but the link in the profile panel not.
This is just a improvement suggest. smile

Another idea: Would it be possible to add a "close window" button on the pop-up ?


Regards,
Benoît V.
Watermelon -pixels - French front-end webdesigner - PluXml is a simple, light and easy to use blog engine.

Offline

#11 2011-03-12 10:46:08

Visman
Member
From: Siberia
Registered: 2010-07-10
Posts: 1,129

Re: [MOD] Upload Mod - 2.0.1

Bloody wrote:

As I said, it's easier for user to manage uploads in its profile panel than manage them only on the topic view : like delete files for example.

Well, I will add in a profile.

Bloody wrote:

Another idea: Would it be possible to add a "close window" button on the pop-up ?

2af0e8cedf5a3aaa4383870089fd41f7.jpg


My modification of FluxBB 1.5.10 - rev.77 * Parserus - BBCode parser
I speak only Russian  tongue

Offline

#12 2011-03-12 16:41:39

Bloody
Member
From: French Strawberries Fields
Registered: 2008-11-29
Posts: 43
Website

Re: [MOD] Upload Mod - 2.0.1

Thanks for answer. smile

I know that there is an X to close all the pop-up window. tongue
Visman, will you put the french lang file in your next release ?


Regards,
Benoît V.
Watermelon -pixels - French front-end webdesigner - PluXml is a simple, light and easy to use blog engine.

Offline

#13 2011-03-12 17:09:43

Bloody
Member
From: French Strawberries Fields
Registered: 2008-11-29
Posts: 43
Website

Re: [MOD] Upload Mod - 2.0.1

Actually, I try to put the fancy box (I'd install your mod) to replace the pop-up that doesn't please me.

I food the pop-up code but I don't know how to change it with the fancybox code.

        echo '<script type="text/javascript">'."\n";
        echo '/* <![CDATA[ */'."\n";
        echo 'function PopUp(c,d,a,b,e){window.open(c,d,"top="+(screen.height-b)/3+", left="+(screen.width-a)/2+", width="+a+", height="+b+", "+e);return false};';
        echo 'var all_ul=document.getElementsByTagName("ul"),i=all_ul.length-1;';
        echo 'while (i>-1){';
        echo 'if(all_ul[i].className=="bblinks"){';
        echo 'var ul_html=all_ul[i].innerHTML;';
        echo 'ul_html+="<li><span><a href=\"upfiles.php\" onclick=\"return PopUp(this.href,\'gest\',\'820\',\'430\',\'resizable=yes,location=no,menubar=no,status=no,scrollbars=yes\');\">'.$lang_up['upfiles'].'</a></span></li>";';
        echo 'all_ul[i].innerHTML=ul_html;';
        echo 'i=0;';
        echo '}';
        echo 'i--';
        echo '}'."\n";
        echo '/* ]]> */'."\n";
        echo '</script>'."\n";

Any Idea ?:)


Regards,
Benoît V.
Watermelon -pixels - French front-end webdesigner - PluXml is a simple, light and easy to use blog engine.

Offline

#14 2011-03-13 05:14:13

Visman
Member
From: Siberia
Registered: 2010-07-10
Posts: 1,129

Re: [MOD] Upload Mod - 2.0.1

Bloody wrote:

Visman, will you put the french lang file in your next release ?

Yes.

Bloody wrote:

Actually, I try to put the fancy box (I'd install your mod) to replace the pop-up that doesn't please me.

Very interesting idea.
But while I don't have its decision.
P.S. Tips & Tricks http://www.fancybox.net/blog


My modification of FluxBB 1.5.10 - rev.77 * Parserus - BBCode parser
I speak only Russian  tongue

Offline

#15 2011-03-13 09:06:10

Bloody
Member
From: French Strawberries Fields
Registered: 2008-11-29
Posts: 43
Website

Re: [MOD] Upload Mod - 2.0.1

Visman wrote:

P.S. Tips & Tricks http://www.fancybox.net/blog

Thanks Visman. smile
   
I knew this site. I have again downloaded the script to try to replace the pop-up script by Fancybox one in "uploadf.php" file. smile
   
If I succeeded, I will put here my code. big_smile


Regards,
Benoît V.
Watermelon -pixels - French front-end webdesigner - PluXml is a simple, light and easy to use blog engine.

Offline

#16 2011-03-18 23:47:15

jejeje
Member
Registered: 2011-03-18
Posts: 288
Website

Re: [MOD] Upload Mod - 2.0.1

alexzut wrote:

no

try this one which i did, create a folder members inside img (img/members) and give it 777 full writes and everything should be working
Thx for this mod smile

Offline

#17 2011-03-19 00:29:31

jejeje
Member
Registered: 2011-03-18
Posts: 288
Website

Re: [MOD] Upload Mod - 2.0.1

umm using my suggestion means anyone can download those files do you guys have any suggestion on how to strict the guests from downloading these files ?

Offline

#18 2011-03-19 03:40:45

Visman
Member
From: Siberia
Registered: 2010-07-10
Posts: 1,129

Re: [MOD] Upload Mod - 2.0.1

to jejeje:
file parser.php

function handle_url_tag($url, $link = '', $bbcode = false)
{
    $url = pun_trim($url);
    $full_url = str_replace(array(' ', '\'', '`', '"'), array('%20', '', '', ''), $url);
    if (strpos($url, 'www.') === 0) // If it starts with www, we add http://
        $full_url = 'http://'.$full_url;
    else if (strpos($url, 'ftp.') === 0) // Else if it starts with ftp, we add ftp://
        $full_url = 'ftp://'.$full_url;
    else if (!preg_match('#^([a-z0-9]{3,6})://#', $url)) // Else if it doesn't start with abcdef://, we add http://
        $full_url = 'http://'.$full_url;

    // Ok, not very pretty :-)
    if ($bbcode)
    {
        if ($full_url == $link)
            return '[url]'.$link.'[/url]';
        else
            return '[url='.$full_url.']'.$link.'[/url]';
    }
    else
    {
        if ($link == '' || $link == $url)
        {
            $url = pun_htmlspecialchars_decode($url);
            $link = utf8_strlen($url) > 55 ? utf8_substr($url, 0 , 39).' … '.utf8_substr($url, -10) : $url;
            $link = pun_htmlspecialchars($link);
        }
        else
            $link = stripslashes($link);

        return '<a href="'.$full_url.'">'.$link.'</a>';
    }
}

-->

function handle_url_tag($url, $link = '', $bbcode = false)
{
    global $pun_user, $pun_config;
    
    $url = pun_trim($url);
    $full_url = str_replace(array(' ', '\'', '`', '"'), array('%20', '', '', ''), $url);
    if (strpos($url, 'www.') === 0) // If it starts with www, we add http://
        $full_url = 'http://'.$full_url;
    else if (strpos($url, 'ftp.') === 0) // Else if it starts with ftp, we add ftp://
        $full_url = 'ftp://'.$full_url;
    else if (!preg_match('#^([a-z0-9]{3,6})://#', $url)) // Else if it doesn't start with abcdef://, we add http://
        $full_url = 'http://'.$full_url;

    if ($pun_user['is_guest'] && strpos($full_url, $pun_config['o_base_url']) === 0)
        return 'No link';

    // Ok, not very pretty :-)
    if ($bbcode)
    {
        if ($full_url == $link)
            return '[url]'.$link.'[/url]';
        else
            return '[url='.$full_url.']'.$link.'[/url]';
    }
    else
    {
        if ($link == '' || $link == $url)
        {
            $url = pun_htmlspecialchars_decode($url);
            $link = utf8_strlen($url) > 55 ? utf8_substr($url, 0 , 39).' … '.utf8_substr($url, -10) : $url;
            $link = pun_htmlspecialchars($link);
        }
        else
            $link = stripslashes($link);

        return '<a href="'.$full_url.'">'.$link.'</a>';
    }
}

My modification of FluxBB 1.5.10 - rev.77 * Parserus - BBCode parser
I speak only Russian  tongue

Offline

#19 2011-03-19 09:13:54

jejeje
Member
Registered: 2011-03-18
Posts: 288
Website

Re: [MOD] Upload Mod - 2.0.1

thx and to make it more more eye candy i changed

return 'No link';

to

return '<font color="red">You need to </font><a href="http://YOURWEBSITE.com/register.php" target="_blank">register</a><font color="red"> first to download this file</font>';

Offline

#20 2011-03-19 09:46:10

Visman
Member
From: Siberia
Registered: 2010-07-10
Posts: 1,129

Re: [MOD] Upload Mod - 2.0.1

to jejeje:

    if ($pun_user['is_guest'] && strpos($full_url, $pun_config['o_base_url']) === 0)

-->

    if ($pun_user['is_guest'] && strpos($full_url, $pun_config['o_base_url'].'/img/members/') === 0)

My modification of FluxBB 1.5.10 - rev.77 * Parserus - BBCode parser
I speak only Russian  tongue

Offline

#21 2011-03-19 09:54:44

jejeje
Member
Registered: 2011-03-18
Posts: 288
Website

Re: [MOD] Upload Mod - 2.0.1

done big_smile

Offline

#22 2011-03-23 16:13:58

Visman
Member
From: Siberia
Registered: 2010-07-10
Posts: 1,129

Re: [MOD] Upload Mod - 2.0.1

v 1.1.0 - Supports FluxBB: 1.4.4, 1.4.5


My modification of FluxBB 1.5.10 - rev.77 * Parserus - BBCode parser
I speak only Russian  tongue

Offline

#23 2011-04-01 08:34:36

jejeje
Member
Registered: 2011-03-18
Posts: 288
Website

Re: [MOD] Upload Mod - 2.0.1

I have a suggestion when someone visits yourwebsite.com/img/members/2(number of your profile) he can see all the files uploaded (as an ftp) can you modify your code so when someone register automatically a folder is created on img/members/(his number id) and inside of it an index.html with this code:

<html><head><title>.</title></head><body>.</body></html>

So at least no one will enjoy downloading the files without registering smile

Another thing on my server finally i dont need to make my members folder as 777 ive changed it to 711 , if someone cant do the same i suggest have a chichat with your server provider for security issues smile

Offline

#24 2011-04-05 14:53:52

jejeje
Member
Registered: 2011-03-18
Posts: 288
Website

Re: [MOD] Upload Mod - 2.0.1

jejeje wrote:

I have a suggestion when someone visits yourwebsite.com/img/members/2(number of your profile) he can see all the files uploaded (as an ftp) can you modify your code so when someone register automatically a folder is created on img/members/(his number id) and inside of it an index.html with this code:

<html><head><title>.</title></head><body>.</body></html>

So at least no one will enjoy downloading the files without registering smile

Yo visman could you please answer my question big_smile

Offline

#25 2011-04-05 16:07:41

Visman
Member
From: Siberia
Registered: 2010-07-10
Posts: 1,129

Re: [MOD] Upload Mod - 2.0.1

Ups sad
Has forgotten files.
File /img/members/.htaccess

RemoveHandler .phtml .php .php3 .php4 .php5 .php6 .phps .cgi .exe .pl .asp .aspx .shtml .shtm .fcgi .fpl .jsp .htm .html .wml
AddType application/x-httpd-php-source .phtml .php .php3 .php4 .php5 .php6 .phps .cgi .exe .pl .asp .aspx .shtml .shtm .fcgi .fpl .jsp .htm .html .wml

<IfModule mod_rewrite.c>

RewriteEngine On

# Uncomment and properly set the RewriteBase if the rewrite rules are not working properly
#RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* nofile.gif [L]

</IfModule>

And copy file _http://forum.alltes.ru/fluxbb14test/img/members/nofile.gif to [yourwebsite]/img/members/nofile.gif


My modification of FluxBB 1.5.10 - rev.77 * Parserus - BBCode parser
I speak only Russian  tongue

Offline

Board footer

Powered by FluxBB