Add the Category to Window Title When Watching a Video in Clip-Bucket v2


A few days ago, I was asked for a way of displaying the name of the category along with the video title in the <title></title> tags. Here’s the code so everyone can enjoy it! Tested under v2.6.


1. Open ./watch_video.php

2. Find:


and before that, paste:

$catsarr = explode(' ',$vdo['category']); //Explode DB cats, they're in format: #1# #2# #43#
$firstcat = str_replace('#','',$catarr[0]); //Remove #
$catarr = get_category($firstcat); //Fetch cat array
$catname = $catarr['category_name']; //We just need the category name

Assign('catname',$catname); //Assign it so we can use it in our template

3. Save and Upload.

1. Open ./styles/{YOURTEMPLATE}/layout/global_header.html

2. Find:


and replace it with:

<title>{cbtitle}{if $catname} - {$catname}{/if}</title>

3. Save and Upload.

There you go. Whenever you are watching a video, it will display the category name inside the title. If the video pertains to multiple categories, it will just show the first category. Should you have any questions or comments, please post them down below.

Best Regards.


Looking for quality Clip-Bucket hosting? Try out Arvixe and you won’t be disappointed.
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.

2 Comments on Add the Category to Window Title When Watching a Video in Clip-Bucket v2

  1. cavit says:

    On the main page as you guys know there is a profile detail like my videos, account, friend requests etc. And also there is an avatar image located. But mine is not showing the changed avatar, it is showing me only the default avatar image, even though I changed my avatar. So I checked the code:


    What is wrong here?How to fix this please help.

    • Alex says:


      Is this a default Clip-Bucket installation or have you made any modifications?

      Also, it is very possible (and likely) that you’re just viewing a cached copy. Please try clearing your browser and DNS cache and/or trying in a different browser.

      If none of the above helps, feel free to reply.


Leave a Reply

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