Automedia 3 Plugin for MyBB 1.8
Documentation
Author: doylecc ( http://community.mybb.com/user-14694.html)
Version: 3.0.3 (02-04-2015)
Homepage: http://mybbplugins.de.vu
Contact: http://mybbplugins.de.vu
Content
Plugin Description
The AutoMedia Plugin embeds automatically video/audio/flash without need for MyCode tags.
The plugin recognizes the posted URL and shows the videos/audios. You don't need to insert any MyCode. The plugin utilizes the oEmbed API by including the Embera library and optionally the Embed.ly service.
AutoMedia 3 has a modular structure - custom modules for sites can be enabled/disabled, added/removed and updated separately, without updating or disabling the plugin itself.
Feature Overview:
->Can be enabled/disabled in ACP
->Template edits are applied automatically if one day a new theme is imported or added.
Additionally, template edits can be reapplied from Plugins overview in ACP (e.g. after reverting your templates) without deactivating the plugin.
->Can be disabled for guests only
->Can be disabled for certain usergroups
->Can be enabled for certain forums only
->Embedding of individual links can be disabled by using MyCode tags [amoff]URL[/amoff].
->By using the [ampl]URL1.mp3|URL2.mp3|URL3.mp3[/ampl] MyCode tags
MP3 playlists can be created.
->Embedding can be disabled for signatures (default)
->Embedding can be disabled in quotes
->Codebuttons for MyCode can be displayed in editor below textbox.
->Every user can enable/disable embedding in User CP.
->Embeds videos and music from dozens of different websites.
->The embed.ly API Key can be used.
->Documentation available from plugin overview in ACP.
->Embedding of adult video sites can be enabled/disabled.
->Embedding of adult video sites can be enabled/disabled for guests only.
->Permissions for adult videos can be set by usergroups and forums.
->The plugin uses the MyBB cache system to avoid unnecessary database queries.
List of supported file types and websites:
The oEmbed API supports many websites (Embera about 65 and embed.ly about 250). See Embera Providers list and embed.ly Providers List for more details.
Additionally the included Mediaelement HTML5 player, Flowplayer and MP3 player let you embed different file types. e.g.:
# MP3/M4A/WAV/OGG audio and MP3 Playlist
# MP4/M4V/MP4V/OGV/WEBM video
# FLV Flash video
# SWF Flash
# DivX video
# AVI video
# MKV video
# MOV Quicktime video
# RM/RAM/SMIL/RV/RPM Real media
# WMV/WMA Windows media
# MPG/MPEG video
Please note that you need to have all necessary plugins/addons installed in your webbrowser to play all media file types!
# 12 different adult video websites are currently supported (deactivated by default)
cURL and fsockopen support:
If cURL or fsockopen isn't supported on your server media from most sites can't be shown.
Back to top
Screenshots
Screenshots, news, updates and the latest modules are available at:
https://github.com/doylecc/AutoMedia
Back to top
Installation
- Upload the complete content of the Upload folder into your forum home directory.
(For additional languages you have to upload the language files too.)
- Go to your "AdminCP Configuration - Plugins" and click "Install & Activate" behind AutoMedia
- After the activation you'll find a new settinggroup "AutoMedia Global" in "ACP - Configuration - Settings".
Here you can generally enable/disable embedding without losing your settings.
You can disable embedding for guests only.
You can disable embedding for different usergroup(s).
Embedding can be enabled for certain forums only.
Embedding of adult videos can be enabled (disabled by default).
Embedding of adult videos can be disabled for guests only.
Permissions for adult videos can be set by usergroups and forums.
Embedding can be disabled in signatures (default).
Permissions can be set for embedding of flash files (admins only)(admins, supermods, mods)(all users).
Width and height of embedded media can be set.
Embera library can be (de)activated.
Embed.ly can be used with a valid API key.
Codebuttons can be enabled/disabled for MyCode.
Embedding can be disabled in quotes.
- Adds an own admin permission.
- In "ACP - Tools & Maintenance" a new menu item "AutoMedia" is added, where you can view and manage the installed modules for all supported sites and file types.
You can enable/disable embedding for every single mediasite and file type. (all are enabled by default)
- The plugin adds a new menu item "AutoMedia" in "User CP". In "AutoMedia" a select box is shown. Every user can set whether he wants embedding enabled (Yes (default)) or disabled (No).
If he chooses "No" he will only see the links in posts instead the embedded videos/audios and in his own posts only links will be shown to all users.
- All done.
Back to top
Update
Update from version 3.0:
- Upload the complete content of the Upload folder into your forum home directory and overwrite the existing files.
- In ACP -> Configuration -> Plugins deactivate AutoMedia and activate it again.
- In ACP -> Templates & Style -> Templates -> run Find Updated Templates. If there are any automedia templates listed, revert them (and possibly reinsert your own code.)
- All done.
Update from all older versions:
- Deinstall the old AutoMedia plugin.
- Upload the complete content of the Upload folder into your forum home directory and overwrite the existing files.
(You can delete the old "mediaplayer" folder in the forum home directory.)
For additional languages you have to upload new language files too.
- see "Installation" beginning with #2
Back to top
Global Settings
In "ACP - Configuration - AutoMedia Global" you can see the following 20 settings:
- Enable AutoMedia for AutoMedia Sites? - Here you can completely activate/deactivate the automatic embedding.
- Enable AutoMedia
for Guests? - Here you can disable the automatic embedding for Guests.
- Disallow AutoMedia
for the following Usergroups: - Here you can disable the automatic embedding for certain usergroups (id's separated by comma).
- Show AutoMedia
in following Forums only: - Here you can insert the id's of the forums (id's separated by comma, 0 = all forums) where automatic embedding shall be activated.
- Enable Embedding of Adult Sites? - Here you can enable/disable the automatic embedding of adult site videos (special modules).
(deactivated by default) - Notice: Adult Sites (special) modules in Module Management are only visible if embedding of adult sites is enabled.
- Enable Adult Site Videos for Guests? - Here you can disable the automatic embedding of adult site videos for guests.
- Allow Adult Site Videos for the following Usergroups: - Here you can enable the automatic embedding of adult site videos for certain usergroups (id's separated by comma).
- Allow Adult Site Videos for the following Forums only: - Here you can insert the id's of the forums (id's separated by comma, 0 = all forums) where automatic embedding of adult site videos shall be activated.
- Enable AutoMedia for "AutoMedia Sites" in Signatures? - Here you can enable/disable the automatic embedding in signatures (disabled by default.)
- Permissions for embedding of flash files - Here you can set the permissions for who is allowed to embed flash files (FLV and SWF) in post. There are 3
options: a: Admins only, b: Admins, Supermoderators and
Moderators and c: all users (default).
- Max. width of
shown media files. - Here you can set the width (in pixels) for the embedded files.
- Max. height of
shown files. - Here you can set the height (in pixels) for the embedded files.
- Use Embera oEmbed library. (default)
- Use Embed.ly service. (Embedly and Embera can be used together)
- Insert Embed.ly API key.
- Embed Embed.ly media immediately or after clicking a button or as a modal popup.
- Let Embed.ly display previews of linked websites.
- Display Embed.ly media as Embedly-Cards.
- Show Codebuttons
for MP3 Playlist and Deactivation MyCodes - if set to "Yes" the codebuttons for inserting the [amoff]-MyCode (disabling the embedding for individual links) and the [ampl]-MyCode (for creating a MP3 playlist) are displayed for the users below the editors message text box.
- AutoMedia in Quotes? - Here you can enable/disable the automatic embedding in quotes.
Back to top
Module Management
- In "ACP - Tools & Maintenance" you can find the menu item "AutoMedia"
- It leads to the Module Management of AutoMedia.
- Here you can see an overview of all available custom modules (Manage installed
AutoMedia custom modules.)
- If embedding of Adult Sites is enabled in the global plugin settings an additional tab is visible. (Installed
Adult Sites modules.)
- The overview lists all custom modules that are located in the module-folder "inc/plugins/automedia/mediasites/" as PHP files. (The module-folder
for adult site videos (special modules) is "inc/plugins/automedia/special/".)
- The 1.
column lists the serial number.
The 2. column lists the name of the module. If you click on the name, you can view the code of the module.
The 3. column shows the status of the module. A green framed happy smiley signals: the module is activated and a red framed sad smiley signals: the module is deactivated.
In the 4th column every module can be activated (if it's currently not active) or deactivated (if it's currently active) The options are additionally highlighted by different colors.
Below the table you can find a button (Activate all). By clicking the button all modules will be activated at once.
- The Module Management for adult site videos (special modules) works the same way in it's own tab.
- New modules can be added by uploading the module's PHP file
into the respective module-folder (site modules into "inc/plugins/automedia/mediasites/" and special modules into "inc/plugins/automedia/special/")
via FTP, file manager, SSH etc.
After that go to the AutoMedia Module Management in ACP - the new modules are listed in the overview as not activated. Click to activate them.
- Modules
can get removed completely in two steps.
1. Deactivate them in the AutoMedia Module Management in ACP.
2. After that delete the module's PHP file via FTP, file manager, SSH etc. from the respective module-folder (site modules from "inc/plugins/automedia/mediasites/" and special modules from "inc/plugins/automedia/special/").
- For adding, removing, updating modules, the plugin itself doesn't need to get deactivated or updated.
Back to top
User-CP
In User-CP you'll find the menu item "AutoMedia." Here the user can enable/disable the automatic embedding.
On the right part of the table a status icon is shown.
Thumbs up = automatic embedding is enabled in the users personal settings.
Thumbs down = automatic embedding is disabled in the users personal settings.
The center of the table shows a select box with following options: "YES" (enable embedding) and "NO" (disable embedding).
The setting is saved after clicking the "Ok" button.
Back to top
MyCode-Buttons
If the codebuttons for inserting the MyCodes are enabled in the global plugin settings, the buttons are displayed below the editors message text box.
With a click on the respective button the MyCode tags are inserted (opening and closing tag simultaneously.)
The tags are inserted at the cursor point or - if text is selected - before and after the selected text.
Back to top
Module-Generation
A few tips for creating custom modules:
- A custom module is a PHP file, which must be located in the correct folder.
("inc/plugins/automedia/mediasites/" or "inc/plugins/automedia/special/")
- The module can be activated only, if the function name contains the name of the module.
- Here's an example of the code structure:
The module's file name is: my_module.php
Hence the name of the module is: my_module
The function name of the module has to be: automedia_my_module($message)
Code:
<?php
//Direct initialization of this file is not allowed.
if(!defined("IN_MYBB"))
{
die("Direct initialization of this file is not allowed.
Please make sure IN_MYBB is defined.");
}
//Now the function:
function automedia_my_module($message)
{
// The following variables are required for video width and height:
global $mybb, $width, $height;
// Determine width and height, but don't forget the global settings:
$w = $width;
$h = $height;
// Detect the desired URL
if (preg_match('SEARCHPATTERNisU',$message))
{
// Replace link with the embed code. Don't forget using the <div="am_embed"> tag and the variables for width and height!
$message = preg_replace("#SEARCHPATTERN#i", "<div class=\"am_embed\">EMBED-CODE width=$w heigth=$h</div>", $message);
}
return $message;
}
Back to top
License
This program is free software:
you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details..
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Back to top
Last edited: 02-04-2015