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.