function set_category_kw($cat_id, &$keyword_q, &$location_q) { $keyword_q = ''; $location_q = ''; $cat_id = (int) $cat_id; $sql = "SELECT * FROM JobsFiller_keywords WHERE category_id='" . jb_escape_sql($cat_id) . "' "; $result = jb_mysql_query($sql); $row = mysql_fetch_array($result, MYSQL_ASSOC); if (strlen($row['kw']) > 0) { // keywords $keyword_q = trim($row['kw']); } else { $keyword_q = JB_getCatName($cat_id); // use the category name itself as the keyword } if (strlen($row['loc']) > 0) { // location $location_q = trim($row['loc']); } else { $location_q = $this->config['l']; // use the default location from the config } }
function JB_get_list_template_value($field, $val, $admin, $form_id = 1) { $LM =& JB_get_ListMarkupObject($form_id); $Form =& JB_get_DynamicFormObject($form_id); // it is assumed that this function is called in 'view' mode // the viewer id and type is unknown so null is passed if ($Form->process_field_restrictions($field, null, null, $admin)) { // Its a restricted field, eg anonymous, blocked or member's only return $Form->get_value($field['field_id']); } switch ($field['field_type']) { case 'TIME': // convert timestamp to local time zone // using the raw value stored in the record if ($val != '0000-00-00 00:00:00') { $val = JB_get_local_time($Form->get_value($field['field_id']) . ' GMT'); } break; case 'EDITOR': $val = strip_tags($val); $val = jb_escape_html($val); if (!$admin) { $val = JB_email_at_replace($val); } break; case 'IMAGE': if (JB_image_thumb_file_exists($Form->get_value($field['field_id']))) { $val = $LM->get_img_html($Form->get_value($field['field_id'])); } break; case "CURRENCY": if ($val > 0) { $val = JB_escape_html(JB_format_currency($Form->get_value($field['field_id']), JB_get_default_currency())); } else { $val = ''; } break; case "CATEGORY": $val = jb_escape_html(JB_getCatName($Form->get_value($field['field_id']))); break; case "RADIO": $val = jb_escape_html(JB_getCodeDescription($field['field_id'], $Form->get_value($field['field_id']))); break; case "SELECT": $val = jb_escape_html(JB_getCodeDescription($field['field_id'], $Form->get_value($field['field_id']))); break; case "MSELECT": case "CHECK": $vals = explode(",", $Form->get_value($field['field_id'])); $comma = ''; $str = ''; if (sizeof($vals) > 0) { foreach ($vals as $v) { $str .= $comma . jb_escape_html(JB_getCodeDescription($field['field_id'], $v)); $comma = ", "; } } $val = $str; break; case "DATE": case "DATE_CAL": if ($val != '0000-00-00 00:00:00') { $val = JB_get_local_time($Form->get_value($field['field_id']) . " GMT"); $val = JB_get_formatted_date($val); } else { $val = ''; } break; case "SKILL_MATRIX": $sql = "SELECT name FROM skill_matrix_data where object_id='" . JB_escape_sql($Form->get_value('resume_id')) . "' "; $result = JB_mysql_query($sql) or die(mysql_error()); $val = ''; $comma = ''; while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $val .= $comma . $row['name']; $comma = ", "; } break; default: // plugins can alter the data in the cell to be // be presented on the list in a custom manner $args = array('val' => &$val, 'has_changed' => false, 'field' => &$field, 'form_id' => $form_id, 'data' => $Form->get_values()); JBPLUG_do_callback('get_list_template_value', $args); // This hook was added in 3.6, allows plugins to modify the cell data based on $field, eg. $field['field_type'], the plugin should set 'has_changed' to true if the data in 'val' was changed. if ($args['has_changed']) { // has it changed? return $val; } // if not modified by plugin $val = jb_escape_html($val); if (!$admin) { $val = JB_email_at_replace($val); } } return $val; }
######################################### if ($CAN_VIEW_RESUMES == true) { // has a subscription to view resumes, or if no subscription is allowed to view resumes JB_display_dynamic_search_form(2); // Display Category tree code // do we have a CATEGORY type field? (field_type) $DynamicForm = jb_get_DynamicFormObject(2); foreach ($DynamicForm->get_tag_to_field_id() as $field) { // If it does have a CATEGORY, display the category tree and // break out from the loop if ($field['field_type'] == 'CATEGORY' && $_REQUEST['action'] != 'search' && $_REQUEST['resume_id'] == false) { ?> <div style="padding-bottom:3.5em; text-align:left"> <div style="float:left; "> <span class="category_name"> <?php echo jb_escape_html(JB_getCatName($_REQUEST['cat'])); ?> </span><br> <span class="category_path"><?php echo JB_getPath_templated($_REQUEST['cat']); ?> </span> </div> <?php if (is_numeric($_REQUEST['cat'])) { ?> <div style="float: right;"> <a href="index.php"><a href="search.php"><?php echo $label['c_back2top']; ?> </a></a>
?> </span><br> <span class="category_path"><?php echo JB_getPath_templated($cat_id); ?> </span> </div> <div style="float: right;"> <a href="index.php"><a href="browse.php"><?php echo $label['c_back2top']; ?> </a></a> <?php if (JB_CAT_RSS_SWITCH == 'YES') { $cat_name = trim(JB_getCatName($cat_id)); if ($cat_name) { ?> <p> <a href="<?php echo JB_BASE_HTTP_PATH . "rss.php?cat=" . jb_escape_html($cat_id); ?> "><img alt="RSS" src="<?php echo JB_THEME_URL . 'images/rss_cat.png'; ?> " border="0" ></a> <?php $label['rss_subscribe'] = str_replace('%RSS_LINK%', JB_BASE_HTTP_PATH . "rss.php?cat=" . jb_escape_html($cat_id), $label['rss_subscribe']); $label['rss_subscribe'] = str_replace('%CATEGORY_NAME%', jb_escape_html($cat_name), $label['rss_subscribe']); echo $label['rss_subscribe']; ?>
function showSubcat($c) { //global $connection; global $JobsFiller_default_l; global $JobsFiller_default_k; $query = " SELECT *, categories.category_id as CID, seo_keys FROM categories LEFT JOIN JobsFiller_keywords ON categories.category_id = JobsFiller_keywords.category_id WHERE parent_category_id = '{$c}' and form_id=1 ORDER BY list_order, category_name ASC "; $result = jb_mysql_query($query) or die(mysql_error()); //echo "<b>cateid:".$row2[1]." $query </b>"; if (mysql_num_rows($result) == 0) { $query = " SELECT kw, loc, categories.category_id as CID, seo_keys FROM categories LEFT JOIN JobsFiller_keywords ON categories.category_id = JobsFiller_keywords.category_id WHERE categories.category_id = '{$c}' and form_id=1 "; $result = jb_mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result, MYSQL_ASSOC); if (trim($row['loc']) == '') { $row['loc'] = $JobsFiller_default_l; } if (trim($row['kw']) == '') { $row['kw'] = $row['seo_keys']; } if (trim($row['kw']) == '') { // still empty? $row['kw'] = JB_getCatName($row['CID']); //$JobsFiller_default_k; } ?> What: <input size='36' type="text" value="<?php echo jb_escape_html($row['kw']); ?> " name='kw_<?php echo $row['CID']; ?> '> Where: <input size='36' type="text" value="<?php echo jb_escape_html($row['loc']); ?> " name='loc_<?php echo $row['CID']; ?> '><br> <?php } else { $x = 0; echo "<br><div style='margin-left: 20px;'>"; while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $x++; if ($x > SHOW_SUBCATS) { break; } //if ($row['allow_records']=='N') echo "<b>†</b>"; echo "<A HREF=" . $_SERVER['PHP_SELF'] . "?cat=" . $row['CID'] . "><font color=#0000FF>" . jb_escape_html($row['category_name']) . "</font></A> "; //;echo "<small>(ID: ". ($row[0]).")</small>"; if (trim($row['loc']) == '') { $row['loc'] = $JobsFiller_default_l; } if (trim($row['kw']) == '') { $row['kw'] = $row['seo_keys']; } if (trim($row['kw']) == '') { // still empty? //$row['kw'] = $JobsFiller_default_k; $row['kw'] = JB_getCatName($row['CID']); } ?> What: <input size='35' type="text" value="<?php echo jb_escape_html($row['kw']); ?> " name='kw_<?php echo $row['CID']; ?> '> Where: <input size='35' type="text" value="<?php echo jb_escape_html($row['loc']); ?> " name='loc_<?php echo $row['CID']; ?> '> <br> <?php // does this category have sub-categories? $query = " SELECT * FROM categories LEFT JOIN JobsFiller_keywords ON categories.category_id = JobsFiller_keywords.category_id WHERE parent_category_id = '" . $row['CID'] . "' ORDER BY list_order, category_name ASC "; $result2 = jb_mysql_query($query); if (mysql_num_rows($result2) > 0) { echo "<br>"; $row2 = mysql_fetch_row($result2); ?> <table style="margin-left: 15px;" cellspacing="1" border="0" width="100%"> <?php showAllCat($row['CID'], 1); ?> </table> <?php } } } echo "</div>"; }
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; }
return $string; } $date = date('r'); $gmt_diff = date('O'); $q = "?"; if (!($logo_path = JB_resolve_document_path(JB_RSS_FEED_LOGO))) { $logo_path = JB_RSS_FEED_LOGO; } $img_size = @getimagesize($logo_path); if ($img_size[0] == false) { // try to get it by using http $img_size = @getimagesize(JB_RSS_FEED_LOGO); } if (isset($_REQUEST['cat'])) { $cat_id = (int) $_REQUEST['cat']; $title_append = ' - ' . JB_getCatName($cat_id); $out_to_file = false; } else { $cat_id = null; } if (isset($_REQUEST['emp'])) { $emp_id = (int) $_REQUEST['emp']; require_once 'include/profiles.inc.php'; $title_append = ' - ' . JB_get_employer_name($emp_id); $out_to_file = false; } else { $emp_id = null; } $output = "<" . $q . "xml version=\"1.0\" encoding=\"utf-8\" " . $q . ">\n" . "<rss version=\"2.0\">\n" . "<channel>\n" . "<title>" . JB_rss_xmlentities(strip_tags(JB_SITE_HEADING) . $title_append) . "</title>\n" . "<link>" . JB_BASE_HTTP_PATH . "</link>\n" . "<description>" . JB_rss_xmlentities(strip_tags(JB_SITE_DESCRIPTION)) . "</description>\n" . "<language>en</language>\n" . "<pubDate>" . $date . "</pubDate>\n" . "<lastBuildDate>" . $date . "</lastBuildDate>\n" . "<docs>http://blogs.law.harvard.edu/tech/rss</docs>\n" . "<generator>HiTeacher custom in-house RSS generator</generator>\n" . "<managingEditor>" . JB_SITE_CONTACT_EMAIL . "</managingEditor>\n" . "<webMaster>" . JB_SITE_CONTACT_EMAIL . "</webMaster>\n" . "<image>\n" . "<link>" . JB_BASE_HTTP_PATH . "</link>\n" . "<title>" . JB_BASE_HTTP_PATH . "</title>\n" . "<url>" . JB_RSS_FEED_LOGO . "</url>\n" . "<width>" . $img_size[0] . "</width>" . "<height>" . $img_size[1] . "</height>" . "</image>\n"; $now = gmdate("Y-m-d H:i:s"); if ($cat_id) {
function JB_field_form($NEW_FIELD, $data, $form_id) { if ($_REQUEST['save'] == false && $_REQUEST['field_id'] != false && $data['error'] == false) { // load in the values $sql = "SELECT *, t2.field_comment AS FCOMMENT, t2.field_label AS LABEL, t2.error_message AS ERRMSG FROM form_fields AS t1, form_field_translations AS t2 WHERE t1.field_id=t2.field_id AND lang='" . JB_escape_sql($_SESSION['LANG']) . "' AND t1.field_id='" . JB_escape_sql($_REQUEST['field_id']) . "'"; $result = JB_mysql_query($sql) or die(mysql_error()); $row = mysql_fetch_array($result, MYSQL_ASSOC); $row['field_comment'] = $row['FCOMMENT']; $row['field_label'] = $row['LABEL']; $row['error_message'] = $row['ERRMSG']; } else { $row['field_id'] = $_REQUEST['field_id']; $row['form_id'] = $_REQUEST['form_id']; $row['field_label'] = $_REQUEST['field_label']; $row['field_sort'] = $_REQUEST['field_sort']; $row['field_type'] = $_REQUEST['field_type']; $row['is_required'] = $_REQUEST['is_required']; $row['display_in_list'] = $_REQUEST['display_in_list']; $row['reg_expr'] = $_REQUEST['reg_expr']; $row['error_message'] = $_REQUEST['error_message']; $row['field_init'] = $_REQUEST['field_init']; $row['field_width'] = $_REQUEST['field_width']; $row['field_height'] = $_REQUEST['field_height']; $row['is_in_search'] = $_REQUEST['is_in_search']; $row['template_tag'] = $_REQUEST['template_tag']; $row['section'] = $_REQUEST['section']; $row['list_sort_order'] = $_REQUEST['list_sort_order']; $row['search_sort_order'] = $_REQUEST['search_sort_order']; $row['field_comment'] = $_REQUEST['field_comment']; $row['is_hidden'] = $_REQUEST['is_hidden']; $row['is_anon'] = $_REQUEST['is_anon']; $row['is_blocked'] = $_REQUEST['is_blocked']; $row['is_prefill'] = $_REQUEST['is_prefill']; $row['is_member'] = $_REQUEST['is_member']; $row['multiple_sel_all'] = $_REQUEST['multiple_sel_all']; $row['category_init_id'] = $_REQUEST['category_init_id']; $row['is_cat_multiple'] = $_REQUEST['is_cat_multiple']; $row['cat_multiple_rows'] = $_REQUEST['cat_multiple_rows']; //if (get_magic_quotes_gpc()) { // grrr! assuming mc is always on $row['field_label'] = stripslashes($row['field_label']); $row['field_comment'] = stripslashes($row['field_comment']); $row['error_message'] = stripslashes($row['error_message']); $row['template_tag'] = stripslashes($row['template_tag']); $row['field_init'] = stripslashes($row['field_init']); //} } JBPLUG_do_callback('init_field_form_values', $row, $form_id); ?> <?php if ($row['template_tag'] == '') { // try to get template tag from the database (It could be blank because it was reserved) $sql = "SELECT * FROM form_fields AS t1, form_field_translations AS t2 WHERE t1.field_id=t2.field_id AND lang='" . JB_escape_sql($_SESSION['LANG']) . "' AND t1.field_id='" . JB_escape_sql($_REQUEST['field_id']) . "'"; $temp_result = JB_mysql_query($sql) or die(mysql_error()); $temp_row = mysql_fetch_array($temp_result, MYSQL_ASSOC); $row['template_tag'] = $temp_row['template_tag']; } if (JB_is_reserved_template_tag($row['template_tag'])) { $disabled = " disabled "; } ?> <form method="POST" name="form2" action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?> " method="post" > <input type="hidden" name="form_id" value="<?php echo jb_escape_html($form_id); ?> "> <input type="hidden" name="NEW_FIELD" value="<?php echo jb_escape_html($_REQUEST['NEW_FIELD']); ?> "> <input type="hidden" name="field_id" value="<?php echo jb_escape_html($row['field_id']); ?> "> <input type="hidden" name="mode" value="<?php echo jb_escape_html($_REQUEST['mode']); ?> "> <table border="0" cellSpacing="1" cellPadding="3" bgColor="#d9d9d9" > <tr> <td colspan="2"><?php if ($NEW_FIELD == 'NO') { echo "<font face='Arial' size='2'><b>[EDIT FIELD]</b></font>"; } else { echo "<font face='Arial' size='2'><b>[ADD NEW FIELD]</b></font>"; } ?> <br><input class="form_submit_button" type="submit" value="Save" name="save"><?php if ($NEW_FIELD == 'NO') { ?> <input type="submit" value="Delete" name="delete" onClick="return confirmLink(this, 'Delete this field, are you sure?')"><?php } if ($_REQUEST['allow_anyway'] != '') { echo "<br><input type='checkbox' name='do_alter'><font color='red'>Change the field's Database Type</font> (This will delete any previous data stored in the field)"; } ?> </td> </tr> <tr bgColor="#ffffff"> <td><font face="Arial" size="2"><b>Field label</b></font></td> <td> <input type="text" name="field_label" size="27" value="<?php echo jb_escape_html($row['field_label']); ?> " ></td> </tr> <tr bgcolor="#ffffff"> <td><font face="Arial" size="2" ><b>Type<font color="#ff0000"><b>*</b></font></b></font></td> <td><select size="5" name="field_type" > <option value="BLANK" <?php if ($row['field_type'] == 'BLANK') { echo " selected "; } ?> >Blank Space</option> <option value="CATEGORY" <?php if ($row['field_type'] == 'CATEGORY') { echo " selected "; } ?> >Category</option> <option value="CHECK" <?php if ($row['field_type'] == 'CHECK') { echo " selected "; } ?> >Check Boxes</option> <option value="CURRENCY" <?php if ($row['field_type'] == 'CURRENCY') { echo " selected "; } ?> >Currency</option> <option value="DATE" <?php if ($row['field_type'] == 'DATE') { echo " selected "; } ?> >Date</option> <option value="DATE_CAL" <?php if ($row['field_type'] == 'DATE_CAL') { echo " selected "; } ?> >Date - Calendar</option> <option value="FILE" <?php if ($row['field_type'] == 'FILE') { echo " selected "; } ?> >File</option> <option value="GMAP" <?php if ($row['field_type'] == 'GMAP') { echo " selected "; } ?> >Google Map</option> <option value="IMAGE" <?php if ($row['field_type'] == 'IMAGE') { echo " selected "; } ?> >Image</option> <option value="INTEGER" <?php if ($row['field_type'] == 'INTEGER') { echo " selected "; } ?> >Integer</option> <?php //if ($form_id==1) { // HTML editor is for job posts only. ?> <option value="EDITOR" <?php if ($row['field_type'] == 'EDITOR') { echo " selected "; } ?> >HTML Editor</option> <?php // } ?> <option value="MSELECT" <?php if ($row['field_type'] == 'MSELECT') { echo " selected "; } ?> >Multiple Select</option> <option value="NOTE" <?php if ($row['field_type'] == 'NOTE') { echo " selected "; } ?> >Note</option> <option value="NUMERIC" <?php if ($row['field_type'] == 'NUMERIC') { echo " selected "; } ?> >Numeric</option> <option value="RADIO" <?php if ($row['field_type'] == 'RADIO') { echo " selected "; } ?> >Radio Buttons</option> <option value="SEPERATOR" <?php if ($row['field_type'] == 'SEPERATOR') { echo " selected "; } ?> >Seperator</option> <option value="SELECT" <?php if ($row['field_type'] == 'SELECT') { echo " selected "; } ?> >Single Select</option> <?php if ($form_id == 2) { // skill matrix is for resumes only. ?> <option value="SKILL_MATRIX" <?php if ($row['field_type'] == 'SKILL_MATRIX') { echo " selected "; } ?> >Skill Matrix</option> <?php } ?> <option value="TEXTAREA" <?php if ($row['field_type'] == 'TEXTAREA') { echo " selected "; } ?> >Text Editor</option> <option value="TEXT" <?php if ($row['field_type'] == 'TEXT') { echo " selected "; } ?> >Text Field</option> <option value="URL" <?php if ($row['field_type'] == 'URL') { echo " selected "; } ?> >URL</option> <option value="YOUTUBE" <?php if ($row['field_type'] == 'YOUTUBE') { echo " selected "; } ?> >YouTube Video</option> <?php echo JBPLUG_do_callback('echo_field_type_option', $row, $form_id); ?> </select></td> </tr> <tr bgcolor="#ffffff"> <td><font face="Arial" size="2"><b>Initial Value</b></font></td> <td> <input type="text" name="field_init" value="<?php echo jb_escape_html($row['field_init']); ?> " size="3"><font size='2'> (Default value for text fields, can be left blank.) </font></td> </tr> <!-- tr bgcolor="#ffffff"> <td><font face="Arial" size="2"><b>Sort order<font color="#ff0000"><b>*</b></font></b></font></td> <td> <input type="text" name="field_sort" value="<?php echo $row[field_sort]; ?> " size="3"><font size='2'> (1=first, 2=2nd, etc) </font></td> </tr--> <tr bgcolor="#ffffff"> <td><font face="Arial" size="2"><b>Section<font color="#ff0000"><b>*</b></font></b></font></td> <td> <select name="section"> <option value='1' <?php if ($row['section'] == '1') { echo " selected "; } ?> >1</option> <option value='2' <?php if ($row['section'] == '2') { echo " selected "; } ?> >2</option> <?php if ($form_id < 4) { ?> <option value='3' <?php if ($row['section'] == '3') { echo " selected "; } ?> >3</option> <?php } if ($form_id === 1 && JB_MAP_DISABLED == 'GMAP') { ?> <option value='4' <?php if ($row['section'] == '4') { echo " selected "; } ?> >4 (Map)</option> <?php } ?> </select> </td> </tr> <tr bgColor="#eaeaea"> <td colspan="2">Validation (only required fields are validated)</td> </tr> <tr bgcolor="#ffffff"> <td><font face="Arial" size="2"><b>Is Required?</b></font></td> <td><input type="checkbox" name="is_required" value="Y" <?php if ($row['is_required'] == 'Y') { echo " checked "; } ?> ></td> </tr> <tr bgcolor="#ffffff"> <td><font face="Arial" size="2"><b>Type of check</b></font></td> <td> <select name="reg_expr"> <option value="" <?php if ($row['reg_expr'] == '') { echo " selected "; } ?> >[Select]</option> <option value="not_empty" <?php if ($row['reg_expr'] == 'not_empty') { echo " selected "; } ?> >Must not be empty</option> <option value="email" <?php if ($row['reg_expr'] == 'email') { echo " selected "; } ?> >Valid Email</option> <option value="date" <?php if ($row['reg_expr'] == 'date') { echo " selected "; } ?> >Valid Date</option> <option value="numeric" <?php if ($row['reg_expr'] == 'numeric') { echo " selected "; } ?> >Must be numeric</option> </select> </td> </tr> <tr bgcolor="#ffffff"> <td><font face="Arial" size="2"><b>Error message</b></font></td> <td> <input type="text" name="error_message" size="27" value="<?php echo jb_escape_html($row['error_message']); ?> ">(The reason for the error. Eg: <i>was not filled in</i> or <i>was invalid</i> for email.)</td> </tr> <tr bgColor="#eaeaea"> <td colspan="2">Display</td> </tr> <!-- tr bgcolor="#ffffff"> <td><font face="Arial" size="2"><b>Display in list?</b></font></td> <td><input type="checkbox" name="display_in_list" value="Y" <?php if ($row[display_in_list] == 'Y') { echo " checked "; } ?> > <font face="Arial" size="2">Column Order:</font><input type="text" name="list_sort_order" value="<?php echo $row[list_sort_order]; ?> " size="2"></td> </tr --> <tr bgcolor="#ffffff"> <td><font face="Arial" size="2"><b>Is on search form?</b></font></td> <td><?php if ($row['field_type'] == 'GMAP') { echo 'The Google maps field does not support search in this version'; } else { ?> <input type="checkbox" name="is_in_search" value="Y" <?php if ($row['is_in_search'] == 'Y') { echo " checked "; } ?> > <font face="Arial" size="2">Sort Order:</font><input type="text" name="search_sort_order" value="<?php echo $row['search_sort_order']; ?> " size="2">(1=first)<?php } ?> </td> </tr> <tr bgcolor="#ffffff"> <td><font face="Arial" size="2"><b>Template Tag <font color="#ff0000"><b>*</b></font></b></font></td> <td> <input type="text" name="template_tag" <?php echo $disabled; ?> size="20" value="<?php echo jb_escape_html($row['template_tag']); ?> "> (a unique identifier for this field)</td> </tr> <tr bgColor="#eaeaea"> <td colspan="2">Parameters</td> </tr> <tr bgcolor="#ffffff"> <td><font face="Arial" size="2"><b>Width</b></font></td> <td> <input type="text" name="field_width" size="3" value="<?php echo jb_escape_html($row['field_width']); ?> "></td> </tr> <tr bgcolor="#ffffff"> <td><font face="Arial" size="2"><b>Height</b></font></td> <td> <input type="text" name="field_height" size="3" value="<?php echo jb_escape_html($row['field_height']); ?> "><font size='2'>(for textareas or multiple selects)</font></td> </tr> <tr bgcolor="#ffffff"> <td><font face="Arial" size="2"><b>Is hidden from website?</b></font> </td> <td><input type="checkbox" name="is_hidden" <?php if ($row['is_hidden'] == 'Y') { echo " checked "; } ?> value="Y"><font size='2'>Is hidden from website. Only visibile on the editing form (and to Admins).</font></td> </tr> <?php if ($form_id == 2) { // only resumes ?> <tr bgcolor="#ffffff"> <td><font face="Arial" size="2"><b>Can be anonymous?</b></font> </td> <td><input type="checkbox" name="is_anon" <?php if ($row['is_anon'] == 'Y') { echo " checked "; } ?> value="Y"><font size='2'>(Can be anonymous on resumes. If this feature is enabled, users can hide this field and reveal after responding to Employer's request.)</font></td> </tr> <?php } ?> <?php if ($form_id == 2) { // only resumes ?> <tr bgcolor="#ffffff"> <td><font face="Arial" size="2"><b>Is blocked?</b></font> </td> <td><input type="checkbox" name="is_blocked" <?php if ($row['is_blocked'] == 'Y') { echo " checked "; } ?> value="Y"><font size='2'>(Can be subjected to blocking. A field is un-blocked for users who are subscribed to the resume DB or received an application from a corresponding candidate. Blocking options are set in Main Config. )</font></td> </tr> <?php } ?> <tr bgcolor="#ffffff"> <td><font face="Arial" size="2"><b>Is Members Only?</b></font> </td> <td><input type="checkbox" name="is_member" <?php if ($row['is_member'] == 'Y') { echo " checked "; } ?> value="Y"><font size='2'>(Can be subjected to Membership. Membership options are set in Main Config. )</font></td> </tr> <?php if ($form_id == 1) { // only job posts can be pre-filled ?> <tr bgcolor="#ffffff"> <td><font face="Arial" size="2"><b>Pre-fill?</b></font> </td> <td><input type="checkbox" name="is_prefill" <?php if ($row['is_prefill'] == 'Y') { echo " checked "; } ?> value="Y"><font size='2'>(Attempt to pre-fill the field with data from the previous record)</font></td> </tr> <?php } ?> <tr bgcolor="#ffffff"> <td><font face="Arial" size="2"><b>Field Comment</b></font> </td> <td><input type="text" name="field_comment" value="<?php echo jb_escape_html($row['field_comment']); ?> "><font size='2'>(Comment to be displayed next to the field, like the one you are reading now.)</font></td> </tr> <tr bgcolor="#ffffff"> <td><font face="Arial" size="2"><b>Category</b></font></td> <td> <input type="button" onclick="window.open('selectcat_window.php?field_id=<?php echo $row['field_id']; ?> &form_id=<?php echo $form_id; ?> ', '', 'toolbar=no,scrollbars=yes,location=no,statusbar=no,menubar=no,resizable=1,width=500,height=500,left = 50,top = 50');return false;" value="Select Category..." > <input type="hidden" name="category_init_id" value="<?php echo jb_escape_html($row['category_init_id']); ?> " size="3"><font size='2'> (If field is a category, select the initial category) </font> Currently Selected:<br><input type="text" disabled name="category_init_name" value="<?php echo jb_escape_html(JB_getCatName($row['category_init_id'])) . " (#" . jb_escape_html($row['category_init_id']) . ")"; ?> " size="30"><br> <input type="checkbox" name="is_cat_multiple" <?php if ($row['is_cat_multiple'] == 'Y') { echo " checked "; } ?> value="Y"><font size='2'>Multiple Categories can be selected when searching, with <input type="text" value="<?php echo $row['cat_multiple_rows']; ?> " size='1' name='cat_multiple_rows'> rows showing on the search form.</font> And, <input type="checkbox" name="multiple_sel_all" <?php if ($row['multiple_sel_all'] == 'Y') { echo " checked "; } ?> value="Y"> the first option selects all. </td> </tr> </table> <input class="form_submit_button" type="submit" value="Save" name="save"> </form> <?php }
function JBJobCategoryPage($cat_id, $offset, $admin = false) { $this->cat_id = (int) $cat_id; $this->list_mode = 'BY_CATEGORY'; $this->page_name = "CATEGORY_PAGE"; // load the posts in the category $this->category = JB_get_category($this->cat_id); $this->vars = array('cat_id' => $this->cat_id, 'CAT_NAME' => JB_getCatName($this->cat_id), 'CAT_PATH' => JB_getPath_templated($this->cat_id), 'CAT_STRUCT' => JB_getCatStruct($this->cat_id, $_SESSION["LANG"], 1), 'category' => &$this->category, 'admin' => $admin); JBPLUG_do_callback('init_job_category_page_vars', $this->vars); // register the header_tags() method so that JBMarkup can call it back global $JBMarkup; $JBMarkup->set_handler('header', $this, 'header_tags'); }
function get_template_value($tmpl, $admin = false, $raw = false) { $val = ''; $field_id = $this->tag_to_field_id[$tmpl]['field_id']; if (!isset($this->data[$field_id])) { $this->data[$field_id] = ''; } if ($raw) { // return without any post-processing return $this->data[$field_id]; } /* Hook here for your plugin to bypass this function * Tip: Your plugin can use $this object like this: * $obj = JB_get_DynamicFormObject($form_id) * $field_id = $this->tag_to_field_id[$tmpl]['field_id']; * ... */ $val = false; JBPLUG_do_callback('get_template_value', $val, $this->form_id, $tmpl, $admin); if ($val !== false) { return $val; } if ($this->process_field_restrictions($tmpl, $this->viewer_id, $this->viewer_type, $admin)) { // Its a restricted field, eg anonymous, blocked or member's only return $this->data[$field_id]; } // it is assumed that this function is called in 'view' mode /*if (JB_process_field_restrictions($this->data, $this->tag_to_field_id[$tmpl], 'view', $admin)) { // Its a restricted field, eg anonymous, blocked or member's only return $this->data[$field_id]; } */ switch ($this->tag_to_field_id[$tmpl]['field_type']) { case "URL": $val = $this->data[$field_id]; if (strlen($val) > 0) { if (strpos($val, 'http://') === false && strpos($val, 'https://') === false) { $val = 'http://' . $val; } $val = JB_escape_html($val); // no html allowed in this field } break; case "IMAGE": if (!JB_image_thumb_file_exists($this->data[$field_id])) { $val = $label['employer_resume_list_no_image']; } else { $val = $this->data[$field_id]; } break; case "NUMERIC": case "INTEGER": $val = jb_escape_html($this->data[$field_id]); // no html allowed in this field break; case "CURRENCY": if ($val > 0) { $val = JB_escape_html(JB_format_currency($this->data[$field_id], JB_get_default_currency())); } else { $val = ''; } break; case "CATEGORY": $val = jb_escape_html(JB_getCatName($this->data[$field_id])); break; case "RADIO": $val = jb_escape_html(JB_getCodeDescription($field_id, $this->data[$field_id])); break; case "SELECT": $val = jb_escape_html(JB_getCodeDescription($field_id, $this->data[$field_id])); break; case "MSELECT": case "CHECK": $vals = explode(",", $this->data[$field_id]); $comma = ''; $str = ''; if (sizeof($vals) > 0) { foreach ($vals as $v) { $str .= $comma . jb_escape_html(JB_getCodeDescription($field_id, $v)); $comma = ", "; } } $val = $str; break; case "TIME": if ($this->data[$field_id] != '0000-00-00 00:00:00') { // convert the time to a local time zone $val = JB_get_local_time($this->data[$field_id] . " GMT"); } break; case "DATE": case "DATE_CAL": if ($this->data[$field_id] != '0000-00-00 00:00:00') { $val = JB_get_local_time($this->data[$field_id] . " GMT"); $val = JB_get_formatted_date($val); } else { $val = ''; } break; case "SKILL_MATRIX": $sql = "SELECT name FROM skill_matrix_data where object_id='" . JB_escape_sql($this->data['resume_id']) . "' "; $result = JB_mysql_query($sql) or die(mysql_error()); $val = ''; $comma = ''; while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $val .= $comma . $row['name']; $comma = ", "; } break; case "TIME": // time is used for post_date, resume_date, signup_date, profile_date, etc.. $val = JB_get_local_time($this->data[$field_id] . " GMT"); // the time is always stored as GMT break; case 'TEXTAREA': case "TEXT": $val = JB_escape_html($this->data[$field_id]); // no html allowed in this field break; case "EDITOR": // HTML is allowed for this field //assuming that input was sanitized and only allowed HTML is included $val = $this->data[$field_id]; break; case 'GMAP': $val = 'lat:' . $this->data[$field_id . '_lat'] . '/lng:' . $this->data[$field_id . '_lng']; break; default: $val = false; // A plugin can filter the $val value to be returned JBPLUG_do_callback('get_template_value_filter', $val, $this->tag_to_field_id[$tmpl]['field_type']); if ($val !== false) { return $val; } else { // $val is empty which means that it wasn't set by a plugin // escape HTML just in case. $val = JB_escape_html($this->data[$field_id]); // no html allowed in this field } break; } if ($field_id == '') { //echo '<b>Configuration error: Failed to bind the "'.$tmpl.'" Template Tag. (not defined)</b> <br> '; } return $val; }