function multiundelete_page()
    {
        global $wpdb;
        // If this is a POST, validate source and user credentials
        FeedWordPressCompatibility::validate_http_request('feedwordpress_feeds', 'manage_links');
        // Get single link ID or multiple link IDs from REQUEST parameters
        // if available. Sanitize values for MySQL.
        $link_list = $this->requested_link_ids_sql();
        if (MyPHP::post('confirm') == 'Undelete') {
            if (is_array(MyPHP::post('link_action'))) {
                $actions = MyPHP::post('link_action');
            } else {
                $actions = array();
            }
            $do_it = array('unhide' => array());
            foreach ($actions as $link_id => $what) {
                $do_it[$what][] = $link_id;
            }
            $alter = array();
            if (count($do_it['unhide']) > 0) {
                $unhiddem = "(" . implode(', ', $do_it['unhide']) . ")";
                $alter[] = "\n\t\t\t\tUPDATE {$wpdb->links}\n\t\t\t\tSET link_visible = 'Y'\n\t\t\t\tWHERE link_id IN {$unhiddem}\n\t\t\t\t";
            }
            $errs = array();
            $success = array();
            foreach ($alter as $sql) {
                $result = $wpdb->query($sql);
                if (!$result) {
                    $errs[] = mysql_error();
                }
            }
            if (count($alter) > 0) {
                echo "<div class=\"updated\">\n";
                if (count($errs) > 0) {
                    echo "There were some problems processing your ";
                    echo "re-subscribe request. [SQL: " . implode('; ', $errs) . "]";
                } else {
                    echo "Your re-subscribe request(s) have been processed.";
                }
                echo "</div>\n";
            }
            return true;
            // Continue on to Syndicated Sites listing
        } else {
            // $link_list has previously been sanitized for html by self::requested_link_ids_sql
            $targets = $wpdb->get_results("\n\t\t\t\tSELECT * FROM {$wpdb->links}\n\t\t\t\tWHERE link_id IN {$link_list}\n\t\t\t\t");
            ?>
	<form action="<?php 
            print $this->form_action();
            ?>
" method="post">
	<div class="wrap">
	<?php 
            FeedWordPressCompatibility::stamp_nonce('feedwordpress_feeds');
            ?>
	<input type="hidden" name="action" value="<?php 
            print FWP_RESUB_CHECKED;
            ?>
" />
	<input type="hidden" name="confirm" value="Undelete" />
	
	<h2>Re-subscribe to Syndicated Links:</h2>
	<?php 
            foreach ($targets as $link) {
                $subscribed = 'Y' == strtoupper($link->link_visible);
                $link_url = esc_html($link->link_url);
                $link_name = esc_html($link->link_name);
                $link_description = esc_html($link->link_description);
                $link_rss = esc_html($link->link_rss);
                if (!$subscribed) {
                    ?>
	<fieldset>
	<legend><?php 
                    echo $link_name;
                    ?>
</legend>
	<table class="editform" width="100%" cellspacing="2" cellpadding="5">
	<tr><th scope="row" width="20%"><?php 
                    _e('Feed URI:');
                    ?>
</th>
	<td width="80%"><a href="<?php 
                    echo $link_rss;
                    ?>
"><?php 
                    echo $link_rss;
                    ?>
</a></td></tr>
	<tr><th scope="row" width="20%"><?php 
                    _e('Short description:');
                    ?>
</th>
	<td width="80%"><?php 
                    echo $link_description;
                    ?>
</span></td></tr>
	<tr><th width="20%" scope="row"><?php 
                    _e('Homepage:');
                    ?>
</th>
	<td width="80%"><a href="<?php 
                    echo $link_url;
                    ?>
"><?php 
                    echo $link_url;
                    ?>
</a></td></tr>
	<tr style="vertical-align:top"><th width="20%" scope="row">Subscription <?php 
                    _e('Options');
                    ?>
:</th>
	<td width="80%"><ul style="margin:0; padding: 0; list-style: none">
	<li><input type="radio" id="unhide-<?php 
                    echo $link->link_id;
                    ?>
"
	name="link_action[<?php 
                    echo $link->link_id;
                    ?>
]" value="unhide" checked="checked" />
	<label for="unhide-<?php 
                    echo $link->link_id;
                    ?>
">Turn back on the subscription
	for this syndication source.</label></li>
	<li><input type="radio" id="nothing-<?php 
                    echo $link->link_id;
                    ?>
"
	name="link_action[<?php 
                    echo $link->link_id;
                    ?>
]" value="nothing" />
	<label for="nothing-<?php 
                    echo $link->link_id;
                    ?>
">Leave this feed as it is.
	I changed my mind.</label></li>
	</ul>
	</table>
	</fieldset>
	<?php 
                }
            }
            ?>
	
	<div class="submit">
	<input class="button-primary delete" type="submit" name="submit" value="<?php 
            _e('Re-subscribe to selected feeds &raquo;');
            ?>
" />
	</div>
	</div>
	<?php 
            return false;
            // Don't continue on to Syndicated Sites listing
        }
    }
예제 #2
0
function fwp_upgrade_page()
{
    if (MyPHP::post('action') == 'Upgrade') {
        $ver = get_option('feedwordpress_version');
        if (get_option('feedwordpress_version') != FEEDWORDPRESS_VERSION) {
            echo "<div class=\"wrap\">\n";
            echo "<h2>Upgrading FeedWordPress...</h2>";
            $feedwordpress = new FeedWordPress();
            $feedwordpress->upgrade_database($ver);
            echo "<p><strong>Done!</strong> Upgraded database to version " . FEEDWORDPRESS_VERSION . ".</p>\n";
            echo "<form action=\"\" method=\"get\">\n";
            echo "<div class=\"submit\"><input type=\"hidden\" name=\"page\" value=\"syndication.php\" />";
            echo "<input type=\"submit\" value=\"Continue &raquo;\" /></form></div>\n";
            echo "</div>\n";
            return;
        } else {
            echo "<div class=\"updated\"><p>Already at version " . FEEDWORDPRESS_VERSION . "!</p></div>";
        }
    }
    ?>
<div class="wrap">
<h2>Upgrade FeedWordPress</h2>

<p>It appears that you have installed FeedWordPress
<?php 
    echo FEEDWORDPRESS_VERSION;
    ?>
 as an upgrade to an existing installation of
FeedWordPress. That's no problem, but you will need to take a minute out first
to upgrade your database: some necessary changes in how the software keeps
track of posts and feeds will cause problems such as duplicate posts and broken
templates if we were to continue without the upgrade.</p>

<p>Note that most of FeedWordPress's functionality is temporarily disabled
until we have successfully completed the upgrade. Everything should begin
working as normal again once the upgrade is complete. There's extraordinarily
little chance of any damage as the result of the upgrade, but if you're paranoid
like me you may want to back up your database before you proceed.</p>

<p>This may take several minutes for a large installation.</p>

<form action="" method="post">
<?php 
    FeedWordPressCompatibility::stamp_nonce('feedwordpress_upgrade');
    ?>
<div class="submit"><input type="submit" name="action" value="Upgrade" /></div>
</form>
</div>
<?php 
}
예제 #3
0
 function post($key, $default = NULL)
 {
     return MyPHP::post($key, $default);
 }