$group_name = $db->get_var("SELECT group_name FROM " . table_groups . " WHERE group_id = '{$group}'"); if ($group_name) { $title .= " | " . $group_name; $where .= " AND link_group_id = '{$group}' "; } } // This doesn't seem to work -kb if ($search) { $where .= $search; $title = htmlspecialchars(sanitize($_GET['search'], 3)); } $order_by = " ORDER BY {$order_field} DESC "; $last_modified = $db->get_var($sql = "SELECT UNIX_TIMESTAMP(max({$order_field})) {$from} {$where}"); $sql = "SELECT * {$from} {$where} {$order_by} LIMIT {$rows}"; } do_rss_header($title); // module system hook $vars = ''; check_actions('rss_start_data', $vars); $link = new Link(); $links = $db->get_results($sql); if ($links) { foreach ($links as $dblink) { $link->id = $dblink->link_id; $cached_links[$dblink->link_id] = $dblink; $link->read(); $user = new User($link->author); #print_r($link); $category_name = $db->get_var($sql = "SELECT category_name FROM " . table_categories . " WHERE category_id = {$link->category}"); #print $sql; $link->link_summary = str_replace("\n", "<br />", $link->link_summary);
} $rows = isset($_GET['rows']) && is_numeric($_GET['rows']) ? $_GET['rows'] : 40; $time = isset($_GET['time']) && is_numeric($_GET['time']) ? $_GET['time'] : 0; if (is_numeric($requestID)) { $id = $requestID; $link = new Link(); $link->id = $requestID; if (!$link->read()) { // check for redirects include mnminclude . 'redirector.php'; $x = new redirector($_SERVER['REQUEST_URI']); $main_smarty->assign('tpl_center', '404error'); $main_smarty->display($the_template . '/pligg.tpl'); die; } do_rss_header($link); // get all parent comments $sql = "SELECT * FROM " . table_comments . "\r\n\t\t\tLEFT JOIN " . table_users . " ON comment_user_id=user_id \r\n\t\t\tWHERE comment_link_id={$link->id}"; if ($time > 0) { $from = time() - $time; $sql .= " AND comment_date > FROM_UNIXTIME({$from})"; } $sql .= " ORDER BY comment_date DESC "; if ($rows > 0) { $sql .= " LIMIT 0,{$rows}"; } $comments = $db->get_results($sql); if ($comments) { require_once mnminclude . 'comment.php'; $comment = new Comment(); foreach ($comments as $dbcomment) {