Ejemplo n.º 1
0
    $tntSocialFeatureP = $_POST['tntSocialFeatureP'];
    $tntSocialFeatureIconSize = $_POST['tntSocialFeatureIconSize'];
    if ($videoLimit != "") {
        $videoOptions = array('limitPerPage' => $videoLimit, 'limitAdminPerPage' => $videoLimitAdmin, 'columnPerRow' => $videoColumn, 'tntJquery' => $tntJquery, 'tntColorbox' => $tntColorbox, 'skinColorbox' => $skinColorbox, 'videoWidth' => $videoWidth, 'videoHeight' => $videoHeight, 'videoOrder' => $videoOrder, 'videoOrderBy' => $videoOrderBy, 'socialFeature' => $tntSocialFeature, 'socialFeatureFB' => $tntSocialFeatureFB, 'socialFeatureTW' => $tntSocialFeatureTW, 'socialFeatureG' => $tntSocialFeatureG, 'socialFeatureP' => $tntSocialFeatureP, 'socialFeatureIconSize' => $tntSocialFeatureIconSize);
        update_option('tntVideoManageOptions', $videoOptions);
        $location = add_query_arg(array('m' => 1));
    } else {
        $location = add_query_arg(array('m' => 0));
    }
    Header("Location: {$location}");
}
/**
 * Process: Update Action Selected
 */
if (isset($_POST['tntBtnAct'])) {
    $tntVid = new TNT_Video();
    $tntAction = $_POST["tntActions"];
    $arrVideoID = $_POST["tntChkVideos"];
    $tntResult = true;
    switch ($tntAction) {
        case 1:
            foreach ($arrVideoID as $vID) {
                if ($vID) {
                    $tntVid->tntGetVideo($vID);
                    $tntVid->videoStatus = 1;
                    $tntVid->tntUpdateVideo();
                } else {
                    $tntResult = false;
                    break;
                }
            }
Ejemplo n.º 2
0
/**
 * Callback function for shortcode [tnt_video]
 */
function tntSCVideo($attr)
{
    $tntOptions = get_option('tntVideoManageOptions');
    //Get video ID
    $videoID = (int) $attr['id'];
    //Get width
    $videoWidthOption = $tntOptions['videoWidth'];
    $videoWidth = isset($attr['width']) ? $attr['width'] : $videoWidthOption;
    //Get height
    $videoHeightOption = $tntOptions['videoHeight'];
    $videoHeight = isset($attr['height']) ? $attr['height'] : $videoHeightOption;
    //Get video by videoID
    $args = array('videoID' => $videoID, 'isPublish' => 1);
    $video = TNT_Video::tntGetVideos($args);
    if ($video) {
        //Show template
        $vShow = "";
        foreach ($video as $vid) {
            $vShow['videoTitle'] = $vid->video_title;
            switch ($vid->video_link_type) {
                case "1":
                    $linkEmbed = tntGetYoutubeEmbedLink($vid->video_link);
                    $vShow['videoFrame'] = '<iframe width="' . $videoWidth . '" height="' . $videoHeight . '" src="' . $linkEmbed . '" frameborder="0" allowfullscreen></iframe>';
                    break;
                case "2":
                    $linkEmbed = tntGetVimeoEmbedLink($vid->video_link);
                    $vShow['videoFrame'] = '<iframe width="' . $videoWidth . '" height="' . $videoHeight . '" src="' . $linkEmbed . '" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
                    break;
            }
        }
        $view = tntTemplateVideoItem($vShow);
    } else {
        $view = "No Video ID found";
    }
    return $view;
}
Ejemplo n.º 3
0
/**
 * Function to display the "video category manage" page
 */
function tnt_video_cat_manager()
{
    ?>
		<div class="wrap">
			<?php 
    screen_icon('upload');
    ?>
			<h2>Video Category Manage</h2>
			<hr />
			<table class="tntTable widefat">

				<thead>
					<tr>
						<th>ID</th>
						<th>Title</th>
						<th>Amount of Videos</th>
						<th>Parent</th>
						<th>Shortcode</th>
						<th>Action</th>
					</tr>
				</thead>
				<tfoot>
					<tr>
						<th>ID</th>
						<th>Title</th>
						<th>Amount of Videos</th>
						<th>Parent</th>
						<th>Shortcode</th>
						<th>Action</th>
					</tr>
				</tfoot>
				<tbody>
					<?php 
    $tntVideoCats = TNT_VideoCat::tntGetCats();
    foreach ($tntVideoCats as $tntC) {
        ?>
							<tr>
								<td><?php 
        echo $tntC->video_cat_id;
        ?>
</td>
								<td><b><a href="<?php 
        echo admin_url();
        ?>
admin.php?page=tnt_video_cat_edit_page&catID=<?php 
        echo $tntC->video_cat_id;
        ?>
"><?php 
        echo $tntC->video_cat_title;
        ?>
</a></b></td>
								<td>
									<?php 
        $videos = TNT_Video::tntGetVideos(array('catID' => $tntC->video_cat_id));
        $videosCount = count($videos);
        ?>
									<b><a href="<?php 
        echo admin_url();
        ?>
admin.php?page=tnt_video_manage_page&vCat=<?php 
        echo $tntC->video_cat_id;
        ?>
"><?php 
        echo $videosCount;
        ?>
</a></b>
								</td>
								<td><?php 
        echo $tntC->video_cat_parent_id;
        ?>
</td>
								<td><?php 
        echo '[tnt_video_list id=' . $tntC->video_cat_id . ']';
        ?>
</td>
								<td>
									<a href="<?php 
        echo admin_url();
        ?>
admin.php?page=tnt_video_cat_edit_page&catID=<?php 
        echo $tntC->video_cat_id;
        ?>
" class="button-secondary">Edit</a> 
									<a href="<?php 
        echo admin_url();
        ?>
admin.php?page=tnt_video_cat_del_page&catID=<?php 
        echo $tntC->video_cat_id;
        ?>
" class="button-secondary">Delete</a>
								</td>
							</tr>
					 <?php 
    }
    ?>
				</tbody>
			</table>
		</div>
	<?php 
}