Exemplo n.º 1
0
}
// ---------------------------------------------------------------------------
// Error checking
// ---------------------------------------------------------------------------
if (!isset($_SESSION['users_id'])) {
    failure('Invalid user id');
}
if (!isset($_POST['id']) || !filter_var($_POST['id'], FILTER_VALIDATE_INT) || $_POST['id'] < 1) {
    failure('Invalid feed id');
}
$id = $_POST['id'];
// ---------------------------------------------------------------------------
// Secondary error checking
// ---------------------------------------------------------------------------
$feed = new suxRSS();
if (!$feed->getFeedByID($id)) {
    failure('Invalid feed');
}
// ---------------------------------------------------------------------------
// Go
// ---------------------------------------------------------------------------
$module = 'feeds';
$link = 'link__rss_feeds__users';
$col = 'rss_feeds';
// Get image names from template config
$tpl = new suxTemplate($module);
$tpl->configLoad('my.conf', $module);
$image = $tpl->getConfigVars('imgUnsubscribed');
$db = suxDB::get();
$query = "SELECT COUNT(*) FROM {$link} WHERE {$col}_id = ? AND users_id = ? ";
$st = $db->prepare($query);