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.
Contained in this feature Chart, Will list every Attachmax and what each function does and the purpose that it carries.
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 MakhaevAdding, 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.
This Book will explain, what each feature does in the admin config section.
From domain names to Uploading Settings.
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.
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.
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
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 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.
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;
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.
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
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
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
# wget http://ffmpeg.mplayerhq.hu/ffmpeg-export-snapshot.tar.bz2
# tar -xjvf ffmpeg-export-snapshot.tar.bz2
5)
Setting up the Libs
# 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
# tar -zxvf lame-3.97.tar.gz
Commands to compile Lame
# ./configure --disable-shared
# make
# make install && cd ..
7) Compile FFmpeg Installation
# make
# make install
This installation should work on most servers and can be very quickly done with support for most of the popular codecs.
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 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/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 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
# sh bootstrap
#
./configure
# make; make install && cd ..
8)Installing 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
and Comment this out to look like
Save file and # cd ../..
# autoreconf -vif
# ./configure
# make;make install
# cd ..
9)Installing LAME (for audio)
# ./configure; make;make install
# cd ..
10) Installing Xvid
# ./configure; make; make install;
# cd ../../..
11)Installing x264
# ./configure --enable-shared
# make;make install
# cd ..
12) Configuring for 3gp Support
# 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
Find around Line 68 and comment the entire line like below
The line should look something like this, new packages may vary
Paste Below
# Save file
14)
Setting up the Libs
# 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
# 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
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
# 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
6) Untar all of the packages
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
# sh bootstrap
#
./configure;make; make install;cd ..
8) Installing 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)
10) Installing Xvid
11) Installing x264
12) Configuring for 3gp Support
#
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
# 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
# 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
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
1b) cd /usr/src
2)Download & Install FFmpeg
unzip
ffmpeg-installer.zip
php -e install.php
or 2a) Download FFmpeg Installer (Latest)
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.
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.
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
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 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
# 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
# ruby setup.rb config
# ruby setup.rb setup
# ruby setup.rb install
3) Webpage Installation
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
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.
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
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;
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;
}
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;
}
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.
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;
}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 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';
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)
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.
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.