Пример #1
0
                if (!isset($person['delete'])) {
                    $newOpml->entries[] = $person;
                }
            } else {
                $newOpml->entries[] = $person;
            }
        }
    }
    // Add feed
    if (isset($_POST['add'])) {
        if ('http://' != $_POST['url']) {
            //autodiscover feed
            $feed = new SimplePie();
            $feed->enable_cache(false);
            $feed->set_feed_url($_POST['url']);
            $feed->init();
            $feed->handle_content_type();
            $person['name'] = $feed->get_title();
            $person['website'] = $feed->get_permalink();
            $person['feed'] = $feed->feed_url;
            $oldOpml->entries[] = $person;
            $newOpml->entries = $oldOpml->entries;
        }
    }
    // Backup old OPML
    OpmlManager::backup(dirname(__FILE__) . '/../custom/people.opml');
    // Save new OPML
    OpmlManager::save($newOpml, dirname(__FILE__) . '/../custom/people.opml');
}
header("Location: index.php");
die;
Пример #2
0
                    $newOpml->entries[] = $person;
                }
            } else {
                $newOpml->entries[] = $person;
            }
        }
    }
    // Add feed
    if (isset($_POST['add'])) {
        if ('http://' != $_POST['url']) {
            //autodiscover feed
            $feed = new SimplePie();
            $feed->enable_cache(false);
            $feed->set_feed_url($_POST['url']);
            $feed->init();
            $feed->handle_content_type();
            $person['name'] = $feed->get_title();
            $person['website'] = $feed->get_permalink();
            $person['feed'] = $feed->feed_url;
            $person['isDown'] = '0';
            $oldOpml->entries[] = $person;
        }
        $newOpml->entries = $oldOpml->entries;
    }
    // Backup old OPML
    OpmlManager::backup(__DIR__ . '/../custom/people.opml');
    // Save new OPML
    OpmlManager::save($newOpml, __DIR__ . '/../custom/people.opml');
}
header("Location: index.php");
die;