Create a New Video SEO Pattern in Clip-Bucket v2


Bored of the default video SEO patterns Clip-Bucket has? Want your site to look different from all the hundreds of websites using Clip-Bucket? Well, you’ve arrived to the right place! This time I will give you instructions on how to create your customized videos SEO pattern. This was tested under v2.6, yet should work for the whole v2 branch.

+For this example, we will create a pattern like: http://yoursite.tld/V/Our-Video-Title

+Backup all the files to be edited so you can restore changes.

+If you get stuck at any point, please do not hesitate to contact me.

1. Open ./includes/classes/video.class.php
2. Find:

function get_video($vid,$file=false)

3. Replace the former with:

function get_video($vid=NULL,$file=false,$vtit=NULL)

4. Go to line 104 or find:

$results = $db->select(tbl("video,users"),tbl("video.*,$userFields"),tbl("video.videokey='$vid'")." AND ".tbl("video.userid=").tbl("users.userid"));

5. After that paste: (Here we are retrieving the video that has $vtit title):

if($vtit!=NULL) {
                $results = $db->select(tbl("video,users"),tbl("video.*,$userFields"),tbl("video.title='$vtit'")." AND ".tbl("video.userid=").tbl("users.userid"));

** Our whole get_video function should now look like this:

     * Function used to get video data
    function get_video($vid=NULL,$file=false,$vtit=NULL)
        global $db;

        $userFields = "users.userid,users.username,users.avatar,users.avatar_url,";

                $results = $db->select(tbl("video,users"),tbl("video.*,$userFields"),tbl("video.videoid='$vid'")." AND ".tbl("video.userid=").tbl("users.userid"));
                $results = $db->select(tbl("video,users"),tbl("video.*,$userFields"),tbl("video.videokey='$vid'")." AND ".tbl("video.userid=").tbl("users.userid"));

            if($vtit!=NULL) {
                $results = $db->select(tbl("video,users"),tbl("video.*,$userFields"),tbl("video.title='$vtit'")." AND ".tbl("video.userid=").tbl("users.userid"));
            $results = $db->select(tbl("video,users"),tbl("video.*,$userFields"),tbl("video.file_name='$vid'")." AND ".tbl("video.userid=").tbl("users.userid"));

            return $results[0];
            return false;


1. Open ./watch_video.php
2. Find:

$vkey = @$_GET['v']; 
$vdo = $cbvid->get_video($vkey);

3. Replace it with: (Here we are replacing hyphens with spaces from the t var sent by .htaccess)

if(!isset($_GET['t'])) {
    $vkey = @$_GET['v'];
    $vdo = $cbvid->get_video($vkey);
    } else {
    $vtit = str_replace("-"," ",@$_GET['t']);
    $vdo = $cbvid->get_video('',false,$vtit);


1. Open ./includes/functions.php (if you don’t have the functions file separated in functions1, functions2, etc; if you do have the functions file separated, go one by one until you find the code on the next step.)
2. Go to line 872 or find:

$link = BASEURL.'/video/'.$vdetails['videoid'].'_'.SEO(clean(str_replace(' ','-',$vdetails['title']))).$plist;

3. After the next:


which for me is on line 874, add the following case:

case 4:
                    $link = BASEURL.'/V/'.SEO(clean(str_replace(' ','-',$vdetails['title']))).$plist;


1. Open ./.htaccess (may be hidden)
2. Find:

RewriteRule ^video/([0-9]+)_(.*) watch_video.php?v=$1&%{QUERY_STRING} [L]

3. After that, add our new rewrite rule:

RewriteRule ^V/(.*) watch_video.php?t=$1&%{QUERY_STRING} [L]

Now, to be able to select it through the admin_area, do the following:

1. Open ./admin_area/styles/cbv2/layout/main.html
2. Find:


3. After that, add:

                  <input type="radio" name="seo_vido_url" value="4" id="seo_vido_url_4" 
                   {if $row.seo_vido_url==4} checked="checked"{/if}/> 


1. Open phpMyAdmin or any DB Manager you use
2. Execute the following query to make our script use our type 4 of seo pattern (the case we previously added):

UPDATE `cb_config` SET `value` = '4' WHERE `cb_config`.`name` ='seo_vido_url';

*Remember to change cb_ if you changed our table prefix during CB installation.

There you go. Save and Upload everything, overwriting when prompted to. If for any reason you would like to revert changes, just restore from the backup you did at the start. Any question, comment, suggestion is greatly appreciated, so don’t forget to leave it down below at the comments section!

Best Regards,


Looking for quality ClipBucket Hosting? Look no further than Arvixe Web Hosting!

Tags: , , , , , , , , , , , , , , | Posted under ClipBucket | RSS 2.0

Author Spotlight

Richi González

I started programming when I was 12. I'm a Developer and have been working with the Clip-Bucket script since it came out. I'm the Liaison between Arvixe and Clip-Bucket, so anything you need regarding Clip-Bucket or any particular computer-related subject you need, let me know so I can assist you.

Leave a Reply

Your email address will not be published. Required fields are marked *