Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Updated: Added player_loc conditional to provide for not using this s…
…itemap feature. Refactor content_loc data url to use largest converted video file. Renamed extension settings file
  • Loading branch information
brookinsconsulting committed Nov 7, 2014
1 parent 08eb124 commit effc07d
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions cronjobs/bcgenerategooglevideositemap.php
Expand Up @@ -17,7 +17,7 @@

// Fetch ini settings
$ini = eZINI::instance( 'site.ini' );
$sitemapINI = eZINI::instance( 'bcgooglevideositemaps.ini' );
$sitemapINI = eZINI::instance( 'bcgooglevideositemap.ini' );

// Test for and fetch ini settings
if( $sitemapINI->hasVariable( 'BCGoogleVideoSitemapSettings', 'SitemapRootNodeID' ) &&
Expand All @@ -29,7 +29,6 @@
$sitemapINI->hasVariable( 'BCGoogleVideoSitemapSettings', 'SiteSectionExcludeID' ) &&
$sitemapINI->hasVariable( 'BCGoogleVideoSitemapSettings', 'SiteFetchDepth' ) &&
$sitemapINI->hasVariable( 'BCGoogleVideoSitemapSettings', 'SiteFetchLimit' ) &&
$sitemapINI->hasVariable( 'BCGoogleVideoSitemapSettings', 'SiteVideoPlayerSWF' ) &&
$sitemapINI->hasVariable( 'BCGoogleVideoSitemapSettings', 'VideoObjectClassIdentifiers' ) &&
$sitemapINI->hasVariable( 'BCGoogleVideoSitemapSettings', 'VideoObjectClassAttributeIdentifier' ) &&
$ini->hasVariable( 'SiteSettings', 'SiteURL' ) )
Expand Down Expand Up @@ -148,10 +147,11 @@
if( $objectEmbededRelatedObjectAttributeVideoContentAttributes['response'][0]['status'] != 'error' && isset( $objectEmbededRelatedObjectAttributeVideoContentAttributes['thumb'] ) )
{
$objectEmbededRelatedObjectAttributeVideoContentAttributeThumbnail = $objectEmbededRelatedObjectAttributeVideoContentAttributes['thumb'];
$objectEmbededRelatedObjectAttributeVideoContentAttributeDownload = $objectEmbededRelatedObjectAttributeVideoContentAttributes['response'][1]['conversions'][0]['link'];
$objectEmbededRelatedObjectAttributeVideoContentAttributeDownload = $objectEmbededRelatedObjectAttributeVideoContentAttributes['response'][1]['conversions'][0]['link']['protocol'] . '://' . $objectEmbededRelatedObjectAttributeVideoContentAttributes['response'][1]['conversions'][0]['link']['address'] . $objectEmbededRelatedObjectAttributeVideoContentAttributes['response'][1]['conversions'][0]['link']['path'];
$objectEmbededRelatedObjectAttributeVideoContentAttributeDownloadMetaDetails = array_reverse( $objectEmbededRelatedObjectAttributeVideoContentAttributes['response'][1]['conversions'] )[0];
$objectEmbededRelatedObjectAttributeVideoContentAttributeDownload = $objectEmbededRelatedObjectAttributeVideoContentAttributeDownloadMetaDetails['link'];
$objectEmbededRelatedObjectAttributeVideoContentAttributeDownload = $objectEmbededRelatedObjectAttributeVideoContentAttributeDownloadMetaDetails['link']['protocol'] . '://' . $objectEmbededRelatedObjectAttributeVideoContentAttributeDownloadMetaDetails['link']['address'] . $objectEmbededRelatedObjectAttributeVideoContentAttributeDownloadMetaDetails['link']['path'];
$objectEmbededRelatedObjectAttributeVideoContentAttributeResponce = $objectEmbededRelatedObjectAttributeVideoContentAttributes['response'];
$objectEmbededRelatedObjectAttributeVideoContentAttributeResponceVideoDuration = round( $objectEmbededRelatedObjectAttributeVideoContentAttributes['response'][1]['conversions'][0]['duration'] );
$objectEmbededRelatedObjectAttributeVideoContentAttributeResponceVideoDuration = round( $objectEmbededRelatedObjectAttributeVideoContentAttributeDownloadMetaDetails['duration'] );
$objectAttributeDescriptionContentText = trim( strip_tags( $objectEmbededRelatedObjectDataMap['summary']->content()->attribute('output')->attribute('output_text') ) );

// Create new video:video element
Expand Down Expand Up @@ -200,17 +200,20 @@
$videoContentLocText = $dom->createTextNode( $objectEmbededRelatedObjectAttributeVideoContentAttributeDownload );
$videoContentLocText = $videoContentLoc->appendChild( $videoContentLocText );

// Create new video:player_loc element
$videoPlayerLoc = $dom->createElement( $xmlVideoSubNodes[4] );
$videoPlayerLoc->setAttribute( "allow_embed", "yes" );
$videoPlayerLoc->setAttribute( "autoplay", "ap=1" );
if( $objectAttributeVideoPlayerUrl != '' )
{
// Create new video:player_loc element
$videoPlayerLoc = $dom->createElement( $xmlVideoSubNodes[4] );
$videoPlayerLoc->setAttribute( "allow_embed", "yes" );
$videoPlayerLoc->setAttribute( "autoplay", "ap=1" );

// append to video sub node
$videoPlayerLoc = $videoNode->appendChild( $videoPlayerLoc );
// append to video sub node
$videoPlayerLoc = $videoNode->appendChild( $videoPlayerLoc );

// set text videoPlayerLoc with data
$videoPlayerLocText = $dom->createTextNode( $objectAttributeVideoPlayerUrl );
$videoPlayerLocText = $videoPlayerLoc->appendChild( $videoPlayerLocText );
// set text videoPlayerLoc with data
$videoPlayerLocText = $dom->createTextNode( $objectAttributeVideoPlayerUrl );
$videoPlayerLocText = $videoPlayerLoc->appendChild( $videoPlayerLocText );
}

// Create new video:duration element
$videoDuration = $dom->createElement( $xmlVideoSubNodes[5] );
Expand Down

0 comments on commit effc07d

Please sign in to comment.