1. Подскажите, кто - нибудь из понимающих, что прописать в файле (прикреплен), чтобы можно было загружать и было видно на странице видео vkontakte.
2. Есть ли плагин (вкладка) для загрузки аудио Groupjive .
и....
3. При попытке вставить какой либо код (например youtube) в в кладку "стена" или "описание группы" код или не сохраняется или просто не показывает видео. Я знаю, что в Joomla есть такая фишка, типа "черный список" и т.д. - на сайте в статьях коды сохраняются, я настроил, видимо где-то в самой Groupjive запрет еще есть, мож знает кто, где? Все установки в которые смог добраться прверил....
Буду очень признательно за ответы по существу.
<?php
if ( ! ( defined( '_VALID_CB' ) || defined( '_JEXEC' ) || defined( '_VALID_MOS' ) ) ) {
die( 'Direct Access to this location is not allowed.' );
}
global $_PLUGINS;
$_PLUGINS->registerFunction( 'gj_onAfterDeleteCategory', 'deleteCategoryVideos', 'cbgjvideoPlugin' );
$_PLUGINS->registerFunction( 'gj_onBeforeGroupTab', 'getVideos', 'cbgjvideoPlugin' );
$_PLUGINS->registerFunction( 'gj_onAfterDeleteGroup', 'deleteGroupVideos', 'cbgjvideoPlugin' );
$_PLUGINS->registerFunction( 'gj_onGroupEdit', 'getParam', 'cbgjvideoPlugin' );
$_PLUGINS->registerFunction( 'gj_onConfigIntegrations', 'getConfig', 'cbgjvideoPlugin' );
$_PLUGINS->registerFunction( 'gj_onPluginFE', 'getPluginFE', 'cbgjvideoPlugin' );
$_PLUGINS->registerFunction( 'gj_onAfterCreateGroup', 'setParam', 'cbgjvideoPlugin' );
$_PLUGINS->registerFunction( 'gj_onAfterUpdateGroup', 'setParam', 'cbgjvideoPlugin' );
$_PLUGINS->registerFunction( 'gj_onAfterDeleteUser', 'leaveGroup', 'cbgjvideoPlugin' );
$_PLUGINS->registerFunction( 'onAfterDeleteUser', 'deleteUser', 'cbgjvideoPlugin' );
class cbgjvideoPlugin extends cbPluginHandler {
public function getPluginFE( $params, $user, $plugin ) {
if ( $params[0] && $params[1] ) {
switch ( $params[3] ) {
case 'video_edit':
$this->editVideo( $params[0], $params[1], $params[2], $user, $plugin );
break;
case 'video_save':
cbSpoofCheck( 'plugin' );
$this->saveVideo( $params[0], $params[1], $params[2], $user, $plugin );
break;
case 'video_delete':
$this->deleteVideo( $params[0], $params[1], $params[2], $user, $plugin );
break;
}
}
}
public function getVideos( $group, $category, $user, $plugin ) {
global $_CB_database;
$params = $group->getParams();
$video_show = $params->get( 'video_show', 1 );
$video_public = $params->get( 'video_public', 1 );
$authorized = cbgjClass::getAuthorization( $category, $group, $group->user_id );
if ( ( ! $video_public && ! in_array( 'mod_lvl5', $authorized ) ) || ! $video_show ) {
return;
}
cbgjClass::getTemplate( 'cbgroupjivevideo' );
$paging = new cbgjPaging( 'video' );
$limit = $paging->getlimit( 2 );
$limitstart = $paging->getLimistart();
$search = $paging->getFilter( 'search' );
$where = array();
if ( isset( $search ) && ( $search != '' ) ) {
$where[] = '( ' . $_CB_database->NameQuote( 'url' ). ' LIKE ' . $_CB_database->Quote( '%' . $_CB_database->getEscaped( $search, true ). '%', false ). ' )';
}
$query = 'SELECT COUNT(*)'
. "\n FROM " . $_CB_database->NameQuote( '#__groupjive_plugin_video' )
. "\n WHERE " . $_CB_database->NameQuote( 'category' ). " = " . (int) $category->id
. "\n AND " . $_CB_database->NameQuote( 'group' ). " = " . (int) $group->id
. ( count( $where )? "\n AND " . implode( "\n AND ", $where ) : null );
$_CB_database->setQuery( $query );
$total = $_CB_database->loadResult();
if ( $total <= $limitstart ) {
$limitstart = 0;
}
$pageNav = $paging->getPageNav( $total, $limitstart, $limit );
$query = 'SELECT ' . $_CB_database->NameQuote( 'id' )
. "\n FROM " . $_CB_database->NameQuote( '#__groupjive_plugin_video' )
. "\n WHERE " . $_CB_database->NameQuote( 'category' ). " = " . (int) $category->id
. "\n AND " . $_CB_database->NameQuote( 'group' ). " = " . (int) $group->id
. ( count( $where )? "\n AND " . implode( "\n AND ", $where ) : null )
. "\n ORDER BY " . $_CB_database->NameQuote( 'date' ). " DESC"
. "\n LIMIT " . (int) $pageNav->limitstart . ", " . (int) $pageNav->limit;
$_CB_database->setQuery( $query );
$rows = $_CB_database->loadResultArray();
$pageNav->search = $paging->getInputSearch( 'gjForm_video', 'search', CBTxt::T( 'Search Videos...' ), $search );
$pageNav->searching = ( $search ? true : false );
if ( class_exists( 'HTML_cbgroupjivevideo' ) ) {
return HTML_cbgroupjivevideo::showVideos( $rows, $pageNav, $group, $category, $user, $plugin );
} else {
return $this->showVideos( $rows, $pageNav, $group, $category, $user, $plugin );
}
}
private function showVideos( $rows, $pageNav, $group, $category, $user, $plugin ) {
global $_CB_framework, $_CB_database;
$_CB_framework->document->addHeadStyleSheet( $plugin->livePath . '/plugins/cbgroupjivevideo/cbgroupjivevideo.css' );
$display_search = $plugin->params->get( 'video_search', 1 );
$display_paging = $plugin->params->get( 'video_paging', 1 );
$display_limitbox = $plugin->params->get( 'video_limitbox', 1 );
$video_width = $plugin->params->get( 'video_width', 400 );
$video_height = $plugin->params->get( 'video_height', 300 );
$display_captcha = $plugin->params->get( 'video_captcha', 0 );
$group_toggle = $plugin->params->get( 'group_toggle', 3 );
$override_group_s = CBTxt::T( $plugin->params->get( 'override_group_s', 'Group' ) );
$form_url = cbgjClass::getPluginURL( array( 'plugin', 'video_save', $category->id, $group->id ) );
$group_url = cbgjClass::getPluginURL( array( 'groups', 'show', $category->id, $group->id ) );
$authorized = cbgjClass::getAuthorization( $category, $group, $group->user_id );
$canPublish = $this->getPublishAccess( $group, $category, $user, $plugin );
$tabs = new cbTabs( 1, 1 );
$return = $tabs->startTab( 'tabVideo', htmlspecialchars( CBTxt::T( 'Videos' ) ), $plugin->element . 'Group' . $plugin->id . $category->id . $group->id . 'Videos' )
. '<div class="gjVideo">';
if ( $canPublish ) {
if ( $display_captcha && ( ! in_array( 'usr_mod', $authorized ) ) ) {
$captcha = cbgjCaptcha::render();
} else {
$captcha = false;
}
$return .= '<form action="' . $form_url . '" method="post" enctype="multipart/form-data" name="gjForm_videonew" id="gjForm_videonew" class="gjForm">'
. '<div class="gjTabHead">'
. '<div class="gjEdit">'
. '<div class="gjEditContent">'
. '<div class="gjEditContentInput">'
. '<div class="gjEditContentInputTitle">' . CBTxt::Th( 'Title' ). '</div>'
. '<div class="gjEditContentInputField">'
. '<input type="text" size="35" class="inputbox" value="" name="video_title" id="video_title" />'
. '<span class="gjEditContentInputIcon">'
. cbgjClass::getIcon( CBTxt::Th( 'Optionally input video title. Titles will link directly to video. Only plain text is supported. HTML and other elements will be removed.' ) )
. '</span>'
. '</div>'
. '<div class="gjClr"></div>'
. '</div>'
. '<div class="gjEditContentInput">'
. '<div class="gjEditContentInputTitle"><div>' . CBTxt::Th( 'URL' ). '</div><div><small>' . CBTxt::Th( '(required)' ). '</small></div></div>'
. '<div class="gjEditContentInputField">'
. '<input type="text" size="35" class="inputbox" value="" name="video_url" id="video_url" />'
. '<span class="gjEditContentInputIcon">'
. cbgjClass::getIcon( CBTxt::Th( 'Input video URL. Only plain text is supported. HTML and other elements will be removed. Please note not all video providers are supported.' ) )
. '</span>'
. '</div>'
. '<div class="gjClr"></div>'
. '</div>'
. '<div class="gjEditContentInput">'
. '<div class="gjEditContentInputTitle">' . CBTxt::Th( 'Caption' ). '</div>'
. '<div class="gjEditContentInputField">'
. '<textarea id="video_caption" name="video_caption" class="inputbox" cols="30" rows="2"></textarea>'
. '<span class="gjEditContentInputIcon">'
. cbgjClass::getIcon( CBTxt::Th( 'Optionally input video caption. Only plain text is supported. HTML and other elements will be removed.' ) )
. '</span>'
. '</div>'
. '<div class="gjClr"></div>'
. '</div>';
if ( $captcha !== false ) {
$return .= '<div class="gjEditContentInput">'
. '<div class="gjEditContentInputTitle"><div>' . CBTxt::Th( 'Captcha' ). '</div><div><small>' . CBTxt::Th( '(required)' ). '</small></div></div>'
. '<div class="gjEditContentInputField">'
. '<div style="margin-bottom: 5px;">' . $captcha['code'] . '</div>'
. '<div>' . $captcha['input'] . '</div>'
. '</div>'
. '<div class="gjClr"></div>'
. '</div>';
}
$return .= '</div>'
. '<input type="submit" value="' . htmlspecialchars( CBTxt::T( 'Publish' ) ). '" class="gjButton gjButtonSubmit" />'
. '</div>';
if ( $group_toggle > 1 ) {
$return .= '<div class="gjTabHeadToggle">'
. '<a href="javascript: void(0);" class="gjTabHeadToggleExpand">' . CBTxt::Th( 'Expand New Video' ). '</a>'
. '<a href="javascript: void(0);" class="gjTabHeadToggleCollapse">' . CBTxt::Th( 'Collapse New Video' ). '</a>'
. '</div>';
}
$return .= '</div>'
. cbGetSpoofInputTag( 'plugin' )
. '</form>';
}
$return .= '<form action="' . $group_url . '" method="post" name="gjForm_video" id="gjForm_video" class="gjVideo_form">'
. '<div class="gjMain">'
. '<div class="gjMainTitle">'
. ( $display_paging && $display_limitbox ? '<div class="gjMainTitleDisplay">' . $pageNav->getLimitBox(). '</div>' : null )
. ( $display_search ? '<div class="gjMainTitleSearch">' . $pageNav->search . '</div>' : null )
. '<div class="gjClr"></div>'
. '</div>';
if ( $rows ) foreach ( $rows as $row_id ) {
$row = new cbgjVideo( $_CB_database );
if ( $row_id ) {
$row->load( (int) $row_id );
}
$edit_url = cbgjClass::getPluginURL( array( 'plugin', 'video_edit', $category->id, $group->id, $row->id ) );
$delete_url = cbgjClass::getPluginURL( array( 'plugin', 'video_delete', $category->id, $group->id, $row->id ), CBTxt::T( 'Are you sure you want to delete this video?' ) );
$authorized = cbgjClass::getAuthorization( $category, $group, $row->user_id );
$edit = '<a href="' . $edit_url . '"><img src="' . $plugin->livePath. '/images/edit.png" alt="' . htmlspecialchars( CBTxt::T( 'Edit' ) ). '" /></a>';
$delete = '<a href="javascript: void(0);" onclick="' . $delete_url . '"><img src="' . $plugin->livePath. '/images/unpublish.png" alt="' . htmlspecialchars( CBTxt::T( 'Delete' ) ). '" /></a>';
$return .= '<div class="gjMainVideo">'
. ( $row->title ? '<div class="gjMainVideoTitle"><a href="' . $row->url . '" target="_blank">' . htmlspecialchars( $row->title ). '</a></div>' : null )
. '<div class="gjMainVideoURL">'
. $row->getEmbed( $video_width, $video_height )
. '</div>'
. ( $row->caption ? '<div class="gjMainVideoCaption">' . htmlspecialchars( $row->caption ). '</div>' : null )
. '<div class="gjMainVideoMenu">'
. ( array_intersect( array( 'mod_lvl3', 'usr_me' ), $authorized )? $edit : null )
. ( array_intersect( array( 'mod_lvl4', 'usr_me' ), $authorized )? $delete : null )
. '</div>'
. '<div class="gjClr"></div>'
. '</div>';
} else {
if ( $display_search && $pageNav->searching ) {
$return .= CBTxt::Th( 'No video search results found.' );
} else {
$return .= CBTxt::Ph( 'This [group] has no videos.', array( '[group]' => $override_group_s ) );
}
}
$return .= '<div class="gjClr"></div>'
. '<div class="gjMainPaging">' . ( $display_paging ? $pageNav->getPagesLinks() : null ). '</div>'
. '</div>'
. cbGetSpoofInputTag( 'plugin' )
. '</form>'
. '</div>'
. $tabs->endTab();
return $return;
}
private function editVideo( $catid, $grpid, $id, $user, $plugin ) {
global $_CB_framework, $_CB_database;
$override_category_s = $plugin->params->get( 'override_category_s', 'Category' );
$override_group_s = $plugin->params->get( 'override_group_s', 'Group' );
$video_width = $plugin->params->get( 'video_width', 400 );
$video_height = $plugin->params->get( 'video_height', 300 );
$general_title = CBTxt::T( $plugin->params->get( 'general_title', $plugin->name ) );
$override_category_p = CBTxt::T( $plugin->params->get( 'override_category_p', 'Categories' ) );
$override_overview_s = CBTxt::T( $plugin->params->get( 'override_overview_s', 'Overview' ) );
$category = new cbgjCategory( $_CB_database );
if ( $catid ) {
$category->load( (int) $catid );
}
$group = new cbgjGroup( $_CB_database );
if ( $grpid ) {
$group->load( (int) $grpid );
}
$row = new cbgjVideo( $_CB_database );
if ( $id ) {
$row->load( (int) $id );
}
$authorized = cbgjClass::getAuthorization( $category, $group, $row->user_id );
if ( $row->id && in_array( 'grp', $authorized ) && array_intersect( array( 'mod_lvl3', 'usr_me' ), $authorized ) ) {
cbgjClass::getTemplate( 'cbgroupjivevideo_edit' );
$plugin_url = cbgjClass::getPluginURL();
$overview_url = cbgjClass::getPluginURL( array( 'overview' ) );
$category_url = cbgjClass::getPluginURL( array( 'categories', 'show', $category->id ) );
$group_url = cbgjClass::getPluginURL( array( 'groups', 'show', $category->id, $group->id ) );
$form_url = cbgjClass::getPluginURL( array( 'plugin', 'video_save', $category->id, $group->id, $row->id ) );
$cancel_url = cbgjClass::getPluginURL( array( 'groups', 'show', $category->id, $group->id ), CBTxt::T( 'Are you sure you want to cancel? All unsaved data will be lost!' ) );
$page_title = CBTxt::T( 'Edit Video' );
$_CB_framework->setPageTitle( $page_title );
if ( $general_title != '' ) {
$_CB_framework->appendPathWay( $general_title, $plugin_url );
}
$_CB_framework->appendPathWay( $override_category_p . ' ' . $override_overview_s, $overview_url );
$_CB_framework->appendPathWay( htmlspecialchars( $category->name ), $category_url );
$_CB_framework->appendPathWay( htmlspecialchars( $group->name ), $group_url );
$_CB_framework->appendPathWay( $page_title, $group_url );
$input = array();
$input['title'] = '<input type="text" size="35" class="inputbox" value="' . htmlspecialchars( $row->title ). '" name="video_title" id="video_title" />';
$input['url'] = '<input type="text" size="35" class="inputbox" value="' . $row->url . '" name="video_url" id="video_url" />';
$input['caption'] = '<textarea id="video_caption" name="video_caption" class="inputbox" cols="30" rows="2">' . htmlspecialchars( $row->caption ). '</textarea>';
if ( class_exists( 'HTML_cbgroupjivevideoEdit' ) ) {
$return = HTML_cbgroupjivevideoEdit::showVideoEdit( $row, $input, $group, $category, $user, $plugin );
} else {
$return = '<div class="gjGroupEdit">'
. '<form action="' . $form_url . '" method="post" enctype="multipart/form-data" name="gjForm" id="gjForm" class="gjForm">'
. '<div class="gjEdit">'
. '<div class="gjEditTitle">' . $page_title . '</div>'
. '<div class="gjEditContent">'
. '<div class="gjEditContentInput">'
. '<div class="gjEditContentInputTitle">' . CBTxt::Th( 'Title' ). '</div>'
. '<div class="gjEditContentInputField">'
. $input['title']
. '<span class="gjEditContentInputIcon">'
. cbgjClass::getIcon( CBTxt::Th( 'Optionally input video title. Titles will link directly to video. Only plain text is supported. HTML and other elements will be removed.' ) )
. '</span>'
. '</div>'
. '<div class="gjClr"></div>'
. '</div>'
. '<div class="gjEditContentInput">'
. '<div class="gjEditContentInputTitle"><div>' . CBTxt::Th( 'URL' ). '</div><div><small>' . CBTxt::Th( '(required)' ). '</small></div></div>'
. '<div class="gjEditContentInputField">'
. '<div style="margin-bottom: 10px;">' . $row->getEmbed( $video_width, $video_height ). '</div>'
. '<div>'
. $input['url']
. '<span class="gjEditContentInputIcon">'
. cbgjClass::getIcon( CBTxt::Th( 'Input video URL. Only plain text is supported. HTML and other elements will be removed. Please note not all video providers are supported.' ) )
. '</span>'
. '</div>'
. '</div>'
. '<div class="gjClr"></div>'
. '</div>'
. '<div class="gjEditContentInput">'
. '<div class="gjEditContentInputTitle">' . CBTxt::Th( 'Caption' ). '</div>'
. '<div class="gjEditContentInputField">'
. $input['caption']
. '<span class="gjEditContentInputIcon">'
. cbgjClass::getIcon( CBTxt::Th( 'Optionally input video caption. Only plain text is supported. HTML and other elements will be removed.' ) )
. '</span>'
. '</div>'
. '<div class="gjClr"></div>'
. '</div>'
. '</div>'
. '<input type="submit" value="' . htmlspecialchars( CBTxt::T( 'Save' ) ). '" class="gjButton gjButtonSubmit" />'
. '<input type="button" value="' . htmlspecialchars( CBTxt::T( 'Cancel' ) ). '" class="gjButton gjButtonCancel" onclick="' . $cancel_url . '" />'
. '</div>'
. cbGetSpoofInputTag( 'plugin' )
. '</form>'
. '</div>';
}
echo $return;
} else {
if ( in_array( 'grp_access', $authorized ) ) {
$url = array( 'groups', 'show', $category->id, $group->id );
$msg = CBTxt::T( 'Not authorized.' );
} elseif ( in_array( 'cat_access', $authorized ) ) {
$url = array( 'categories', 'show', $category->id );
$msg = CBTxt::P( '[group] not found!', array( '[group]' => $override_group_s ) );
} else {
$url = array( 'overview' );
$msg = CBTxt::P( '[category] not found!', array( '[category]' => $override_category_s ) );
}
cbgjClass::getPluginURL( $url, $msg, false, true, 'error' );
}
}
private function saveVideo( $catid, $grpid, $id, $user, $plugin ) {
global $_CB_framework, $_CB_database;
$override_category_s = $plugin->params->get( 'override_category_s', 'Category' );
$override_group_s = $plugin->params->get( 'override_group_s', 'Group' );
$display_captcha = $plugin->params->get( 'video_captcha', 0 );
$category = new cbgjCategory( $_CB_database );
if ( $catid ) {
$category->load( (int) $catid );
}
$group = new cbgjGroup( $_CB_database );
if ( $grpid ) {
$group->load( (int) $grpid );
}
$row = new cbgjVideo( $_CB_database );
if ( $id ) {
$row->load( (int) $id );
}
$authorized = cbgjClass::getAuthorization( $category, $group, $row->user_id );
$canPublish = $this->getPublishAccess( $group, $category, $user, $plugin );
if ( in_array( 'grp', $authorized ) && ( ( $row->id && array_intersect( array( 'mod_lvl3', 'usr_me' ), $authorized ) ) || $canPublish ) ) {
$row->user_id = ( $row->user_id ? (int) $row->user_id : $user->id );
$row->category = ( $row->category ? $row->category : $category->id );
$row->group = ( $row->group ? $row->group : $group->id );
$row->title = trim( strip_tags( stripslashes( cbGetParam( $_POST, 'video_title', null ) ) ) );
$row->url = trim( strip_tags( stripslashes( cbGetParam( $_POST, 'video_url', null ) ) ) );
$row->caption = trim( strip_tags( stripslashes( cbGetParam( $_POST, 'video_caption', null ) ) ) );
$row->date = ( $row->date ? $row->date : cbgjClass::dateDB() );
$video = $row->getEmbed();
if ( $row->url == '' ) {
$error = CBTxt::T( 'URL not specified!' );
} elseif ( ! $row->user_id ) {
$error = CBTxt::T( 'User not specified!' );
} elseif ( ! $row->category ) {
$error = CBTxt::T( 'Category not specified!' );
} elseif ( ! $row->group ) {
$error = CBTxt::T( 'Group not specified!' );
} elseif ( ! $video ) {
$error = CBTxt::T( 'Provider not supported!' );
}
if ( $display_captcha && ( ! $row->id ) && ( ! in_array( 'usr_mod', $authorized ) ) ) {
$captcha = cbgjCaptcha::validate();
if ( $captcha !== true ) {
$error = CBTxt::T( $captcha );
}
}
if ( isset( $error ) ) {
cbgjClass::getPluginURL( array( 'groups', 'show', $category->id, $group->id ), $error, false, true, 'error' );
}
if ( ! $row->store() ) {
cbgjClass::getPluginURL( array( 'groups', 'show', $category->id, $group->id ), CBTxt::P( 'Video failed to save! Error: [error]', array( '[error]' => $row->getError() ) ), false, true, 'error' );
}
cbgjClass::getPluginURL( array( 'groups', 'show', $category->id, $group->id ), CBTxt::T( 'Video saved successfully!' ), false, true );
} else {
if ( in_array( 'grp_access', $authorized ) ) {
$url = array( 'groups', 'show', $category->id, $group->id );
$msg = CBTxt::T( 'Not authorized.' );
} elseif ( in_array( 'cat_access', $authorized ) ) {
$url = array( 'categories', 'show', $category->id );
$msg = CBTxt::P( '[group] not found!', array( '[group]' => $override_group_s ) );
} else {
$url = array( 'overview' );
$msg = CBTxt::P( '[category] not found!', array( '[category]' => $override_category_s ) );
}
cbgjClass::getPluginURL( $url, $msg, false, true, 'error' );
}
}
private function deleteVideo( $catid, $grpid, $id, $user, $plugin ) {
global $_CB_database;
$override_category_s = $plugin->params->get( 'override_category_s', 'Category' );
$override_group_s = $plugin->params->get( 'override_group_s', 'Group' );
$category = new cbgjCategory( $_CB_database );
if ( $catid ) {
$category->load( (int) $catid );
}
$group = new cbgjGroup( $_CB_database );
if ( $grpid ) {
$group->load( (int) $grpid );
}
$row = new cbgjVideo( $_CB_database );
if ( $id ) {
$row->load( (int) $id );
}
$authorized = cbgjClass::getAuthorization( $category, $group, $row->user_id );
if ( $row->id && in_array( 'grp', $authorized ) && array_intersect( array( 'mod_lvl4', 'usr_me' ), $authorized ) ) {
if ( ! $row->delete() ) {
cbgjClass::getPluginURL( array( 'groups', 'show', $category->id, $group->id ), CBTxt::P( 'Video failed to delete! Error: [error]', array( '[error]' => $row->getError() ) ), false, true, 'error' );
}
cbgjClass::getPluginURL( array( 'groups', 'show', $category->id, $group->id ), CBTxt::T( 'Video deleted successfully!' ), false, true );
} else {
if ( in_array( 'grp_access', $authorized ) ) {
$url = array( 'groups', 'show', $category->id, $group->id );
$msg = CBTxt::T( 'Not authorized.' );
} elseif ( in_array( 'cat_access', $authorized ) ) {
$url = array( 'categories', 'show', $category->id );
$msg = CBTxt::P( '[group] not found!', array( '[group]' => $override_group_s ) );
} else {
$url = array( 'overview' );
$msg = CBTxt::P( '[category] not found!', array( '[category]' => $override_category_s ) );
}
cbgjClass::getPluginURL( $url, $msg, false, true, 'error' );
}
}
public function deleteCategoryVideos( $category, $user, $plugin ) {
global $_CB_database;
$query = 'DELETE'
. "\n FROM " . $_CB_database->NameQuote( '#__groupjive_plugin_video' )
. "\n WHERE " . $_CB_database->NameQuote( 'category' ). " = " . (int) $category->id;
$_CB_database->setQuery( $query );
$_CB_database->query();
}
public function deleteGroupVideos( $group, $category, $user, $plugin ) {
global $_CB_database;
$query = 'DELETE'
. "\n FROM " . $_CB_database->NameQuote( '#__groupjive_plugin_video' )
. "\n WHERE " . $_CB_database->NameQuote( 'category' ). " = " . (int) $category->id
. "\n AND " . $_CB_database->NameQuote( 'group' ). " = " . (int) $group->id;
$_CB_database->setQuery( $query );
$_CB_database->query();
}
public function getParam( $group, $category, $user, $plugin ) {
global $_CB_framework;
$override_group_s = CBTxt::T( $plugin->params->get( 'override_group_s', 'Group' ) );
$override_owner_s = CBTxt::T( $plugin->params->get( 'override_owner_s', 'Owner' ) );
$override_mod_p = CBTxt::T( $plugin->params->get( 'override_mod_p', 'Moderators' ) );
$override_admin_p = CBTxt::T( $plugin->params->get( 'override_admin_p', 'Admins' ) );
$override_user_p = CBTxt::T( $plugin->params->get( 'override_user_p', 'Users' ) );
$params = $group->getParams();
$input = array();
$input['video_show'] = moscomprofilerHTML::yesnoSelectList( 'video_show', null, $params->get( 'video_show', 1 ), CBTxt::T( 'Enable' ), CBTxt::T( 'Disable' ) );
$input['video_public'] = moscomprofilerHTML::yesnoSelectList( 'video_public', null, $params->get( 'video_public', 1 ) );
$list_publish = array();
$list_publish[] = moscomprofilerHTML::makeOption( '0', $override_group_s . ' ' . $override_user_p );
$list_publish[] = moscomprofilerHTML::makeOption( '1', '. - ' . $override_group_s . ' ' . $override_mod_p );
$list_publish[] = moscomprofilerHTML::makeOption( '2', '. - ' . $override_group_s . ' ' . $override_admin_p );
$list_publish[] = moscomprofilerHTML::makeOption( '3', '. - ' . $override_group_s . ' ' . $override_owner_s );
$input['video_publish'] = moscomprofilerHTML::selectList( $list_publish, 'video_publish', 'class="inputbox"', 'value', 'text', $params->get( 'video_publish', 1 ), 1, false, false );
if ( $_CB_framework->getUi() == 2 ) {
$return = '<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
. '<thead>'
. '<tr>'
. '<th colspan="3">' . CBTxt::Th( 'Video Integration' ). '</div>'
. '</tr>'
. '</thead>'
. '<tbody>'
. '<tr>'
. '<th width="15%">' . CBTxt::Th( 'Videos' ). '</div>'
. '<td width="40%">' . $input['video_show'] . '</div>'
. '<td>' . CBTxt::Th( 'Select usage of group videos.' ). '</div>'
. '</tr>'
. '<tr>'
. '<th width="15%">' . CBTxt::Th( 'Public' ). '</div>'
. '<td width="40%">' . $input['video_public'] . '</div>'
. '<td>' . CBTxt::Th( 'Select if group video tab is publicly visible.' ). '</div>'
. '</tr>'
. '<tr>'
. '<th width="15%">' . CBTxt::Th( 'Publish' ). '</div>'
. '<td width="40%">' . $input['video_publish'] . '</div>'
. '<td>' . CBTxt::Th( 'Select group publish access. Publish access determines what type of users can publish videos to your group (e.g. Users signify only those a member of your group can publish). The users above the selected will also have access.' ). '</div>'
. '</tr>'
. '</tbody>'
. '</table>';
} else {
cbgjClass::getTemplate( 'cbgroupjivevideo_params' );
if ( class_exists( 'HTML_cbgroupjivevideoParams' ) ) {
$return = HTML_cbgroupjivevideoParams::showVideoParams( $input, $group, $category, $user, $plugin );
} else {
$return = '<div class="gjEditTitle">' . CBTxt::Th( 'Video Integration' ). '</div>'
. '<div class="gjEditContent">'
. '<div class="gjEditContentInput">'
. '<div class="gjEditContentInputTitle">' . CBTxt::Th( 'Videos' ). '</div>'
. '<div class="gjEditContentInputField">'
. $input['video_show']
. '<span class="gjEditContentInputIcon">'
. cbgjClass::getIcon( CBTxt::Ph( 'Select usage of [group] videos.', array( '[group]' => $override_group_s ) ) )
. '</span>'
. '</div>'
. '<div class="gjClr"></div>'
. '</div>'
. '<div class="gjEditContentInput">'
. '<div class="gjEditContentInputTitle">' . CBTxt::Th( 'Public' ). '</div>'
. '<div class="gjEditContentInputField">'
. $input['video_public']
. '<span class="gjEditContentInputIcon">'
. cbgjClass::getIcon( CBTxt::Ph( 'Select if [group] video tab is publicly visible.', array( '[group]' => $override_group_s ) ) )
. '</span>'
. '</div>'
. '<div class="gjClr"></div>'
. '</div>'
. '<div class="gjEditContentInput">'
. '<div class="gjEditContentInputTitle">' . CBTxt::Th( 'Publish' ). '</div>'
. '<div class="gjEditContentInputField">'
. $input['video_publish']
. '<span class="gjEditContentInputIcon">'
. cbgjClass::getIcon( CBTxt::Ph( 'Select [group] publish access. Publish access determines what type of [users] can publish videos to your [group] (e.g. [users] signify only those a member of your [group] can publish). The [users] above the selected will also have access.', array( '[group]' => $override_group_s, '[users]' => $override_user_p ) ) )
. '</span>'
. '</div>'
. '<div class="gjClr"></div>'
. '</div>'
. '</div>';
}
}
return $return;
}