This module can be used to manage galleries or albums of videos that are hosted on sites such as Youtube, Dailymotion, Google Videos, Yahoo Videos or Veoh.
It has 3 levels: category, video album (or gallery) and video itself. It allows embedding videos one by one or in paged list .
NEW! NEW! NEW! From the 1.1 version, it is now also possible to deal with videos stored on your web server (formats mkv, divx, avi, mp4) using the divx web player plugin!
Make sure your users have the appropriate permissions. If you are not using the access restriction option (see settings),
the "HostedVideoAlbums: Normal user" permission will be enough to use the module.
In the settings tab, you can choose which tabs will be displayed for the normal user.
Only the administrator and users with the "HostedVideoAlbums: Advanced" permission will have access to settings tab.
If you wish to define level-specific permissions, activate the access restriction option in the settings tab and give
the "HostedVideoAlbums: Manage name_of_level" permission to the appropriate users.
To use this module, you will need to create the 3 levels (ie category, album and video). First, you will have to create the categories in the "Categories" tab, then create the video albums in the "Video Albums" tab and then the videos themselves in the "Video" tab.
For categories, all you need to provide is the display name of the category, and optionnaly its alias (used with the "alias" parameter) and its description.
For albums, you will also provide a name, an alias (optional), the category to which the album is attached, a description (optional), a language (in the form fr or en-US), and the default width and height of the videos in this album (used when the width or height of the video is not set).
For videos, you need to provide a name, an alias (optional), the album to which the video is attached, a description (optional), the video site where the video is hosted, the video identfier (see below) and optionaly the width an height of the video (if not set, the default one of the album is used)
For Youtube, the video id is the last part of the url after "v=". For instance, in http://www.youtube.com/watch?v=7SZtGvXkEIw, it's "7SZtGvXkEIw".
For Dailymotion, it's the last part of the url after the last "/". For instance, in http://www.dailymotion.com/video/xcqa0g_cornershop-who-fingered-rock-n-roll_music, it's "xcqa0g_cornershop-who-fingered-rock-n-roll_music".
For Yahoo videos, it's also the last part of the url after the last "/". For instance, in http://video.yahoo.com/watch/7095687/18465878, it's "18465878".
For Google videos, it's the last part of the url after "docid=". For instance, in http://video.google.com/videoplay?docid=7521423388637542657#, it's "7521423388637542657#"
For Veoh, it's the last part of the url after the last "/". For instance, in http://www.veoh.com/browse/videos/category/music/watch/v555658setkP3D8, it's "v555658setkP3D8".
To insert a video hosted on your own site, the video id is the complete filename from the cmsms site root (for instance, if the movie is in the "MyMovies" directory at the cmsms site root and is named "MyMovie.avi", the id is "/MyMovies/MyMovie.avi".
The width and height of videos can generally be found in the "embed" code of the video sites. For each of these sites, either directly in the page or by clicking on a link in the page (youtube & google videos) or by clicking on the export button in the video (dailymotion), you will be provided with a piece of html code containing a width and a height.
To call the module, simply use the following tag:
{cms_module module="HostedVideoAlbums" what="<level>"}
If you omit the what parameter, the whole list of videos will be displayed. It is equivalent to:
{cms_module module="HostedVideoAlbums" what="video"}
{cms_module module="HostedVideoAlbums" what="category"} will display the categories list.
{cms_module module="HostedVideoAlbums" what="album"} will display the albums list, whatever the category.
You may also ask for elements who belong to a specific parent:
{cms_module module="HostedVideoAlbums" parent="alias_of_parent"}
The alias can be a category or an album alias.
You may finally ask for a specific element:
{cms_module module="HostedVideoAlbums" alias="alias_of_item"}
You will need to create a default category anyway. Name it for instance "default" then create all your albums in this category and use the
{cms_module module="HostedVideoAlbums" what="album"} to display all the albums.
Same, if you don't need the video albums, create a default album in the default category and link all your videos to this album. Then insert the videos using
{cms_module module="HostedVideoAlbums" what="video"}
You may limit the number of items to be shown on one page:
{cms_module module="HostedVideoAlbums" nbperpage="5"}
In the template, you can build the page menu using the following tags (see ListLinks or ListVideos templates):
{$page_showing}, {$page_totalitems}, {$page_pagenumbers}, {$page_next}, {$page_previous}
To get a list of item that meet specific criteria, you can create a query using the queries tab of the admin panel, and call them using the "query" parameter:
{cms_module module="HostedVideoAlbums" query="5"}
If the option to allow manuel sql queries is enabled (see "Settings" tab), you may also provide the sql query directly with the query parameter. For example:
{cms_module module="HostedVideoAlbums" what="video" query="A.date_modified > '2009-03-15' AND A.active = 1"}
The query parameter can only hold the WHERE clause of the query, and should not include the WHERE command itself. To avoid problems, the prefix "A." should be used before field names (where applicable, the "B." prefix can be used to specify criteria on the parent's fields).
Although the abstraction layer is not easily prone to injections, remember that activating this option means giving a sql opening within the templates and be careful.
You can choose for each level which template will display this level.
By default, for the category level, only one template is provided: ListLinks. This template displays in a bulleted list, for each category, the name of the category and it's description. The name is an hyperlink to the page displaying all the albums of the category.
At the album level, you also use ListLinks which will display in a bulleted list, for each album of the category, the name of the album and its description. The name is an hyperlink to the page displaying all the videos of the album.
At the video level, you can choose between ListLinks and ListVideos:
It's quite simple to add a new hosting site!
First, you must have a look at the "embedding code" of this site and locate what is the form of the video id and where it should be inserted in the url (movie parameter of the embedding code). Then just add the new site name in the "Sites" tab then edit the EmbedVideo template and add just before the {/if} line a set of lines in the form:
{elseif $item->site_namevalue=="<the new site name>"}
{assign var="movie"
value="<begining of the url>`$item->videoid`<end of the url>"}
Look at the other cases to find the inspiration :)
These are special actions you can use in the module declaration to create sitemaps, breadcrumbs and so on...
To embed a video inside an HVA template, you can use the "embedvideo" action:
{cms_module module="HostedVideoAlbums" action="embedvideo" item=$item}
The "item=$item" parameter is mandatory.
You may use the action "link" to create a link to the default action, using the same parameters:
{cms_module module="HostedVideoAlbums" action="link" what="video" random="1"}
would create a link to a random element of this level.
You may use the action "sitemap" to create a video sitemap:
{cms_module module="HostedVideoAlbums" action="sitemap"}
You can select the levels using the "what" parameter, and may select more than one using "|" : what="level1|level2".
Other available parameters for this action are "detailpage" and "inline".
This will help you include the module entries to a google sitemap, provided that your elements are all displayed on the same page.
*** If you are using the google sitemap generator module ***
Open your sitemap generator (gsitemap.php), and just before the closure of the urlset (echo ' <>/urlset>'. "\\n";), add the following lines:
$modulename = "HostedVideoAlbums";
if( isset($gCms->modules[$modulename]) && $gCms->modules[$modulename]["active"] && $themodule = $gCms->modules[$modulename]["object"]){
// HERE YOU MUST PUT THE ID OR ALIAS OF THE PAGE USED TO DISPLAY THE MODULE ELEMENTS:
$detailpage = "MYPAGE";
$params = array("mode"=>"google", "detailpage"=>$detailpage);
$themodule->DoAction("sitemap", "", $params);
}
Of course, enter a detailpage, be it an id or page alias.
Note that you could also use the "what" parameter to specify which levels you wish to see displayed (you can specify several levels with "level1|level2" and so on). Otherwise, all levels will be displayed.
*** If you are using the SiteMap Made Simple module ***Simply put the code above in a UDT (user-defined-tag), and call the UDT at the end of your sitemap's template, just before <>/urlset>.
You may use the action "search" to display a search form:
{cms_module module="HostedVideoAlbums" action="search"}
Use the "searchmode" parameter to switch between advanced (default) and simple mode. You may specify the level in which to search using the "what" parameter. You cannot use the advanced search mode in all levels at the same time.
The following parameters can be used with the search action: what, limit, nbperpage, orderby, detailpage, listtemplate, inline, searchmode.
See HostedVideoAlbums/templates/search.tpl to modify the search form.
This module has been originally created with CTLModuleMaker and modified after, and is released under the GNU Public License.