/***************************************************************************
                           newbb_fileup  -  description
                           ----------------------------
    begin                : Mon Mar 08 2004
    copyleft             : (C) 2004-2007 Bluemoon inc.
    home page            : http://www.bluemooninc.biz/
    auther               : Yoshi Sakai
    email                : webmaster@bluemooninc.biz
----------------------------------------------------------------------------
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
 ***************************************************************************/

Special Thanks to
*****************
download by Nat Sakimura,funran7
Version 1.80: Sponsored by NEC Corporation.

Introduction
************
I modified XOOPS forum module to more easyly about file upload and attach.
You can upload directly and attach automatically.
It's just overwrite newbb folder. (Strongly recommend backup before!)

Installation
************
1.Backup all files about (XOOPS_ROOT/modules/newbb) folder. (In case of you don't like this.)
2.Extract newbb folder in newbb_fileupXXXX.zip to XOOPS_ROOT/modules/
3.Cerate thumbnail folder and set permission 777 (XOOPS_ROOT./uploads/thumbs).
4.Install from Modules Administration.

--- For Update from Previous Versions -----------------------------------------
5.CLICK A NEWBB MODULE ADMIN AT ONCE FOR ADD A NEW TABLE AS 'bb_users2topics'.
6.UPDATE TO 1.8, Click "update database" at newbb module admin.
-------------------------------------------------------------------------------
7.Customize the fileup.ini.php, if you need some changes.
    You should change the upload folder that is not in web path. It will be more secure.


Newest Version Information
**************************
V1.80m 2007/06/18
       New: "Temporary save" for your posting.
       New: "Download to text" for save all threads of a topic for your local.
  Brush-up: Search private forum for accessible user.
  Brush-up: Separate search words as multi-byte space.
  Brush-up: Search with suggestion words for Japanse (Hankaku-Zenkaku Kana).
  Brush-up: Notify to only private members when someone posting at private forum.
      Move: Move 3 parameters (SAVE_AS_MBSTR, normal_maxbyte, private_maxbyte ) from fileup.ini.php to module administration.
And much more....

V1.80n 2007/06/22 Bugfix: Notify with fulltext.
V1.80o 2007/06/25 Change: Notify as new forum only public when admin made it. Notify as a new forum at private when admin registered as private user.
V1.81 2007/06/30 Added new class as download.class.php. Then ext2mime.php move into download.class.php.
Bugfix: Download with multi-binary name files.
V1.81a 2007/07/10 Bugfix: It was sending notify mail for existing topic by each edit. You may notify as "temporary save" change it to "submit" or simply submit as now topic and replay.
V1.82 2008/02/07 Signature supported on template.
V1.83 2008/03/18 Bugfix: Lost the redirect page at return from "notify me of new posts in the current thread.".
v1.84 2008/04/25 Security update for XSS Vulnerability at download.php.
V1.85 2008/06/18 Bugfix: Image file handling of multibyte file at post.php.
V1.86 2008/06/30 Bugfix: sort by uname at viewforum.php.
V1.87 2008/08/16 Added new function: The permitted group can see the notified user list. 
V1.88 2008/09/06 Bugfix: Error stop at search.inc.php as search by guest. Added "File type for upload" at module admin.
V1.89 2008/12/11 New: Supported JQuery Lightbox plugin for thumbnail images.
V1.90 2008/12/13 Makinosuke works was merged around newbb_edit.html. Thanks a lot!
V1.91 2008/12/29 New: Supported JQuery MarkItUp plugin for text editing. ( work with Makinosuke too)
V1.92 2009/01/07 Bugifx: search.php,viewforum.php. MarkItUp more fitted for xoops BBcode.
V1.93 2009/01/08 Bugifx: sort at newbb_viewforum.html. MarkItUp has Tango disktop color list.
V1.94 2009/03/02 Bugifx: At download.php, it couldn't send html header.
V1.95 2009/03/14 Update: The width parameter of "code" and "quote" in style.css. It changed from fixed 580px to 97%.
V1.96 2009/04/04 Bugifx: Page jump link for flat view. MarkItUp work with ImpressCMS. Templates fix by Makinosuke.
V1.97 2009/08/18 Bugfix: Thred sticky, rock and delete. The modal dialog confirmation opens when you delete a file.
V1.97a 2009/08/29 Repackage with jQueryUI liblary. Bugfix for returning to the top page at view topic.
V1.97b 2009/10/16 Update themplates as index, search, viewforum.

Previous Version Information
****************************
v1.01 2004/03 Added simple forumform.
v1.02 2004/03 denied MIME type executable and html file upload.
v1.03 2004/03 I changed rejecting process MIME to watching extension name.
V1.04 2004/03 Added newbb_fileup.txt and xoopscode.php. omit the  original files.
V1.05 2004/03 Added notify check box to simple form. 
V1.06 2004/03 Change the uploaded file name for add type problem.(Security update.)
V1.07 2004/03 I made fileup.ini.php for parameter.(default form, max upload size, check MIMEtype etc...)
V1.08 2004/03/25 Added Max file size parameter for private forum.
V1.09 2004/03/25 I deleted mb_strings function. but still can use multi-byte strings. ( it's good for non mb_string support servers. )
V1.10 2004/03/28 Bug fix about switching form on reply.
V1.11 2004/04/10 Bug fix about switching form Http Get Method.
V1.12 2004/04/11 Support multi-byte file name and Guest upload option. ( Use Careflly! Anyone can do that. )
V1.13 2004/04/11 Add upload title strings, Smilies for simple form at fileup.ini.php.
V1.14 2004/04/21 Add download.php for sanitize decode about uploadfile.
V1.15 2004/04/21 Fix download.php for file size problem.
V1.16 2004/04/21 Add guest download option. (Thanks Tiro!)
V1.17 2004/04/21 Support download icon. ( Use ./newbb/images/phpBB/attachment.gif )
V1.18 2004/04/27 Add upload usage message for upload in fileup.ini.php.
V1.19 2004/04/27 Fix the Excel file download problem.
V1.20 2004/04/27 Fix disappear download icon at flat mode.
V1.21 2004/04/29 Add download icon and UPLOADS parameter on fileup.ini.php.
V1.22 2004/04/30 Support thumbnail for JPG and PNG attached files.
V1.23 2004/05/01 Cut the uploader's name when downloading.
V1.24 2004/05/12 Modify download for PDF. Modify post for click thmbs then open new window. add $img_dir on fileup.ini
V1.25 2004/05/12 Add UPLOAD_ACCLEVEL for acceptable user's level. Add denyUser for some naughty user.
V1.26 2004/05/12 Bugfix about guest form.
V1.27 2004/05/12 Change denyUser(uname) to denyUID(uid).
v1.28 2004/05/25 Support GIF thumbsnail and open as new window.
v1.29 2004/06/04 Altanate display about forum option. Change new post icon.
v1.30 2004/09/06 Hide private forums for confidential use.
v1.31 2004/09/06 Support uploads from preview button.
v1.32 2004/09/06 Support alternative view in edit and delete simple/normal option.
v1.33 2004/10/11 Support alternative view for Mozilla,Opera.
v1.34 2004/11/09 Add ALTANATE_DISP in fileup.ini.php. Auto embeds for video, audio, flash files.
v1.35 2004/11/15 Suppot HTMLArea.
v1.36 2004/12/21 Add upload file permission (private forum = 511, ordinary = 000).
                 Create a log file in upload folder when someone to download.
v1.37 2004/12/25 Security update for phpBB worm.
v1.38 2005/01/17 Add option replace user's name with real name. ( SHOW_NAME in fileup.ini.php )
v1.39 2005/02/17 Auto enbed for Flush files.
v1.40 2005/03/14 Change allow the html posting by Joefta.
                 Change img_dir,thumb_dir in fileup.ini.php. It work with XOOPS_URL, XOOPS_ROOT_PATH.
v1.41 2005/05/21 Bugfix about MIME for MS-Word at download.php by fanrun7.
v1.42 2005/06/03 Add Content-disposition header for each browser at download.php by fanrun7.
v1.43 2005/07/08 Add chmod(0644) for uploaded file and work under non GD.
v1.44 2005/07/25 Add a private newposts icon in index.php line(115-127) and config.php line(53)
v1.45 2005/07/25 Add a checkPermit function to admin/index.php.
v1.46 2005/08/23 Bugfix about Anonymous upload.
v1.47 2005/08/26 Omit under the 5 minutes for topic_lastread of cookie. And save it max 500threads.
v1.48 2005/09/13 Update icon images and fix for msword MIME strings. Bugfix for chmod at post.php.
v1.49 2005/09/16 Merge hack for notification by hhankt.
v1.50 2005/09/16 Bugfix for notification and support SSL dwonload by entama.
v1.51 2005/10/25 Security update for bbcode decoding and image file upload.
v1.52 2005/10/29 No display for private categorie. Support one time ticket. HTTP_GET_VARS,HTTP_POST_VARS to _GET,_POST
v1.53 2005/10/31 Add $def_sortsince in fileup.ini.php. Use default view since 'n' days.
v1.54 2005/11/01 Move sort line bottom to top at newbb_viewforum.html. Change sort since 75 to 90, 100 to 180 at viewforum.php. 
v1.55 2005/11/03 Change forum order from forum_id to forum_name. Bug fix for conflict functions.
v1.56 2005/11/18 Add read sign function. 
v1.60 2005/12/18 !!! CLICK A NEWBB MODULE ADMIN AT ONCE FOR ADD A NEW TABLE AS 'bb_users2topics'. !!!
	1: Add a new table 'bb_users2topics' for already read record.
	2: Support WYSIWYG editor SPAW and drop HTMLarea.
	3: Notification check box to forum and topic view. Add a option image file.
	4: Change Admin menu structure.
v1.61 2005/12/23 Bugfix about count up for topic_views.
v1.62 2006/02/11 Bugfix for real name at viewforum.php.
v1.63 2006/02/15 Bugfix for notification in template of view forum and topic.
v1.64 2006/04/06 More real name for SHOW_NAME option at view forum and reply.
v1.65 2006/05/12 Fix for mb_convert_encoding parameter as SAVE_AS_MBSTR on fileup.ini.php.
v1.66 2006/05/22 Add ext2mime.php for MIME decoding by extension at download.php.
v1.67 2006/07/07 Add 'pragma : public' in download.php for IE SSL download. $HTTP_COOKIE_VARS to $_COOKIE. $HTTP_SERVER_VARS to $SERVER. Bugfix for Opera9.0 (table tag issue at newbb_index.html)
v1.68 2006/07/14 For anonymous user, view topic mode can be controlled by Site preferences.(At General Settings>Default Comment Display Mode and Default Comments Display Order)
v1.69 2006/12/09 Supported IE7, except small zip file. (right click to save)
Update gtickets.php (from pical v0.90)
v1.70 2006/12/09 Bugfix for PNG,GIF thumbnail.
v1.71 2007/01/09 Bugfix for thumbnail and topics order.
v1.72 2007/03/13 Added a new source as NewbbViewForm.class.php for viewtopic.php. Added new function as delete a uploaded file for poster and admin.
v1.73 2007/03/16 Bugfix as can't see a topic of private forum.
v1.74 2007/04/27 Bugfix as page navigation at viewtopic.php.
v1.75 2007/04/28 Add reset of category order to under the 'Set Category Ordering' tag at admin_forums.php.
