Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YouTube-like URL format #349

Open
sphynkx opened this issue Mar 9, 2024 · 0 comments
Open

YouTube-like URL format #349

sphynkx opened this issue Mar 9, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@sphynkx
Copy link
Contributor

sphynkx commented Mar 9, 2024

As for old CB, for CBv5 also could configure youtube-like URLs (like https://domain.tld/watch?v=XXXXXXX ). Here is some modifications.

  1. In webserver config (here is sample for Nginx) add some rewrites:
    location / {
          if (!-e $request_filename){
              rewrite ^(.*)$ /$1_video.php;
             }
          try_files $uri $uri/ @rewrite;
    }

    location @rewrite {
          rewrite ^/(.*)$ /index.php;
    }

   location /embed {
          rewrite ^/embed?(.*) /player/embed_player.php?$1$query_string;
   }
  1. Modify includes/functions_video.php:415
<        $link = BASEURL . '/watch_video.php?v=' . $vdetails['videokey'] . $plist;
>        $link = BASEURL . '/watch?v=' . $vdetails['videokey'] . $plist;
  1. Modify includes/classes/video.class.php:1805
<        $embed_code .= 'src="' . BASEURL . '/player/embed_player.php?vid=' . $vdetails['videokey'];
>        $embed_code .= 'src="' . BASEURL . '/player/embed?vid=' . $vdetails['videokey'];
  1. Optionally also it could add creation date under titles of videos. Need to modify styles/cb_28/layout/watch_video.html:26 - aftrer the line
    <h1>{display_clean($video.title)}</h1>
    add line
    <h4>{date('d.m.Y', strtotime($video.datecreated))}</h4>
    Proposition: Make the Youtube-like URL-format as option in site configuration.
@MacWarrior MacWarrior added the enhancement New feature or request label Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants