mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 09:49:28 +02:00
You can now change the titles without loose the links
The URL Friendly version now uses the video ID as well Also we add some indexes in the video URL and in the filename to speedup the search
This commit is contained in:
parent
ed80a11dfe
commit
e1802adfc9
5 changed files with 23 additions and 3 deletions
|
@ -96,6 +96,8 @@ Options All -Indexes
|
|||
RewriteRule ^video/([A-Za-z0-9-_.]+)/page/([0-9]+)/??$ view/?videoName=$1&page=$2 [QSA]
|
||||
RewriteRule ^v/([0-9]+)/?$ view/?v=$1 [QSA]
|
||||
RewriteRule ^v/([0-9]+)/page/([0-9]+)/??$ view/?v=$1&page=$2 [QSA]
|
||||
RewriteRule ^video/([0-9]+)/([A-Za-z0-9-_.]+)/?$ view/?v=$1 [QSA]
|
||||
RewriteRule ^video/([0-9]+)/([A-Za-z0-9-_.]+)/page/([0-9]+)/??$ view/?v=$1&page=$3 [QSA]
|
||||
|
||||
#for the video name
|
||||
RewriteRule ^cat/([A-Za-z0-9-]+)/video/([A-Za-z0-9-_.]+)/?$ view/?catName=$1&videoName=$2 [QSA]
|
||||
|
@ -105,6 +107,7 @@ Options All -Indexes
|
|||
RewriteRule ^cat/([A-Za-z0-9-_.]+)/videoEmbeded/([A-Za-z0-9-_.]+)/?$ view/videoEmbeded.php?catName=$1&videoName=$2 [QSA]
|
||||
RewriteRule ^videoEmbed/([A-Za-z0-9-_.]+)/?$ view/videoEmbeded.php?videoName=$1 [QSA]
|
||||
RewriteRule ^vEmbed/([0-9]+)/?$ view/videoEmbeded.php?v=$1 [QSA]
|
||||
RewriteRule ^videoEmbed/([0-9]+)/([A-Za-z0-9-_.]+)/?$ view/videoEmbeded.php?v=$1 [QSA]
|
||||
|
||||
RewriteRule ^plugin/([A-Za-z0-9-_.]+)/(.*)?$ plugin/$1/$2 [NC,L]
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ if (file_exists("../videos/configuration.php")) {
|
|||
exit;
|
||||
}
|
||||
|
||||
$installationVersion = "8.0";
|
||||
$installationVersion = "8.1";
|
||||
|
||||
|
||||
header('Content-Type: application/json');
|
||||
|
|
|
@ -142,6 +142,8 @@ CREATE TABLE IF NOT EXISTS `videos` (
|
|||
INDEX `index5` (`order` ASC),
|
||||
INDEX `fk_videos_videos1_idx` (`next_videos_id` ASC),
|
||||
INDEX `fk_videos_sites1_idx` (`sites_id` ASC),
|
||||
INDEX `clean_title_INDEX` (`clean_title` ASC),
|
||||
INDEX `video_filename_INDEX` (`filename` ASC),
|
||||
CONSTRAINT `fk_videos_sites1`
|
||||
FOREIGN KEY (`sites_id`)
|
||||
REFERENCES `sites` (`id`)
|
||||
|
|
|
@ -2552,9 +2552,11 @@ if (!class_exists('Video')) {
|
|||
$clean_title = self::get_clean_title($videos_id);
|
||||
}
|
||||
if ($embed) {
|
||||
return "{$global['webSiteRootURL']}videoEmbed/{$clean_title}{$get_http}";
|
||||
//return "{$global['webSiteRootURL']}videoEmbed/{$clean_title}{$get_http}";
|
||||
return "{$global['webSiteRootURL']}videoEmbed/{$videos_id}/{$clean_title}{$get_http}";
|
||||
} else {
|
||||
return "{$global['webSiteRootURL']}{$cat}video/{$clean_title}{$get_http}";
|
||||
//return "{$global['webSiteRootURL']}{$cat}video/{$clean_title}{$get_http}";
|
||||
return "{$global['webSiteRootURL']}video/{$videos_id}/{$clean_title}{$get_http}";
|
||||
}
|
||||
} else {
|
||||
if (empty($videos_id) && !empty($clean_title)) {
|
||||
|
|
13
updatedb/updateDb.v8.1.sql
Normal file
13
updatedb/updateDb.v8.1.sql
Normal file
|
@ -0,0 +1,13 @@
|
|||
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
|
||||
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
|
||||
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
|
||||
|
||||
ALTER TABLE `videos`
|
||||
ADD INDEX `clean_title_INDEX` (`clean_title` ASC),
|
||||
ADD INDEX `video_filename_INDEX` (`filename` ASC);
|
||||
|
||||
UPDATE configurations SET version = '8.1', modified = now() WHERE id = 1;
|
||||
|
||||
SET SQL_MODE=@OLD_SQL_MODE;
|
||||
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
|
||||
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
|
Loading…
Add table
Add a link
Reference in a new issue