Attachmax v2 Dolphin

attachmax bullet Attachmax - Video Community Software
Making money with Attachmax box

Attachmax allows you to run your very own youtube Video Community site, just like popular Videos sites such as youtube, dailymotion and revver. Additionally Attachmax includes the ability for Images and Files, following the trend of other popular File Sharing communities such as Imageshack and Rapidshare. So not only do you get a fully functional Video Script, but a complete File Sharing Website.

With youtube.com the biggest media site on the internet being bought for over 1.65 billion dollars, Video websites have become big money enterprises. Videos are now taking over the internet and have become the new boom in Internet publishing. They will be sure to dominate websites in the coming years.

Currently Advertising is moving towards Video Advertising and this is growing immensely, with the Attachmax Software you too will be ready to launch your very own profitable online business today.

attachmax bullet What can you do with Attachmax?
checkmark Upload Millions of youtube videos onto your site, giving you instant content ready to promote and gain revenue through online Advertising
checkmark Embed Flash Converted Videos onto your Websites, by simply copying and pasting the embed code
checkmark Gain Revenue through paid memberships that is connected with your paypal, 2co Payment accounts.
checkmark Build giant Video/File Sharing communities, that allows Videos to be discussed, shared, viewed, searched, indexed and downloaded.
checkmarkCreate Promotional, Instructional or Personal Videos, building traffic to generate income via Advertising such as the hugely profitable Google Adsense. .

checkmark Create Categories, Tags and Related Keywords based on Specified topics.

checkmark Allow users to generate profile pages, that displays all content upload by users, as well as profile information about the user..
checkmark Upgrade to newer versions, as we continue to strive to make Attachmax the dominant force in File/Sharing Scripts.
checkmark Upload any combination of format, any format is configurable via the backend admin.
- For instance, wmv, avi, mpeg, flv,rar, zip, jpg, gif, png
checkmarkCreate ready made links to promote on discussion boards, webpages and via emails.
checkmarkWith Attachmax not only do you have the ability to upload Videos/Files via Browse but via url and this is additionaly structured with a progress meter, giving proper indication of how long your video will take to complete.
checkmarkAttachmax has support for different types of Operating Systems such as Windows, Macintosh and Linux.
attachmax bullet Support & Code Base
Attachmax is an established software that has been developed by Internationally renowned Software Developer, Alexander Makhaev. Backed up with a degree in Applied Mathematics, Alex has been in the forefront to construct Attachmax to a leading Video Community Script.

Alex along with our team will be on hand to provide knowledgeable, expert help.
Additionally we provide support via a community forum, helpdesk and via emails.
attachmax bulletGetting Started
We take the hassles and complications of running your own Video site, by fully setting up the script with your Dedicated Server.
Upon purchase we'll schedule a time to install
- All Dependencies
- Configure Script with software
Once completed, all you need to worry about is maintaining the Video content.
Through editing, deleting and Uploading Video content.
Attachmax v2.1.0 Dedicated Server Version
Price - $195
Price - $395
What you'll get
- Attachmax License (Was $250)
- Copyright Removal (Worth $30)
- Free Installation (Worth $30)
- Attachmax PSD Template (Worth $100)
Worth $410, Now $195
- Attachmax Lifetime License (Was $450)
- Copyright Removal (Worth $30)
- Free Installation (Worth $30)
- Attachmax PSD Template (Worth $100)
Worth $610, Now $395
bullet4 Sites running Attachmax Software.
boobtube
everything_unreal
bluetube.co.za
xtreme
boobtube
 

Documentation

Listed here is documentation for the attachmax scripts.
In each category you will find related Documentation.

For instance:
Features - Lists all of the admin features and what they do.
Server Modules - Has information on how to install Attachmax dependencies such as ffmpeg, progress meters.
Templates - Carries docs on changing and adjusting templates.
Installation - A howto guide on installing the Attachmax script.

Requirements

Attachmax requires a web server, PHP4 (4.3.3) + and MySQL (4.1)
Your database user will also need sufficient privileges to run Attachmax.

- GD
- Mysql 4.1 Or Greater
- FFmpeg

NOTE: the Apache web server and MySQL database are recommended;
Other Webserver combinations may work, but havent been tested.
-------------------------
OPTIONAL
- Patching of php for Progress Meter (can use animated Loading bar)
- Mod Rewrite to make use of SEO short url's.

Features

Contained in this feature Chart, Will list every Attachmax and what each function does and the purpose that it carries.

Adding custom flv player to AttachMax

Its pretty simple to add and use custom player with AttachMax. I'll explain it on Jeroen Wijering's player example (we are using it on AttachMax.com now).

At first, please download Jeroen player and copy mediaplayer.swf to players/amJeroenPlayer/mediaplayer.swf and add bll/Player/Players/amJeroenPlayer.php file with following content:

<?php
class amJeroenPlayer extends amPlayer
{
    var $_sourcePath;

    function amJeroenPlayer()
    {
        parent::amPlayer();
        $this->setSourcePath(AM_PLAYER_DIR . '/amJeroenPlayer/' . 
            'mediaplayer.swf');
    }

    function getAutoPlayString ()
    {
        return $this->getAutoPlay() ? 'true' : 'false';
    }

    function getSourcePath()
    {
        return $this->_sourcePath;
    }

    function setSourcePath($value)
    {
        $this->_sourcePath = $value;
    }

    function getCustomParams()
    {
        return isset($GLOBALS[__CLASS__ . '_customParams']) ?
          $GLOBALS[__CLASS__ . '_customParams'] : array();
    }

    function setCustomParams($params)
    {
        $GLOBALS[__CLASS__ . '_customParams'] = $params;
    }

    function getHtml()
    {
        $p = amJeroenPlayer::getCustomParams();

        $flashVarsString = "file=" . $this->getVideoUrl();
        if (isset($p['FlashVars']))
        {
            foreach ($p['FlashVars'] as $k => $v)
            {
                $flashVarsString .= "&$k=$v";
            }
        }
        $flashVarsString .= '&autostart=' . $this->getAutoPlayString();

        $embedString = '';
        if (isset($p['embed']))
        {
            foreach ($p['embed'] as $k => $v)
            {
                $embedString .= " $k=\"$v\"";
            }
        }
        $embedString = '<embed src="' . $this->getSourcePath() .
            '" FlashVars="' . $flashVarsString . '" width="' .
            $this->getWidth() .
            '" height="' . $this->getHeight() . '" ' .
            $embedString . '>';

        return $embedString;
    }

}

Player class is ready, only few changes remained.

Open bll/Player/amPlayerFactory.php, find "function getExtensionsToPlayers()" and change "'flv' => 'amFlvPlayer'" to 'flv' => 'amJeroenPlayer'" under it. Then open configPlayers.php file and add:

amJeroenPlayer::setCustomParams(
    array(
       'embed' => array(
            'type' => 'application/x-shockwave-flash',
            'pluginspage' => 'http://www.macromedia.com/go/getflashplayer'
        ),

        'FlashVars' => array(
        )

    )
);

Jeroen player is ready to use now. To revert old player back you need to change single line in bll/Player/amPlayerFactory.php file, as we did for Jeroen player before.

For other, than Jeroen, flv player you can use same code with minor changes.

Please let me know, if you have any questions.

Alexander Makhaev

Admin Categories

Adding, Changing & Rss Feeds for Categories

Adding Categories
1) Log into admin - http://yourdomain.com/admin
2) Click on Rss Categories Link

3) Below where it says "Add new category:"
Type in the name of your category and then click Submit.
Your Category will now be displayed in 5 locations
- In Admin
- Homepage Categories
- List files
- Upload Forum
- Advertise.php


Changing Categories

1) Whilst still logged into Admin Category Section
Click on edit link of your chosen cat.
You will now have the option to change cat name.
Once completed click Submit.

1a) Deleting categories
On the row of your chosen category, click delete to remove the category


Manually Adding an Rss Feed

1) Click on the name of your category, via the hyperlink. i.e Sport
2) New Page will be displayed with
Add new feed to category:
Type in a valid Rss Feed Url, usually ending with .xml extension.

3) New Page will pop up listing the different news items, to choose one, click on the radio button,
and below set how long you would like the rss feed to be shown for.
Optionally type in a number between 0-100 in Probability field.
This setting will determin how often your feed will show up, if there is more than one feed of the same category.
When finished setting these figures, Submit.

Admin Config Section

This Book will explain, what each feature does in the admin config section.

From domain names to Uploading Settings.

Admin Email, Username and Password

Admin Email:
This is the email that will be sent, when a user registers onto your site.
It will also be displayed on the contact link on all pages.

Admin Name:
You're able to set the login name that admin can login as.
This field is then implented onto the Database for security.

Admin Password:
The Password for admin 'log in' can be set here, setting this email is encrypted and this is placed in database for extra security.

There is no limit towards the character and you're able to use a combination of letters and numbers. The admin password is case sensitive, so be sure to remember this when logged in.

Custom Features on/off

Attachmax has a group of Features that can be turned on or off. Here we briefly describe the purpose of each feature.

Use abBlocks:
Turning Adblocks on enables you to set up advertisments or custom blocks in specified regions.

Use upload progress meter:
Attachmax comes with an Advanced Progress meter, however it requires php patching, if your script isnt patched, you should leave this to off.

Use download ticket:
Admin is able to set a timer of how long videos should last before they are able to be downloaded by users. If you dont require this feature, it should be set to off.

Use user-friendly URL's:
In most servers this can be set to on, what this feature does is allow all url's to be displayed in short form, however if you dont have mod rewrite enabled, this needs to be off.

Use Perl upload:
This can be set to on, if you would like a progress indicator, as most servers have Perl, this will give shared hosting an opportunity to have indication of uploading progress. Use strict hotlink protection:

Extensions

There are 3 different forms that can be controlled in the Extensions field.

Image Extensions:
Video Extensions:
Other Extensions:

To add an extension type in the letters of the extension into the related type. If needed add a comma to seperate the extensions.

Example: You wanted to add wmv into the streaming extension.
Current extensions are:
mpeg,mpg,avi,mov,asf,rm,flv,mp3,mp4

To add wmv, that list would now look like:
mpeg,mpg,avi,mov,asf,rm,flv,mp3,mp4,wmv
This is the step you would take for any of the extension types.

Each of these types output in different ways.
The first extension acts an image, when a user uploads an image, it will display relevant hotlinking information to enable a user to post these images outside of the script.
Other options are that it will allow you to view your uploaded image.

Addin an extension to the Video types, allows Videos to streamed after they have been uploaded.

The last extension is Other, this will treat any extension, as an extension that can be downloaded, but not streamed, or viewed.

Another Option is Forbidden Extensions, this will be phased out of this version, but it will allow certain extensions to not be available to be uploaded, for security purposes.

Limiting Uploading, Comment, Rating Access

Admin has the ability to limit permissions via 4 sets of Drop Down Menu's.

Comments permissions:
Via this menu, you're able to restrict comments being made from guests or Registered Users only.

Type of upload access:
Via this option, you can set whether you would like All users to be able to upload or only Registered Users.

Use rate feature for users:
This allows you to choose whether you would like Users to be rated.

Use rate feature for files:
Here you also have the option to set the rating feature for files, usually Compressed Files (Other Files Extension)

Premium Settings

Attachmax is more than just a youtube clone, it can also operate as a paid Downloading Membership Service. Therefore you will need several key features that will allow you to seperate the Guest users from Paid Users.

There are three key points here:
Guest Speed Limit: This will affect the speed for all registered users, if you have a value of 200, then 200 will be the maximum that each user will be able to download at.

Guest Thread Limit:
This allows users to set the number of connections that a Guest may have, for instance, a value of one will only allow 1 download at a time. "0" will allow infinite downloads.

Guest Key Timeout:
This will be the amount of time a user must be able to download this file, before that download is considered timed out.

This also acts as hotlinking protection, so the same download link will not be accessible after a certain time period.

The Premium Settings act the same way, the only difference is that it affects Registered or Paid Members.

Site Name

This will be displayed, on the title of every page, followed by the content title.

Example: Site Name = 'Attachmax'

Nike Football Joga Bonito Ibrahimovic vs C Ronaldo - 'Attachmax'

Site Url & Absolute path

Site URL:
This feature basically sets the Domain Setting.

Its usually filled in with the installation, if another domain is set, your downloads will be pointing to the location of another domain.

Absolute path to site:
This is the full path to where you script is run from, changing this values alters the location of the script. This factor is also set up with the installation. So in most cases its not needed to change.

Store without counting rate for (Days)

There's a special script on attachmax that can delete any file on your webpage, by running a certain file on your webpage.

Via admin you can control the specifics.

Setting this allows you to: Start calculating the time until x(Days) has been reached.

So for instance, if you set (Days) to 10, then after 10 Days, this file will now be able to be deleted on Server.

This works in conjuction with the field:
(Min downloads per day to keep file saved)

Using these two factors combined you can set formula to delete unpopular Videos/Files.

Min downloads to keep file saved

In conjuction with: [Store without counting rate for (Days)]
and
[Min downloads per day to keep file saved]

You have the ability by running a file on your server, to delete unpopular or unused Videos on your Server. There are two values in, [Min downloads per day to keep file saved] that determine the popularity of the files.

The first value, determines, the amount of (x)avg amount of Downloads a file must have before it can be deleted.

The second value, determines the amount (x) days that a file must be before it can be deleted.

Here is a formula to work out this AVG = [# of downloads] / [Days file has been on server]

So for example:
avg = 14
days - 6

Then the value to delete files will be 14/6 = 2.2

Video Tool

The Video Tool is a powerful feature of attachmax, basically through 3 radio buttons, it changes how the Videos will be Displayed and Encoded.

Video Tool:
Here you have 3 choices:
- FFmpeg
If your server is compiled with ffmpeg, you're able to choose ffmpeg and your videos will be encoded using ffmpeg encoder.

You'll have the option to set these values.
Bitrate:
The affects the quality of the Video, choosing a value such as 750k is average quality, Putting a number such as 2000 is higher quality, however it will take longer to load the video.

Resolution:
This affects the size of the Video, the larger value you set, the more quality is produced for larger viewing sizes. You should match this to the size of your player.

- Mencoder
Mencoder is an alternative to FFmpeg, if your server isn't compiled with ffmpeg and is compiled with mencoder, than you're able to switch from the different encoders at your disposal. Mencoder is set to be a faster option and supports more Video Formats, with very good picture quality under compression. Bitrate and Resolution can also be set for Mencoder.

- None
Choose this option if your server doesn't have FFmpeg or Mencoder Software, this will allow you to share videos, and add thumbnails, the only difference is that the final video isn't in Flash Format and thumbnails will be create Manually rather than Automatically.

Approve Rss Feeds

Approve RSS

When users Purchase Rss Feeds via
http://yourdomain.com/advertise.php

You will then have the ability to Approve or Disapprove the Rss Feeds via admin.
Firstly it will show relevant information such as:
- Category chosen
- If payment was made
- Date Submitted
- Title of the Feed
- Full Passage of the feed
- Link to the Rss Feed

Then you will be able to approve the Rss Feed, which will then be submitted into the chosen category section for that feed.

Changing Contact Email

How to change Contact Email

1)Log into your Admin panel, and navigate to Config section

2)Replace Admin Email with yours

This will affect, every contact page as well as the Registration Contact Details.

Changing Flash Player Text

Attachmax v2.0.2

To change Text on Flash Player
1)Navigate to frontend/dl/player_notwmv.tpl Find attachmax.com
value="flvTitle=AttachMax.com
Replace with any value

i.e value="flvTitle=yourdomain.com

Full structure to look like

Attachmax v2.1.0

To change player pop up text, you can edit configPlayers.php file, find line with
'flvTitle' => 'AttachMax.com'
and change 'AttachMax.com' to your title.

Convert wmv files Automatically

You can set up your crontab to automatically, convert your wmv files.

1)Set up crontab
#crontab -e

Using your editor add this lines

*/10 * * * * /usr/bin/lynx -source http://www.yourdomain.com/convert_wmv.php

Where yourdomain.com is the url of your where your script is installed.

This will set up your script to run the conversion script if needed every 10 minutes.

To manually run this command anytime, just type in your browser - http://www.yourdomain.com/convert_wmv.php

Encoding Video with set Quality Levels

1) Accessing Conversion File
Go to your Slave Folder and edit index.php

//Find this Code and change

exec(FFMPEG . " -i ".$root.$filesdir.$storage_filename." -ar 44100 ".$root.$filesdir.$storage_filename.".flv");

//and Replace it with this

exec(FFMPEG . " -i ".$root.$filesdir.$storage_filename." -s 480x360 -b 750k -ar 44100 ".$root.$filesdir.$storage_filename.".flv");

Where -b = The Bitrate of the Video
750k is just a good template the produces fair quality video for good size ratio, how high you would like the quality is up to you.
i.e 2000k is very good quality, but produces big file sizes
200k is poor quality but produces small File sizes

Where -s = the Size of the Video
Videos are encoded at all sorts of resolutions, so here you can choose a figure that you would like the videos to be encoded at.

Much more FFMPEG encoding Guides and options are available at
http://howto-pages.org/ffmpeg/
http://www.penguin-soft.com/penguin/man/1/ffmpeg.html

Finding and setting FFMPEG location

Finding out Location of FFMPEG and changing location via admin Unless your Host has provided you with instructions to the location of ffmpeg, you will need to find this yourself, to do this 1) Log into server   2) Type in  #updatedb    3)  #which ffmpeg Now assuming you've already completed installation, and you would like to edit location, this can be done via going into http://yourdomain/admin and into the server Section. There you will see the FFMPEG value, change that to the location found in 3) If you have already done this and ffmpeg is still isnt converting videos then verify ffmpeg is installed correctly by running this command inside your fffmpeg directory ffmpeg -i yourmoviefile.ext -s 480x360 -b 700k -ar 44100 outputfile.flv If you dont get sufficient output then your ffmpeg isnt installed correctly.

Rapidshare Timer Settings

Enabling and Setting Timer for Rapidshare Ticker
1) Log into admin and inside config
- Use download ticket, set the radio button to on and click Submit.

Editing Timer
1) Edit templates/_files/view/_common.php
//Find
var duration = 4;

//Replace
var duration = x;

2) Save File

Where x is equal to the amount of seconds you would like to make user wait before viewing Video.
i.e To set a timeout of 5 seconds it would be
var duration = 5;

Tariffs

More About Tariffs
Tariffs basically control the Payment Mechanism for the Attachmax Script, currently there is two Payment method which the administrator can receive payment.
- RSS Feed Advertising (http://yourdomain.com/advertise.php)
- or via Premium Memberships (http://yourdomain.com/register.php).

By default the script creates a Free Tariff for Premium Registration.
Also created by default is Gold, Silver, Bronze for the Rss Feed Advertising.
Basically the concept is that you can give priority to High Paid Advertisements, and organise them via Names.


What's configurable?
Customizable in the admin section is the removal of all current tariffs and the creation of new payment methods..
Allowing you the option to set these factors:
- Name
- Price
- Time Period
- Type of Payment
- Priority for Rss Feeds

The option to create these fields can be done via in the empty form fields, upon entering the information below, you will then be able to click the Add New Button.
Or to edit any current field, just make the changes in current fields and click the Update Button.

Server Modules

A list of Server Modules that can be installed on your Dedicated Server. Many of these are optional and a choice to give you a different method.

Encoders
- FFmpeg
- Mencoder

Progress Meters
- Php Progress Meter
- Perl Progress Meter

- flvtool2

FFMPEG & Mencoder Installation Howto's

Below are links to different FFmpeg and Mencoder Installations, I recommend choosing the option that is best in your situation.

If you have any notes or comments regarding this, please use the contact form

Quick & Easy FFmpeg Installation

Supported OS: Fedora Core 4+/RHE, Centos 4+
(Same installation method can be applied to Ubuntu, Slackware, Suse(but using the the correct package manager based on OS)

1) Log into your SSH Account

2) Setting Up the Tmp Dir
mkdir /home/tmp
TMPDIR="/home/tmp"
export TMPDIR="/home/tmp"
chmod 777 /home/tmp

3) Install missing Packages
Make sure to have them all, otherwise this installation may not work
yum install automake autoconf libtool m4 gcc-c++

4) Download and untar ffmpeg
# cd /usr/src
# wget http://ffmpeg.mplayerhq.hu/ffmpeg-export-snapshot.tar.bz2
# tar -xjvf ffmpeg-export-snapshot.tar.bz2

5) Setting up the Libs
Now check to see if (/usr/local/lib exist) on ld.so.conf
# cat /etc/ld.so.conf

If line exists, you can move onto the next step, if it doesnt exist then, run this command

# echo /usr/local/lib >>/etc/ld.so.conf
# ldconfig

6) Lame Installation
# wget http://mesh.dl.sourceforge.net/sourceforge/lame/lame-3.97.tar.gz
# tar -zxvf lame-3.97.tar.gz

Commands to compile Lame
# ./configure --disable-shared
# make
# make install && cd ..

7) Compile FFmpeg Installation
# ./configure --disable-shared --enable-libmp3lame
# make
# make install

This installation should work on most servers and can be very quickly done with support for most of the popular codecs.

FFmpeg Dreamhost Installation Guide

1)Log into your Dreamhost Account and where you can edit your username, you have the option to enable ssh.

2)In Your Dreamhost, where you see Extra Security, turn this off.

3)Get FFmpeg. usually dreamhost has most of the standard modules needed to compile and comes with subversion.
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg

4) Setting Up the Tmp Dir
mkdir /home/username/tmp
TMPDIR="/home/username/tmp"
export TMPDIR="/home/username/tmp"
chmod 777 /home/username/tmp

(where username is the name of your ssh folder) - You can find this out with the command pwd )

4a) cd /home/username

5) svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg && cd ffmpeg

6) Lame Installation ( Inside FFmpeg dir)
wget http://mesh.dl.sourceforge.net/sourceforge/lame/lame-3.97.tar.gz

7) tar -zxvf lame-3.97.tar.gz && cd lame*

8) Commands to compile Lame
./configure --prefix=/home/username/ffmpeg/lame --disable-shared

9) make
10) make install
11) cd ..

12) FFmpeg Installation
./configure --prefix=/home/username/ffmpeg --cross-compile --disable-shared --enable-libmp3lame --extra-cflags=-I/home/username/ffmpeg/lame/include --extra-ldflags=-L/home/username/ffmpeg/lame/lib

13) make
14) make install

-------------------------------
This installation requires a bit more testing on Dreamhost Hosting but should work

 


FFMPEG Installation Advanced

FFMPEG INSTALLATION FROM SOURCE
Supported OS: Fedora Core 4+/RHE, Centos 4+
(Same installation method can be applied to Ubuntu, Slackware, Suse(but using the the correct package manager based on OS)

Summary
download and install:
libffac, libffad2,nasm, x264,amr, xvid, libogg, libvorbis, mp3lame, 3gp, ffmpeg

Setting Up Install Folder, Logging and download Packages
1)Log into ssh
2) cd /usr/src && mkdir install && cd install

3) Check for these Packages
rpm -qa automake autoconf libtool m4 gcc-c++ libogg-devel libvorbis-devel ncurses nasm subversion

4) Install missing Packages
Make sure to have them all, otherwise this installation cannot work
yum install automake autoconf libtool m4 gcc-c++ libogg-devel libvorbis-devel ncurses nasm subversion

4a) *For Fedora Core/Centos Users*

If you have the dries repo, instead of manually downloading, untarring and installing, you can just use yum package installer
yum install libogg-devel libvorbis-devel x264-devel lame-devel faad2-devel faac-devel xvidcore-devel.i386 a52dec-devel.i386 amrnb-devel.i386
Skip to step 12 if this step is complete

5) Download Video Codecs
wget http://prdownloads.sourceforge.net/faac/faad2-2.0.tar.gz?download
wget http://prdownloads.sourceforge.net/faac/faac-1.24.tar.gz?download
wget http://mesh.dl.sourceforge.net/sourceforge/lame/lame-3.97.tar.gz
wget http://downloads.xvid.org/downloads/xvidcore-1.1.2.tar.gz
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
svn co svn://svn.videolan.org/x264/trunk x264

6) Untar all of the packages
tar -zxvf faac-1.24.tar.gz
tar -zxvf faad2-2.0.tar.gz
tar -zxvf lame-3.97.tar.gz
tar -zxvf xvidcore-1.1.2.tar.gz

If any are missing than simply yum install (packagename), if you dont have a package manager than get one, it will save you alot of time
and headaches.

7)Installing Faac
# cd faac
# sh bootstrap
# ./configure
# make; make install && cd ..

8)Installing Faad2

# cd faad2
There is 2 bugs with this package, so need to manually edit these files
# nano Makefile.am
Edit the file to look like this
SUBDIRS = libfaad common frontend plugins
EXTRA_DIST = faad2.spec

# cd common/mp4ff && nano mp4ffint.h
Find this line
void mp4ff_track_add(mp4ff_t *f);

and Comment this out to look like
//void mp4ff_track_add(mp4ff_t *f);

Save file and # cd ../..
# autoreconf -vif
# ./configure
# make;make install
# cd ..

9)Installing LAME (for audio)

# cd lame*
# ./configure; make;make install
# cd ..

10) Installing Xvid
# cd xvid*/build/generic/
# ./configure; make; make install;
# cd ../../..

11)Installing x264

# cd x264
# ./configure --enable-shared
# make;make install
# cd ..

12) Configuring for 3gp Support
# cd ffmpeg/libavcodec
# wget http://www.3gpp.org/ftp/Specs/2004-03/Rel-5/26_series/26073-530.zip
# wget http://www.3gpp.org/ftp/Specs/2004-03/Rel-5/26_series/26104-540.zip
# mkdir amr amr_float && cd amr
# unzip ../26073-530.zip
# unzip 26073-530_ANSI_C_source_code.zip
# mv c-code/* .
# cd ../amr_float
# unzip ../26104-540.zip
# unzip 26104-540_ANSI_C_source_code.zip
# mv c-code/* .
# cd ../..

13) Setting up 3gp Support
nano libavcodec/amr/makefile
Find around Line 68 and comment the entire line like below

#CFLAGS = -Wall -pedantic-errors -I. $(CFLAGS_$(MODE)) -D$(VAD)
The line should look something like this, new packages may vary

Paste Below
CFLAGS = -Wall -DMMS_IO -I. $(CFLAGS_$(MODE)) -D$(VAD)

# Save file

14) Setting up the Libs
Now check to see if (/usr/local/lib exist) on ld.so.conf
# cat /etc/ld.so.conf

If line exists, you can move onto the next step, if it doesnt exist then, run this command

# echo /usr/local/lib >>/etc/ld.so.conf
# ldconfig


17) Configuring FFmpeg
# ./configure --enable-shared --enable-xvid --enable-libvorbis --enable-libogg --enable-libmp3lame --enable-gpl --enable-libfaad --enable-libfaac --enable-x264 --enable-amr_nb-fixed --enable-pp

# make
# make install

If Installation went ok, run
run ldd /usr/local/bin/ffmpeg
This checks the path to the libs, if any of them are missing they will show here

Below are some common errors that can happen.

If there was message about tmpdir
Unable to create and execute files in /tmp. Set the TMPDIR environment.........

Run
mkdir /home/tmp
TMPDIR="/home/tmp"
export TMPDIR="/home/tmp"
chmod 777 /home/tmp

If there was error message about missing x264, then try installing via rpm
wget http://dag.wieers.com/packages/x264/x264-0.0.0-0.3.20061214.el4.rf.i386.rpm (Fc4 only, make sure to match your distro)
wget http://dag.wieers.com/packages/x264/x264-devel-0.0.0-0.3.20061214.el4.rf.i386.rpm (Fc4 only make sure to match your distro)
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
rpm -ivh x264-0.0.0-0.3.20061214.el4.rf.i386.rpm
rpm -ivh x264-devel-0.0.0-0.3.20061214.el4.rf.i386.rpm

If Libraries couldnt be found and it gave error message on make, try to run the ffmpeg configure lines with path to libs

./configure --disable-shared --enable-xvid --enable-libvorbis --enable-libogg --enable-libmp3lame --enable-gpl --enable-libfaad --enable-libfaac --enable-x264 --enable-amr_nb --enable-pp --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib

make
make install

Insom Modified installation

FFMPEG INSTALLATION FROM SOURCE
Supported OS: Fedora Core 4+/RHE, Centos 4+
(Same installation method can be applied to Ubuntu, Slackware, Suse(but using the the correct package manager based on OS)

Summary
download and install: libffac, libffad2,nasm, x264,amr, xvid, libogg, libvorbis, mp3lame, ffmpeg

Setting Up Install Folder, Logging and download Packages
Log into ssh
# cd /usr/src && mkdir install && cd install

Check for these Packages
rpm -qa automake autoconf libtool m4 gcc-c++ subversion

Install missing Packages
yum install automake autoconf libtool m4 gcc-c++

4a) *For Fedora Core/Centos Users*
If you have the dries repo, instead of manually downloading, untarring and installing, you can just use yum package installer
yum install libogg-devel libvorbis-devel x264-devel lame-devel faad2-devel faac-devel xvidcore-devel.i386 a52dec-devel.i386 amrnb-devel.i386
Skip to step 12 if complete

5) Download Video Codecs wget http://prdownloads.sourceforge.net/faac/faad2-2.0.tar.gz?download;wget http://prdownloads.sourceforge.net/faac/faac-1.24.tar.gz?download; wget http://mesh.dl.sourceforge.net/sourceforge/lame/lame-3.97.tar.gz; wget http://downloads.xvid.org/downloads/xvidcore-1.1.2.tar.gz; ; svn co svn://svn.videolan.org/x264/trunk x264

6) Untar all of the packages
tar -zxvf faac-1.24.tar.gz; tar -zxvf faad2-2.0.tar.gz; tar -zxvf lame-3.97.tar.gz; tar -zxvf xvidcore-1.1.2.tar.gz

If any are missing than simply yum install (packagename), if you dont have a package manager than get one, it will save you alot of time
and headaches.

7) Installing Faac
# cd faac
# sh bootstrap
# ./configure;make; make install;cd ..

8) Installing Faad2

# cd faad2
There is 2 bugs with this package, so need to manually edit these files

# nano Makefile.am
Edit the file to look like this
SUBDIRS = libfaad common frontend plugins
EXTRA_DIST = faad2.spec

# cd common/mp4ff && nano mp4ffint.h
Find this line
void mp4ff_track_add(mp4ff_t *f);

and Comment this out to look like
//void mp4ff_track_add(mp4ff_t *f);

Save file
# cd ../..;autoreconf -vif;./configure;make;make install;cd ..

9) Installing LAME (for audio)

# cd lame* && ./configure; make;make install;cd ..
10) Installing Xvid
# cd xvid*/build/generic/ && ./configure; make; make install;cd ../../..
11) Installing x264

# cd x264;./configure --enable-shared;make;make install;cd ..
12) Configuring for 3gp Support
# cd ffmpeg/libavcodec && wget http://www.3gpp.org/ftp/Specs/2004-03/Rel-5/26_series/26073-530.zip && wget http://www.3gpp.org/ftp/Specs/2004-03/Rel-5/26_series/26104-540.zip && mkdir amr amr_float && cd amr;unzip ../26073-530.zip
# unzip 26073-530_ANSI_C_source_code.zip;mv c-code/* . && cd ../amr_float;unzip ../26104-540.zip
# unzip 26104-540_ANSI_C_source_code.zip && mv c-code/* .;cd ../..

13) Setting up the Libs
Now check to see if (/usr/local/lib exist) on ld.so.conf
# cat /etc/ld.so.conf

If line exists, you can move onto the next step, if it doesnt exist then, run this command

# echo /usr/local/lib >>/etc/ld.so.conf
# ldconfig

14) Configuring FFmpeg
# ./configure --enable-shared --enable-xvid --enable-libvorbis --enable-libogg --enable-libmp3lame --enable-gpl --enable-libfaad --enable-libfaac --enable-x264 --enable-amr_nb --enable-pp

# make
# make install

If Installation went ok, run
run ldd /usr/local/bin/ffmpeg
This checks the path to the libs, if any of them are missing they will show here

Below are some common errors that can happen.

If there was message about tmpdir
Unable to create and execute files in /tmp. Set the TMPDIR environment.........

Run
mkdir /home/tmp;TMPDIR="/home/tmp";export TMPDIR="/home/tmp";chmod 777 /home/tmp

If there was error message about missing x264, then try installing via rpm
wget http://dag.wieers.com/packages/x264/x264-0.0.0-0.3.20061214.el4.rf.i386.rpm (Fc4 only, make sure to match your distro)
wget http://dag.wieers.com/packages/x264/x264-devel-0.0.0-0.3.20061214.el4.rf.i386.rpm (Fc4 only make sure to match your distro)
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
rpm -ivh x264-0.0.0-0.3.20061214.el4.rf.i386.rpm
rpm -ivh x264-devel-0.0.0-0.3.20061214.el4.rf.i386.rpm

If Libraries couldnt be found and it gave error message on make, try to run the ffmpeg configure lines with path to libs

./configure --enable-shared --enable-libmp3lame --enable-xvid --enable-libvorbis --enable-libogg --enable-gpl --enable-libfaad --enable-libfaac --enable-x264 --enable-amr_nb --enable-amr_nb-fixed --enable-pp --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib

make
make install

FFmpeg Installation in 5min

FFMPEG INSTALLATION in 5min
Supported OS: Fedora Core 4+/RHE, Centos 4+
(Same installation method can be applied to Ubuntu, Slackware, Suse(but using the the correct package manager based on OS)

Summary
download and install FFmpeg with most codec support

1) Setting Up Install Folder
1a)Log into ssh as root
1b) cd /usr/src

2)Download & Install FFmpeg
wget http://s8.attachmax.com/ffmpeg-installer.zip
unzip ffmpeg-installer.zip
php -e install.php

or 2a) Download FFmpeg Installer (Latest)
lynx http://krakjoe.com/projects/ffmpeg-installer
Click Y to allow for cookie
Arrow Down to Download
Move cursor to "Save to Disk" (hit Enter)
q and then Enter to exit out
unzip ffmpeg-installer.zip
php -e install.php

Wait 5 - 10 Minutes and then it should be iunstalled at the path /usr/bin/ffmpeg, you can then log into attachmax and set up this path in the servers tab.
In admin/config make sure to choose FFmpeg as the encoder.

If for some reason ffmpeg fails, try to install manually using any of the ffmpeg guides on this site.


FFmpeg installation on Windows

To install FFmpeg on windows server to make it work with AttachMax, please follow steps below:
1. Download FFmpeg for windows from http://www.attachmax.com/FFmpeg_for_Windows__1.html (5.7MB).
2. Unzip it to some directory (e.g. C:\Program Files\ffmpeg).
3. Open "Servers" tab in AttachMax admin panel and insert FFmpeg path (e.g. C:\Program Files\ffmpeg\ffmpeg.exe).

To use FFmpeg for flv encoding and thumbnails creation, you should select "ffmpeg" as "Video Tool" from "Config" tab in AttachMax admin panel.

Mencoder Installation

Show work on Centos/FC/RH Distros:

Log into the Server and Find what Version its using
1) uname -a
2) More information if needed
cat /etc/redhat-release
cat /etc/issue

3) Navigate into Dag's Fedora/Centos Packages
Make sure to get the package that matches your linux distro, otherwise you will get a corrupt version.
http://dag.wieers.com/rpm/packages/

4)cd /usr/src

Get the Packages
5)wget http://dag.wieers.com/packages/mplayer/mencoder-1.0-0.33.rc1.el4.rf.i386.rpm
6)rpm -ivh mencoder-1.0-0.33.rc1.el4.rf.i386.rpm

You'll probably get something like this
libasound.so.2 is needed by mencoder-1.0-0.33.rc1.el4.rf.i386
libasound.so.2(ALSA_0.9) is needed by mencoder-1.0-0.33.rc1.el4.rf.i386
libasound.so.2(ALSA_0.9.0rc4) is needed by mencoder-1.0-0.33.rc1.el4.rf.i386
libcdda_interface.so.0 is needed by mencoder-1.0-0.33.rc1.el4.rf.i386
libcdda_paranoia.so.0 is needed by mencoder-1.0-0.33.rc1.el4.rf.i386
libdv.so.4 is needed by mencoder-1.0-0.33.rc1.el4.rf.i386
libdvdnav.so.4 is needed by mencoder-1.0-0.33.rc1.el4.rf.i386
libfaac.so.0 is needed by mencoder-1.0-0.33.rc1.el4.rf.i386
libfribidi.so.0 is needed by mencoder-1.0-0.33.rc1.el4.rf.i386
liblirc_client.so.0 is needed by mencoder-1.0-0.33.rc1.el4.rf.i386
liblzo.so.1 is needed by mencoder-1.0-0.33.rc1.el4.rf.i386
libmad.so.0 is needed by mencoder-1.0-0.33.rc1.el4.rf.i386
libmp3lame.so.0 is needed by mencoder-1.0-0.33.rc1.el4.rf.i386
libmpcdec.so.3 is needed by mencoder-1.0-0.33.rc1.el4.rf.i386
libsmbclient.so.0 is needed by mencoder-1.0-0.33.rc1.el4.rf.i386
libtheora.so.0 is needed by mencoder-1.0-0.33.rc1.el4.rf.i386
libungif.so.4 is needed by mencoder-1.0-0.33.rc1.el4.rf.i386
libx264.so.54 is needed by mencoder-1.0-0.33.rc1.el4.rf.i386
libxvidcore.so.4 is needed by mencoder-1.0-0.33.rc1.el4.rf.i386
mplayer = 1.0 is needed by mencoder-1.0-0.33.rc1.el4.rf.i386

7) Quick Install some Packages
yum install lirc alsa-lib cdparanoia-libs alpha9 fribidi aalib openal libdv libtheora samba-common SDL arts audiofile esound lzo-devel.i386 libmpcdec-devel.i386 libungif-devel.i386

8) wget http://dag.wieers.com/packages/mplayer-fonts/mplayer-fonts-1.1-3.0.rf.noarch.rpm
9) rpm -ivh mplayer-fonts-1.1-3.0.rf.noarch.rpm
10) wget http://dag.wieers.com/packages/libXvMCW/libXvMCW-0.9.3-1.2.el4.rf.i386.rpm
11) rpm -ivh libXvMCW-0.9.3-1.2.el4.rf.i386.rpm
12) wget http://dag.wieers.com/packages/libXvMCW/libXvMCW-devel-0.9.3-1.2.el4.rf.i386.rpm
13) rpm -ivh libXvMCW-devel-0.9.3-1.2.el4.rf.i386.rpm
14) wget http://dag.wieers.com/packages/xvidcore/xvidcore-1.1.2-1.el4.rf.i386.rpm
15) rpm -ivh xvidcore-1.1.2-1.el4.rf.i386.rpm
16) wget http://dag.wieers.com/packages/libmp4v2/libmp4v2-1.5.0.1-3.el4.rf.i386.rpm
17) rpm -ivh libmp4v2-1.5.0.1-3.el4.rf.i386.rpm
18) wget http://dag.wieers.com/packages/x264/x264-0.0.0-0.3.20061214.el4.rf.i386.rpm
19) rpm -ivh x264-0.0.0-0.3.20061214.el4.rf.i386.rpm
20) wget http://dag.wieers.com/packages/x264/x264-devel-0.0.0-0.3.20061214.el4.rf.i386.rpm
21) rpm -ivh x264-devel-0.0.0-0.3.20061214.el4.rf.i386.rpm
22) wget http://dag.wieers.com/packages/mplayer/mplayer-docs-1.0-0.33.rc1.el4.rf.i386.rpm
23) rpm -ivh mplayer-docs-1.0-0.33.rc1.el4.rf.i386.rpm
24) wget http://dag.wieers.com/rpm/packages/faac/faac-1.24-1.1.el3.rf.i386.rpm
25) rpm -ivh faac-1.24-1.1.el3.rf.i386.rpm
26) http://dag.wieers.com/rpm/packages/libdvdnav/libdvdnav-0.1.10-2.2.el4.rf.i386.rpm
27) rpm -ivh libdvdnav-0.1.10-2.2.el4.rf.i386.rpm
28) wget http://dag.wieers.com/rpm/packages/libmad/libmad-0.15.1b-4.el4.rf.i386.rpm
29) rpm -ivh libmad-0.15.1b-4.el4.rf.i386.rpm
30) wget http://dag.wieers.com/rpm/packages/lame/lame-3.96.1-4.el4.rf.i386.rpm
31) rpm -ivh lame-3.96.1-4.el4.rf.i386.rpm
32) wget http://dag.wieers.com/packages/mplayer/mplayer-1.0-0.33.rc1.el4.rf.i386.rpm

rpm -qa xvidcore faad2 libjpeg libogg libvorbis x264 lame a52dec faac

wget http://s1.attachmax.com/test/all-20061022.tar.bz2 tar -xjvf all-20061022.tar.bz2

mv all-20061022 codecs && mv codecs/ /usr/local/lib

wget http://www.3gpp.org/ftp/Specs/archive/26_series/26.073/26073-510.zip;wget http://www.3gpp.org/ftp/Specs/archive/26_series/26.104/26104-510.zip;wget http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip

unzip 26073-510.zip;unzip 26104-510.zip;unzip 26204-510.zip

260* is general amr, 261* is amr_float, 262* is amrwb_float(i c) wget http://www1.mplayerhq.hu/MPlayer/releases/MPlayer-1.0rc1.tar.bz2
tar -xjvf MPlayer-1.0rc1.tar.bz2
cd MPlayer-1.0rc1/libavcodec
mkdir amr amr_float amrwb_float

cd amr
unzip -q ../../../26073-510_ANSI-C_source_code.zip cd ../amr_float/
unzip -q ../../../26104-510_ANSI_C_source_code.zip cd ../amrwb_float/
unzip -q ../../../26204-510_ANSI-C_source_code.zip
cd ../../

./configure --prefix=/usr/local --disable-gui --disable-smb --disable-network
make
make install

MEncoder installation on Windows

To install MEncoder on windows server to make it work with AttachMax, please follow steps below:
1. Download FFmpeg for windows from http://www.attachmax.com/MEncoder_for_Windows.html (9.85MB).
2. Unzip it to some directory (e.g. C:\Program Files\mplayer).
3. Open "Servers" tab in AttachMax admin panel and insert MEncoder path (e.g. C:\Program Files\mplayer\mencoder.exe) and MPlayer path (e.g. C:\Program Files\mplayer\mplayer.exe).

To use MEncoder for flv encoding and thumbnails creation, you should select "mencoder" as "Video Tool" from "Config" tab in AttachMax admin panel.

FFmpeg for Windows works faster, than MEncoder from our experience.

Flvtool2 info and installation

Flvtool2 Installation

FLVTool2 can calculate a lot of meta data and insert a onMetaData tag. It can cut FLV files and add cue Points (onCuePoint)
- (In simple terms, flvtool2 reads cuepoints from the source flv file to help the Flash Player calculate progress indication, rewind and forward.)

1) Download and Extract Flvtool2
Log into ssh
# wget http://rubyforge.org/frs/download.php/17497/flvtool2-1.0.6.tgz
# tar -zxvf flvtool2-1.0.6.tgz

1a) *For Fedora Core/Centos Users*
(via package manager)
# yum install ruby

2) Install Flvtool2 # cd flvtool2*
# ruby setup.rb config
# ruby setup.rb setup
# ruby setup.rb install

3) Webpage Installation
Using above method flvtool2 is usually isntalled at /usr/bin/flvtool2
Navigate to your http://yourattachmax.com/admin

In admin/servers tab, tick Use flvtool2
- Then enter path /usr/bin/flvtool2

Flvtool2 should be installed and working

Perl Upload Progress Meter installation

PERL UPLOAD PROGRESS METER INSTALLATION INSTRUCTIONS

Perl uploader files need to be placed to cgi-bin directory or apache httpd.conf can be changed to allow scripts execution from perl-uploader folder. It can be done with following lines under your domain

ScriptAlias /perl-uploader/ "/path/to/attachmax/perl-uploader/"
<Directory "/path/to/attachmax/perl-uploader">
AllowOverride All
Order allow,deny
Allow from all
</Directory>


Then 'chmod +x perl-uploader/pcgi.pl', 'chmod 666 up.log', rename config.pl.unix or config.pl.win (for Windows users) to config.pl and edit it:
1. Set $main::tmp_dir to slave temp path (/path/to/attachmax/slave/tmp)
2. Set $main::max_upload to your file max size value
3. Set $main::post_path to e.g. http://slave.domain.com/index.php or if installed in slave folder
http://www.domain.com/slave/index.php
Next steps to get it working:

1. Set "Perl uploader url" from "Servers" tab in admin panel (e.g. http://slave.domain.com/perl-uploader/pcgi.pl or http://www.domain.com/perl-uploader/pcgi.pl)
2. Open "Config" tab in admin panel and switch "Use Perl upload" and "Use upload progress meter" options to "yes"
Perl Progress meter should now be installed and working.

PHP Progress Meter Installation

Written by Luke(aka asmo)
Edited by Jon Nikolakakis

HOW TO INSTALL PROGRESS METER(intermed level)
Installation Time - 10 min or less depending on Service Administration Skills

1)cd /usr/src
2)wget http://pdoru.from.ro/upload-progress-meter/upload-progress-meter-v4.1.tgz
3)tar -zxvf upload-progress-meter-v4.1.tgz
4)cd upload-progress*
5)cd php-patch/ && ls -l
6)Copy patch into php Directory, in my case both php and progress meter were download to /usr/src

so my command will be:
cp patch.upload-progress-callback-v4.1-for-php4.3.10.txt ../../php-4.4.4
and to check -> ls -l ../../php-*

7) cd ../../php-4.4.4

7) Now I can patch my php
Patch php using patch.upload-progress-callback-v4.1-for-php4.3.10.txt

patch -p1 < patch.upload-progress-callback-v4.1-for-php4.3.10.txt
It was succesful and this is the result I achieved
===================================================
patch -p1 < patch.upload-progress-callback-v4.1-for-php4.3.10.txt
patching file main/rfc1867.c
Hunk #1 succeeded at 129 with fuzz 2 (offset 1 line).
Hunk #2 succeeded at 795 (offset 4 lines).
Hunk #3 succeeded at 877 (offset 1 line).
Hunk #4 succeeded at 944 (offset 5 lines).
Hunk #5 succeeded at 967 (offset 1 line).
Hunk #6 succeeded at 1026 with fuzz 2 (offset 6 lines).
Hunk #7 succeeded at 1250 (offset 8 lines).
===================================================

7)nano /usr/local/apache/htdocs/info.php

8) add these lines
<? phpinfo(); ?>
Save file then go to
http://yourip/info.php

Keep this file open it will reveal the location of 4 important factors
Your current PHP version
Current configure lines
extension_dir
Location of php.ini

9)Now you're ready to compile php with knowledge of this information,
for example with prefix (example -> /usr/local/php)

10) Copy your configure lines in info.php(step 8)
In my case
./configure' '--with-apxs=/usr/local/apache/bin/apxs' '--with-mysql=/usr/local/mysql2' '--prefix=/usr/local/php' '--with-zlib=/usr/local/zlib' '--with-openssl=/usr/local/ssl' '--enable-fastcgi' '--enable-memory-limit' '--enable-zend-multibyte' '--with-bz2' '--enable-shmop' '--enable-safe-mode' '--enable-sigchild' '--enable-bcmath' '--with-freetype-dir=/usr/local/freetype' '--with-gd=/usr/local/gd' '--enable-gd-native-ttf' '--enable-mbstring' '--with-mm=/usr/local/mm' '--enable-inline-optimization' '--disable-debug'

11) If not in the location of where you downloaded php to, then go to it
i.e /usr/src/php-4.4

 

when php is installed go into upload-progress-meter-v4.1/upload_progress_meter
12) cd /usr/src/upload-pr*/upload_progress_meter && ls -l
You should see the config file dir
and do:

13) /usr/local/php/bin/phpize (depending on where you php is installed, find this information from your
info.php

./configure --with-php-config=/usr/local/php/bin/php-config
make
make install

14) now full path to upload-meter extension should be:
location_of_php/no-debug-non-zts-XXXXXXXX/upload_progress_meter.so
where XXXXXXXX = date numbers, may be differend than the one i have so it need to be checked.

So in your php.ini file, find "extension_dir"
In this case it was extension_dir=/usr/local/php/lib/php/extensions, so the config lines will be

extension_dir=/usr/local/php/lib/php/extensions
extension=no-debug-non-zts-20020429/upload_progress_meter.so

But use your exact extension_dir lines by going into your php,ini

In httpd.conf in your domain add:
11)
--- cut cut ---
php_value upload_progress_meter.store_method "file"
php_value upload_progress_meter.file 1
php_value upload_progress_meter.file.filename_template "/tmp/uploadbar/upl_%s.txt"
--- cut cut ---

now you need to create one directory:

12) mkdir /tmp/uploadbar && chmod 777 /tmp/uploadbar

now restart your apache and verify using test files in 'live-demo' dir or via phpinfo() function.
enjoy.

Uploading Large Files

There is no limit to the file size, you can upload through attachmax.
However there is a limit that is controlled by your Server.

If you're on Dedicated or VPS you have full control to configure the server settings for larger uploads but:

If you're on shared hosting, you may be restricted to the settings that are set up by your shared host.

Some of these values can be read about it here

There is a work around that can be done to some Shared Hosts, this can be done by editing the .htaccess files and adding these values.

php_value upload_max_filesize 100M
php_value post_max_size 150M
php_value memory_limit 32M
php_value max_execution_time 600

php_value max_execution_time 600 is equal to about 10 minutes.

One factor that cannot be controlled is Apache Timeout.

Templates

Displayed here is all information regarding optimizing the Attachmax Templates.
Attachmax comes with its own Theme Developer, which allows you to view the css and html code behind each page. Alternatively users can use Firefox's excellent firebug tool which allows you to inspect the html and css code while hovering over each element.

These guides aim to fill in the gap to modify each and every part of the Attachmax Template System.

Please provide us with as much feedback on the template system or how we can improve the documentation.

If you're interested in doing some custom work to help us to improve the templates, or writing a few template guides, please contact us via email at - jonnikola@optusnet.com.au

Changing Background Image/Color

The background is controlled by css, and can be viewed inside
css/style.css page. (Line 119)

body {
	margin: 0px;
	padding: 0px;
	* padding-top: 50px;
	* padding-bottom: 35px;
	background-image: url(../images/pageBackground.gif);
	text-align: center;
	font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 11px;
}

To change the background can be done by inserting a new image or removing this line.
background-image: url(../images/pageBackground.gif);
and replacing that line with the code below

background-color:#FFFFFF;

Changing Banners

Below is the html & css code to change the Banners on Attachmax Homepage.
HTML Elements - File located at - templates/frontend/header.tpl
---------

<div id="branding">
    	<a href="<?php echo $siteUrl ?>"><img alt="<?php echo $siteName ?>" src="images/logo.png" /></a>
    	<a id="buy" href="http://cihilt.com"><img alt="Buy AttachMax Script" src="images/buy.png" /></a>
    </div>

CSS Elements - Files located at css/style.css
---------

#branding {
	float: left;
	background: url(../images/banner_bg.png) repeat-x;
	border-bottom: 10px solid rgb(255, 218, 103);
}

#branding img {
	float: left;
}

#buy {
	float: right;
}

Changing Homepage Categories

Below is the html & css code to change the Categories.
HTML Elements - File located at - index.php
---------

$category = amCategory::getById(39);
$file_row = array(
                'files' => amFile::search(array('order' => FILES_ORDER_VIEWS, 'limit' => 5,
                                     'types' => array($type), 'category' => $category)),
                'title' => 'Top 5 Sport'
             );
array_push($files, $file_row);

Theres two main parts you need to change that will influence what kind of information the categories will display.
Where you have FILES_ORDER_LAST_VIEW_TIME,

Can be substituted with either:
FILES_ORDER_LAST_VIEW_TIME, - To Order via last view time
FILES_ORDER_UPLOAD_TIME, - To order via last Uploaded time
FILES_ORDER_VIEWS, - To order via Most Viewed

Where you have amCategory::getById(39);
This line points to the category id, which can be viewed from either 3 locations.
1) Hovering over homepage Categories with mouse
2)Inside admin Category section
3)Viewing the id directly from the database
So in our case 39 is the Sport category and will show all Sport Videos.

Another part that you can modify is the title
Where you have - 'title' => 'Top 5 Sport'
You can adjust the text to display the text any way you wish.

Another part that can be adjusted is:
'limit' => 5,
This tells the script how many videos to show, if you're handy with coding, you may display the Video thumbnails in vertical format and increase this limit to something like 10.

HTML Design elements that control the categories - templates/frontend/home/index.tpl

<div class="content">
				 <?php foreach ($file_row['files'] as $file): ?>
				     <?php echo $file->getShortPreviewHtml() ?>
				 <?php endforeach; ?>
</div>

CSS Elements - css/style.css - line 111
============

#videos #top .content, #files #top .content, #images #top .content {style.css (line 111)
background-color:white;
float:left;
padding-bottom:5px;
width:750px;
}

Embed Code

The embed code is located at templates\_files\view\_video_embed_code.tpl

<div><b>Embed: </b><input type="text" class="text" onclick="am_highlight(this)" readonly="true" value="<?php echo am_h(str_replace(array("\n", "\t"), '', $playerHtml)) ?>" /></div>

This is controlled via css in the folder css/view.css (line 74)

#file_info .embed div {
    padding:0pt 0pt 5px;
}

Using css, you can move or adjust the position, to completely change the look.

Homepage Navigation

Location of HMTL and CSS code to change the navigation

HTML Elements - templates/frontend/header.tpl - line 40
============

        <ul id="secondNav">
            <li class="videos"><a>">Videos</a></li>
            <li class="images"><a>">Images</a></li>
            <li class="files"><a>">Files</a></li>
            <li class="list"><a href="list.php">List Files</a></li>
            <li class="upload"><a href="upload.php">Upload</a></li>
            <li class="register"><a href="register.php">Register</a></li>
        </ul>
    

CSS Elements - css/style.css - line 111
============
Both these Css elements control the display of the navigation,
#secondNav controls more the Navigation links, while #secondNavHolder, is the placeholder for the menyu

#secondNavHolder {style.css (line 358)
background:transparent url(../images/taskbar_top.jpg) repeat-x scroll center bottom;
float:left;
padding-bottom:27px;
}
* {style.css (line 4)
margin:0pt;
padding:0pt;
}


#secondNav {style.css (line 364)
background:#5A84BD url(../images/middle_menu/attachmax.gif) no-repeat scroll left top;
float:left;
list-style-type:none;
margin:0pt;
padding:0pt 0pt 0pt 180px;
width:775px;
}
ul, ol {style.css (line 14)
margin-left:2em;
}

Installation

Unzip Files
1) Unzip all files from "attachmax script" inside a folder.

Upload
2) Upload all of these files into your public_html directory (example /home/yourusername/public_html/*
(In Plesk its usually httpdocs)

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

Alternative Approach for ssh or cpanel users.
1) Upload the zip file into chosen directory
i.e /home/username/public_html

2)Either use Cpanel option to unzip the file or use ssh command "unzip filename.zip"

Create The Database and Users

CREATE AND PREPARE THE ATTACHMAX DATABASE
-----------------------------------------
Before you proceed to the next installation step you should know:
- "username" - the username for connecting to the database
- "password" - the password for the Database
- "databasename" - the name of the database

1) You can either create this through phpmyadmin or directly via ssh into mysql

Via Phpmyadmin

1) On the Phpmyadmin homepage where it says "Create new database"
Enter any name for the database and then click Create.

2) You will be taken to a new page that gives you a message
Database "name you chose" has been created.

3) Go back to your Homepage and click Privileges

4) Click Enter Username link

5) You will be taken to a new Page, where you can enter
Username: enter a username here
Host: Usually localhost
Password: The password for the user

Down Below you will see some radio options,


Below that Select the adequate Privileges and your Done

------------------------------------------------------------
Faster Alternative approach for ssh users.
Enter these commands
1) mysql -p (which will take you into mysql shell)
2) Create database databasename
2) grant all privileges on databasename.* to user@localhost identified by 'password';
i.e grant all privileges on am_test.* to am_user@localhost identified by 'zoomzoom';

Install Attachmax Script via Webpage

1) Grant File Permissions
Either Ftp and chmod 0777

Files
- config.php
- .htaccess
- slave/config.php

Folders
- cache
- tmp
- slave/images
- slave/files
slave/images

Or if you have ssh faster way inside your attachmax directory is
chmod 0777 config.php cache tmp .htaccess slave/config.php slave/images slave/files



2)Start Installation Website
In browser go to install/ of your chosen installation website,
eg: http://www.yourwebsite/install/
Click Check Button and then next if all writeable and green



3) Database Settings
Click next when entering database details from below, if the database connection fails
it could mean that you type in the wrong information, double check password, for extra spaces and case sensitive information.

- enter your database Username in first field
- enter your Database Password in second field
- Type in your Mysql Database Name
(Only click Drop tables, if you would like to reinstall attachmax with the same
database details and would like to wipe the database clean)



4)Site settings:
By Default Url will already be entered
along with the path, of your current directory, so you will really only need to modify
the name of your site. This can be anything and can be modified later via admin.
You will have option of 3 tick boxes, for first time installs leave everything blank, unless you are sure
you have patched your php for Progress meter and have Short Url's capability.



5)Site admin settings:
Enter a valid email address, admin username and password, which will be used to log into admin.
Click next when done



6)Paypal Settings
Enter the name of your paypal account if you have one, leave blank if you dont.
Only click 2co checkbox if your account is able to accept 2co payments.

Click next to Install Slave Server (Where your Files and Images Will be placed)

Remote Slave Server Installation

Adding Remote Slave Servers (On different Server)
Using ssh
1) Set up a subdomain on another Server, i.e s1.yourdomain.com, test that the domain is up
More information of how to do this can be found via this guide

2) Copy Database Information
Now in your homepage, go into your config.php and copy these 3 entries.
$dbuser = "fvi9";
$dbpass = "fvi9";
$db = "fvi9";


3) Finding Ip of Slave Server
This can be found many ways, but im assuming you already have this knowledge, if not then look at this guide

Keep these values in a notepad as you will need these in future steps.

4) Granting privileges to slave
Now go into shell and type in
a) mysql -p *you should now be logged into mysql shell
b) grant all privileges on databasename.* to dbuser@ipofslave identified by 'password';
i.e grant all privileges on fvi9.* to fvi8@204.34.234.3 identified by 'fvi8';

5) Then type these commands
Flush Privileges;
exit;

6)Now Go onto your slave Server and Upload the contents inside of Slave from the original Attachmax zip package
on the your subdomain root directory.
i.e s1.yourdomain.com in [/home/username/public_html/s1]

7) Giving File Permissions
#chmod 0777 files images
# chmod 667 config.php

8) Running the Install File
Run installer the location will be dependent on where you've uploaded the install folder the domain that you choose in step 1
Follow Steps

9) If succesful a connection will be made to the remote host.
Once finished test an upload from homepage.

10) Now go in and install ffmpeg and other dependencies and you're ready with your new slave.

Setting Up Subdomain via shell

Go into
1) cd /var/named

Usually by default all nameservers are there

2) In your domain type in
nano domain.net.db

In the bottom of this file add an entry like this,
where the ip is the one of your chosen subdomain.

s1 30 IN A 70.212.8.71

Now restart named

and go into your httpd.conf file
Add the entry to s1.