示例#1
0
function wp_rss_multi_importer_category_page()
{
    ?>
      <div class="wrap">
	 <h2>Categories Admin</h2>	
	

	<div id="poststuff">



     <form action="options.php" method="post"  >  

		<div class="postbox">
		<div class="inside">
	<h3><?php 
    _e("RSS Multi-Importer Categories (and their shortcodes)", 'wp-rss-multi-importer');
    ?>
</h3>
	
	
	<?php 
    settings_fields('wp_rss_multi_importer_categories');
    $options = get_option('rss_import_categories');
    if (!empty($options)) {
        $size = count($options);
        for ($i = 1; $i <= $size; $i++) {
            if ($i % 2 == 0) {
                continue;
            }
            $key = key($options);
            $j = cat_get_id_number($key);
            $textUpper = strtoupper($options[$key]);
            echo "<div class='cat-input' id='{$j}'>";
            echo "<p><label class='textinput' for='Category ID'>" . wprssmi_convert_key($key) . "</label>\n\n\n\n       <input id='5' class='cat-input' size='20' name='rss_import_categories[{$key}]' type='text' value='{$textUpper}' />  [wp_rss_multi_importer category=\"" . $j . "\"]";
            next($options);
            $key = key($options);
            echo "  <input id='5'  size='20' name='rss_import_categories[{$key}]' type='hidden' value='{$options[$key]}' />";
            echo "</div>";
            next($options);
        }
    }
    ?>
  <div id="category"><a href="javascript:void(0)" id="addCat" class="addCategory"><img src="<?php 
    echo WP_RSS_MULTI_IMAGES;
    ?>
addCat.png"></a>  	
<p class="submit"><input type="submit" value="Save Settings" name="submit" class="button-primary"></p>
</div></div>	          
</form>
</div></div>

<?php 
}
示例#2
0
function wp_rss_multi_importer_category_images_page()
{
    ?>

	<h2><?php 
    _e("Multi-Importer", 'wp-rss-multi-importer');
    ?>
</h2>
	       <div class="wrap">
      <div class="wrap">
		 <h2>Category Default Images, Post Tags and Filter Words Admin</h2>
	<div id="poststuff">
  


     <form action="options.php" method="post" class="catform" >  
	
		<div class="postbox">
		<div class="inside">
	<h3><?php 
    _e("Set a Default Feed Category Image, Post Category Tags and Category Word Filters (all are optional) - note: filters work for shortcode, AutoPost, and the widget", 'wp-rss-multi-importer');
    ?>
</h3>

	
	<?php 
    settings_fields('wp_rss_multi_importer_categories_images');
    $options = get_option('rss_import_categories');
    $options_images = get_option('rss_import_categories_images');
    if (!empty($options)) {
        echo '<div class="default-image-wrapper"><span class="default-image-text">Default Feed Category Image</span><span class="vtip" title="The image link you put here will be used as a default image for feeds in a category - if you choose to use this default image.">?</span><span class="default-tags-text">Post Category Tags</span><span class="default-filter-text">Include Filter Words</span><span class="vtip" title="Only include posts that have these words in the titles or content.">?</span><br>';
        echo '<span class="default-image-text-more">(full URL required)</span><span class="default-tags-text-more">(comma delimited list)</span><span class="default-tags-filter-more">(comma delimited list)</span><span class="default-tags-exclude-more">(check to exclude words)</span><span class="vtip" title="Make it so posts that have these words<br> in the titles or content will not be be included.">?</span></div>';
        $size = count($options);
        for ($i = 1; $i <= $size; $i++) {
            if ($i % 2 == 0) {
                continue;
            }
            $key = key($options);
            $j = cat_get_id_number($key);
            $textUpper = strtoupper($options[$key]);
            if (!empty($options_images)) {
                $cat_default_image = $options_images[$j]['imageURL'];
                $cat_default_tags = $options_images[$j]['tags'];
                $cat_default_filterwords = $options_images[$j]['filterwords'];
                $cat_default_filterwords_exclude = isset($options_images[$j]['exclude']) ? $options_images[$j]['exclude'] : null;
                if ($cat_default_filterwords_exclude == 1) {
                    $checkmsg = 'checked=checked';
                } else {
                    $checkmsg = '';
                }
            }
            echo "<div class='default-list-name'>" . $textUpper . ":</div>";
            next($options);
            echo "<div class='default-list-image'><input class='default-cat-image'  size='50' name='rss_import_categories_images[{$j}][imageURL]' type='text' value='{$cat_default_image}' /></div>";
            echo "<div class='default-list-tags'><input id='default-cat-tags' class='default-cat-tags'  size='20' name='rss_import_categories_images[{$j}][tags]' type='text' value='{$cat_default_tags}' /></div>";
            echo "<div class='default-list-tags'><input id='default-cat-tags' class='default-cat-tags'  size='40' name='rss_import_categories_images[{$j}][filterwords]' type='text' value='{$cat_default_filterwords}' /><input type='checkbox' Name='rss_import_categories_images[{$j}][exclude]' Value='1' {$checkmsg}></div>";
            next($options);
        }
        echo "<br><p class='submit'><input type='submit' value='Save Settings' name='submit' class='button-primary'></p>";
    } else {
        _e("<br>Once you add categories (above), you'll be able to add default images and tags here.", 'wp-rss-multi-importer');
    }
    ?>

</div></div>	          
</form>
</div></div>
</div>
<?php 
}
示例#3
0
function wp_rss_multi_importer_diagnostics()
{
    ?>
		<h2><?php 
    _e("Multi-Importer", 'wp-rss-multi-importer');
    ?>
</h2>
		       <div class="wrap">
		 <h2>Diagnostics</h2>
		
		
		
		
		
	<div id="poststuff">
		<div class="postbox">
		<div class="inside">
						
<?php 
    $post_options = get_option('rss_post_options');
    _e('<p>A quick check of basic diagnostics (filters, cron scheduler, php settings, text settings) are now being run and will let you know if there are any obvious problems below. <a href="http://www.wprssimporter.com/faqs" target=\\"_blank\\">Go here to see all FAQs about typical problems and how they can be solved.</a></p>', 'wp-rss-multi-importer');
    //  Check FOPEN for Images
    if (ini_get('allow_url_fopen') == 0) {
        _e('<h3>Your server is not configured to accept images from outside sources.  Please contact your web host to set allow_url_fopen to ON.  You might be able to do this for yourself if your host gives you a way to edit the php.ini file.</h3>', 'wp-rss-multi-importer');
    }
    //  Check FSOCKOPEN for Images
    if (!function_exists('fsockopen')) {
        _e('<h3>Your server is not configured to for fsockopen.  Without this being configured, you may have problems connecting to another server to get an RSS feed. Please contact your web host to set fsockopen.  You might be able to do this for yourself if your host gives you a way to edit the php.ini file.</h3>', 'wp-rss-multi-importer');
    }
    //  Check the Cron Scheduler
    echo '<h3>Cron Schedule</h3>';
    $cronSchedule = get_option('cron');
    //	var_dump($cronSchedule);
    foreach ($cronSchedule as $timestamp => $cronhooks) {
        foreach ((array) $cronhooks as $hook => $events) {
            foreach ((array) $events as $key => $event) {
                if (stripos($hook, 'wp_rss_multi_event_feedtopost') !== false) {
                    //echo  $hook.' is scheduled for every '.friendly_event_schedule_name($event[ 'schedule' ]).'<br>' ;
                    _e('<p style="margin-left:30px"> The AutoPost is successfully scheduled for this time period:  ' . friendly_event_schedule_name($event['schedule']) . '. </p>', 'wp-rss-multi-importer');
                }
                if (stripos($hook, 'wp_rss_multi_event_importfeeds') !== false) {
                    _e('<p style="margin-left:30px"> The database is successfully scheduled for this time period:  ' . friendly_event_schedule_name($event['schedule']) . '. </p>', 'wp-rss-multi-importer');
                }
            }
        }
    }
    if (!isset($post_options['active']) || $post_options['active'] == 0) {
        _e('<p style="margin-left:30px">The AutoPost is not active, so there is no schedule.</p>', 'wp-rss-multi-importer');
    } else {
        echo '<p><strong>IMPORTANT:</strong> If the period for AutoPost is less than the period for the database, you will not be getting new AutoPost feeds until the database is updated.  It is better to have the AutoPost set for a longer interval than than the database.</p>';
    }
    echo '<p>If there are cron schedules, but things do not seem to be working, <a href="http://www.wprssimporter.com/faqs/the-cron-scheduler-isnt-working-whats-happening/" target="_blank">read this to learn what is going on.</a>	</p>';
    // check for Word Filters
    $options = get_option('rss_import_categories');
    $option_category = get_option('rss_import_categories_images');
    if (!empty($options)) {
        $size = count($options);
        for ($i = 1; $i <= $size; $i++) {
            if ($i % 2 == 0) {
                continue;
            }
            $key = key($options);
            $j = cat_get_id_number($key);
            $myCatIDs[] = array("CatID" => $j);
            next($options);
            next($options);
        }
    }
    if (!empty($myCatIDs)) {
        foreach ($myCatIDs as $myCatID) {
            $catID = $myCatID['CatID'];
            if (!empty($option_category)) {
                $filterString = isset($option_category[$catID]['filterwords']) ? $option_category[$catID]['filterwords'] : null;
                $exclude = isset($option_category[$catID]['exclude']) ? $option_category[$catID]['exclude'] : null;
                $filterWords = explode(',', $filterString);
                if (!is_null($filterWords) && !empty($filterWords) && is_array($filterWords)) {
                    foreach ($filterWords as $filterWord) {
                        if ($filterWord != '') {
                            $msg = 1;
                            break;
                        } else {
                            $msg = 0;
                        }
                    }
                }
            }
            if ($msg == 1) {
                _e("<h3>Category Word Filters are On</h3><p style='margin-left:30px'>This could be a reason you are getting no new posts.</p>", 'wp-rss-multi-importer');
            }
        }
    }
    //  Check for 0 for amount of text
    $text_options = get_option('rss_import_options');
    $post_options = get_option('rss_post_options');
    if (isset($post_options['active']) && $post_options['active'] == 1) {
        if ($post_options['descnum'] == 0) {
            _e("<h3>You appear to be running the Feed to Post and chosen to have no text</h3><p style='margin-left:30px'>This is the most likely reason you have no text in your posts.  If you want text to show, set that in the Feed to Post admin page.</p>", 'wp-rss-multi-importer');
        }
    } elseif ($text_options['descnum'] == 0) {
        _e("<h3>Notice: You appear to be using the Shortcode and chosen to have no text</h3><p style='margin-left:30px'>This is the most likely reason you have no text in your posts.  If you want text to show and are using the Shortcode, set that in the Shortcode admin page.</p>", 'wp-rss-multi-importer');
    }
    // Check for feed numbers
    $feed_options = get_option('rss_import_items');
    $numFeeds = count($feed_options) / 3;
    if (isset($post_options['active']) && $post_options['active'] == 1) {
        if ($post_options['maxfeed'] * $numFeeds > $post_options['maxperfetch']) {
            _e("<h3>You appear to be running the Feed to Post and configured the number of feeds incorrectly.</h3><p style='margin-left:30px'>This is the most likely reason you have problems.  <a href=\"http://www.wprssimporter.com/faqs/how-does-the-number-of-entries-per-feed-and-page-or-fetch-work//\" target=\"_blank\">GO HERE TO SEE HOW TO SET THIS OPTION</a></p>", 'wp-rss-multi-importer');
        }
    } elseif ($text_options['maxfeed'] * $numFeeds > $text_options['maxperPage']) {
        _e("<h3>Notice: You appear to be using the Shortcode and configured the feeds incorrectly.</h3><p style='margin-left:30px'>This is the most likely reason you have problems.  <a href=\"http://www.wprssimporter.com/faqs/how-does-the-number-of-entries-per-feed-and-page-or-fetch-work//\" target=\"_blank\">GO HERE TO SEE HOW TO SET THIS OPTION</a></p>", 'wp-rss-multi-importer');
    }
    ?>
		<h3>Check Your Feeds</h3><br>
		<button type="button"  name="checkfeedsall" id="checkfeeds-all" value="" ><?php 
    _e("CLICK TO CHECK ALL FEEDS NOW", 'wp-rss-multi-importer');
    ?>
</button> <p>This could take a few minutes, so click once and then be patient!</p><div id="checkfeeds_note"></div><div id="rssmi-ajax-loader-center"></div>
	
		</div></div></div>
		
		<div id="poststuff">
			<div class="postbox">
			<div class="inside">

			<?php 
    echo rssmi_show_last_feed_update();
    ?>
		</div></div></div>
		
		
		
		</div>
		
		<?php 
}