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

Hello,

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.

m1

1. Open ./watch_video.php

2. Find:

assign('vid_cat',$vid_cat);

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:

<title>{cbtitle}</title>

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.

Richi

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

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 became a Liaison between Arvixe and Clip-Bucket, so I am here to assist you with anything you need regarding Clip-Bucket or any particular computer-related subject you need. Best Regards, Richi

Leave a Reply

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


3 − = 2

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>