Новости Joomla

0 Пользователей и 1 Гость просматривают эту тему.
  • 7 Ответов
  • 2242 Просмотров
*

Santana

  • Осваиваюсь на форуме
  • 20
  • 1 / 0
Вопрос по Groupjive 2.0.1
« : 18.10.2011, 03:26:58 »
Установил на сайт плагин  Groupjive 2.0.1, имею пару-тройку вопросов:
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 . '&nbsp;' . $override_user_p );
$list_publish[] = moscomprofilerHTML::makeOption( '1', '.&nbsp;-&nbsp;' . $override_group_s . '&nbsp;' . $override_mod_p );
$list_publish[] = moscomprofilerHTML::makeOption( '2', '.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;' . $override_group_s . '&nbsp;' . $override_admin_p );
$list_publish[] = moscomprofilerHTML::makeOption( '3', '.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;' . $override_group_s . '&nbsp;' . $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;
}

« Последнее редактирование: 18.10.2011, 03:43:14 от Santana »
*

Santana

  • Осваиваюсь на форуме
  • 20
  • 1 / 0
Re: Вопрос по Groupjive 2.0.1
« Ответ #1 : 18.10.2011, 03:37:13 »
вторая часть кода....
      
Код
		return $return;
}

public function setParam( $group, $user, $plugin ) {
$params = $group->getParams();

$params->set( 'video_show', cbGetParam( $_POST, 'video_show', 1 ) );
$params->set( 'video_public', cbGetParam( $_POST, 'video_public', 1 ) );
$params->set( 'video_publish', cbGetParam( $_POST, 'video_publish', 1 ) );

$group->params = trim( $params->toIniString() );

if ( ! $group->store() ) {
trigger_error( CBTxt::P( '[element] - setParam SQL Error: [error]', array( '[element]' => $plugin->element, '[error]' => $group->getError() ) ) );
}
}

public function getConfig( $user, $plugin ) {
$input = array();

$input['video_paging'] = moscomprofilerHTML::yesnoSelectList( 'video_paging', null, $plugin->params->get( 'video_paging', 1 ), CBTxt::T( 'Enable' ), CBTxt::T( 'Disable' ) );
$input['video_limitbox'] = moscomprofilerHTML::yesnoSelectList( 'video_limitbox', null, $plugin->params->get( 'video_limitbox', 1 ), CBTxt::T( 'Enable' ), CBTxt::T( 'Disable' ) );
$input['video_search'] = moscomprofilerHTML::yesnoSelectList( 'video_search', null, $plugin->params->get( 'video_search', 1 ), CBTxt::T( 'Enable' ), CBTxt::T( 'Disable' ) );
$input['video_width'] = '<input type="text" id="video_width" name="video_width" value="' . htmlspecialchars( $plugin->params->get( 'video_width', 400 ) ). '" class="inputbox" size="7" />';
$input['video_height'] = '<input type="text" id="video_height" name="video_height" value="' . htmlspecialchars( $plugin->params->get( 'video_height', 300 ) ). '" class="inputbox" size="7" />';
$input['video_captcha'] = moscomprofilerHTML::yesnoSelectList( 'video_captcha', null, $plugin->params->get( 'video_captcha', 0 ), CBTxt::T( 'Enable' ), CBTxt::T( 'Disable' ) );

$return = '<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
. '<thead>'
. '<tr>'
. '<th colspan="3">' . CBTxt::Th( 'Video Integration' ). '</th>'
. '</tr>'
. '</thead>'
. '<tbody>'
. '<tr>'
. '<th width="15%">' . CBTxt::Th( 'Paging' ). '</th>'
. '<td width="40%">' . $input['video_paging'] . '</td>'
. '<td>' . CBTxt::Th( 'Enable or disable usage of paging on Videos tab. If disabled will also disable Page Limit.' ). '</td>'
. '</tr>'
. '<tr>'
. '<th width="15%">' . CBTxt::Th( 'Page Limit' ). '</th>'
. '<td width="40%">' . $input['video_limitbox'] . '</td>'
. '<td>' . CBTxt::Th( 'Enable or disable usage of page limit on Videos tab.' ). '</td>'
. '</tr>'
. '<tr>'
. '<th width="15%">' . CBTxt::Th( 'Search' ). '</th>'
. '<td width="600px">' . $input['video_search'] . '</td>'
. '<td>' . CBTxt::Th( 'Enable or disable usage of searching on Videos tab.' ). '</td>'
. '</tr>'
. '<tr>'
. '<th width="15%">' . CBTxt::Th( 'Width' ). '</th>'
. '<td width="600px">' . $input['video_width'] . '</td>'
. '<td>' . CBTxt::Th( 'Input default width of videos shown on groups Videos tab.' ). '</td>'
. '</tr>'
. '<tr>'
. '<th width="15%">' . CBTxt::Th( 'Height' ). '</th>'
. '<td width="600px">' . $input['video_height'] . '</td>'
. '<td>' . CBTxt::Th( 'Input default height of videos shown on groups Videos tab.' ). '</td>'
. '</tr>'
. '<tr>'
. '<th width="15%">' . CBTxt::Th( 'Captcha' ). '</th>'
. '<td width="40%">' . $input['video_captcha'] . '</td>'
. '<td>' . CBTxt::Th( 'Enable or disable usage of Captcha on Video tab. Requires latest CB Captcha or integrated Captcha to be installed and published. Moderators are exempt from this configuration.' ). '</td>'
. '</tr>'
. '</tbody>'
. '</table>';

return $return;
}

public function leaveGroup( $row, $group, $category, $user, $plugin ) {
$this->deleteUserVideos( $user, $group );
}

public function deleteUser( $user, $deleted ) {
$this->deleteUserVideos( $user );
}

private function deleteUserVideos( $user, $group = null ) {
global $_CB_database;

$query = 'DELETE'
. "\n FROM " . $_CB_database->NameQuote( '#__groupjive_plugin_video' )
. "\n WHERE " . $_CB_database->NameQuote( 'user_id' ). " = " . (int) $user->id
. ( $group ? "\n AND " . $_CB_database->NameQuote( 'group' ). " = " . (int) $group->id : null );
$_CB_database->setQuery( $query );
$_CB_database->query();
}

private function getPublishAccess( $group, $category, $user, $plugin ) {
$params = $group->getParams();
$access = $params->get( 'video_publish', 1 );
$authorized = cbgjClass::getAuthorization( $category, $group, $group->user_id );

if ( ( $access == 0 ) && in_array( 'mod_lvl5', $authorized ) ) {
return true;
} elseif ( ( $access == 1 ) && in_array( 'mod_lvl4', $authorized ) ) {
return true;
} elseif ( ( $access == 2 ) && in_array( 'mod_lvl3', $authorized )) {
return true;
} elseif ( ( $access == 3 ) && in_array( 'mod_lvl2', $authorized ) ) {
return true;
}

return false;
}
}

class cbgjVideo extends comprofilerDBTable {
var $id = null;
var $user_id = null;
var $category = null;
var $group = null;
var $title = null;
var $url = null;
var $caption = null;
var $date = null;

public function cbgjVideo( $db ) {
$this->comprofilerDBTable( '#__groupjive_plugin_video', 'id', $db );
}

public function getEmbed( $width = 400, $height = 300 ) {
$url_domain = preg_replace( '/^(?:(?:\w+\.)*)?(\w+)\..+$/', '\1', parse_url( $this->url, PHP_URL_HOST ) );
$embed = null;

if ( $url_domain ) {
$url_scheme = parse_url( $this->url, PHP_URL_SCHEME );

if ( ! $url_scheme ) {
$url_scheme = ( ( isset( $_SERVER['HTTPS'] ) && ( ! empty( $_SERVER['HTTPS'] ) ) && ( $_SERVER['HTTPS'] != 'off' ) )? 'https' : 'http' );
}

if ( ( ! $width ) || ( ! is_integer( $width ) ) ) {
$width = 400;
}

if ( ( ! $height ) || ( ! is_integer( $height ) ) ) {
$height = 300;
}

switch ( $url_domain ) {
case 'youtube':
if ( preg_match( '%^.*(?:v=|v/)([\w-]+).*%', $this->url, $matches ) ) {
$embed = '<object width="' . $width . '" height="' . $height . '">'
. '<param name="movie" value="' . $url_scheme . '://www.youtube.com/v/' . $matches[1] . '&fs=1&rel=0" />'
. '<param name="allowfullscreen" value="true" />'
. '<param name="allowscriptaccess" value="always" />'
. '<embed src="' . $url_scheme . '://www.youtube.com/v/' . $matches[1] . '&fs=1&rel=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="' . $width . '" height="' . $height . '"></embed>'
. '</object>';
}
break;
case 'veoh':
if ( preg_match( '#^.*(?:watch%3D|watch/)([\w-]+).*#', $this->url, $matches ) ) {
$embed = '<object width="' . $width . '" height="' . $height . '">'
. '<param name="movie" value="' . $url_scheme . '://www.veoh.com/static/swf/webplayer/WebPlayer.swf?version=AFrontend.5.5.3.1004&permalinkId=' . $matches[1] . '&player=videodetailsembedded&videoAutoPlay=0&id=anonymous" />'
. '<param name="allowfullscreen" value="true" />'
. '<param name="allowscriptaccess" value="always" />'
. '<embed src="' . $url_scheme . '://www.veoh.com/static/swf/webplayer/WebPlayer.swf?version=AFrontend.5.5.3.1004&permalinkId=' . $matches[1] . '&player=videodetailsembedded&videoAutoPlay=0&id=anonymous" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="' . $width . '" height="' . $height . '"></embed>'
. '</object>';
}
break;
case 'dailymotion':
if ( preg_match( '%^.*video/([\w-]+).*%', $this->url, $matches ) ) {
$embed = '<object width="' . $width . '" height="' . $height . '">'
. '<param name="movie" value="http://www.dailymotion.com/swf/video/' . $matches[1] . '?additionalInfos=0" />'
. '<param name="allowfullscreen" value="true" />'
. '<param name="allowscriptaccess" value="always" />'
. '<embed src="http://www.dailymotion.com/swf/video/' . $matches[1] . '?additionalInfos=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="' . $width . '" height="' . $height . '"></embed>'
. '</object>';
}
break;
case 'yahoo':
if ( preg_match( '%^.*watch/([\w-]+)/([\w-]+).*%', $this->url, $matches ) ) {
$embed = '<object width="' . $width . '" height="' . $height . '">'
. '<param name="movie" value="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.46" />'
. '<param name="allowfullscreen" value="true" />'
. '<param name="allowscriptaccess" value="always" />'
. '<param name="flashvars" value="id=' . $matches[2] . 'vid=' . $matches[1] . '&embed=1" />'
. '<embed src="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.46" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="' . $width . '" height="' . $height . '" flashvars="id=' . $matches[2] . 'vid=' . $matches[1] . '&embed=1"></embed>'
. '</object>';
}
break;
case 'vimeo':
if ( preg_match( '%^.*(?:clip_id=|/)([\w-]+).*%', $this->url, $matches ) ) {
$embed = '<object width="' . $width . '" height="' . $height . '">'
. '<param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=' . $matches[1] . '&server=vimeo.com&show_title=1&show_byline=1&show_portrait=1&fullscreen=1&autoplay=0&loop=0" />'
. '<param name="allowfullscreen" value="true" />'
. '<param name="allowscriptaccess" value="always" />'
. '<embed src="http://vimeo.com/moogaloop.swf?clip_id=' . $matches[1] . '&server=vimeo.com&show_title=1&show_byline=1&show_portrait=1&fullscreen=1&autoplay=0&loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="' . $width . '" height="' . $height . '"></embed>'
. '</object>';
}
break;
case 'break':
if ( preg_match( '%^.*/([\w-=]+).*%', $this->url, $matches ) ) {
$embed = '<object width="' . $width . '" height="' . $height . '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">'
. '<param name="movie" value="http://embed.break.com/' . $matches[1] . '" />'
. '<param name="allowfullscreen" value="true" />'
. '<param name="allowscriptaccess" value="always" />'
. '<embed src="http://embed.break.com/' . $matches[1] . '" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="' . $width . '" height="' . $height . '"></embed>'
. '</object>';
}
break;
case 'myspace':
if ( preg_match( '/^.*(?:videoid=|m=)([\w-]+).*/', $this->url, $matches ) ) {
$embed = '<object width="' . $width . '" height="' . $height . '">'
. '<param name="movie" value="http://mediaservices.myspace.com/services/media/embed.aspx/m=' . $matches[1] . ',t=1,mt=video" />'
. '<param name="allowfullscreen" value="true" />'
. '<param name="allowscriptaccess" value="always" />'
. '<param name="wmode" value="transparent" />'
. '<embed src="http://mediaservices.myspace.com/services/media/embed.aspx/m=' . $matches[1] . ',t=1,mt=video" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="' . $width . '" height="' . $height . '" wmode="transparent"></embed>'
. '</object>';
}
break;
case 'blip':
if ( preg_match( '%^.*play/([\w-]+).*%', $this->url, $matches ) ) {
$embed = '<object width="' . $width . '" height="' . $height . '">'
. '<param name="movie" value="' . $url_scheme . '://blip.tv/play/' . $matches[1] . '" />'
. '<param name="allowfullscreen" value="true" />'
. '<param name="allowscriptaccess" value="always" />'
. '<embed src="' . $url_scheme . '://blip.tv/play/' . $matches[1] . '" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="' . $width . '" height="' . $height . '"></embed>'
. '</object>';
}
break;
case 'viddler':
if ( preg_match( '%^.*player/([\w-]+).*%', $this->url, $matches ) ) {
$embed = '<object width="' . $width . '" height="' . $height . '">'
. '<param name="movie" value="' . $url_scheme . '://www.viddler.com/player/' . $matches[1] . '/" />'
. '<param name="allowfullscreen" value="true" />'
. '<param name="allowscriptaccess" value="always" />'
. '<param name="flashvars" value="fake=1" />'
. '<embed src="' . $url_scheme . '://www.viddler.com/player/' . $matches[1] . '/" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="' . $width . '" height="' . $height . '" flashvars="fake=1"></embed>'
. '</object>';
}
break;
case 'flickr':
if ( preg_match( '%^.*(?:photo_id=|photos/[\w-]+/)([\w-]+).*%', $this->url, $matches ) ) {
$embed = '<object width="' . $width . '" height="' . $height . '">'
. '<param name="movie" value="http://www.flickr.com/apps/video/stewart.swf?photo_id=' . $matches[1] . '" />'
. '<param name="allowfullscreen" value="true" />'
. '<param name="allowscriptaccess" value="always" />'
. '<embed src="http://www.flickr.com/apps/video/stewart.swf?photo_id=' . $matches[1] . '" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="' . $width . '" height="' . $height . '"></embed>'
. '</object>';
}
break;
case 'metacafe':
if ( preg_match( '%^.*(?:watch/|fplayer/)([\w-]+)/([\w-]+).*%', $this->url, $matches ) ) {
$embed = '<object width="' . $width . '" height="' . $height . '">'
. '<param name="movie" value="http://www.metacafe.com/fplayer/' . $matches[1] . '/' . $matches[2] . '.swf" />'
. '<param name="allowfullscreen" value="true" />'
. '<param name="allowscriptaccess" value="always" />'
. '<param name="flashvars" value="playerVars=showStats=yes|autoPlay=no" />'
. '<embed src="http://www.metacafe.com/fplayer/' . $matches[1] . '/' . $matches[2] . '.swf" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="' . $width . '" height="' . $height . '" flashvars="playerVars=showStats=yes|autoPlay=no"></embed>'
. '</object>';
}
break;
case 'liveleak':
if ( preg_match( '%^.*(?:i=|e/)([\w-]+).*%', $this->url, $matches ) ) {
$embed = '<object width="' . $width . '" height="' . $height . '">'
. '<param name="movie" value="http://www.liveleak.com/e/' . $matches[1] . '" />'
. '<param name="allowfullscreen" value="true" />'
. '<param name="allowscriptaccess" value="always" />'
. '<param name="wmode" value="transparent" />'
. '<embed src="http://www.liveleak.com/e/' . $matches[1] . '" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="' . $width . '" height="' . $height . '" wmode="transparent"></embed>'
. '</object>';
}
break;
case 'gametrailers':
if ( preg_match( '%^.*(?:mid=|video/[\w-]+/)([\w-]+).*%', $this->url, $matches ) ) {
$embed = '<object width="' . $width . '" height="' . $height . '">'
. '<param name="movie" value="http://www.gametrailers.com/remote_wrap.php?mid=' . $matches[1] . '" />'
. '<param name="allowfullscreen" value="true" />'
. '<param name="allowscriptaccess" value="always" />'
. '<param name="quality" value="high" />'
. '<embed src="http://www.gametrailers.com/remote_wrap.php?mid=' . $matches[1] . '" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="' . $width . '" height="' . $height . '" quality="high"></embed>'
. '</object>';
}
break;
case 'hulu':
if ( preg_match( '%^.*embed/([\w-]+).*%', $this->url, $matches ) ) {
$embed = '<object width="' . $width . '" height="' . $height . '">'
. '<param name="movie" value="http://www.hulu.com/embed/' . $matches[1] . '" />'
. '<param name="allowfullscreen" value="true" />'
. '<param name="allowscriptaccess" value="always" />'
. '<embed src="http://www.hulu.com/embed/' . $matches[1] . '" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="' . $width . '" height="' . $height . '"></embed>'
. '</object>';
}
break;
case 'cnn':
if ( preg_match( '%^.*(?:video/|videoId=)([\w-/.]+)%', $this->url, $matches ) ) {
$embed = '<object width="' . $width . '" height="' . $height . '">'
. '<param name="movie" value="http://i.cdn.turner.com/cnn/.element/apps/cvp/3.0/swf/cnn_416x234_embed.swf?context=embed&videoId=' . $matches[1] . '" />'
. '<param name="allowfullscreen" value="true" />'
. '<param name="allowscriptaccess" value="always" />'
. '<param name="wmode" value="transparent" />'
. '<embed src="http://i.cdn.turner.com/cnn/.element/apps/cvp/3.0/swf/cnn_416x234_embed.swf?context=embed&videoId=' . $matches[1] . '" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="' . $width . '" height="' . $height . '" wmode="transparent"></embed>'
. '</object>';
}
break;
case 'megavideo':
if ( preg_match( '%^.*v/([\w-]+).*%', $this->url, $matches ) ) {
$embed = '<object width="' . $width . '" height="' . $height . '">'
. '<param name="movie" value="http://www.megavideo.com/v/' . $matches[1] . '" />'
. '<param name="allowfullscreen" value="true" />'
. '<param name="allowscriptaccess" value="always" />'
. '<embed src="http://www.megavideo.com/v/' . $matches[1] . '" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="' . $width . '" height="' . $height . '"></embed>'
. '</object>';
}
break;
case 'blogtv':
if ( preg_match( '%^.*(?:/|vb/)([\w-]+).*%', $this->url, $matches ) ) {
$embed = '<object width="' . $width . '" height="' . $height . '">'
. '<param name="movie" value="http://www.blogtv.com/vb/' . $matches[1] . '" />'
. '<param name="allowfullscreen" value="true" />'
. '<param name="allowscriptaccess" value="always" />'
. '<embed src="http://www.blogtv.com/vb/' . $matches[1] . '" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="' . $width . '" height="' . $height . '"></embed>'
. '</object>';
}
break;
case 'expotv':
if ( preg_match( '%^.*(?:/|embed/)([\w-]+).*%', $this->url, $matches ) ) {
$embed = '<object width="' . $width . '" height="' . $height . '">'
. '<param name="movie" value="' . $url_scheme . '://www.expotv.com/video/embed/' . $matches[1] . '" />'
. '<param name="allowfullscreen" value="true" />'
. '<param name="allowscriptaccess" value="always" />'
. '<param name="wmode" value="transparent" />'
. '<embed src="' . $url_scheme . '://www.expotv.com/video/embed/' . $matches[1] . '" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="' . $width . '" height="' . $height . '" wmode="transparent"></embed>'
. '</object>';
}
break;
case 'g4tv':
if ( preg_match( '%^.*(?:videos/|lv3/)([\w-]+).*%', $this->url, $matches ) ) {
$embed = '<object width="' . $width . '" height="' . $height . '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">'
. '<param name="movie" value="http://g4tv.com/lv3/' . $matches[1] . '" />'
. '<param name="allowfullscreen" value="true" />'
. '<param name="allowscriptaccess" value="always" />'
. '<embed src="http://g4tv.com/lv3/' . $matches[1] . '" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="' . $width . '" height="' . $height . '"></embed>'
. '</object>';
}
break;
case 'revver':
if ( preg_match( '%^.*(?:video/|mediaId=)([\w-]+).*%', $this->url, $matches ) ) {
$embed = '<object width="' . $width . '" height="' . $height . '">'
. '<param name="movie" value="http://flash.revver.com/player/1.0/player.swf?mediaId=' . $matches[1] . '" />'
. '<param name="allowfullscreen" value="true" />'
. '<param name="allowscriptaccess" value="always" />'
. '<param name="flashvars" value="allowFullScreen=true" />'
. '<embed src="http://flash.revver.com/player/1.0/player.swf?mediaId=' . $matches[1] . '" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="' . $width . '" height="' . $height . '" flashvars="allowFullScreen=true"></embed>'
. '</object>';
}
break;
case 'spike':
if ( preg_match( '%^.*(?:spike\.com:|video/[\w-]+/)([\w-]+).*%', $this->url, $matches ) ) {
$embed = '<object width="' . $width . '" height="' . $height . '">'
. '<param name="movie" value="http://media.mtvnservices.com/mgid:ifilm:video:spike.com:' . $matches[1] . '" />'
. '<param name="allowfullscreen" value="true" />'
. '<param name="allowscriptaccess" value="always" />'
. '<param name="quality" value="high" />'
. '<param name="flashvars" value="autoPlay=false" />'
. '<embed src="http://media.mtvnservices.com/mgid:ifilm:video:spike.com:' . $matches[1] . '" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="' . $width . '" height="' . $height . '" quality="high" flashvars="autoPlay=false"></embed>'
. '</object>';
}
break;
case 'mtv':
if ( preg_match( '%^.*(?:mtv\.com:|videos/[\w-]+/)([\w-]+).*%', $this->url, $matches ) ) {
if ( preg_match( '%^.*(?:videolist:|/playlist).*%', $this->url ) ) {
$embed = '<object width="' . $width . '" height="' . $height . '">'
. '<param name="movie" value="http://media.mtvnservices.com/mgid:uma:videolist:mtv.com:' . $matches[1] . '" />'
. '<param name="allowfullscreen" value="true" />'
. '<param name="allowscriptaccess" value="always" />'
. '<param name="flashvars" value="configParams=id=' . $matches[1] . '&uri=mgid:uma:videolist:mtv.com:' . $matches[1] . '" />'
. '<embed src="http://media.mtvnservices.com/mgid:uma:videolist:mtv.com:' . $matches[1] . '" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="' . $width . '" height="' . $height . '" flashvars="configParams=id=' . $matches[1] . '&uri=mgid:uma:videolist:mtv.com:' . $matches[1] . '"></embed>'
. '</object>';
} else {
$embed = '<object width="' . $width . '" height="' . $height . '">'
. '<param name="movie" value="http://media.mtvnservices.com/mgid:uma:video:mtv.com:' . $matches[1] . '" />'
. '<param name="allowfullscreen" value="true" />'
. '<param name="allowscriptaccess" value="always" />'
. '<param name="flashvars" value="configParams=vid=' . $matches[1] . '&uri=mgid:uma:video:mtv.com:' . $matches[1] . '" />'
. '<embed src="http://media.mtvnservices.com/mgid:uma:video:mtv.com:' . $matches[1] . '" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="' . $width . '" height="' . $height . '" flashvars="configParams=vid=' . $matches[1] . '&uri=mgid:uma:video:mtv.com:' . $matches[1] . '"></embed>'
. '</object>';
}
}
break;
case 'stupidvideos':
if ( preg_match( '/^.*(?:#|i=)([\w-]+).*/', $this->url, $matches ) ) {
$embed = '<object width="' . $width . '" height="' . $height . '">'
. '<param name="movie" value="http://images.stupidvideos.com/2.0.2/swf/video.swf?sa=1&sk=7&si=2&i=' . $matches[1] . '" />'
. '<param name="allowfullscreen" value="true" />'
. '<param name="allowscriptaccess" value="always" />'
. '<embed src="http://images.stupidvideos.com/2.0.2/swf/video.swf?sa=1&sk=7&si=2&i=' . $matches[1] . '" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="' . $width . '" height="' . $height . '"></embed>'
. '</object>';
}
break;
}
}

return $embed;
}
}
?>
 
« Последнее редактирование: 18.10.2011, 03:41:26 от Santana »
*

AlexSmirnov

  • Завсегдатай
  • 1862
  • 272 / 16
  • Ищите и найдете
Re: Вопрос по Groupjive 2.0.1
« Ответ #2 : 18.10.2011, 03:45:06 »
нет смысла вдаваться в детали пока Вы строите систему на песке.

последней бесплатной версией этого расширения была версия 2.2, да и та была с багами.

моя рекомендация:

для Joomla! 1.5.24 - или покупайте на joomlapolis.com последнюю версию GroupJive 2.4, или тестируйте другое расширение, работающее с Joomla! группами.

Joomla! 1.7.2 работает с произвольно созданными группами из коробки.
# Back the fufalo (особенно ту самую столкершу)! #
# ВАЖНО! Кайфую от удаления присланного в личку спама, почти как от любви (особенно по выходным). #
*

Santana

  • Осваиваюсь на форуме
  • 20
  • 1 / 0
Re: Вопрос по Groupjive 2.0.1
« Ответ #3 : 18.10.2011, 03:57:20 »
нет смысла вдаваться в детали пока Вы строите систему на песке.

последней бесплатной версией этого расширения была версия 2.2, да и та была с багами.

моя рекомендация:

для Joomla! 1.5.24 - или покупайте на joomlapolis.com последнюю версию GroupJive 2.4, или тестируйте другое расширение, работающее с Joomla! группами.

Joomla! 1.7.2 работает с произвольно созданными группами из коробки.

Joomla! 1.7.x еще долго будет сырой, по практике знаю срогать что то все равно придется вручнуюю, не в группах, так где-нибудь еще...так что жду еще советов и рекомендаций
*

AlexSmirnov

  • Завсегдатай
  • 1862
  • 272 / 16
  • Ищите и найдете
Re: Вопрос по Groupjive 2.0.1
« Ответ #4 : 18.10.2011, 04:11:25 »
если говорить чисто о стандартной из коробки Joomla! 1.7, без добавления сторонних расширений, то ее уже спокойно ставят на сайты клиентов, в том числе на сайты для работы с группами.

дело Ваше. если желаете оставаться на 1.5.24, как я уже говорил, ищите нужные расширения.

что касается меня лично, то тема исчерпана.
# Back the fufalo (особенно ту самую столкершу)! #
# ВАЖНО! Кайфую от удаления присланного в личку спама, почти как от любви (особенно по выходным). #
*

Santana

  • Осваиваюсь на форуме
  • 20
  • 1 / 0
Re: Вопрос по Groupjive 2.0.1
« Ответ #5 : 18.10.2011, 04:13:21 »
если говорить чисто о стандартной из коробки Joomla! 1.7, без добавления сторонних расширений, то ее уже спокойно ставят на сайты клиентов, в том числе на сайты для работы с группами.

дело Ваше. если желаете оставаться на 1.5.24, как я уже говорил, ищите нужные расширения.

что касается меня лично, то тема исчерпана.
спасибо за совет, жду помощи от других пользователей
*

Santana

  • Осваиваюсь на форуме
  • 20
  • 1 / 0
Re: Вопрос по Groupjive 2.0.1
« Ответ #6 : 22.10.2011, 22:20:44 »
Ни у кого нет никаких идей?  >:(
*

Santana

  • Осваиваюсь на форуме
  • 20
  • 1 / 0
Re: Вопрос по Groupjive 2.0.1
« Ответ #7 : 25.10.2011, 23:11:44 »
Тишина, как в танке (
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

Вопрос от "Чайника" Форма Авторизации не работает

Автор Jon Silver

Ответов: 4
Просмотров: 1939
Последний ответ 22.04.2014, 18:33:44
от Jon Silver
В админке нет отдельного меню СВ и GroupJive

Автор nick71

Ответов: 1
Просмотров: 1369
Последний ответ 31.01.2013, 00:30:11
от AlexSmirnov
[Новость] Выпуск плагина русской локализации GroupJive 2.5.1 (версия RC1)

Автор AlexSmirnov

Ответов: 0
Просмотров: 6069
Последний ответ 28.04.2012, 02:09:07
от AlexSmirnov
Работа для программистов: Написать модуль под GroupJive v2.4

Автор oazis

Ответов: 0
Просмотров: 1394
Последний ответ 29.11.2011, 22:12:30
от oazis
GroupJive 2.4 - как добавить video.yandex.ru?

Автор oazis

Ответов: 1
Просмотров: 1813
Последний ответ 03.11.2011, 15:15:52
от oazis