• Welcome to PHPVIBE Forums. Please log in.

[ Video Sharing CMS v4 ] Reject Duplicate Videos

Started by ClashCorp,

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

ClashCorpTopic starter

The way the script is right now it seems to allow users to submit the same YouTube, Dailymotion, etc. Video multiple times which causes problems. It would be great if when a user tried to submit a video that had already been submitted it would show some sort of reject message, and not except the video.
  •  

PHPVibe A.

Hi, you know how this things go, some want to allow, some want to reject.
It's annoying for the user to reject his video.

Here is a simple function for this:


function has_duplicate($link){
global $db;
if(!nullval($link)) {
$sub = $db->get_row("Select count(*) as nr from ".DB_PREFIX."videos where source  like '".$link."'");
return (bool)$sub->nr;
}


Drop it in lib/functions.php or any other global file.

Then in com/com_share.php

you can do this, for example, after:

if(!$vid->isValid(_post('vfile'))){
return '<div class="msg-warning">'._lang("We don't support yet embeds from that website").'</div>';
}


something like:

if(has_duplicate(_post('vfile'))){
return '<div class="msg-warning">'._lang("This video already exists").'</div>';
}

ClashCorpTopic starter

Thanks! I know its annoying for the users video to get rejected but its even more annoying when the user looks through the suggested videos only to find a list of exactly the same video they just watched. :) Thanks Again!
  •  

Similar topics (7)