Jump to content
View in the app

A better way to browse. Learn more.

IPBMafia.ru - поддержка Invision Community, релизы, темы, плагины и приложения

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Вставить видео из вконтакте ipb 3.4.x

Featured Replies

Posted

Просьба ногами не пинать :) Искал в поиске, ничего не нашел. Вопрос именно по версии вставить ipb 3.4.x

Пробовал один bb код (взятый с этого сайта), но не получилось. При вставке видит видео, но когда сохраняешь сообщение, то просто выводить теги, а саму ссылку или видеоконтент не выводит. Какие есть еще варианты вставить видео с вконтакте?

Просьба ногами не пинать :) Искал в поиске, ничего не нашел. Вопрос именно по версии вставить ipb 3.4.x

Пробовал один bb код (взятый с этого сайта), но не получилось. При вставке видит видео, но когда сохраняешь сообщение, то просто выводить теги, а саму ссылку или видеоконтент не выводит. Какие есть еще варианты вставить видео с вконтакте?

Может я не совсем Вас понял. Проблему с вставкой видео из ВК наблюдаю только в видеосистеме.

Решение простое: -нужно брать не  ссылку для вставки, а брать весь код для вставки и из него уже ссылку, которую вставляем куда нам нужно - хоть в сообщение, хоть в видеосистему и всё будет работать.

Ниже скриншот с тем что нужно брать из кода и вставлять:

post-2481-0-47449200-1405086814.jpg

Вообще со вставкой медиа файлов там постоянно какие то не понятки. К примеру сегодня обнаружил что если в видеосистеме добавляешь более двух кодов вставки с рутуба, то работает только последний добавленый. Остальные отображаються просто ссылками.
Меня это сильно не гнетёт, но как бы тему по Вашему вопросу можно и продолжить. Тут много более умных людей по движку  чем мы с Вами и может кто что ещё отпишет по поводу лечения этих багов по полной. )

  • 3 месяца спустя...
  • 3 недели спустя...

У меня на форуме всё так же не работает. Вот содержимой файла кода - что в нём может быть не таки или я не там рою?

 


if( !class_exists('bbcode_parent_class') )
{
require_once( IPS_ROOT_PATH . 'sources/classes/bbcode/custom/defaults.php' );
}

class bbcode_vkvideo extends bbcode_parent_class implements bbcodePlugin
{
/**
* Constructor
*
* @access public
* @param object Registry object
* @return void
*/
public function __construct( ipsRegistry $registry )
{
$this->currentBbcode = 'vkvideo';

parent::__construct( $registry );
}

/**
* Method that is run before the content is stored in the database
* You are responsible for ensuring you mark the replaced text appropriately so that you
* are able to unparse it, if you wish to have bbcode parsed on save
*
* @access public
* @param string $txt BBCode text from submission to be stored in database
* @return string Formatted content, ready for display
*/
public function preDbParse( $txt )
{
return parent::preDbParse( $txt );
}

/**
* Method that is run before the content is displayed to the user
* This is the safest method of parsing, as the original submitted text is left in tact.
* No markers are necessary if you use parse on display.
*
* @access public
* @param string $txt BBCode/parsed text from database to be displayed
* @return string Formatted content, ready for display
*/
public function preDisplayParse( $txt )
{
return parent::preDisplayParse( $txt );
}

/**
* Do the actual replacement
*
* @access protected
* @param string $txt Parsed text from database to be edited
* @return string BBCode content, ready for editing
*/
protected function _replaceText( $txt )
{
$_tags = $this->_retrieveTags();

foreach( $_tags as $_tag )
{
//-----------------------------------------
// Start building open/close tag
//-----------------------------------------

$open_tag = '[' . $_tag . ']';
$close_tag = '[/' . $_tag . ']';

//-----------------------------------------
// Infinite loop catcher
//-----------------------------------------

$_iteration = 0;

//-----------------------------------------
// Doz I can haz opin tag? Loopy loo
//-----------------------------------------

while( ( $this->cur_pos = stripos( $txt, $open_tag, $this->cur_pos ) ) !== false )
{
//-----------------------------------------
// Stop infinite loops
//-----------------------------------------

if( $_iteration > $this->settings['max_bbcodes_per_post'] )
{
break;
}

$_iteration++;

//-----------------------------------------
// Grab the new position to jump to
//-----------------------------------------

$new_pos = strpos( $txt, ']', $this->cur_pos ) ? strpos( $txt, ']', $this->cur_pos ) : $this->cur_pos + 1;

//-----------------------------------------
// No closing tag
//-----------------------------------------

if( stripos( $txt, $close_tag, $new_pos ) === false )
{
break;
}

//-----------------------------------------
// Grab the content
//-----------------------------------------

$_content = substr( $txt, ($this->cur_pos + strlen($open_tag)), (stripos( $txt, $close_tag, $this->cur_pos ) - ($this->cur_pos + strlen($open_tag))) );

//-----------------------------------------
// If this is a single tag, that's it
//-----------------------------------------

if( $_content )
{
$_content = str_replace ("
", '', $_content);
$_content = str_replace ("n", '', $_content);

/* get vk video url */
preg_match("#__(vk.com)/video_ext.php?oid=(.*)&;id=(.*)&;hash=(.*)"; width=";(.*)"; height=";(.*)";#isU", $_content, $_match);

if ( count( $_match ) > 1 )
{
$_vkvideo['oid'] = $_match[2];
$_vkvideo['id'] = $_match[3];
$_vkvideo['hash'] = $_match[4];
$_vkvideo['width'] = $_match[5];
$_vkvideo['height']= $_match[6];
$txt = substr_replace( $txt, $this->_buildOutput( $_vkvideo ), $this->cur_pos, (stripos( $txt, $close_tag, $this->cur_pos ) + strlen($close_tag) - $this->cur_pos) );
}
}
else
{
$txt = substr_replace( $txt, '', $this->cur_pos, (stripos( $txt, $close_tag, $this->cur_pos ) + strlen($close_tag) - $this->cur_pos) );
}

//-----------------------------------------
// And reset current position to end of open tag
//-----------------------------------------

$this->cur_pos = stripos( $txt, $open_tag ) ? stripos( $txt, $open_tag ) : $this->cur_pos + 1; //$new_pos;

if( $this->cur_pos > strlen($txt) )
{
//-----------------------------------------
// Need to reset for next "tag"
//-----------------------------------------

$this->cur_pos = 0;
break;
}
}
}

return $txt;
}

/**
* Build the actual output to show
*
* @access private
* @param array $content Image URL to link to
* @return string Content to replace bbcode with
*/
private function _buildOutput( $content )
{
return "";
}
}


В итоге получаю такое

 

 

post-13348-0-44440300-1416899489_thumb.p

У меня на форуме всё так же не работает. Вот содержимой файла кода - что в нём может быть не таки или я не там рою?

В итоге получаю такое

Где Вы в постах, в которых приводится решение, нашли что-нибудь про тег [vkvideo]? Он тут вообще не нужен. И вставлять нужно только ссылку, без всяких там iframe'ов

  • 6 месяцев спустя...

Где Вы в постах, в которых приводится решение, нашли что-нибудь про тег [vkvideo]? Он тут вообще не нужен. И вставлять нужно только ссылку, без всяких там iframe'ов

И твой вариант тоже не работает 

Edited by WOLF

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Ответить в этой теме...

Последние посетители 0

  • No registered users viewing this page.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.