[ Video Sharing CMS v4 ] Meta tags

Started by alimehdipak,

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

alimehdipakTopic starter

<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.

  •  

PHPVibe A.

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

Quote from: ollipaust on
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.

alimehdipakTopic starter

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.
  •  

PHPVibe A.

Find:


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


Add/Before after:

<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="???">

alimehdipakTopic starter

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
  •  

PHPVibe A.

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

TigerClaw

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

PHPVibe A.

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

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


For remote videos

$source = $video->remote;


The rest

$source = $video->source;



TigerClaw

thank you Alexander. Always spot on!
  •  

PHPVibe A.


TigerClaw

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

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


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

Thanks!
  •  

PHPVibe A.

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
}

}

alimehdipakTopic starter

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
  •  

PHPVibe A.

I think...

Instead of

<meta name="video:duration" content="'.$video->duration.'">

This you want to convert, yes?

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


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


and on the meta tag change it to

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

alimehdipakTopic starter

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
  •  

megaman79

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.
"Very Happy with PHPVibe"
  •  

PHPVibe A.

Quote from: megaman79 on
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.

Quote from: Alexander on
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
}

}


alimehdipakTopic starter

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.
  •  

alimehdipakTopic starter

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
  •  

PHPVibe A.

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

alimehdipakTopic starter

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

PHPVibe A.

Quote from: alimehdipak on
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.

PHPVibe A.

Quote from: alimehdipak on
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

PHPVibe A.

Ok, had found another solution:
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";
}


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


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


alimehdipakTopic starter

its working fine now thanksssssssssssss :-*

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

without this the video sitemap is not work.
  •  

Similar topics (7)