Exemplo n.º 1
0
        if (!empty($f->hub)) {
            $this->db2->query('UPDATE users_rssfeeds SET hub_url="' . $this->db2->e($f->hub) . '" WHERE id="' . $this->db2->insert_id() . '" LIMIT 1');
            $hui = new pubsubhubbub($f->hub);
            $hui->subscribe($D->newfeed_url_t, TRUE);
        }
        $this->redirect($C->SITE_URL . 'settings/rssfeeds/msg:added');
    }
}
$D->feeds = array();
$this->db2->query('SELECT id, feed_url, feed_title, filter_keywords FROM users_rssfeeds WHERE is_deleted=0 AND user_id="' . $this->user->id . '" ORDER BY id ASC');
while ($obj = $this->db2->fetch_object()) {
    $obj->feed_url = stripslashes($obj->feed_url);
    $obj->feed_title = stripslashes($obj->feed_title);
    $obj->filter_keywords = stripslashes($obj->filter_keywords);
    $obj->filter_keywords = str_replace(',', ', ', $obj->filter_keywords);
    $D->feeds[$obj->id] = $obj;
}
if ($this->param('delfeed') && isset($D->feeds[$this->param('delfeed')])) {
    $this->db2->query('SELECT feed_url, hub_url FROM users_rssfeeds WHERE id="' . intval($this->param('delfeed')) . '" AND is_deleted=0 AND user_id="' . $this->user->id . '" AND hub_url<>"" LIMIT 1');
    if ($tmp = $this->db2->fetch_object()) {
        $hui = new pubsubhubbub($tmp->hub_url);
        $hui->subscribe($tmp->feed_url, FALSE);
    }
    $this->db2->query('UPDATE users_rssfeeds SET is_deleted=1 WHERE id="' . intval($this->param('delfeed')) . '" AND is_deleted=0 AND user_id="' . $this->user->id . '" LIMIT 1');
    $this->redirect($C->SITE_URL . 'settings/rssfeeds/msg:deleted');
}
$this->db2->query('SELECT 1 FROM users_rssfeeds WHERE is_deleted=0 AND user_id="' . $this->user->id . '" AND is_twitter="1"');
if ($this->db2->num_rows() > 0) {
    $D->is_twitter_feed_imported = TRUE;
}
$this->load_template('settings_rssfeeds.php');
Exemplo n.º 2
0
<?php

$info = array();
foreach (array($_POST, $_GET) as $arr) {
    foreach (array('hub.', 'hub_') as $pref) {
        foreach (array('mode', 'topic', 'challenge') as $attr) {
            if (!isset($info[$attr]) && isset($arr[$pref . $attr]) && !empty($arr[$pref . $attr])) {
                $info[$attr] = $arr[$pref . $attr];
            }
        }
    }
}
$p = new pubsubhubbub();
$result = $p->receive_notif($info);
echo $result ? $result : 'ERROR';
exit;