        .-------+----------+----------- [Imdb] ---------+---------------------:
        |                       Imdb System v1.10 by TuS                      |
        :-------+----------+----------+-----------------+---------------------:

Index
-----
    1)Features
    2)How it works
    3)Supported Functions
     3.1)FTPD Events
     3.2)USER Commands
     3.3)Imdb-Bars
     3.4)Script Outputs
     3.5)Script Default settings
    5)Requirements
    6)Setup & Install (w/RaidenFTPD)
    7)Configurable Options
    8)Credits
    9)Change Log

1)Features
-----------
    - Standalone Imdb information system for RaidenFTPd
    - Extracts Imdb.com Movie/Series Information, downloads Poster
    - Integrates Imdb.com Information into directory message files
    - Supports User commands and FTPD onNewDir, onFileUploaded(.nfo) events
    - Supports Multiple Running RaidenFTPD servers
    - Coded in vbs which is natively supported by Windows (x86 and x64)

2)How it works
---------------
The FTPD Imdb system monitors FTPD events for directory creation, .nfo upload, user commands and
then queries the Imdb.com website in order to display the information to the FTPD user.
When triggered the script will try identify the Imdb-ID, first by looking in the .nfo file and if the
Imdb-ID is not found then the script will try a goggle search.
Once the Imdb-ID is identified, the script will query the Imdb.com data for the Imdb-ID and extract
the required data.

Typically, the Imdb script will save Imdb.com data to a local file for easy user access (through message
files) and will also download the poster from imdb.com .(See configuration options in the script file).

           !!!!! NOTICE !!!!! NOTICE !!!!! NOTICE !!!!! NOTICE !!!!! NOTICE !!!!!
Due to the fact the the data is extracted from an HTML file (using patterns to match the data) it is
understandable that if the HTML structure is changed by imdb.com the data extraction process will
require rework. This means that every time the imdb.com page is updated/changed you will have to
adapt the data extraction patterns. This requires vbs scripting and Reg-Ex knowledge.
           !!!!! NOTICE !!!!! NOTICE !!!!! NOTICE !!!!! NOTICE !!!!! NOTICE !!!!!

Supported Imdb Tags:
    Budget, Countries, Country, Description, Director, Directors, Duration, Episode, Genres, Genre, 
    Id, Link, MediaLink, MediaType, MPAA, OfficialLink, OfficialLinks, PosterLink, PosterThumbLink,
	Rating, ReleaseDate, ReleaseYear, Screens, Season, Seasons, Star, Stars, StoryLine, TagLine, 
	Title, TitleOriginal, Top250, Votes.
    
3)Supported Functions
----------------------
3.1)FTPD Events
    2 different events can be configured with the Imdb script:

    onNewDir
    FTPD Command MKD. Check and trigger a Imdb query on directory creation.
    RaidenFTPD event: onNewDir

    onFileUploaded
    Monitors FTPD FileUpload of .nfo. Check and trigger a Imdb query on .nfo upload.
    RaidenFTPD event: onFileUploaded

    you do not have to use both or any by the way. Theses events are just an addition to the user
    commands. But if you want to, automatically, query the Imdb.com data upon directory creation or/and
    .nfo upload then just configure the related FTPD event.

    I would recommend using the onFileUploaded event rather then the onNewDir as the uploaded .nfo
    has a chance to contain a valid Imdb-ID.

3.2)USER Commands

    #   COMMAND: site imdb help
        Show help
        .-------+----------+----------- [Imdb] ---------+---------------------:
        | Syntax : site imdb <command> <Release> [<options>]                  |
        +-------+----------+----------+-----------------+---------------------+
        | Commands :                                                          |
        |    getinfo   <Release> <Options> : Get Imdb Information             |
        |    getposter <Release> <Options> : Download Imdb Poster             |
        |    help                          : Show this help                   |
        +-------+----------+----------+-----------------+---------------------+
        | Options :                                                           |
        |    -id:[xxxxxxx]    : Override the Imdb ID detection                |
        |    -is:[true|false] : Force save Imdb data to folder                |
        |    -pd:[true|false] : Force poster download to folder               |
        |    -ps:[height]     : Force poster Height(px) (0=Max)               |
        |                                                                     |
        |                                 defaults: -is:true -pd:true -ps:640 |
        :-------+----------+----------+-----------------+---------------------:

    #   COMMAND: site imdb getinfo <Release>
        Get Imdb information for the <Release>

        Command Output when Imdb found a match
        .-------+----------+----------- [Imdb] ---------+---------------------:
        | <Release>                                                11/12/2011 |
        +-------+----------+----------+-----------------+---------------------+
        | Title   : Mr. Popper's Penguins                    Imdb-ID: 1396218 |
        | Genres  : Comedy, Family                                Rating: 5.9 |
        | Duration: 94 min                                       Country: USA |
        | Released: 20 July 2011                                     MPAA: PG |
        +-------+----------+----------+-----------------+---------------------+
        | Director: Mark Waters                                               |
        | Stars   : Jim Carrey, Carla Gugino, Angela Lansbury                 |
        +-------+----------+----------+-----------------+---------------------+
        | StoryLine: Tom Popper grew up having very little interaction with   |
        | his father who was off exploring the world. When he grows up he     |
        | spends most of time on his work and ignores his children. One day   |
        | his father sends him an unusual gift: six penguins. Popper can't    |
        | help but wonder why his father would send him penguins. He tries    |
        | to get rid of them. But when his children and ex-wife show up to    |
        | celebrate his son's birthday, the kids are taken with the           |
        | penguins. And Popper finally gets to connect with his kids and his  |
        | work suffers.                                                       |
        | TagLine :                                                           |
        +-------+----------+----------+-----------------+---------------------+
        | Link  : http://www.imdb.com/title/tt1396218                         |
        | Media : http://www.imdb.com/media/rm1028896768/tt1396218            |
        | Poster: http://ia.media-imdb.com/images/M/MV5BMTcwMDI4NjEyOF5BMl5Ba |
        | nBnXkFtZTcwNzg5MzEwNQ@@._V1.jpg                                     |
        :-------+----------+----------+-----------------+---------------------:

        Command Output when Imdb is unable to find a match
        .-------+----------+----------- [Imdb] ---------+---------------------:
        | Unable to Identify Imdb-ID. Lookup the Imdb-ID on www.imdb.com and  |
        | use option -id.                                                     |
        :-------+----------+----------+-----------------+---------------------:

        Command Output when the script is unable to connect to Imdb.com
        .-------+----------+----------- [Imdb] ---------+---------------------:
        | Unable to load Imdb Data. Please try again later.                   |
        :-------+----------+----------+-----------------+---------------------:

        Command Output when the User does not have access
        .-------+----------+----------- [Imdb] ---------+---------------------:
        | User:TuS does Not have access to Imdb commands                      |
        :-------+----------+----------+-----------------+---------------------:

    #   COMMAND: site imdb getposter <Release>
        Get Imdb poster for the <Release>

        Command Output when all is good
        .-------+----------+----------- [Imdb] ---------+---------------------:
        | Imdb poster was saved. Please refresh listing in your ftp client    |
        :-------+----------+----------+-----------------+---------------------:

         Command Output when Imdb is unable to find a match
        .-------+----------+----------- [Imdb] ---------+---------------------:
        | Unable to Identify Imdb-ID. Lookup the Imdb-ID on www.imdb.com and  |
        | use option -id.                                                     |
        :-------+----------+----------+-----------------+---------------------:

        Command Output when the script is unable to connect to imdb.com
        .-------+----------+----------- [Imdb] ---------+---------------------:
        | Unable to load Imdb Data. Please try again later.                   |
        :-------+----------+----------+-----------------+---------------------:

        Command Output when the User does not have access
        .-------+----------+----------- [Imdb] ---------+---------------------:
        | User:TuS does Not have access to Imdb commands                      |
        :-------+----------+----------+-----------------+---------------------:

3.3) Imdb-Bar
    The script allows you to automatically create Imdb-Bar in the Release folder. Imdb-Bar can be
    either a 0byte File or a Folder (IMDB_BAR_TYPE).

    There are 2 different type for Imdb-Bars:
            For a "Movie" (Movie)
                IMDB_BAR    = "[IMDB]-(%MPAA%)-(%genre%)-(%releaseyear%)-(%rating% with %votes% votes)-(%screens% screens)-(%duration%)-[IMDB]"
            For "TV" (TV Series) or "TVEP" (TV Episode)
                IMDB_TV_BAR = "[IMDB-TV]-(%MPAA%)-(%genre%)-(%rating% with %votes% votes)-(%releasedate%)-(%duration%)-[IMDB-TV]"

    Theses bars can be customized with the following list of tags:
            .--------------------------------------------------------------------------------:
            |    Tag               |  Description                                            |
            +----------------------+---------------------------------------------------------+
            | %Budget%             |  Media Budget                                           |
            | %Countries%          |  Media Countries                                        |
            | %Country%            |  Media Country (First of %Countries%)                   |
            | %Description%        |  Media Description                                      |
            | %Directors%          |  Media Directors                                        |
            | %Director%           |  Media Director (First of %Directors%)                  |
            | %Duration%           |  Media Duration                                         |
            | %Episode%            |  Media Episode (Valid for TVEP Releases)                |
            | %Genres%             |  Media Genres                                           |
            | %Genre%              |  Media Genre (First of %Genres%)                        |
            | %Id%                 |  Media Imdb-Id                                          |
            | %Link%               |  Media Link                                             |
            | %MediaLink%          |  Media MediaLink                                        |
            | %MediaType%          |  Media MediaType ("Movie"|"TV"|"TVEP")                  |
            | %MPAA%               |  Media MPAA (USA Content Rating)                        |
            | %OfficialLinks%      |  Media OfficialLinks                                    |
            | %OfficialLink%       |  Media OfficialLink (First of %OfficialLinks%)          |
            | %PosterLink%         |  Media PosterLink (Full size Poster link)               |
            | %PosterThumbLink%    |  Media PosterThumbLink (Mini Poster)                    |
            | %Rating%             |  Media Rating (User Rating)                             |
            | %ReleaseDate%        |  Media ReleaseDate (or AirDate local for TVEP Releases) |
            | %ReleaseYear%        |  Media ReleaseYear (yyyy part of %ReleaseDate%)         |
            | %Screens%            |  Media Screens                                          |
            | %Season%             |  Media Season (Valid for TVEP Releases)                 |
            | %Seasons%            |  Media Seasons                                          |
            | %Stars%              |  Media Stars                                            |
            | %Star%               |  Media Star (First of %Stars%)                          |
            | %StoryLine%          |  Media StoryLine                                        |
            | %TagLine%            |  Media TagLine                                          |
            | %Title%              |  Media Title                                            |
            | %TitleOriginal%      |  Media TitleOriginal (if any)                           |
            | %Top250%             |  Media Top250 (Position in Top 250)                     |
            | %Votes%              |  Media Votes                                            |
            :--------------------------------------------------------------------------------:

    Special TV Episode tags if IMDB_GET_EPISODE_ID = False and the query is for a TV Episode Release
    matching the following format [Series].S[yy]E[xx].*. In this case Media Tags will contain the
    [Series] Data and the [Episode] data will be loaded into the Episodes tags.
            .--------------------------------------------------------------------------------:
            |    Tag               |  Description                                            |
            +----------------------+---------------------------------------------------------+
            | %EpisodeAirDate%     | Episode AirDate (USA)                                   |
            | %EpisodeDescription% | Episode Description                                     |
            | %EpisodeID%          | Episode Imdb-ID                                         |
            | %EpisodeLink%        | Episode Link                                            |
            | %EpisodeTitle%       | Episode Title                                           |
            :--------------------------------------------------------------------------------:

                !!! IMPORTANT !!! !!! WARNING !!! !!! IMPORTANT !!! !!! WARNING !!!
    If you do change theses Imdb-Bar templates then do no forget to change the to Imdb-Bar delete
    templates accordingly:
                            DEL_IMDB_BAR    = "[IMDB]-(*)-[IMDB]"
                            DEL_IMDB_TV_BAR = "[IMDB-TV]-(*)-[IMDB-TV]"

    if you do not change theses then you may end up with a new Imdb-Bar
                !!! IMPORTANT !!! !!! WARNING !!! !!! IMPORTANT !!! !!! WARNING !!!

3.4) Script Outputs
     3.4.1) TV and TVEP
        The output is conditioned by the IMDB_GET_EPISODE_ID option configuration

        # IMDB_GET_EPISODE_ID
        This option allows you to configure how the "TV"/"TVEP" data is displayed to the user

        IMDB_GET_EPISODE_ID  = False
        When set to False the user output will mix Imdb data from the Series page and from the
        Episode page.

            .-------+----------+----------- [Imdb] ---------+---------------------:
            | 24.S05E01.US.DVDRiP.XviD-InD                                        |
            +-------+----------+----------+-----------------+---------------------+
            | Title   : 24                                       Imdb-ID: 0285331 |   -|
            | Genres  : Action, Crime, Drama, Thriller                Rating: 8.7 |    |
            | Duration: 42 min                                       Country: USA |    |
            | Dates   : 2001-2010                                     MPAA: TV_14 |    | Series related Info
            +-------+----------+----------+-----------------+---------------------+    |
            | Creator : Robert Cochran                                            |    |
            | Stars   : Kiefer Sutherland, Mary Lynn Rajskub, Carlos Bernard      |   -|
            +-------+----------+----------+-----------------+---------------------+
            | Ep.Title    : Day 5: 7:00 a.m.-8:00 a.m.                            |   -|
            | Ep.Air Date : 15 January 2006                                       |    |
            | Ep.Desc.    : The Russian and US Presidents are set to sign an      |    | Episode related Info
            | anti-terror treaty when assassinations rock Los Angeles.            |    |
            | Ep.Link     : http://www.imdb.com/title/tt0502266                   |   -|
            +-------+----------+----------+-----------------+---------------------+
            | Link  : http://www.imdb.com/title/tt0285331                         |   -|
            | Media : http://www.imdb.com/media/rm1257344768/tt0285331            |    | Series related Info
            | Poster: http://ia.media-imdb.com/images/M/MV5BMjE4OTg2MDU1MV5BMl5Ba |    |
            | nBnXkFtZTcwNTgwMjIxMw@@._V1.jpg                                     |   -|
            :-------+----------+----------+-----------------+---------------------:

            Imdb-Bar Ex:
              IMDB_TV_BAR = "[IMDB-TV]-(%ID%)-(%genre%)-(%star%)-(%director%)-(%rating% with %votes% votes)-(%releaseDate%)-(%duration%)-(%MPAA%)-[IMDB-TV]"
              Results in: [IMDB-TV]-(0285331)-(Action)-(Kiefer_Sutherland)-(Robert_Cochran)-(8.7 with 55,023 votes)-(2001-2010)-(42_min)-(TV_14)-[IMDB-TV]

        IMDB_GET_EPISODE_ID  = True
        When set to True the user output will only extract Imdb data from the Episode page.

            .-------+----------+----------- [Imdb] ---------+---------------------:
            | 24.S05E01.US.DVDRiP.XviD-InD                                        |
            +-------+----------+----------+-----------------+---------------------+
            | Title   : Day 5: 7:00 a.m.-8:00 a.m.               Imdb-ID: 0502266 |   -|
            | Genres  : Action, Crime, Drama, Thriller                Rating: 8.8 |    |
            | Duration: 42 min                                       Country: USA |    |
            | Dates   : 23 September 2006                             MPAA: TV_14 |    |
            +-------+----------+----------+-----------------+---------------------+    |
            | Creator : Jon Cassar                                                |    |
            | Stars   : Kiefer Sutherland, Kim Raver, Mary Lynn Rajskub           |    |
            +-------+----------+----------+-----------------+---------------------+    |
            | StoryLine: Russian President Suvarov is set to meet President       |    |
            | Logan to sign an arms treaty when David Palmer is assassinated,     |    | Episode related Info
            | Tony Almeida and Michelle Dessler are hit by a car bomb and         |    |
            | someone starts chasing Chloe O'Brian. The only link between the     |    |
            | four of them is that they are the only people who know that former  |    |
            | CTU agent Jack Bauer is alive.                                      |    |
            | TagLine  :                                                          |    |
            +-------+----------+----------+-----------------+---------------------+    |
            | Link  : http://www.imdb.com/title/tt0502266                         |    |
            | Media : http://www.imdb.com/media/rm1257344768/tt0285331            |    |
            | Poster: http://ia.media-imdb.com/images/M/MV5BMjE4OTg2MDU1MV5BMl5Ba |    |
            | nBnXkFtZTcwNTgwMjIxMw@@._V1.jpg                                     |   -|
            :-------+----------+----------+-----------------+---------------------:

            Imdb-Bar Ex:
              IMDB_TV_BAR = "[IMDB-TV]-(%ID%)-(%genre%)-(%star%)-(%director%)-(%rating% with %votes% votes)-(%releaseDate%)-(%duration%)-(%MPAA%)-[IMDB-TV]"
              Results in: [IMDB-TV]-(0502266)-(Action)-(Kiefer_Sutherland)-(Jon_Cassar)-(8.8 with 468 votes)-(23_September_2006)-(42_min)-(TV_14)-[IMDB-TV]

    3.4.2) Movie
        There is only 1 output format for the Movie type
            .-------+----------+----------- [Imdb] ---------+---------------------:
            | The.Godfather.1972.FRENCH.DVDRip.Xvid-Ind                           |
            +-------+----------+----------+-----------------+---------------------+
            | Title   : The Godfather                            Imdb-ID: 0068646 |
            | Genres  : Crime, Drama                                  Rating: 9.2 |
            | Duration: 175 min                                      Country: USA |
            | Released: 18 January 1973                                   MPAA: R |
            +-------+----------+----------+-----------------+---------------------+
            | Director: Francis Ford Coppola                                      |
            | Stars   : Marlon Brando, Al Pacino, James Caan                      |
            +-------+----------+----------+-----------------+---------------------+
            | StoryLine: The story begins as "Don" Vito Corleone, the head of a   |
            | New York Mafia "family", oversees his daughter's wedding. His       |
            | beloved son Michael has just come home from the war, but does not   |
            | intend to become part of his father's business. Through Michael's   |
            | life the nature of the family business becomes clear.
            | TagLine  : An offer you can't refuse.                               |
            +-------+----------+----------+-----------------+---------------------+
            | Link  : http://www.imdb.com/title/tt0068646                         |
            | Media : http://www.imdb.com/media/rm2223608832/tt0068646            |
            | Poster: http://ia.media-imdb.com/images/M/MV5BMTIyMTIxNjI5NF5BMl5Ba |
            | nBnXkFtZTcwNzQzNDM5MQ@@._V1.jpg                                     |
            :-------+----------+----------+-----------------+---------------------:

            Imdb-Bar Ex:
              IMDB_BAR = "[IMDB]-(%MPAA%)-(%genre%)-(%releaseyear%)-(%rating% with %votes% votes)-(%screens% screens)-(%duration%)-[IMDB]"
              Results in: [IMDB]-(R)-(Crime)-(1973)-(9.2 with 503,446 votes)-(6 screens)-(175_min)-[IMDB]

3.5) Script Default settings
        The script allow setting the default values for the different options.
        The default values are set in the config file and can be overloaded on
        command execution.

        -id:[xxxxxxx]    : Override the Imdb ID detection
         Default : None
        -is:[true|false] : Force save Imdb data to folder
         Default : IMDB_FILE_SAVE
        -pd:[true|false] : Force poster download to folder
         Default : IMDB_POSTER_DOWNLOAD
        -ps:[height]     : Force poster Height(px) (0=Max)
         Default : IMDB_POSTER_SIZE

5)Requirements
    - Windows Script Host 5.6 or above
    - Script must be invoked by cscript engine
    - FTPD: RaidenFTPD 2.4.3902 or higher (possibly could work with lower)
    - External tools (provided in the ..\Imdb\tools folder)
        - Chmod.exe (RaidenTeam) For Changing owner and mode
        - DirDate.exe (DataMystic) For setting Directory Dates

6)Setup & Install (w/RaidenFTPD)
    + Prerequisite
     This install "guide" assumes following:
      - RaidenFTPD installed to "C:\RaidenServer\RaidenFTPD",
      - You're VFS file is named same as the server name:
        ex: if the server is called "RaidenFTPD32", value provided by the "%h"
        variable then your VFS file should be called "RaidenFTPD32.vfs".

    If this is not the case then you will have to adapt the settings in the config
    file.

    + System files
    Copy the content of this package to a folder.
    In this guide we use : "C:\RaidenServer\RaidenFTPD\Addons\Imdb"

    + Edit "Imdb.config" file
    Even though you have identical setup as described in this setup, open you're
    favorite text editor and inspect/edit the following file : "Imdb.config".
    Make sure every path and filenames match your configuration.
    DO NOT CHANGE ANY LOG LEVEL YET.

    + Cscript as default engine
    Set cscript as default script engine. To do this open command prompt and type
    the following: cscript //H:Cscript.
    You should receive this reply if successful: The default script host is now
    set to "cscript.exe". Default script engine in Windows is wscript. This is
    fine, if we would like messages to appear as a dialog. However this is a
    system which in most cases never will be monitored directly. An error with
    wscript engine will wait for someone to click a button, hence the script will
    never complete if an error occurs. This again might lead to multiple instances
    of unfinished script processes. It's possible to omit setting cscript as
    default engine, and call the script directly using "cscript scriptname".

    + Setup RaidenFTPD

    Command dispatcher
    ------------------
    This section assumes that the sitecmd.ini does not already exist. In case it already exists
    just edit the existing one.

    Go to the directory "C:\RaidenServer\RaidenFTPD\VirtulFS" and create a folder
    with the same name as you're server. You're server name can be found in *.ftpd.
    In this case it's RaidenFTPD32.

    Open your favorite text editor and create a file named sitecmd.ini in this directory.
    Copy the following into the file and save it:

    [root]
    [super]
    [normal]
    [guest]
    [EGGDROP-root]
    [EGGDROP-super]
    [EGGDROP-normal]
    [EGGDROP-guest]

    Each section represents a type of user. If you only want to allow root and super
    users to execute a command, you would insert the command into those sections.
    In this case we will allow only root and super users to perform Imdb command
    on our site.

    x86 System :
    [root]
    Imdb=ask://C:\WINDOWS\System32\cscript.exe "C:\RaidenServer\RaidenFTPD\Addons\Imdb\Imdb.vbs" "%@" 1 "%h" "%S" "%g" "%r" %!
    [super]
    Imdb=ask://C:\WINDOWS\System32\cscript.exe "C:\RaidenServer\RaidenFTPD\Addons\Imdb\Imdb.vbs" "%@" 1 "%h" "%S" "%g" "%r" %!
    [normal]
    Imdb=ask://C:\WINDOWS\System32\cscript.exe "C:\RaidenServer\RaidenFTPD\Addons\Imdb\Imdb.vbs" "%@" 0 "%h" "%S" "%g" "%r" %!
    [guest]
    [EGGDROP-root]
    [EGGDROP-super]
    [EGGDROP-normal]
    [EGGDROP-guest]

    !!! IMPORTANT !!! !!! WARNING !!! !!! IMPORTANT !!! !!! WARNING !!!
    Some variables are in "", others are not. It's crucial to the system that you
    provide the arguments exactly as described in this documentation. This has
    something to do with how the various scripts interpret the arguments.

    Imdb has 7 base parameters: "%@" 1 "%h" "%S" "%g" "%r" %!
        Param 1: GCID     : Variable :  "@" : used for the response outputs
        Param 2: Security : Value    :  0|1 : used for the access security
        Param 3: Server   : Variable : "%h" : used for the VFS File Identification
        Param 4: User     : Variable : "%S" : used to chmod the Files at the end of the Imdb query
        Param 5: Group    : Variable : "%g" : used to chmod the Files at the end of the Imdb query
        Param 6: CurPath  : Variable : "%r" : used to identify the current virtual Path
        Param 7: Command  : Variable :  %!  : Whole string for site command, not including 'site' itself

        !!! Save the file !!!

    + Restart the FTPD

    FTPD event
    ----------------
              !!! IMPORTANT !!! !!! NOTICE !!! !!! IMPORTANT !!! !!! NOTICE !!!
    If you already have a script execution configured for one of the events then you may
    want to look into MultiExec System v1.00 by TuS, on the RaidenFTPD Addon page. The MultiExec
    System allows running multiple commands and scripts on single FTPD event.
        - Check MultiExec.Exemple.txt
              !!! IMPORTANT !!! !!! NOTICE !!! !!! IMPORTANT !!! !!! NOTICE !!!

    Go to the directory "C:\RaidenServer\RaidenFTPD" and open your server's *.ftpd file.

    Open your favorite text editor and look for the following:

    "OnNewDir=", replace it by the following line:
        onNewDir=exec://C:\WINDOWS\System32\cscript.exe "C:\RaidenServer\RaidenFTPD\addons\Imdb\Imdb.vbs" "%@" 1 "%h" "%S" "%g" "%r" "NewDir" "getinfo"

    "onFileUploaded=", replace it by the following line:
        onDelDir=exec://C:\WINDOWS\System32\cscript.exe "C:\RaidenServer\RaidenFTPD\addons\Imdb\Imdb.vbs" "%@" 1 "%h" "%S" "%g" "%r" "FileUploaded" "getinfo"

    Parameter Description
        Param 1: GCID      : Variable :  "@"      : used for the response outputs
        Param 2: Security  : Value    :  0|1      : used for the access security
        Param 3: Server    : Variable : "%h"      : used for the VFS File Identification
        Param 4: User      : Variable : "%S"      : used to chmod the Files at the end of the Imdb query
        Param 5: Group     : Variable : "%g"      : used to chmod the Files at the end of the Imdb query
        Param 6: VirPath   : Variable : "%r"      : the virtual dir/file name which the client just accessed
        Param 6: CmdType   : Static   : "NewDir"  : used for the Command Type Identification
                                        "FileUploaded"
        Param 7: CmdOption : Static   : "getinfo" : used for the Command Option identification

    !!! Save the file !!!

    + Create a new folder or upload a .nfo file depending on which event you want to check:
        - The event was fired (Raiden GUI) you can also have a look on the different parameters
          provided to the script.
        - A imdb.nfo/imdb_poster.jpg files were created (See configuration options in the config
          file for file naming)

    + Inspect script log
    Open the log directory <ScripthPath>\Logs and verify that the log only contain
    Information/Success entries. If not you must correct the error according to the log.

    + Validate the different user commands
    You can import the provide Imdb.v1.0.fce FlashFxp Command export file for this.
    Sorry, i can not provide other FTP Client exports.

    + Tuning off logs
    Once that you're system is working flawless you can turn off the logs ie: Const FILELOG = 0
    to have better performance on execution time.
    Script has log "rollover". The rollover function makes sure that no more than n logs exist
    in your log directory. Number of logs can be tuned ie: Const NUMBEROFLOGS = 5.

    Now, there's really no point of logging if you're not going to read it.
    So if you know that you'll never read any log what's so ever, set log levels to 0:
        ie: Const EVENTLOG = 0
            Const FILELOG = 0

    WARNING! Do NOT use eventlog level 2 & 3. Default is 0, and we recommend you to keep it
    that way. If you insist on getting entries into eventlog, use level 1, and make sure you're
    eventlog do overwrite with new events.

    FTPD Directory message files
    ----------------------------
    If you want to display the imdb.nfo file when you browses into the release folder, you can
    configure the FTPD to do so:
        Raiden Gui -> MenuItem Setup -> MSG Files.

            Enable the Directory Message Files option and set the text box to "imdb.nfo" or
            any other filename matching the config parameter IMDB_FILE_NAME.

7) Configurable Options

    '#------------------------------------#
    '#- Paths and Files Settings         -#
    '#------------------------------------#
    'RaidenFTPD Root folder
    Const RAIDENFTPD_PATH         = "C:\RaidenServer\RaidenFTPD"

    '#------------------------------------#
    '# IMDB Script settings              -#
    '#------------------------------------#

    'Allow IMDB user Commands for the Virtual Paths
    'Only User IMDB requests under theses Virtual Paths will be allowed.(separator is |)
    '"/DiVX" is equivalent to "/DiVX*"
    Const IMDB_ALLOWED_VFS       = "/DiVX|/TV"

    'Deny IMDB user Commands for the Virtual Paths
    'User IMDB requests under theses Virtual Paths will be Denied.(separator is |)
    Const IMDB_DENIED_VFS        = "/REQUESTS|/HOME"

    'Allow IMDB FTPD Events for the Virtual Paths
    'Only IMDB Events requests under theses Virtual Paths will be allowed.(separator is |)
    '"/DiVX" is equivalent to "/DiVX*"
    Const IMDB_EVENT_ALLOWED_VFS = "/DiVX"

    'Deny IMDB FTPD Events for the Virtual Paths
    'Events IMDB requests under theses Virtual Paths will be Denied.(separator is |)
    Const IMDB_EVENT_DENIED_VFS  = "/REQUESTS|/HOME"

    'Allow Imdb Commands to Ops only (Applies only to user commands)
    Const IMDB_OPS_ONLY          = True

    '- Imdb-Bars ---------------------------
    'Enable creation of Imdb Bars
    Const IMDB_ENABLE_BAR = False

    'Bar Type ("Folder"|"File")
    Const IMDB_BAR_TYPE   = "Folder"

    'BAR Folders Templates (see Imdb-Bar-Tags.txt for %tag% information)
    Const IMDB_BAR        = "[IMDB]-(%MPAA%)-(%genre%)-(%releaseyear%)-(%rating% with %votes% votes)-(%screens% screens)-(%duration%)-[IMDB]"
    Const IMDB_TV_BAR     = "[IMDB-TV]-(%MPAA%)-(%genre%)-(%rating% with %votes% votes)-(%releaseDate%)-(%duration%)-[IMDB-TV]"

    'BAR Folders Delete patterns (BE CAREFUL)
    Const DEL_IMDB_BAR    = "[IMDB]-(*)-[IMDB]"
    Const DEL_IMDB_TV_BAR = "[IMDB-TV]-(*)-[IMDB-TV]"

    'Change owner once the BAR is created (%user & %group are used from the script input)
    Const IMDB_BAR_CHOWN  = True
    Const IMDB_BAR_MODE   = 777

    'Allow Space in resolved tags
    Const IMDB_TAG_SPACE  = False

    '- Imdb Info Files ----------------------
    'Imdb Poster settings (IMDB_POSTER_SIZE = 0 for max)
    Const IMDB_POSTER_DOWNLOAD = True
    Const IMDB_POSTER_SIZE     = 640
    Const IMDB_POSTER_NAME     = "imdb_poster"

    'Imdb Information File settings
    Const IMDB_FILE_SAVE       = True
    Const IMDB_FILE_NAME       = "imdb.nfo"
    Const IMDB_FILE_ADD_DATE   = True

    'Change owner once the files are created (%user & %group are used from the script input)
    Const IMDB_FILE_CHOWN      = True
    Const IMDB_FILE_MODE       = 777

    '- Misc ---------------------------------
    'Resolve the Episode Imdb-ID rather then the Series Imdb-ID
    Const IMDB_GET_EPISODE_ID     = False

    'Always use the Original Title
    Const IMDB_USE_ORIGINAL_TITLE = False

    'Preserve Release Folder Modified Date
    Const IMDB_PRESERVE_DATE      = True

    'Ignore list for the Directory processing
    Const DIR_IGNORELIST          = "cd1|cd2|cd3|cd4|cd5|cd6|cd7|cd8|cd9|cd10|disc1|disc2|disc3|disc4|disc5|disc6|disc7|disc8|disc9|disc10|sample|sub|subs|proof"

    '#------------------------------------#
    '# Proxy settings                    -#
    '#------------------------------------#
    'Proxy settings (if you are going through a web proxy)
    Const USE_PROXY      = false
    Const PROXY_URL      = "proxy.corporate.com"
    Const PROXY_USER     = ""
    Const PROXY_PASS     = ""

    '#------------------------------------#
    '# Output Display settings            #
    '#------------------------------------#
    'Display type
    'true  : Output result in boxed style, typically preferred by expert users.
    '        Important! To unleash this simple "eye candy", the FTPD client must
    '        support a fixed length of all characters. If not the output will be
    '        truncated or wrecked.
    'false : Output non boxed result to FTPD client,
    Const SCENEVIEW              = true

    'SCENE Config
    Const WIDTH              = 71

    'SCENE Config
    Const SCENEHEADER         = ".-------+----------+----------- [Imdb] ---------+---------------------:"
    Const SCENESEPARATOR      = "+-------+----------+----------+-----------------+---------------------+"
    Const SCENETAIL           = ":-------+----------+----------+-----------------+---------------------:"

    'NORMAL Config
    Const NORMALHEADER        = " - IMDB -"
    Const NORMALSEPARATOR     = ""
    Const NORMALTAIL          = ""

    '#------------------------------------#
    '# Logging settings                   #
    '#------------------------------------#
    'Loglevel Eventlog 1|2|3 0 = None 1 = Success/Error 2 = Full 3 = Debug.
    '!WARNING! Level above 1 is not recommended (Use file, default is 0)
    Const EVENTLOG     = 0

    'Logs folder is <scriptpath>\Logs
    'Loglevel File 1|2|3 0 = None 1 = Success/Error 2 = Full 3 = Debug
    Const FILELOG      = 3

    'Number of logs to store in log directory 0 = Do not delete any.
    '!WARNING! this will make sure that no more than n files will remain in log directory.
    Const NUMBEROFLOGS = 5

8) Credit
    - Christer Finsen and Nils-Erik Aurker for their VBS Script Framework (FTPD Search system)
    - Team John Long for making the one of the world's most versatile FTPD on Windows,
    - pn169 from RaidenFTPD forum,
    - And last but not least... Me!, AKA TuS for spending my free time on this. :p

9) ChangeLog
    v1.10: 16 Nov 2011
     + Added Imdb-Bars management
     + Added Additional %Tags% for Imdb-Bar templates
     + Added Option IMDB_USE_ORIGINAL_TITLE & IMDB_GET_EPISODE_ID
     + Some code rework & optimization
    v1.00: 11 Nov 2011
     + Initial Release