[ Video Sharing CMS v4 ] PHPVIBER ERROR POST LINK

Started by MacKen,

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MacKenTopic starter

DEMO ERROR: 




FIX: OPEN FILE addvideo.php >> Link: lib/ajax/addvideo.php

Check line: 32 if(_post('type') && _post('file') && ($_FILES['play-img'] || _post('remote-img'))) { //&& ($_FILES['play-img'] || _post('remote-img'))


Replly:

if(_post('type') && _post('file') && _post('title') && _post('duration') && ($_FILES['play-img'] || _post('remote-img'))) { //&& ($_FILES['play-img'] || _post('remote-img'))


P/S:  Temporary substitution

  •  

MacKenTopic starter

Guide: POST LINK YOUTUBE >>> http://youtu.be/6EQ7TMo0RdY


Demo: http://khatvongsong.vn
or
http://khatvongsong.vn/video/vtc14bo-cong-an-triet-de-xoa-cac-bang-nhom-toi-pham-vao-dip-le-304-15-iecwi.html

Steps 1:

Open  file lib/class.providers.php

Line:
define('UNKNOWN_PROVIDER', _lang('Unknown provider or incorrect URL. Please try again.'));
  define('INVALID_URL', _lang('This URL is invalid or the video is removed by the provider.'));

below

inserted

Quotefunction linkifyYouTubeURLs($text) {
    $text = preg_replace('~
        # Match non-linked youtube URL in the wild. (Rev:20130823)
        https?://         # Required scheme. Either http or https.
        (?:[0-9A-Z-]+\.)? # Optional subdomain.
        (?:               # Group host alternatives.
          youtu\.be/      # Either youtu.be,
        | youtube         # or youtube.com or
          (?:-nocookie)?  # youtube-nocookie.com
          \.com           # followed by
          \S*             # Allow anything up to VIDEO_ID,
          [^\w\-\s]       # but char before ID is non-ID char.
        )                 # End host alternatives.
        ([\w\-]{11})      # $1: VIDEO_ID is exactly 11 chars.
        (?=[^\w\-]|$)     # Assert next char is non-ID or EOS.
        (?!               # Assert URL is not pre-linked.
          [?=&+%\w.-]*    # Allow URL (query) remainder.
          (?:             # Group pre-linked alternatives.
            [\'"][^<>]*>  # Either inside a start tag,
          | </a>          # or inside <a> element text contents.
          )               # End recognized pre-linked alts.
        )                 # End negative lookahead assertion.
        [?=&+%\w.-]*        # Consume any URL (query) remainder.
        ~ix',
        //'YouTube link: $1',
      '$1',
        $text);
    return $text;
}


Steps 2:

Line:
case 'youtube':
                  $vid                        = preg_replace('/^.*(\?|\&)v\=/', '', $this->link);
                  $vid                        = preg_replace('/[^\w\-\_].*$/', '', $vid);

Replly:

case 'youtube':
                  //$vid                        = preg_replace('/^.*(\?|\&)v\=/', '', $this->link);
                  //$vid                        = preg_replace('/[^\w\-\_].*$/', '', $vid);
                $vid=linkifyYouTubeURLs(''.$this->link.'');

Steps 3:

Open file  java" : tpl/main/js/phpvibe_app.js

Line:
Quote$(document).ready(function(){
$("#vfile,#remote-img").change(function(e){
  $(this).val($(this).val().replace("http://","www."));
  $(this).val($(this).val().replace("www.www.","www."));
});

Replly:

Quote$(document).ready(function(){
$("#vfile,#remote-img").change(function(e){
  //$(this).val($(this).val().replace("http://","www."));
   $(this).val($(this).val().replace("http://youtu.be/","http://www.youtube.com/watch?v="));
      $(this).val($(this).val().replace("https://www.youtube.com/","http://www.youtube.com/"));
  $(this).val($(this).val().replace("www.www.","http://www."));
});

OK:::  Finish
  •  

PHPVibe A.


Similar topics (7)