function do_submit3() { global $db, $current_user; $link = new Link(); $link->id = $link_id = intval($_POST['id']); if (!check_link_key() || !$link->read() || link_errors($link)) { die; } // Check it is not in the queue already if (Link::duplicates($link->url)) { // Write headers, they were not printed yet do_header(_('enviar historia'), _('enviar historia')); echo '<div id="singlewrap">' . "\n"; report_duplicated($link->url); return; } // Check this one was not already queued if ($link->votes == 0 && $link->status != 'queued') { $link->enqueue(); } header('Location: ' . $link->get_permalink()); die; }
function do_submit3() { global $db, $current_user; $linkres = new Link(); $linkres->id = $link_id = intval($_POST['id']); if (!check_link_key() || !$linkres->read()) { die; } // Check it is not in the queue already if (Link::duplicates($linkres->url)) { // Write headers, they were not printed yet do_header(_("enviar noticia"), "post"); echo '<div id="singlewrap">' . "\n"; report_duplicated($linkres->url); return; } // Check this one was not already queued if ($linkres->votes == 0 && $linkres->status != 'queued') { $db->transaction(); $linkres->status = 'queued'; $linkres->sent_date = $linkres->date = time(); $linkres->get_uri(); $linkres->store(); $linkres->insert_vote($current_user->user_karma); $db->commit(); // Add the new link log/event require_once mnminclude . 'log.php'; log_conditional_insert('link_new', $linkres->id, $linkres->author); $db->query("delete from links where link_author = {$linkres->author} and link_date > date_sub(now(), interval 30 minute) and link_status='discard' and link_votes=0"); if (!empty($_POST['trackback'])) { $trackres = new Trackback(); $trackres->url = clean_input_url($_POST['trackback']); $trackres->link_id = $linkres->id; $trackres->link = $linkres->url; $trackres->author = $linkres->author; $trackres->status = 'pendent'; $trackres->store(); } fork("backend/send_pingbacks.php?id={$linkres->id}"); } header('Location: ' . $linkres->get_permalink()); die; }