/** * Function used to remove video thumbs */ function remove_thumbs($vdetails) { //First lets get list of all thumbs $thumbs = get_thumb($vdetails, 1, true, false, false); if (!is_default_thumb($thumbs)) { if (is_array($thumbs)) { foreach ($thumbs as $thumb) { $file = THUMBS_DIR . '/' . $thumb; if (file_exists($file) && is_file($file)) { unlink($file); } } } else { $file = THUMBS_DIR . '/' . $thumbs; if (file_exists($file) && is_file($file)) { unlink($file); } } e(lang("vid_thumb_removed_msg"), 'm'); } }
/** * Function used to remove video thumbs */ function remove_thumbs($vdetails) { //First lets get list of all thumbs $thumbs = get_thumb($vdetails, 1, true, false, false, true, false); if (!is_default_thumb($thumbs)) { if (is_array($thumbs)) { foreach ($thumbs as $thumb) { if (strstr($thumb, 'timthumb')) { $thumb = $this->convert_tim_thumb_url_to_file($thumb, $file_name = false); } else { $thumb = substr($thumb, 0, -6); } $file = THUMBS_DIR . '/' . $thumb; if (file_exists($file) && is_file($file)) { unlink($file); } } foreach ($thumbs as $thumb) { if (strstr($thumb, 'timthumb')) { $fn = $this->convert_tim_thumb_url_to_file($thumb, $file_name = true); } else { $fn = substr($thumb, 0, -6); } $result = db_select("SELECT * FROM " . tbl("video") . " WHERE file_name = '{$fn}'"); if ($result) { foreach ($result as $result1) { $str = '/' . $result1['file_directory'] . '/'; $file1 = THUMBS_DIR . $str . $thumb; if (file_exists($file1) && is_file($file1)) { unlink($file1); } } } } } else { if (strstr($thumbs, 'timthumb')) { $thumbs_ = $this->convert_tim_thumb_url_to_file($thumbs, $file_name = false); } else { $thumbs_ = substr($thumbs, 0, -6); } $file = THUMBS_DIR . '/' . $thumbs_; if (file_exists($file) && is_file($file)) { unlink($file); } if (strstr($thumbs, 'timthumb')) { $fn = $this->convert_tim_thumb_url_to_file($thumbs, $file_name = true); } else { $fn = substr($thumbs, 0, -6); } $result = db_select("SELECT * FROM " . tbl("video") . " WHERE file_name = '{$fn}'"); if ($result) { foreach ($result as $result1) { $str = '/' . $result1['file_directory'] . '/'; $file1 = THUMBS_DIR . $str . $thumbs; if (file_exists($file1) && is_file($file1)) { unlink($file1); } } } } e(lang("vid_thumb_removed_msg"), 'm'); } }