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.