View file mms_gallery_php/README.txt

File size: 13.09Kb
MMS Gallery PHP v1.0 for mms2web.com by DynaWeb Developers
for support contact: support@mms2web.com

--------------------------------------------------------
QUICK INSTRUCTIONS

Register your domain name at mms2web.com first !

1. create mail forward: mms@yourdomain.com -> mmsgateway@mms2web.com
2. create a directory for images and give full rights
3. configure parameters in mms_template/mms_settings.php file
4. FTP all files to your webserver root

Now send MMS from your mobile to email address mms@yourdomain.com
and then logon to ... http://www.yourdomain.com/mms_gallery.php

---------------------------------------------------------

User manual and set-up instructions

Table of contents

1. Setting up MMS Gallery on a web server
   1.1 Prerequisites for customer web server
   1.2 Configuring MMS Gallery for the web server
   1.3 Saving PHP files to web server
   1.4 Configuring email forwarding for MMS Gallery
   1.5 Receiving MMS files from mms2web.com

2. MMS Gallery functionalities
   2.1 Description of the transfer process
   2.2 Description of the PHP pages
   2.3 Testing and trouble shooting

----------------------------------------------------------

1. Setting up MMS Gallery on a web server

1.1 Prerequisites for customer's web server

   Required versions of web servers and other softwares are:
   - Apache web server 1.3.7
   - PHP v4.3.0
   - Graphics library GD2.0

   If HTTP POST data transfer method is chosen then PHP needs to be able to run
   the XML expat library. This is enabled by default on Apache version 1.3.7 or
   later. The PHP scripts have not been tested on a windows environment running
   Apache and PHP.


1.2 Configuring MMS Gallery for the web server

    Extract the files in the "mms_gallery.zip" file to your local PC.
    Edit the file "mms_settings.php" in the "mms_template"-folder.
    
    Enter the full web server path to folder where the MMS files are transferred
    from the mms2web.com. For example, if you have chosen to use anonymous FTP 
    account to receive the MMS files: 
    $mms_dir="/home/yourfolder/public_ftp/inbound";
    
    If your FTP account (for example: mmsimages@yourdomain.com) saves files 
    directly to a folder at your web root then password protect this folder 
    with basic HTTP authentication (so that no-one can execute saved files). 
    For example: $mms_dir="/home/yourfolder/public_html/mmsimages";
    Change the user rights for this folder to have read, write and execute 
    rights (see below).

    If you have chosen to use HTTP POST data transfer then create a new folder
    on your web server and enter the path of this new folder to the $mms_dir
    variable. for example: $mms_dir="/home/yourfolder/mmsimages";
    For security reasons it is recommended to create this folder off the web
    root.

    In your web server control panel or with linux shell command
    (for example: chmod a=rwx /home/yourfolder/mmsimages) change the
    user rights to your MMS folder to have read, write and execute rights
    (0777). This is needed by the MMS Gallery to be able to save the
    transferred MMS images and create thumbnail images. However, with HTTP POST
    file transfer you have full control over which files are saved to
    your server. You can edit the file "mms_receive.php" and remove the file 
    types that you do not want to be saved to your MMS Gallery (see below for 
    descriptions of the PHP files).

    With HTTP POST file transfer you can define a password that is checked
    during the file transfer. This will prevent outsiders to save files to your 
    web server MMS Gallery. Enter your password at the $http_password-variable 
    at the "mms_settings.php"-file. This same password will need to be entered 
    also at your profile information at mms2web.com members area. For example
    the default value is: $http_password='changethis';


1.3 Saving PHP files to web server

    Unzip and transfer all the contents including the subfolder of the "MMS_Gallery.zip"
    file to your web root. Usually the web root is the "public_html"-folder.

    Your web root will then have 3 files and subfolder "mms_templates" several
    more files.

    Files on the root:
    mms_gallery.php
    mms_receive.php
    mms_gallery_white_label.php

    Files on the subfolder:
    mms_template/get_file.php
    mms_template/get_image.php
    mms_template/get_image_nail.php
    mms_template/mms_lib.php
    mms_template/mms_settings.php
    mms_template/.... etc ...

    Your MMS gallery can then be accessed at your web server address,
    for example: HTTP://WWW.YOURDOMAIN.COM/MMS_GALLERY.PHP
    
    If you would like to fully integrate the MMS gallery to your existing website 
    then edit the page "mms_gallery_white_label.php" to match your website look.
    You may rename the "mms_gallery_white_label.php" template to what ever name 
    suits to your website. You can also edit the page with any wysiwyg html editor
    like Frontpage or Adobe Golive.

1.4 Configuring email forwarding for MMS Gallery

    To be able to receive MMS files there needs to be an email forward from your
    web (or email) server to the mmsgateway@mms2web.com. The forwarded email 
    address needs to have your registered domain name in the address or else the
    gateway will not be able to know from which customer's domain name the mails
    are coming.

    Recommended email address for forwarding is, for example:
    mms@yourdomain.com

    Visitors of your web site will then send MMS messages from their mobile
    phones to this email address mms@yourdomain.com and then these messages are
    forwarded to mmsgateway@mms2web.com.

    In your web server control panel create a forward for email address
    mms@yourdomain.com to email address mmsgateway@mms2web.com.

    You can also create forward by saving a file named ".forward" to your
    /home/yourfolder-directory. This file needs to have a single row of text:
    mmsgateway@mms2web.com

    Then your email address yourfolder@yourdomain.com will be forwarded to the
    mmsgateway@mms2web.com. Then your web site visitors would send
    MMS messages to address yourfolder@yourdomain.com.

    You do not need to create a real mailbox for the forwarded address.
    The forward assigment will forward the mail even when there is no real
    mailbox available.


1.5 Receiving MMS files from mms2web.com

    You can choose between standard FTP file transfer or HTTP POST data transfer. 
    The method of transfer is chosen during the registration to mms2web.com and 
    it can be changed at your profile information editing page at mms2web.com 
    members area. If you change the file transfer method make sure to update the 
    FTP/HTTP password field in your profile information.

    FTP file transfer:

    Login to mms2web.com member's area and configure your FTP account details in
    your "change profile" page. You need to specify your FTP account and
    FTP password.

    Test that the FTP file transfer works to your web server by pressing the
    "Test File Transfer" button.

    The file types that qualify for transfer are image (jpg, gif, png, etc),
    text (txt, imy), video (3gp, etc) and audio (amr, mid, etc). See complete
    listing of all the allowed file types at the "mms_receive.php" file function
    "file_check()".

    Your FTP server needs to be of format ftp.yourdomain.com where
    yourdomain.com is your registered internet domain name at mms2web.com.
    The files are saved to the root of the destination folder that your
    connecting FTP account has write access.

    Depending of your account service level the FTP file transfer will occur
    either immediately upon MMS arrival to our mmsgateway or in every 10 minutes.
    If your web server is down the file transfer will be tried again soon as
    the gateway receives another MMS for your account.


    HTTP POST data transfer:

    HTTP POST file transfer is done vie HTTP POST request where the data is
    included in the body of the HTTP POST request. The data is in XML format.
    The XML format is created by standard XML-RPC interface. However, you will
    not need to have XML-RPC installed on your web server.

    The HTTP POST data is received at your web server by the file
    "mms_receive.php". This file must be located on your web root. The file is
    requested at path: http://www.yourdomain.com/mms_receive.php

    The XML file contains three elements: HTTP password, Filename, and Filedata.
    HTTP password is defined by you in the "mms_settings.php" file and
    also in your profile at mms2web.com. The Filename is automaticly created by
    the MMS gateway at mms2web.com and it contains important information about
    the MMS (id, date, phone number, etc). The Filedata is base64 decoded raw
    binary data of the MMS file content.

    "mms_receive.php"-file saves the received MMS files to a path defined in
    the "mms_template/mms_settings.php" $mms_dir-variable.

     Test that the HTTP POST data transfer works to your web server by pressing
     the "Test File Transfer" button.

    Depending of your account service level the HTTP POST data transfer will 
    occur either immediately upon MMS arrival to our mmsgateway or in every 10 
    minutes. If your web server is down the file transfer will be tried again 
    soon as the gateway receives another MMS for your account.


2. MMS Gallery functionalities

2.1 Description of the transfer process
    
    MMS message consists of several dependent files. MMS message can contain 
    text, audio, video or sound files. MMS message sometimes also contains a
    file called SMIL. This file explains the mobile phone's MMS browser how the
    separate MMS files are sequenced when displayd to user.
    
    When mobile phone user sends a MMS message from his mobile phone to your
    email address (for example: mms@yourdomain.com) the mobile operator's MMS 
    center will convert the MMS message to email format. This email has all the 
    separate image, audio, video and text files attached from the original MMS
    message.

    Your web site forwards this MMS email to our mmsgateway email address and 
    our gateway will separate the email attachments and transfer them 
    individually back to your web site. Then "MMS_Gallery.php" file will display
    the MMS message files saved on your web server. The MMS files are grouped 
    again to form a single MMS message entity.

    MMS gateway will not transfer the SMIL file or any other application files.
    Executable application files are not transferred because of security issues.


2.2 Description of the PHP pages

    Files on the root:

    mms_gallery.php
    - This is the MAIN PAGE of the gallery. Displays all the MMS messages in a
    photo album. You can fully tailor this file to match your web site
    graphical look. This file can be edited with frontpage or other HTML editing
    software. However, do not remove any of the PHP code in the page or else the 
    MMS gallery might not work correctly.

    mms_receive.php
    - Receives the MMS files via HTTP POST data transfer and saves them to
      customer's web server.

    Files on the subfolder:

    mms_template/get_file.php
    - Fetches the video or sound file from a folder that is not located in the
    web root and plays in the web browser.

    mms_template/get_image.php
    - Fetches the image file and displays it in the web browser. Called with
    javascript in mms_gallery.php.

    mms_template/get_image_nail.php
    - Fetches the thumbnails of images. Thumbnail is created if it does not
    already exist.

    mms_template/mms_lib.php
    - Library that contains all the functions needed to manage the MMS files in
    the gallery.

    mms_template/mms_settings.php
    - Common settings for the gallery. You will need to edit this file before 
    the gallery works for your web site. You can define variables:
    $mms_dir : Location where the MMS files are transferred from mms2web.com
    $http_password : Password checked during HTTP POST data transfer
    $mms_per_row : How many MMS messages is displayed per gallery row
    $mms_per_page : How many MMS messages is displayed per gallery page

    mms_template/.... etc ...
    - All other files are used for the graphical presentation of the MMS gallery
    

2.3 Testing and trouble shooting

    Test the file transfer in your mms2web.com member's area "change profile"
    page. This test will check that all the configurations are done correctly 
    and it will save a test file to your web server. This test file can be 
    deleted.

    Make sure that you have the correct version of PHP and Apache installed on
    the web server. Some functions used in the MMS gallery require these
    versions.

    Make sure that you have granted full read, write and execute access rights
    for the MMS destination folder. Otherwise the thumbnails will not be written
    to the gallery.


############################ END OF MANUAL #####################################