public function PostIsSpam() { global $db; if ($this->mCanReport) { $sql = 'INSERT INTO ' . DB_PREFIX . 'spam_reports (the_time, ip, job_id) VALUES (NOW(), "' . $this->mIp . '", ' . $this->mJobId . ')'; if ($db->query($sql)) { if ($this->GetTotalVotesPerPost() > REPORT_POST_NOTIFY_ON) { $job = new Job($this->mJobId); $mihai = new Postman(); $mihai->MailReportSpam($job->GetInfo()); } return true; } else { return false; } } else { return false; } }
<?php $job = new Job($id); if ($extra != '' && $extra == $job->GetAuth()) { $later_edit = true; $_SESSION['later_edit'] = $extra; } else { $later_edit = false; $_SESSION['later_edit'] = ''; } if ($_SESSION['referer'] != BASE_URL . 'post/') { if (!$_SESSION['later_edit']) { redirect_to(BASE_URL . URL_JOB . '/' . $id . '/'); exit; } } $jobInfo = $job->GetInfo(); if (strstr($jobInfo['description'], '*')) { $jobInfo['description'] = $textile->TextileThis($jobInfo['description']); } else { $jobInfo['description'] = str_replace(array("\r\n", "\r", "\n"), "<br />", $jobInfo['description']); } $smarty->assign('job', $jobInfo); $html_title = stripslashes($jobInfo['title']) . ' at ' . stripslashes($jobInfo['company']) . ' / ' . SITE_NAME; $template = 'publish-verify.tpl';
<?php /** * @author putypuruty * * Business logic for editing a post. */ //Note: $id is a job ID if ($id != 0) { $job = new Job($id); } else { $job = new Job(); } $jobToEdit = $job->GetInfo(); $smarty->assign('show_preview', false); $smarty->assign('editor', true); if (!empty($_POST)) { // validation $errors = array(); if (!isset($_POST['type_id']) || !is_numeric($_POST['type_id'])) { $errors['input_id'] = $translations['jobs']['type_error']; $_POST['type_id'] = 0; } if ($_POST['title'] == '') { $errors['title'] = $translations['jobs']['title_error']; } if ($_POST['description'] == '') { $errors['description'] = $translations['jobs']['description_error']; } if ($_POST['poster_email'] == '') { $errors['poster_email'] = $translations['jobs']['email_error'];
public function GetPaginatedJobsForOtherCities($type_id = false, $firstLimit = false, $lastLimit = false) { global $db; $jobs = array(); $conditions = ''; // if $type_id is, in fact, the type's var_name, // get the type's id if (!is_numeric($type_id)) { $type_id = $this->GetTypeId($type_id); } if (is_numeric($type_id) && $type_id != 0) { $conditions .= ' AND type_id = ' . $type_id; } if ($firstLimit >= 0 && $lastLimit >= 0) { $sql_limit = 'LIMIT ' . $firstLimit . ', ' . $lastLimit; } else { $sql_limit = ''; } $sql = 'SELECT id FROM ' . DB_PREFIX . 'jobs WHERE city_id IS NULL' . $conditions . ' AND is_temp = 0 AND is_active = 1 ORDER BY created_on DESC ' . $sql_limit; $result = $db->query($sql); while ($row = $result->fetch_assoc()) { $current_job = new Job($row['id']); $jobs[] = $current_job->GetInfo(); } return $jobs; }
<?php $j = new Job($id); // if auth code used, check it and allow activating if (isset($_SESSION['later_edit']) && $_SESSION['later_edit'] == $j->GetAuth() || $extra != '' && $extra == $j->GetAuth()) { $activator = $j->Activate(); $vali = new Postman(); $vali->MailPostActivatedToUser($j->GetInfo()); $_SESSION['status'] = $translations['jobs']['activated_success']; redirect_to(BASE_URL . URL_JOB . '/' . $id . '/'); exit; } else { redirect_to(BASE_URL); exit; }
<?php $j = new Job($_POST['job_id']); $activator = $j->Activate(); $vali = new Postman(); $vali->MailPostActivatedToUser($j->GetInfo(), BASE_URL_ORIG); echo 1; exit;
$later_edit = true; } } // security: prevent later editing, by forced redirection if (!$later_edit && $id != 0) { $j = new Job($id); if ($j->GetTempStatus() != 1 || $j->GetActiveStatus() != 0) { redirect_to(BASE_URL . URL_JOB . '/' . $id . '/'); exit; } } // this branch executes when returning to edit a post if ($_SERVER['HTTP_REFERER'] == BASE_URL . 'verify/' . $id . '/' && $id != 0 || $later_edit) { $_SESSION['referer'] = BASE_URL . 'post/'; $job = new Job($id); $jobs = $job->GetInfo(); $jobs['description'] = $textile->noTextile($jobs['description']); if (strstr($jobs['url'], 'http://')) { $jobs['url'] = substr($jobs['url'], 7, strlen($jobs['url'])); } $smarty->assign('job', $jobs); } // this branch executes after first writing a post and hitting the submit button if (!empty($_POST['action']) && $_POST['action'] == 'publish') { escape($_POST); $errors = array(); $_SESSION['user_ip'] = $_SERVER['REMOTE_ADDR']; $_SESSION['referer'] = BASE_URL . 'post/'; // validation if ($captcha_enabled) { $resp = recaptcha_check_answer(CAPTCHA_PRIVATE_KEY, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);