Related Topics


[Video CMS v4]Meta tags  (Read 2743 times) Print

1 2  All B


alimehdipak  June 22, 2014, 03:09:37 PM

<meta name="keywords" content="bollywoo,celebs,attend,india,party,arbaz,khan" />
<meta property="video:release_date" content="2014-06-19 14:01:17" />
<meta property="video:tag" content="bollywoo,celebs,attend,india,party,arbaz,khan" />
<meta property="video:duration" content="93" />
<meta property="video:director" content="http://tune.pk/user/paulamerica" />
need five tags sir ,
please tell me how to do,
i need for SEO.


Logged


Alexander  June 22, 2014, 03:12:29 PM

If you use the search, you find fast anything on the forum :)

open tpl.global.php and you will find meta tags in the <header>-section

tpl/{your theme}/tpl.globals.php holds all the meta tags.

Logged

alimehdipak  June 22, 2014, 03:23:28 PM

this five mata tag are not in header file.

there is no <meta name="keywords file ,
<meta property="video:release_date"
<meta property="video:tag" content=
<meta property="video:duration"
<meta property="video:director"
i want you made for my site , this is fresh mata tags,
and this kinda of mata tag phpvibe not use , so please tell me how to do it.

Logged


Alexander  June 22, 2014, 03:33:56 PM

Find:


Code
<meta property="og:image" content="'.thumb_fix($video->thumb).'" />

Add/Before after:

Code
<meta name="keywords" content="'.$video->tags.'">
<meta name="video:release_date" content="'.$video->date.'">
<meta name="video:tag" content="'.$video->tags.'">
<meta name="video:duration" content="'.$video->duration.'">
<meta name="video:director" content="???">

Logged

alimehdipak  June 22, 2014, 05:03:52 PM

none of meta tag is working :(

view-source:http://ivod.co/video/1274/aaj-phir-hate-story-2-arijit-singh-full-song/

<meta name="keywords" content="">
<meta name="video:release_date" content="">
<meta name="video:tag" content="">
<meta name="video:duration" content="">
<meta name="video:director" content="???">

Image : http://prntscr.com/3vbsva

Logged


Alexander  June 22, 2014, 05:37:49 PM

Send me your ftp by message.
On the director, not sure what you wanted to put there, this is why I've added "???"

Logged

TigerClaw  June 25, 2014, 10:51:12 PM

How to extract the video url for <meta property="og:video" > ?

Logged


Alexander  June 26, 2014, 02:25:22 PM

How to extract the video url for <meta property="og:video" > ?

For local videos
Code
$source = thumb_fix(get_option('mediafolder').'/'.str_replace("localfile/","",$video->source));

For remote videos

Code
$source = $video->remote;

The rest

Code
$source = $video->source;


Logged

TigerClaw  June 26, 2014, 10:26:24 PM

thank you Alexander. Always spot on!

Logged



TigerClaw  June 27, 2014, 11:57:15 AM

I have inserted the code in tpl.globals.php after

Code
if(isset($video) && $video) {

and it works but how I can differentiate between local videos, remote and the rest?

Thanks!

Logged


Alexander  June 27, 2014, 02:37:20 PM

Code
if(!nullval($video->remote)) {
//It's remote
} else {
//It's source

if (0 === strpos($video->source, 'localfile')) {
   // It is a local video
} else {
//It's a link/embedded
}

}

Logged

alimehdipak  July 02, 2014, 02:05:25 AM

https://support.google.com/webmasters/answer/2413309?hl=en

chema.org VideoObject properties:


Meta Item : duration Recommended The duration of the video in ISO 8601 format.
can please do how to set video Duration in ISO 8601 format.


Thanks

Logged


Alexander  July 02, 2014, 01:19:18 PM

I think...

Instead of

Code
<meta name="video:duration" content="'.$video->duration.'">
This you want to convert, yes?

Place
Code
$date = new DateTime($video->duration);

right after:
Code
if(com() == video) {
global $video;

and on the meta tag change it to

Code
<meta name="video:duration" content="'.$date->format('\P\Ti\Ms\S').'">

Logged

alimehdipak  July 04, 2014, 02:17:47 AM

i did not receive message for this update :(,
and sir i try on this but its not working , after adding the below code the site not even opening ,  and i want for : <meta itemprop="duration" content="'.$video->duration.'" /> for this ,

Thanks

Logged


megaman79  July 04, 2014, 09:46:43 PM

Alexander,

I just read your reply, I need directions to apply this Meta, I don't know much of coding.
I need the peace of code for local and remote videos.

Thanks for this help.

Logged
"Very Happy with PHPVibe"


Alexander  July 05, 2014, 04:16:31 PM

Alexander,

I just read your reply, I need directions to apply this Meta, I don't know much of coding.
I need the peace of code for local and remote videos.

Thanks for this help.

Code
if(!nullval($video->remote)) {
//It's remote
} else {
//It's source

if (0 === strpos($video->source, 'localfile')) {
   // It is a local video
} else {
//It's a link/embedded
}

}

Logged

alimehdipak  July 07, 2014, 08:57:41 PM

Sir can u please solve this problem : u give me code but its not working

Meta Item : duration Recommended The duration of the video in ISO 8601 format.
can please do how to set video Duration in ISO 8601 format.

Logged


alimehdipak  July 08, 2014, 02:17:00 AM

duration is unknow  : http://prntscr.com/40agoa


The duration is unknown because you didn't use the right duration format. For Video schema.org the duration needs to be represented in ISO8601 format. See more information here:
https://support.google.com/webmasters/answer/2413309?hl=en
and here:
https://schema.org/Duration

Regards.


Please Sir solve this problem.

Thanks

Logged


Alexander  July 08, 2014, 09:34:17 PM

I have no other solution, that was the only function I've found for converting to that type of iso...

Logged

alimehdipak  July 08, 2014, 10:16:27 PM

Can u please try on it on my site.
May be u can do it.
U have my ftp details

Logged


Alexander  July 08, 2014, 11:52:24 PM

Can u please try on it on my site.
May be u can do it.
U have my ftp details

You need to send them again, I delete all messages with sensitive details for security, I can do it tomorrow at the office.

Logged

Alexander  July 09, 2014, 03:54:32 PM

Can u please try on it on my site.
May be u can do it.
U have my ftp details

What version of php you have? Cause I see it doesn't support DateTime class http://php.net/manual/en/datetime.construct.php

Logged

Alexander  July 09, 2014, 04:05:40 PM

Ok, had found another solution:
Code
function secondsToDuration ($seconds) {
  $remaining = $seconds;
  $parts = array();
  $multipliers = array(
    'hours' => 3600,
    'minutes' => 60,
    'seconds' => 1
  );
 
  foreach ($multipliers as $type => $m) {
    $parts[$type] = (int)($remaining / $m);
    $remaining -= ($parts[$type] * $m);
  }
 
  return $parts;
}
 
/**
 * Format a duration as ISO 8601
 * @param {hash}
 * @return {string}
 */
function formatDuration ($parts) {
  $default = array(
    'hours' => 0,
    'minutes' => 0,
    'seconds' => 0
  );
 
  extract(array_merge($default, $parts));
                   
  return "PT{$hours}H{$minutes}M{$seconds}S";
}

Code
$duration = formatDuration(secondsToDuration($video->duration));

Seems it outputs right
Code
<meta property="video:duration" content="PT0H5M27S">

Logged

alimehdipak  July 09, 2014, 07:06:40 PM

its working fine now thanksssssssssssss :-*

check in image : http://prntscr.com/40ymga

without this the video sitemap is not work.

Logged