function get_post_summary(&$JobListAttributes, &$class_postfix) { global $label; if ($JobListAttributes->list_mode == 'ADMIN' || $JobListAttributes->list_mode == 'EMPLOYER') { $new_window = "onclick=\"window.open('post_window.php?post_id=" . $this->get_data_value('post_id') . "', '', 'toolbar=no,scrollbars=yes,location=no,statusbar=no,menubar=no,resizable=1,width=800,height=500,left = 50,top = 50');return false;\""; } $post_url = JB_job_post_url($this->get_data_value('post_id'), $JobListAttributes); $profile_url = JB_emp_profile_url($this->get_data_value('user_id'), $JobListAttributes); ob_start(); // buffer start, // from now on all output is captured in to a buffer, and the // contents of the buffer is returned by this function $TITLE = $this->get_template_value('TITLE', $this->admin); $TITLE = preg_replace(JB_CLEAN_PUN_REGEX, '$1 ', $TITLE); // automatically fix punctuation spacing so that it the line can break ?> <span class="job_list_title<?php echo $class_postfix; ?> " > <a class="job_list_title<?php echo $class_postfix; ?> " href="<?php echo $post_url; ?> " <?php echo $new_window; ?> ><?php echo $TITLE; ?> </a></span> <?php if (!$JobListAttributes->is_internal_page()) { ?> <a href="<?php echo $post_url; ?> " target="new"><img src="<?php echo JB_THEME_URL; ?> images/nw2.gif" width="11" height="11" border="0" alt=""></a> <?php } if (JB_POSTS_SHOW_POSTED_BY == 'YES') { if (JB_POSTS_SHOW_POSTED_BY_BR == 'YES') { echo "<br>"; } $POSTED_BY = $this->get_template_value('POSTED_BY', $this->admin); ?> <span class="job_list_small_print<?php echo $class_postfix; ?> "> <b><?php echo $label['post_list_posted_by']; ?> </b> <a href="<?php echo $profile_url; ?> "><i><?php if ($POSTED_BY == '') { $POSTED_BY = $label["posted_by_unknown"]; } echo $POSTED_BY; ?> </i></a> </span> <?php } if (JB_POSTS_SHOW_JOB_TYPE == 'YES') { if (JB_POSTS_SHOW_JOB_TYPE_BR == 'YES') { echo '<br>'; } ?> <span class="job_list_small_print<?php echo $class_postfix; ?> "> <b><?php echo $label['post_list_category']; ?> </b> </span> <span class="job_list_cat_name<?php echo $class_postfix; ?> "> <?php echo $this->get_template_value('JOB_TYPE', $this->admin); ?> </span> <?php } if (JB_POSTS_SHOW_DESCRIPTION == 'YES') { ?> <br> <span class="job_list_small_print<?php echo $class_postfix; ?> "> <?php echo jb_escape_html(str_replace(' ', ' ', JB_truncate_html_str(strip_tags($this->get_template_value('DESCRIPTION', $this->admin)), JB_POSTS_DESCRIPTION_CHARS, $trunc_str_len))); ?> </span> <?php } if ($this->get_template_value('REASON', $this->admin) != '') { echo '<span style="font-weight:bold">' . $label['post_not_approved_cause'] . '</span><span style="color:red; font-weight:bold;">' . $this->get_template_value('REASON', $this->admin) . '</span>'; } // capture the buffer, and clean it $val = ob_get_contents(); ob_end_clean(); return $val; // return the buffered output }
function JB_echo_job_list_data($admin) { global $label; # HTML output for this function comes from ListMarkup Class # include/themes/default/JBListMarkup.php # Any HTML customizations should be done there. # Please copy this class in to your custom theme directory, and # customize form there $LM =& JB_get_ListMarkupObject(1); // load the ListMarkup Class $Form =& JB_get_DynamicFormObject(1); $ttf =& $Form->get_tag_to_field_id(); global $JobListAttributes; $post_id = $Form->get_template_value('POST_ID', $admin); $post_mode = $Form->get_template_value('POST_MODE', $admin); $class_postfix = $LM->get_item_class_postfix($post_mode); foreach ($LM->column_list as $template_tag) { if ($LM->column_info[$template_tag]['admin'] == 'Y' && !$admin) { continue; // do not render this column } $val = $Form->get_value($ttf[$template_tag]['field_id']); if ($template_tag == 'POST_SUMMARY') { if ($JobListAttributes->list_mode == 'ADMIN' || $JobListAttributes->list_mode == 'EMPLOYER') { $new_window = $LM->get_new_window_js(); } $val = $LM->get_post_summary($JobListAttributes, $class_postfix); } elseif ($template_tag == 'DATE') { $val = JB_get_formatted_date(JB_get_local_time($val)); } else { if ($LM->column_info[$template_tag]['trunc'] > 0) { $val = JB_truncate_html_str($val, $LM->column_info[$template_tag]['trunc'], $trunc_str_len); } $val = JB_get_list_template_value($ttf[$template_tag], $val, $admin, 1); if ($LM->column_info[$template_tag]['clean'] == 'Y') { // fix up punctuation spacing $val = preg_replace(JB_CLEAN_PUN_REGEX, '$1 ', $val); } } if ($LM->column_info[$template_tag]['is_bold'] == 'Y') { $b1 = $LM->get_open_bold(); $b2 = $LM->get_close_bold(); } else { $b1 = ''; $b2 = ''; } if ($LM->column_info[$template_tag]['link'] == 'Y') { // Render as a Link to the record? if ($JobListAttributes->list_mode == 'ADMIN' || $JobListAttributes->list_mode == 'EMPLOYER') { $new_window = "onclick=\"window.open('post_window.php?post_id=" . $post_id . "', '', 'toolbar=no,scrollbars=yes,location=no,statusbar=no,menubar=no,resizable=1,width=800,height=500,left = 50,top = 50');return false;\""; } if ($template_tag == 'POSTED_BY') { // this link will lead to the employer's profile / list $val = $LM->get_open_link(JB_emp_profile_url($Form->get_template_value('USER_ID', $admin), $JobListAttributes), $new_window) . $val . $LM->get_close_link(); } else { // this link will lead to the job post $val = $LM->get_open_link(JB_job_post_url($post_id, $JobListAttributes), $new_window) . $val . $LM->get_close_link(); } } JBPLUG_do_callback('job_list_data_val', $val, $template_tag); //A plugin can modify the $val $LM->list_cell_open($template_tag, $class_postfix); $LM->echo_post_data($val, $b1, $b2); $LM->list_cell_close(); } }
<form method="post" name="form1" action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?> " Onsubmit= "form1.sendbutton.disabled=true;"> <input type="hidden" name="post_id" value="<?php echo jb_escape_html($post_id); ?> "> <input type="hidden" name="url" value="<?php echo JB_job_post_url($post_id, $JobListAttributes, JB_BASE_HTTP_PATH . 'index.php'); ?> " > <table align="center" border="0" width="98%" cellpadding="0" cellspacing="0" style="border-collapse: collapse; margin:3px" > <tr> <td style="background-color:#808080; color: white; font-weight:bold"> <?php echo $label['taf_heading']; ?> </td> </tr> <tr> <td width="100%"><span style="font-weight:bold"><?php echo $label['taf_url']; ?> </span><br> <?php echo JB_BASE_HTTP_PATH; ?> index.php?post_id=<?php
$result = jb_mysql_query($sql); $PForm = JB_get_DynamicFormObject(1); while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $PForm->set_values($row); if ($row['expired'] == 'Y') { // expired posts get archived $changefreq = 'never'; $piority = '0.1'; } else { $changefreq = 'monthly'; // on avg.. $priority = $data['jobs_priority']; } global $params; $params = $row; $output .= '<url>' . "\n" . '<loc>' . JB_xmlentities(JB_job_post_url($row['post_id'], null, JB_BASE_HTTP_PATH . 'index.php')) . '</loc>' . "\n" . '<lastmod>' . $row['formatted_date'] . '</lastmod>' . "\n" . '<changefreq>' . $changefreq . '</changefreq>' . "\n" . '<priority>' . $priority . '</priority>' . "\n" . '</url>' . "\n"; } // employer profiles $sql = "SELECT profile_id, expired, DATE_FORMAT(`profile_date`, '%Y-%m-%dT%H:%i:%s+00:00') AS formatted_date FROM profiles_table ORDER BY expired DESC, `profile_date` DESC"; //echo $sql; $result = jb_mysql_query($sql); while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { if ($row['expired'] == 'Y') { // expired posts get archived $changefreq = 'never'; $piority = '0.1'; } else { $changefreq = 'monthly'; // on avg.. $priority = $data['emp_priority']; }
JB_queue_mail_cc(addslashes($mail_id), addslashes(JB_SITE_NAME), addslashes(JB_SITE_CONTACT_EMAIL)); } $APM->ok_msg($label['app_sent']); if ($user_id) { $label['app_account_links'] = str_replace('%CANDIDATE_FOLDER%', JB_CANDIDATE_FOLDER, $label['app_account_links']); $APM->links(); } // send receipts. // prepare message for the Application receipt. $result = JB_get_email_template(10, $_SESSION['LANG']); $e_row = mysql_fetch_array($result, MYSQL_ASSOC); $EmailMessage = $e_row['EmailText']; $EmailMessage = str_replace("%SITE_CONTACT_EMAIL%", JB_SITE_CONTACT_EMAIL, $EmailMessage); $EmailMessage = str_replace("%SITE_NAME%", JB_SITE_NAME, $EmailMessage); $EmailMessage = str_replace("%POSTED_BY%", $POSTED_BY, $EmailMessage); $EmailMessage = str_replace("%POST_URL%", JB_job_post_url($post_id, $JobListAttributes, JB_BASE_HTTP_PATH . 'index.php'), $EmailMessage); $EmailMessage = str_replace("%EMPLOYER_EMAIL%", $EMAIL, $EmailMessage); $EmailMessage = str_replace("%JOB_TITLE%", $TITLE, $EmailMessage); $EmailMessage = str_replace("%APP_NAME%", $app_name, $EmailMessage); $EmailMessage = str_replace("%POST_ID%", $post_id, $EmailMessage); $EmailMessage = str_replace("%APP_EMAIL%", $app_email, $EmailMessage); $EmailMessage = str_replace("%APP_SUBJECT%", $app_subject, $EmailMessage); $EmailMessage = str_replace("%APP_LETTER%", $app_letter, $EmailMessage); $EmailMessage = str_replace("%APP_ATTACHMENT1%", $_FILES['att1']['name'], $EmailMessage); $EmailMessage = str_replace("%APP_ATTACHMENT2%", $_FILES['att2']['name'], $EmailMessage); $EmailMessage = str_replace("%APP_ATTACHMENT3%", $_FILES['att3']['name'], $EmailMessage); $PForm->set_viewer($employer_id, 'EMPLOYER'); $PForm->reset_fields(); while ($field = $PForm->next_field()) { // substitute template tags form the posting form $EmailMessage = str_replace('%' . $field['template_tag'] . '%', $PForm->get_template_value($field['template_tag']), $EmailMessage);
function JBXM_get_static_data($form_id, &$data, $val, &$feed_row) { if (!preg_match('/%[a-z_]+%/i', $val)) { return $val; // is not a variable } $val = str_replace('%SITE_NAME%', JB_SITE_NAME, $val); $val = str_replace('%SITE_DESCRIPTION%', JB_SITE_DESCRIPTION, $val); $val = str_replace('%SITE_CONTACT_EMAIL%', JB_SITE_CONTACT_EMAIL, $val); $val = str_replace('%BASE_HTTP_PATH%', JB_BASE_HTTP_PATH, $val); $val = str_replace('%RSS_FEED_LOGO%', JB_RSS_FEED_LOGO, $val); $val = str_replace('%FEED_DATE%', date('r'), $val); if (file_exists(JB_RSS_FEED_LOGO)) { $img_size = getimagesize(JB_RSS_FEED_LOGO); } $val = str_replace('%RSS_FEED_LOGO%', JB_RSS_FEED_LOGO, $val); $val = str_replace('%RSS_LOGO_HEIGHT%', $img_size[1], $val); $val = str_replace('%RSS_LOGO_WIDTH%', $img_size[0], $val); $val = str_replace('%DEFAULT_LANG%', $_SESSION['LANG'], $val); // These depend on the different record types // %EXPIRE_DATE% // %DATE% // %LINK% switch ($form_id) { case '1': // job posts $post_time = strtotime($data['post_date'] . " GMT "); //$link = JB_BASE_HTTP_PATH.'index.php?post_id='.$data['post_id']; //$link = JB_job_post_url($data['post_id'], '', '', '', '', '', JB_BASE_HTTP_PATH); $PForm = JB_get_DynamicFormObject(1); $PForm->set_values($data); $link = JBXM_xmlentities(JB_job_post_url($data['post_id'], null, JB_BASE_HTTP_PATH . 'index.php')); $val = str_replace('%LINK%', $link, $val); $val = str_replace('%DATE%', date('Y-m-d', $post_time), $val); $val = str_replace('%DATE_RFC%', date('r', $post_time), $val); $val = str_replace('%DATE_TROVIT%', date('d/m/Y', $post_time), $val); # elapsed = now - post_date # expires = post_date + DISPLAY DAYS if ($data['post_mode'] == 'premium') { $display_dur = JB_P_POSTS_DISPLAY_DAYS * 24 * 60 * 60; } else { $display_dur = JB_POSTS_DISPLAY_DAYS * 24 * 60 * 60; } $expire_time = $post_time + $display_dur; $val = str_replace('%EXPIRE_DATE%', date('Y-m-d', $expire_time), $val); $val = str_replace('%RECORD_ID%', $data['post_id'], $val); $val = str_replace('%USER_ID%', $data['user_id'], $val); break; case '2': // resumes break; } return $val; }
if (!is_numeric($JB_POSTS_PER_RSS) || $JB_POSTS_PER_RSS == 0) { $JB_POSTS_PER_RSS = '15'; } // removed from WHERE: DATE_SUB('".$now."',INTERVAL 30 DAY) <= `post_date` AND $sql = "select *, `post_date` AS DAY, DATE_FORMAT(`post_date`, '%a, %d %b %Y %H:%i:%s {$gmt_diff}') AS formatted_date from posts_table WHERE `approved`='Y' AND expired='N' " . jb_escape_sql($extra_sql) . " ORDER BY `post_date` DESC LIMIT " . $JB_POSTS_PER_RSS; $PostingForm =& JB_get_DynamicFormObject(1); $result = JB_mysql_query($sql) or die(mysql_error()); while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $PostingForm->set_values($row); $TITLE = $PostingForm->get_raw_template_value("TITLE"); $DESCRIPTION = $PostingForm->get_raw_template_value("DESCRIPTION"); $row['formatted_date'] = JB_get_formatted_date($row['post_date']); // force whitespace & strip tags. $DESCRIPTION = str_replace('<', ' <', $DESCRIPTION); $DESCRIPTION = str_replace('>', '> ', $DESCRIPTION); $DESCRIPTION = html_entity_decode(strip_tags($DESCRIPTION)); $DESCRIPTION = preg_replace('/[\\n\\r\\t]/', ' ', $DESCRIPTION); $DESCRIPTION = str_replace(' ', ' ', $DESCRIPTION); $output .= "<item>\n" . "<title>" . JB_rss_xmlentities($TITLE) . "</title>\n" . "<link>" . JB_job_post_url($row['post_id'], $JobListAttributes, JB_BASE_HTTP_PATH . 'index.php') . "</link>\n" . "<description>" . JB_rss_xmlentities(JB_truncate_html_str($DESCRIPTION, 255, $trunc_str_len)) . "...</description>\n" . "<pubDate>" . $row['formatted_date'] . "</pubDate>\n" . "<guid>" . JB_job_post_url($row['post_id'], $JobListAttributes, JB_BASE_HTTP_PATH . 'index.php') . "</guid>\n" . "</item>\n"; } $output .= '</channel>'; $output .= '</rss>'; if ($out_to_file) { $file = fopen(trim(JB_RSS_FEED_PATH), "wb"); fwrite($file, $output, strlen($output)); fclose($file); } if ($out_to_browser) { header('Content-type: application/xml; charset=UTF-8'); echo $output; }
function get_canonical_url() { return JB_job_post_url($this->post_id, $this->JobListAttributes, JB_BASE_HTTP_PATH . 'index.php'); }