Ejemplo n.º 1
0
    $parse_sites = $_POST['sites'];
    $parse_categories = $_POST['categories'];
    $parse_title_generator = $_POST['title_gnerator'];
    $posts_count = $_POST['posts_count'] ? $_POST['posts_count'] * 1 : 10;
} elseif ($_GET) {
    if (isset($_SERVER['REMOTE_ADDR'])) {
        exit;
    }
    $parse_sites = 'all';
    $parse_categories = 'all';
    $parse_title_generator = 'auto';
    $posts_count = 'auto';
}
if ($parse_sites === 'all') {
    $parse_sites = [];
    $sites = $VParser->getSites();
    foreach ($sites as $site) {
        $parse_sites[] = $site->getName();
    }
}
if ($parse_categories === 'all') {
    $parse_categories = [];
    $wp_terms = get_terms('category', ['hide_empty' => false, 'exclude' => 1]);
    foreach ($wp_terms as $term) {
        $parse_categories[] = $term->term_id;
    }
}
if ($parse_title_generator === 'auto') {
    $wp_options = get_option('video_parser_options');
    $parse_title_generator = isset($wp_options['enable_title_generator']) ? $wp_options['enable_title_generator'] : false;
}
Ejemplo n.º 2
0
                    <td>
                    	<input id="added-videos_count" type="text" value="1000"/>
                    </td>
                </tr>
                <tr>
                	<th>Генератор тайтлов</th>
                    <td>
                    	<input id="title-generator-enable" type="checkbox"/>
                    </td>
                </tr>
                <tr>
                	<th>Сервисы</th>
                    <td>
                    	<input id="parse_site" type="checkbox" checked/> <br/>
                        <?php 
foreach ($VParser->getSites() as $site) {
    ?>
                            <input id="parse_site" type="checkbox" checked name="<?php 
    echo $site->getName();
    ?>
"/> <?php 
    echo $site->getName();
    ?>
 <br/>
                        <?php 
}
?>
                    </td>
                </tr>
                <tr>
                	<th>Категории</th>