Beispiel #1
0
if (empty($_POST['s'])) {
    $next_step = 2;
    $process_title = "{$script_name} Installation";
    $message = $message_step1;
} elseif ($_POST['s'] == 2) {
    $next_step = 3;
    $process_title = "Checking Server";
    $message = CheckServerReq();
} elseif ($_POST['s'] == 3) {
    if (InitExixst()) {
        $next_step = 5;
    } else {
        $next_step = 4;
    }
    $process_title = "Checking File Permission";
    $message = CheckFilePermission();
} elseif ($_POST['s'] == 4) {
    $next_step = 5;
    $process_title = "Application Setting";
    $message = ShowForm();
} elseif ($_POST['s'] == 5) {
    if (!InitExixst()) {
        $error_message = CheckForm();
    } else {
        unset($_POST['sql_option']['Fresh Installation']);
    }
    if (empty($error_message)) {
        $next_step = 6;
        WriteConfigurationFile();
        $process_title = "Prepare Database";
        $message = ShowFormSQL();
Beispiel #2
0
function wdtgenerate_sitemap()
{
    if (@$_POST['submit_image']) {
        if ($_FILES['upload_file']['name'] == '') {
            echo '<div class="error">Please select a file</div>';
        } else {
            $image_ext = end(explode('.', $_FILES['upload_file']['name']));
            $img_array = array('jpeg', 'jpg', 'gif', 'png');
            if (in_array($image_ext, $img_array)) {
                $upload_dir = dirname(__FILE__);
                if (!CheckFilePermission($upload_dir . '/noimage.gif')) {
                    echo '<div class="error">You have no write permission on ' . dirname(__FILE__) . '/noimage.gif</div>';
                } else {
                    $res = move_uploaded_file($_FILES['upload_file']['tmp_name'], $upload_dir . '/noimage.gif');
                }
            } else {
                echo '<div class="error">Valid allowed file types :jpg,jpeg,gif,png</div>';
            }
        }
    }
    if ($_POST['submit']) {
        $st = createSitemap();
        if (!$st) {
            echo '<br /><div class="error"><h2>Oops!</h2><p>None of your blog posts contain Either YouTube videos Or Self-hosted videos.</p></div>';
            exit;
        }
        ?>
<div class="wrap">
<h2>Sitemap for Videos</h2>
<?php 
        $sitemapurl = get_bloginfo('home') . "/videositemap.xml";
        ?>
<p>The XML Sitemap has been generated successfully. To confirm that there are no errors,Please open the <a target="_blank" href="<?php 
        echo $sitemapurl;
        ?>
">Sitemap file</a> in web browser.</p>
<?php 
    } else {
        ?>
<div class="wrap">
  <h2>Sitemap for Videos</h2>
  
  <h3>Please click on the below button to generate video sitemap :</h3>
  <form id="options_form" method="post" action="">
    <div class="submit">
      <input type="submit" name="submit" id="sb_submit" value="Generate Video Sitemap" />
    </div>
  </form>
 <a style="text-decoration:none;" href="<?php 
        echo get_bloginfo('url');
        ?>
/videositemap.xml" target="_blank">Display Video Sitemap</a>
</div>

<div class="wrap">
<h3>Upload a default thumbnail :</h3>
<form action="" method="post" enctype="multipart/form-data" style="padding-top:20px;">
<input type="file" name="upload_file" />
<input type="submit" value="change" name="submit_image" />
</form>
<a href="#" style="text-decoration:none; padding-top:20px; float:left;" onClick="window.open('<?php 
        echo get_bloginfo('url');
        ?>
/wp-content/plugins/video_sitemap_xml/default.html','mywindow','width=300,height=300')">Preview Default Thumbnail</a>
</div>
<?php 
    }
}
Beispiel #3
0
        echo '<div id="err" style="color:#FF0000;" align="center">Please fill the youtube or self-hosted video url</div>';
        exit;
    }
    content_for_editor($html_data);
}
// End url submit
// testing for upload from PC
if (isset($_POST['file_submit'])) {
    $fileUrl = '';
    $thumbUrl = '';
    $html_data = '';
    if ($_FILES["media_file"]["tmp_name"] == '') {
        echo '<div id="err"  style="color:#FF0000;" align="center">Please select video file</div>';
        exit;
    }
    if (!CheckFilePermission($upload_dir)) {
        echo '<div id="err"  style="color:#FF0000;" align="center">You have no write permission on<br>' . dirname(__FILE__) . '</div>';
        exit;
    }
    $file_size = $_FILES["media_file"]["size"];
    if ($file_size <= 125829120) {
        if ($_FILES["media_file"]["error"] == 0) {
            $video_ext = array('mp4', 'wmv', 'mov', 'avi');
            $ext = strtolower(end(explode('.', $_FILES["media_file"]['name'])));
            if (in_array($ext, $video_ext)) {
                $upload_dir1 = dirname(__FILE__) . '/upload/video_file';
                $tmp_name1 = $_FILES["media_file"]["tmp_name"];
                $file1 = time() . $_FILES["media_file"]['name'];
                $st1 = move_uploaded_file($tmp_name1, "{$upload_dir1}/{$file1}");
                $fileUrl = plugins_url() . "/video_sitemap_xml/upload/video_file/{$file1}";
                $html_data = '[video url="' . $fileUrl;