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_display_sub_cats_compact(&$cats, $index) { # HTML output for this function comes from CategoryMarkup Class # include/themes/default/JBCategoryMarkup.php # Any HTML customizations should be done there. # Please copy this class in to your custom theme directory, and # customize form there global $label; $CL =& JB_get_CategoryMarkupObject(); $children = $cats[$index]['ch']; $space = ""; $CL->echo_open_sub_cat_c(); for ($x = 0; $x < $cats[$index]['chc']; $x++) { if ($x >= JB_SHOW_SUBCATS) { if (!JB_SHOW_SUBCATS) { break; } // do not show 'more' link when JB_SHOW_SUBCATS is 0 $CL->echo_sub_cat_c_more_link($cats[$index], $label["category_expand_more"]); break; } $ch_cat_name_anchor = $children[$x]['n']; if (JB_CAT_NAME_CUTOFF == 'YES') { $ch_cat_name_anchor = JB_truncate_html_str($ch_cat_name_anchor, JB_CAT_NAME_CUTOFF_CHARS, $trunc_str_len); } $CL->echo_sub_cat_c_link($children[$x], $ch_cat_name_anchor, $space); if (JB_CAT_SHOW_OBJ_COUNT == 'YES') { $CL->echo_sub_cat_c_count($children[$x]['oc']); } $space = $CL->sub_cat_c_set_space(); //if ($x > JB_SHOW_SUBCATS) { // $CL->echo_sub_cat_c_more_link($cats[$index], $label["category_expand_more"]); // break; //} } $CL->echo_close_sub_cat_c(); }
function echo_tt_options($value, $type = '') { global $post_tag_to_search; require_once jb_basedirpath() . "include/posts.inc.php"; foreach ($post_tag_to_search as $key => $tag) { if ($key != '') { $sel = ""; if (is_array($value)) { // multiple selected if (in_array($key, $value)) { $sel = ' selected '; } } else { if ($key == $value) { $sel = ' selected '; } } if ($type != '') { // echo only for the $type if ($tag[$key]['field_type'] == $type) { echo '<option ' . $sel . ' value="' . $key . '">' . JB_truncate_html_str($tag['field_label'], 50, $foo) . '</option>' . "\n"; $output = true; } } else { // echo all echo '<option ' . $sel . ' value="' . $key . '">' . JB_truncate_html_str($tag['field_label'], 50, $foo) . '</option>' . "\n"; $output = true; } } } if ($output == false) { echo '<option>[There are no ' . $type . ' fields to select]</option>'; } }
function JB_break_long_words($input, $with_tags) { // new routine, deals with html tags... if (defined('JB_LNG_MAX')) { $lng_max = JB_LNG_MAX; } else { $lng_max = 80; } //$input = stripslashes($input); while ($trun_str = JB_truncate_html_str($input, $lng_max, $trunc_str_len, false, $with_tags)) { if ($trunc_str_len == $lng_max) { // string was truncated if (strrpos($trun_str, " ") !== false) { // if trun_str has a space? $new_str .= $trun_str; } else { $new_str .= $trun_str . " "; } } else { $new_str .= $trun_str; } $input = substr($input, strlen($trun_str)); } //$new_str = addslashes($new_str); return $new_str; }
function JB_echo_proile_list_data($admin) { global $label, $cur_offset, $order_str, $q_offset, $show_emp, $cat, $list_mode; $LM =& JB_get_ListMarkupObject(3); // load the ListMarkup Class $Form =& JB_get_DynamicFormObject(3); $ttf =& $Form->get_tag_to_field_id(); if ($_REQUEST['order_by'] != '') { $ord = jb_alpha_numeric($_REQUEST['ord']); if ($ord == 'asc') { $ord = 'desc'; } elseif ($ord == 'desc') { $ord = 'asc'; } else { $ord = 'asc'; } $order_str = "&order_by=" . JB_escape_html($_REQUEST['order_by']) . "&ord=" . $ord; } 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'], $admin); 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, 3); JBPLUG_do_callback('pro_list_column_data_filter', $val, $template_tag); 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 = "<b>"; $b2 = "</b>"; } else { $b1 = ''; $b2 = ''; } if ($LM->column_info[$template_tag]['link'] == 'Y') { // Render as a Link to the record? $val = "<a href='" . htmlentities($_SERVER['PHP_SELF']) . "?profile_id=" . $Form->get_template_value('PROFILE_ID', $admin) . "{$order_str}{$q_string}{$q_offset}{$show_emp}{$cat}'>" . $val . "</a>"; } ?> <td class="list_data_cell" <?php if ($LM->column_info[$template_tag]['no_wrap'] == 'Y') { echo ' nowrap '; } ?> > <?php echo $b1 . $val . $b2; ?> </td> <?php } }
mysql_data_seek($result2, 0); $PForm =& JB_get_DynamicFormObject(1); $PForm->set_viewer($user_row['ID']); while ($post_row = mysql_fetch_array($result2, MYSQL_ASSOC)) { $PForm->set_values($post_row); $temp_html = $job_alert_line; // copy the template $DESCRIPTION = $PForm->get_template_value("DESCRIPTION"); $DESCRIPTION = str_replace("\n", " ", $DESCRIPTION); // '' $DESCRIPTION = str_replace("<br>", " ", $DESCRIPTION); // add spaces $DESCRIPTION = str_replace("</p>", " </p>", $DESCRIPTION); // '' $trunc_str_len = ''; $DESCRIPTION = JB_truncate_html_str(strip_tags($DESCRIPTION), 150, $trunc_str_len, true); $temp_html = str_replace("%DESCRIPTION%", $DESCRIPTION, $temp_html); $DATE = JB_get_formatted_date($PForm->get_template_value("DATE")); $FORMATTED_DATE = $DATE; //JB_get_formatted_date($DATE); $temp_html = str_replace('%FORMATTED_DATE%', $FORMATTED_DATE, $temp_html); //$temp_html = str_replace("%POST_ID%", $PForm->get_value('post_id'), $temp_html); $temp_html = str_replace('%BASE_HTTP_PATH%', JB_BASE_HTTP_PATH, $temp_html); // substitute temporary template $PForm->reset_fields(); $PForm->set_viewer($user_row['ID']); while ($field = $PForm->next_field()) { if ($field['field_type'] == 'BLANK' || $field['field_type'] == 'SEPERATOR') { continue; } if ($field['template_tag'] != '' && strlen($field['field_label']) > 0) {
function JBXM_get_filtered_data(&$element_row, &$feed_row, &$data, $field_id = '') { if ($field_id == '') { $field_id = $feed_row['field_settings'][$element_row['element_id']]; } $val = trim($data[$field_id]); if ($field_id == 'summary') { // generate a summary. // get the raw description global $post_tag_to_field_id; $description = trim($data[$post_tag_to_field_id['DESCRIPTION']['field_id']]); // truncate it and strip any tags $val = str_replace(' ', ' ', JB_truncate_html_str(strip_tags($description), JB_POSTS_DESCRIPTION_CHARS, $trunc_str_len)); return $val; } $field_type = $feed_row['field_settings']['ft_' . $element_row['element_id']]; if ($element_row['strip_tags'] == 'Y') { $val = strip_tags($val); $from_html = array(" ", " ", "\n\n", "\r\n\r\n"); $to_text = array(" ", " ", "\n", "\n"); $val = str_replace($from_html, $to_text, $val); } if ($element_row['truncate'] > 0) { $val = JB_truncate_html_str($val, $element_row['truncate'], $trunc_str_len, false); } switch ($field_type) { case 'MSELECT': case 'CHECK': if ($element_row['qualify_codes'] == 'Y') { $vals = explode(",", $val); $comma = ''; $str; if (sizeof($vals) > 0) { foreach ($vals as $v) { $str .= $comma . JB_getCodeDescription($field_id, $v); $comma = ", "; } } $val = $str; } break; case 'SELECT': case 'RADIO': if ($element_row['qualify_codes'] == 'Y') { $val = JB_getCodeDescription($field_id, $val); } break; case 'CATEGORY': if ($element_row['qualify_cats'] == 'Y') { $val = JB_getCatName($val); } break; case 'FILE': if ($feed_row['export_with_url'] == 'Y') { $val = JB_FILE_PATH . $val; } break; case 'IMAGE': if ($feed_row['export_with_url'] == 'Y') { $val = JB_IM_PATH . $val; } break; case 'PLUGIN': JBPLUG_do_callback('JBXM_get_filtered_data', $val, $feed_row); break; } if ($element_row['is_boolean'] == 'Y') { $match = $feed_row['field_settings']['boolean_p_' . $element_row['element_id']]; if ($field_type == 'MSELECT' || $field_type == 'RADIO') { if (strpos(strtolower($val), strtolower($match)) !== false) { $val = 'true'; } else { $val = 'false'; } } else { if (strtolower($val) == strtolower($match)) { $val = 'true'; } else { $val = 'false'; } } } 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; }