[ Video Sharing CMS v4 ] YouTube Image Related

Started by Imran Murtaza,

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Imran MurtazaTopic starter

ImranMurtaza
  •  

Hersh

Depends on where you want to change it. Do you want to do it during import, in the db or just for the video players?

For imports, you have to make changes to /mods/youtube.php and /mods/youtube-1by1.php.
Search for "ytimg" in both scripts and make the changes.

For video player thumbnails, search for "ytimg" in /lib/class.providers.php

If you already have a bunch of videos imported and you want to change those as well, the update the rows in vibe_videos.thumb.

Good luck
  •  

Imran MurtazaTopic starter

Hersh I have changed but it not showing on the site page but only changed in moderator area not in site area.
ImranMurtaza
  •  

Hersh

That is because you already imported the videos. It is in the database, which is why I said this:
QuoteIf you already have a bunch of videos imported and you want to change those as well, the update the rows in vibe_videos.thumb.

You will have to change it in the database.
  •  

Imran MurtazaTopic starter

Hersh I told that new imported video thumbnails are also not working on site page but working in just moderator area. and after import the url is from i.ytimg.com
ImranMurtaza
  •  

Marius P.

there's one function in lib/class.youtube.php


function youtube_import($video=array(), $cat = null, $owner = null) {
global $db;
if(is_null($owner)) {$owner = get_option('importuser','1');}
if(isset($video["videoid"]) && isset($video["title"]) ) {
$video["path"] = 'http://www.youtube.com/watch?v='.$video["videoid"];
//This change
$video["thumbnail"] = 'http://ytimg.googleusercontent.com/vi/'.$video["videoid"].'/mqdefault.jpg';
//End change
$db->query("INSERT INTO ".DB_PREFIX."videos (`pub`,`source`, `user_id`, `date`, `thumb`, `title`, `duration`, `tags` , `views` , `liked` , `category`, `description`, `nsfw`) VALUES 
('".intval(get_option('videos-initial'))."','".$video["path"]."', '".$owner."', now() , '".$video["thumbnail"]."', '".toDb($video["title"]) ."', '".intval($video["duration"])."', '".toDb(_post('tags'))."', '0', '0','".toDb($cat)."','".toDb($video["description"])."','0')");   
//var_dump($video);
} else {
echo '<p><span class="redText">Missing video id or title </span></p>';
}
}



See


//This change
$video["thumbnail"] = 'http://ytimg.googleusercontent.com/vi/'.$video["videoid"].'/mqdefault.jpg';
//End change
Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

Imran MurtazaTopic starter

ImranMurtaza
  •  

3dclassic

Quote from: Hersh on
Depends on where you want to change it. Do you want to do it during import, in the db or just for the video players?

For imports, you have to make changes to /mods/youtube.php and /mods/youtube-1by1.php.
Search for "ytimg" in both scripts and make the changes.

For video player thumbnails, search for "ytimg" in /lib/class.providers.php

If you already have a bunch of videos imported and you want to change those as well, the update the rows in vibe_videos.thumb.

Good luck

where from find vibe_videos.thumb?
  •  

PHPVibe A.

Quote from: 3dclassic on
where from find vibe_videos.thumb?

That's a database structure, vibe_videos (table) thumb (fields)

Similar topics (7)