Changeset 1589766
- Timestamp:
- 02/06/2017 09:03:04 AM (9 years ago)
- Location:
- zartis-job-plugin
- Files:
-
- 17 added
- 2 edited
-
tags/2.3.3 (added)
-
tags/2.3.3/Zartis_Job_Landing.php (added)
-
tags/2.3.3/Zartis_Job_Plugin.php (added)
-
tags/2.3.3/Zartis_Job_Token.php (added)
-
tags/2.3.3/css (added)
-
tags/2.3.3/css/hirehive-widget-styles.css (added)
-
tags/2.3.3/css/zartis_wp.css (added)
-
tags/2.3.3/images (added)
-
tags/2.3.3/images/arrow_right_alt1_24x24.png (added)
-
tags/2.3.3/images/check_12x10.png (added)
-
tags/2.3.3/images/check_alt_16x16.png (added)
-
tags/2.3.3/js (added)
-
tags/2.3.3/js/jquery-1.6.4.min.js (added)
-
tags/2.3.3/js/zartis_functions.js (added)
-
tags/2.3.3/js/zartis_functions.min.js (added)
-
tags/2.3.3/readme.txt (added)
-
tags/2.3.3/screenshot-1.png (added)
-
trunk/Zartis_Job_Plugin.php (modified) (13 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
zartis-job-plugin/trunk/Zartis_Job_Plugin.php
r1588382 r1589766 4 4 Plugin URI: http://hirehive.io 5 5 Description: (Formerly Zartis ATS) Easily add your own secure jobs and careers page to your WordPress site. Includes full access to professional candidate management and posting to twitter, facebook and free job aggregation sites. 6 Version: 2.3. 26 Version: 2.3.3 7 7 Author: HireHive 8 8 Author URI: http://hirehive.io … … 34 34 if (!defined('Zartis_Url')) 35 35 define('Zartis_Url', WP_PLUGIN_URL . '/' . HireHive_Folder); 36 36 37 37 // Add jquery core and our css styles 38 38 if (is_admin()) { … … 40 40 wp_enqueue_style('zartis_wp', Zartis_Url . '/css/zartis_wp.css'); 41 41 wp_enqueue_script('zartis_functions', Zartis_Url . '/js/zartis_functions.js'); 42 42 43 43 // The styles for the widget 44 44 wp_enqueue_style('hirehive_wp_widget', Zartis_Url . '/css/hirehive-widget-styles.css'); … … 83 83 global $wpdb; 84 84 $zartis_page_ID = get_option('Zartis_Page_ID'); 85 85 86 86 // Clean up DB fields 87 87 HireHive_CleanUp_DB(); 88 88 89 89 // the id of our page... 90 90 $page_ID = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE ID = '" . $zartis_page_ID . "'"); … … 114 114 add_action('admin_menu', 'Add_HireHive_Admin_Menu'); 115 115 $Zartis_Notice = get_option('Zartis_Notice'); 116 116 117 117 //checks if this is an activation and then displays the zartis message 118 118 if ($Zartis_Notice == "False") { … … 133 133 function Display_HireHive_Widget( $atts ) { 134 134 $category = ''; 135 135 136 136 if( isset( $atts['category'] ) && $atts['category']) { 137 137 $category = $atts['category']; 138 138 } 139 139 140 140 $Company_Zartis_ID = get_option('Zartis_Unique_ID'); 141 141 142 142 $Zartis_Group = get_option('Zartis_Group'); 143 143 144 144 if ($Zartis_Group == null){ 145 145 $Zartis_Group = 1; 146 146 } 147 147 148 148 if ($Company_Zartis_ID != "False") { 149 149 try { 150 150 151 151 if ($category !=null){ 152 152 $url = 'https://my.hirehive.io/api/v2/public/search?cname='.$Company_Zartis_ID.'&groupBy='.$Zartis_Group.'&category='.$category; … … 155 155 $url = 'https://my.hirehive.io/api/v2/public/search?cname='.$Company_Zartis_ID.'&groupBy='.$Zartis_Group; 156 156 } 157 157 158 158 $jsondata = file_get_contents($url); 159 159 160 160 if (strlen($jsondata) == 0){ 161 161 throw new Exception('file_get_contents returned nothing'); 162 162 } 163 163 164 164 $groups = json_decode($jsondata, true); 165 165 166 166 if (strlen($groups) == 0){ 167 167 throw new Exception('json_decode returned nothing'); 168 168 } 169 169 170 170 $decodeError = ''; 171 171 switch (json_last_error()) { 172 172 173 173 case JSON_ERROR_NONE: 174 174 break; … … 192 192 break; 193 193 } 194 194 195 195 if (strlen($decodeError) > 0) { 196 196 $emailBody = "JSON Decode failed: " .$Company_Zartis_ID; … … 201 201 $emailBody .= '<br><br>'; 202 202 $emailBody .= '<pre>' .print_r($decodeError, 1). '</pre>'; 203 203 204 204 $headers = 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; 205 205 206 206 error_log($emailBody, 1, '[email protected]', $headers); 207 207 208 208 throw new Exception('JSON version failed, fallback to JS widget'); 209 209 } 210 210 211 211 $jobTemplate = '<a class="hh-list-row" href="{{Link}}"><span class="hh-list-title">{{Title}}</span> <span class="hh-list-location">{{Location}}, {{Country}}</span> <span class="hh-list-type">{{Type}}</span></a>'; 212 212 213 213 $jobsHTML = "<div id='jobs_iframe' class='hh-list'>"; 214 214 $jobsHTML .= '<!-- Jobs for - ' .$Company_Zartis_ID. ' -->'; 215 $jobsHTML .= '<!-- Chosen group - ' .$Zartis_Group. ' -->';215 $jobsHTML .= '<!-- Chosen group - ' .$Zartis_Group. ' -->'; 216 216 $jobsHTML .= '<!-- Category - ' .$category. ' -->'; 217 217 218 218 foreach ($groups as $group) { 219 219 if ($Zartis_Group > 1){ 220 $jobsHTML .= '<h3 class="hh-list-cat">'.$group["name"].'</h3>'; 221 } 222 220 if (strlen($group["name"]) > 0){ 221 $jobsHTML .= '<h3 class="hh-list-cat">'.$group["name"].'</h3>'; 222 } 223 } 224 223 225 if ($category !=null){ 224 226 $jobsHTML .= Compile_Job_Template($jobTemplate, $group); … … 230 232 } 231 233 } 232 234 233 235 $jobsHTML .= "</div>"; 234 236 235 237 return $jobsHTML; 236 238 } … … 238 240 // If we have an exception using the API to get the jobs then we fallback to the old JS Version 239 241 $script = '<script type="text/javascript"src="https://my.hirehive.io/' . $Company_Zartis_ID . '/getwidget"></script><script type="text/javascript"charset="utf-8">function getParam(name){name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(window.location.href);if(results==null)return"";else return results[1];}function updateIFrame(height){var iframe=document.getElementById("jobs_iframe");iframe.setAttribute("height",height);}var height=getParam("height");if(height==""){var zartis_options={};zartis_options.display="iframe";zartis_options.company="' . $Company_Zartis_ID . '";zartis_options.placement="left";zartis_options.type="widget";zartis_options.color="#222";zartis_options.width="' . $Zartis_Width . '%";zartis_options.style="idea";zartis_options.url=document.URL;var zartis_widget=new ZARTIS.jobs_widget(zartis_options);}else{window.top.updateIFrame(height);}</script>'; 240 242 241 243 $script .= '<!-- Jobs for - ' .$Company_Zartis_ID. ' -->'; 242 $script .= '<!-- Chosen group - ' .$Zartis_Group. ' -->';244 $script .= '<!-- Chosen group - ' .$Zartis_Group. ' -->'; 243 245 $script .= '<!-- Category - ' .$category. ' -->'; 244 246 $script .= '<!--' .$e.message. '-->'; 245 247 246 248 return $script; 247 249 } 248 250 249 251 } else { 250 252 return false; … … 253 255 254 256 function Compile_Job_Template($template, &$job){ 255 257 256 258 $template = str_replace("{{Title}}",$job["title"],$template); 257 259 $template = str_replace("{{Link}}",$job["jobUrl"],$template); … … 259 261 $template = str_replace("{{Country}}",$job["countryName"],$template); 260 262 $template = str_replace("{{Type}}",$job["type"],$template); 261 263 262 264 return $template; 263 265 } -
zartis-job-plugin/trunk/readme.txt
r1588382 r1589766 5 5 Requires at least: 2.9 6 6 Tested up to: 4.7.2 7 Stable tag: 2.3. 27 Stable tag: 2.3.3 8 8 9 9 Easily add job listings and secure candidate management to your Wordpress site. … … 105 105 = 2.3.2 106 106 * Added a fallback for file_get_contents not working 107 108 = 2.3.3 109 * Check if group name is not empty before adding the h3 tag
Note: See TracChangeset
for help on using the changeset viewer.