Esempio n. 1
0
<h1> Videos </h1>
<?php 
if (isset($_POST["speichern"])) {
    addVideo();
} else {
    if (isset($_POST["view"])) {
        viewVideo();
    } else {
        if (isset($_POST["delete"])) {
            removeVideo();
        } else {
            if (isset($_GET['videoid'])) {
                viewVideo();
            }
        }
    }
}
?>

<?php 
if (isLoggedIn() && hasCurrentUserRight("video")) {
    ?>
    <script>
        jQuery(document).ready(function () {
            jQuery("button").click(function () {
                jQuery("form.toggle").slideToggle("slow");
            });
        });
    </script>
    <center><button>Show/Hide Add Video Form</button></center>
    <form name="videoadd" method="post" action="<?php 
            continue;
        } else {
            if (preg_match("@{{Curatevideo\\|(wonderhowto|videojug|youtube|howcast|5min)\\|([^\\|]+)\\|@", $body, $matches)) {
                // Check to see if the supported video providers videos are valid (ie video still exists). If not, add them to the unsupported list
                if (!isSupportedVideo($matches[1], $matches[2])) {
                    $video['vid_id'] = $matches[2];
                    $video['vid_service'] = $matches[1];
                    $unsupported[] = $video;
                    printVideo($video);
                    removeVideo($video);
                }
            } else {
                $video['vid_service'] = "UNKNOWN";
                $unsupported[] = $video;
                printVideo($video);
                removeVideo($video);
            }
        }
    } else {
        error("oops. couldn't load page_id {$page}\n");
    }
}
#var_dump($unsupported);
echo "\n\n\nTotal videos to remove: " . sizeof($unsupported) . "\n";
function removeVideo(&$video)
{
    if (!removeVideosFromLinkedArticles($video)) {
        return;
    }
    if (!removeVideoPage($video)) {
        return;