var channelID = arguments.feedID; var feedStream = []; var feedArray = []; var postQty = arguments.maxPosts; var d = 1; var PostID = ""; var appConfigStruct = application.ptSocialMedia.getAppConfig(); var buildOp = false; // Determine post filter operator from chosen mode from app configuration if ( LEN(TRIM(arguments.filterType)) EQ 0 AND structKeyExists(appConfigStruct,"filterType") AND LEN(TRIM(appConfigStruct['filterType'])) ) arguments.filterType = appConfigStruct['filterType']; // Convert excludedPostIDs to filteredPostIDs if ( arguments.filtertype EQ "included" AND LEN(TRIM(arguments.filteredPostIDs)) EQ 0 AND LEN(TRIM(arguments.excludedPostIDs)) NEQ 0 ) arguments.filteredPostIDs = arguments.excludedPostIDs; feedStream = buildYouTubeCSData(channelID=channelID,maxPosts=arguments.maxPosts,showFeedDump=arguments.showFeedDump); if ( arguments.showFeedDump ) application.ptSocialMedia.utils.doDUMP(feedStream,"YouTube-feedStream (#arguments.FeedID#)",0); if ( IsArray(feedStream) ) { if ( ArrayLen(feedStream) LTE arguments.maxPosts ) postQty = ArrayLen(feedStream); for ( d=1; d LTE postQty; d++ ) { PostID = ""; if ( StructKeyExists(feedStream[d],"content") AND StructKeyExists(feedStream[d].content,"postid") ) PostID = feedStream[d].content.postid; if ( LEN(TRIM(PostID)) ) buildOp = true; // Disabled - Add all posts to the cache //if ( ListFindNoCase(arguments.excludedPostIDs,PostID) ) // buildOp = false; // Disabled - Add all posts to the cache (new) /* if (arguments.filtertype EQ "excluded") // Do not Build a Feed Data Struct for Posts that are part of the Excluded Posts List buildOp = ListFindNoCase(arguments.filteredPostIDs, PostID) NEQ 0; else // Build a Feed Data Struct for Posts that are part of the included Posts List buildOp = ListFindNoCase(arguments.filteredPostIDs, PostID) EQ 0; */ if ( buildOp ) { ArrayAppend(feedArray,feedStream[d]); } // END - buildOp } // END - loop } return feedArray; var feedArray = ArrayNew(1); var feedData = StructNew(); var feedStream = ArrayNew(1); var postQty = arguments.maxPosts; var userData = StructNew(); var dt = ""; var d = 1; var feedAuthorName = ""; var lnk = 1; var PostID = ""; var thmbArray = ArrayNew(1); var thmb = 1; var mmcComponent = Server.CommonSpot.api.getObject('multimediaChannel'); var mmComponent = Server.CommonSpot.api.getObject('multimedia'); var qfComponent = Server.CommonSpot.api.getObject('QuickFind'); var mmcListQuery = mmcComponent.getList(serviceid=3); var mmResultData = qfComponent.getMultimediaResults(searchString='', searchTypeList='metadata,keywords,tags', subsiteFilter=0, includeChildSubsites=1, limit=arguments.maxposts, orderBy='DateAdded', orderByDirection='Desc', displayDate='DateAdded', ownerFilter='Anyone', multimediaServiceID=3, multimediaChannelID=arguments.channelID, contentTypeList='Multimedia File'); var mmResultQuery = mmResultData.resultQuery; feedData = application.ptSocialMedia.feedController.buildFeedDataFormat(); // General Post Metadata feedService = Application.ptSocialMedia.youTubeFeedsDAO.getYouTubeMetadata(); StructAppend(feedData,feedService,true); feedData.PublishedDate = currPubDateTimeStruct.ISO8601DateTime; feedData.csFormattedPublishedDate = currPubDateTimeStruct.csDateTime; feedData.FeedID = arguments.channelID; // Unique custom element record ID //feedData.FeedID = 180029; // Unique custom element record ID feedData.FeedType = "channel uploads"; feedData.FeedImage = videoData.ThumbnailImageURL; feedData.FeedName = mmcListQuery.name; // Content Info feedData.Content.postid = videoData.extReferenceID; feedData.Content.title = videoData.title; feedData.Content.link = "https://www.youtube.com/watch?v=" & videoData.extReferenceID; feedData.Content.thumbnail = videoData.ThumbnailImageURL; feedData.Content.description = videoData.description; feedData.Content.date = currPubDateTimeStruct.ISO8601DateTime; feedData.Content.csFormattedDate = currPubDateTimeStruct.csDateTime; // Facebook Like Button feedData.FBLikeBtn.link = feedData.Content.Link; // Twitter Tweet Button feedData.TweetBtn.link = feedData.Content.Link; feedData.TweetBtn.message = Left(feedData.Content.Title,120); arrayAppend(feedArray,feedData,true); var reHTML = ""; var appConfigStruct = application.ptSocialMedia.getAppConfig(); var uiTheme = 'redmond'; var appStyleSheet = "/ADF/apps/pt_social_media/style/socialmedia.css"; // Set the UI theme from the Configuration Element if ( structKeyExists(appConfigStruct,"ui_theme") AND LEN(TRIM(appConfigStruct['ui_theme'])) ) uiTheme = appConfigStruct['ui_theme']; // load jQuery headers application.ptSocialMedia.scripts.loadJQuery(noconflict=1); application.ptSocialMedia.scripts.loadJQueryUI(themeName=UItheme); // load headers for jQuery light box application.ptSocialMedia.scripts.loadADFLightbox(); application.ADF.scripts.addFooterJS(hideHelpFooterJS,"TERTIARY");
#renderInlineYouTubeVideoPlayer( videoid=TRIM(arguments.videoid) ,videoWidth=arguments.videoWidth ,videoHeight=arguments.videoHeight ,urlParams=arguments.urlParams )#
application.ADF.scripts.addFooterJS(resizeWindowFooterJS,"TERTIARY");
var reHTML = ""; var appConfigStruct = application.ptSocialMedia.getAppConfig(); var embeddedVideoURL = "https://www.youtube.com/embed/{{videoid}}"; var replaceStr = "{{videoid}}"; var uParams = "&autoplay=1&origin=#request.site.url#"; var playerID = LCASE(ReReplace(arguments.videoid,'[^0-9A-Za-z]','','all')); if ( structKeyExists(appConfigStruct,"apiYouTubeEmbeddedVideoURL") AND LEN(TRIM(appConfigStruct['apiYouTubeEmbeddedVideoURL'])) ) embeddedVideoURL = appConfigStruct['apiYouTubeEmbeddedVideoURL']; if ( FindNoCase(replaceStr, embeddedVideoURL) ) embeddedVideoURL = ReplaceNoCase(embeddedVideoURL,replaceStr,TRIM(arguments.videoid),"one"); if ( LEN(TRIM(arguments.urlParams)) ) { uParams = TRIM(arguments.urlParams); if ( Find("?",embeddedVideoURL,1) ) { if ( Find("&",uParams,"1") NEQ 1 ) uParams = "&" & uParams; } else { if ( Find("?",uParams,"1") NEQ 1 ) uParams = "?" & uParams; } embeddedVideoURL = embeddedVideoURL & uParams; }