Changeset 2940918
- Timestamp:
- 07/20/2023 03:23:49 PM (3 years ago)
- Location:
- expertfile-expert-content-templates/trunk
- Files:
-
- 17 edited
-
expertfile.php (modified) (2 diffs)
-
public/class-expertfile-public.php (modified) (3 diffs)
-
public/classes/Api.php (modified) (2 diffs)
-
public/classes/Design.php (modified) (1 diff)
-
public/classes/Expert.php (modified) (5 diffs)
-
public/classes/ExpertAnswer.php (modified) (2 diffs)
-
public/classes/Inquiry.php (modified) (2 diffs)
-
public/classes/Sitemap.php (modified) (1 diff)
-
public/classes/Spotlight.php (modified) (2 diffs)
-
public/classes/Utils.php (modified) (1 diff)
-
public/js/analytic.ly.js (modified) (1 diff)
-
public/js/expertanswer.js (modified) (1 diff)
-
public/js/spotlight.js (modified) (1 diff)
-
public/js/util.js (modified) (3 diffs)
-
public/partials/expert/directory.php (modified) (1 diff)
-
public/partials/expert/profile.php (modified) (2 diffs)
-
public/partials/expertanswer/post.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
expertfile-expert-content-templates/trunk/expertfile.php
r2893860 r2940918 11 11 * Plugin URI: https://expertfile.com/wordpress 12 12 * Description: The easiest most powerful way to add expert content to your website from directories to profiles & more... 13 * Version: 1.0.3 313 * Version: 1.0.34 14 14 * Author: ExpertFile 15 15 * Author URI: https://expertfile.com … … 24 24 } 25 25 26 define( 'EXPERTFILE_VERSION', '1.0.1 2' );26 define( 'EXPERTFILE_VERSION', '1.0.13' ); 27 27 define( 'EXPERTFILE_PLUGIN_NAME', 'expertfile' ); 28 28 define( 'EXPERTFILE_API_ENDPOINT', 'https://public-api.expertfile.com' ); -
expertfile-expert-content-templates/trunk/public/class-expertfile-public.php
r2893860 r2940918 484 484 $profile_page_url = ($profile_page_url == "" ? $url_options['profile-url'] : $profile_page_url); 485 485 486 if ( is_null($post_id)) {486 if (!isset($post_id)) { 487 487 return; 488 488 } … … 624 624 $post_id = $qs['id'] ?? get_query_var('id') ?? null;; 625 625 626 if ( is_null($post_id)) {626 if (!isset($post_id)) { 627 627 return; 628 628 } … … 1097 1097 $id = $options['organization-id']; 1098 1098 1099 if ( is_null($id) || is_null($secret) || is_null($id)) {1099 if (!isset($id) || !isset($secret) || !isset($id)) { 1100 1100 return; 1101 1101 } -
expertfile-expert-content-templates/trunk/public/classes/Api.php
r2833229 r2940918 12 12 function set_token($token) 13 13 { 14 if ( is_null($token)) {14 if (!isset($token)) { 15 15 return; 16 16 } … … 23 23 function make_request($token = null, $url, $params = [], $type = 'GET') 24 24 { 25 if ( is_null($token)) {25 if (!isset($token)) { 26 26 $token = $this->get_oauth_2_token($this->client_id, $this->client_secret); 27 27 -
expertfile-expert-content-templates/trunk/public/classes/Design.php
r2695500 r2940918 15 15 $token 16 16 ) { 17 if ( is_null($this->organization_id)) {17 if (!isset($this->organization_id)) { 18 18 return; 19 19 } -
expertfile-expert-content-templates/trunk/public/classes/Expert.php
r2759416 r2940918 27 27 28 28 29 if ( is_null($this->organization_id)) {29 if (!isset($this->organization_id)) { 30 30 return; 31 31 } … … 71 71 $q 72 72 ) { 73 if ( is_null($this->organization_id)) {73 if (!isset($this->organization_id)) { 74 74 return; 75 75 } … … 91 91 ) { 92 92 93 if ( is_null($this->organization_id) || is_null($username)) {93 if (!isset($this->organization_id) || !isset($username)) { 94 94 return; 95 95 } … … 105 105 $username 106 106 ) { 107 if ( is_null($this->organization_id) || is_null($username)) {107 if (!isset($this->organization_id) || !isset($username)) { 108 108 return; 109 109 } … … 123 123 $page_size 124 124 ) { 125 if ( is_null($this->organization_id) || is_null($username)) {125 if (!isset($this->organization_id) || !isset($username)) { 126 126 return; 127 127 } -
expertfile-expert-content-templates/trunk/public/classes/ExpertAnswer.php
r2695500 r2940918 15 15 public function get_expert_answers($token, $tags, $page_size, $page_number) 16 16 { 17 if ( is_null($this->organization_id)) {17 if (!isset($this->organization_id)) { 18 18 return; 19 19 } … … 41 41 $post_id 42 42 ) { 43 if ( is_null($this->organization_id) || is_null($post_id)) {43 if (!isset($this->organization_id) || !isset($post_id)) { 44 44 return; 45 45 } -
expertfile-expert-content-templates/trunk/public/classes/Inquiry.php
r2695500 r2940918 15 15 $token 16 16 ){ 17 if ( is_null($this->organization_id)) {17 if (!isset($this->organization_id)) { 18 18 return; 19 19 } … … 29 29 $parameters 30 30 ){ 31 if ( is_null($this->organization_id)) {31 if (!isset($this->organization_id)) { 32 32 return; 33 33 } -
expertfile-expert-content-templates/trunk/public/classes/Sitemap.php
r2893860 r2940918 18 18 $parameters 19 19 ) { 20 if ( is_null($this->organization_id)) {20 if (!isset($this->organization_id)) { 21 21 return; 22 22 } -
expertfile-expert-content-templates/trunk/public/classes/Spotlight.php
r2695500 r2940918 16 16 $post_id 17 17 ){ 18 if ( is_null($this->organization_id) || is_null($post_id)) {18 if (!isset($this->organization_id) || !isset($post_id)) { 19 19 return; 20 20 } … … 35 35 ){ 36 36 37 if ( is_null($this->organization_id)) {37 if (!isset($this->organization_id)) { 38 38 return; 39 39 } -
expertfile-expert-content-templates/trunk/public/classes/Utils.php
r2836218 r2940918 60 60 { 61 61 62 if ( is_null($url) || is_null($identifier) || is_null($type)) return "";62 if (!isset($url) || !isset($identifier) || !isset($type)) return ""; 63 63 $encoded_pattern = '/{{encoded}}/'; 64 64 -
expertfile-expert-content-templates/trunk/public/js/analytic.ly.js
r2695500 r2940918 1 !function(e){function t(n){if(r[n])return r[n].exports;var a=r[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var r={};t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,r){!function(e){function t(){var r=this;return t.prototype.TYPES={DIRECTORY:"directory",USER:"user",SPOTLIGHT:"spotlight",QANDA:"qanda"},t.prototype.getQueryStringParameter=function(e,t){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var r=new RegExp("[\\?&]"+e+"=([^&#]*)"),n=r.exec(t.toLowerCase());return null===n?"":decodeURIComponent(n[1].replace(/\+/g," "))},t.prototype.buildQueryString=function(e){return Object.keys(e).map(function(t){return encodeURI(t)+"="+encodeURIComponent(JSON.stringify(e[t]))}).join("&")},t.prototype.track=function(t){t.source||(t.source="corpapi");var n=new XMLHttpRequest,a="https://public-api.expertfile.com";if(delete t.url,"corpapi"===t.source){t.asset_type||(t.asset_type="directory");if(!{directory:!0,user:!0,spotlight:!0}[t.asset_type])return;t.referrer=document.referrer?document.referrer:"direct",t.attr||(t.attr={}),t.attr.page_url=t.page_url||e.location.href,t.asset_type="user"===t.asset_type?"featured":t.asset_type,a=a+"/v2/analytics/corpapi/"+t.asset_type,delete t.asset_type}else if("embed"===t.source){if(!t.attr)return;a=a+"/v2/analytics/embed/"+t.attr.theme+"/"+t.attr.template}else if("expertfile"===t.source){if(!t.attr)return;a="spotlight"===t.asset_type?a+"/v2/analytics/spotlight/"+t.attr.corporation+"/"+t.attr.postid:"qanda"===t.asset_type?a+"/v2/analytics/qanda/"+t.attr.corporation+"/"+t.attr.questionid:a+"/v2/analytics/"+t.attr.username}var o=r.buildQueryString(t);n.open("GET",a+"?"+o),n.send()},this}void 0===e.analyticly&&(e.analyticly=new t)}(window)}]); 1 (function (window) { 2 function analyticly() { 3 var _analyticly = this; 4 5 analyticly.prototype.TYPES = { 6 DIRECTORY: 'directory', 7 USER: 'user', 8 SPOTLIGHT: 'spotlight', 9 QANDA: 'qanda' 10 }; 11 12 analyticly.prototype.getQueryStringParameter = function (name, url) { 13 name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]'); 14 15 var regex = new RegExp('[\\?&]' + name + '=([^&#]*)'), 16 results = regex.exec(url.toLowerCase()); 17 18 return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' ')); 19 }; 20 21 analyticly.prototype.buildQueryString = function (params) { 22 return Object.keys(params) 23 .map(function (k) { return encodeURI(k) + '=' + encodeURIComponent(JSON.stringify(params[k])); }) 24 .join('&'); 25 }; 26 27 analyticly.prototype.track = function (params) { 28 if (!params.source) params.source = 'corpapi'; 29 30 var xhr = new XMLHttpRequest(), 31 url = 'http://public_api.local.expertfile.com:8078'; 32 33 delete params['url']; 34 35 if (params.source === 'corpapi') { 36 if (!params.asset_type) params.asset_type = 'directory'; 37 38 var routes = { 39 'directory': true, 40 'user': true, 41 'spotlight': true, 42 'qanda': true 43 }; 44 45 if (!routes[params.asset_type]) return; 46 47 params.referrer = document.referrer ? document.referrer : 'direct'; 48 49 if (!params.attr) params.attr = {}; 50 51 params.attr.page_url = params.page_url || window.location.href; 52 params.asset_type = params.asset_type === 'user' ? 'featured' : params.asset_type; 53 54 url = url + '/v2/analytics/corpapi/' + params.asset_type; 55 56 delete params['asset_type']; 57 } else if (params.source === 'embed') { 58 if (!params.attr) return; 59 60 url = url + '/v2/analytics/embed/' + params.attr.theme + '/' + params.attr.template; 61 } else if (params.source === 'expertfile') { 62 if (!params.attr) return; 63 64 if (params.asset_type === 'spotlight') { 65 url = url + '/v2/analytics/spotlight/' + params.attr.corporation + '/' + params.attr.postid; 66 } else if (params.asset_type === 'qanda') { 67 url = url + '/v2/analytics/qanda/' + params.attr.corporation + '/' + params.attr.questionid; 68 } else { 69 url = url + '/v2/analytics/' + params.attr.username; 70 } 71 } 72 73 var query = _analyticly.buildQueryString(params); 74 75 xhr.open('GET', url + '?' + query); 76 xhr.send(); 77 }; 78 79 return this; 80 } 81 82 if (typeof (window.analyticly) === 'undefined') { 83 window.analyticly = new analyticly(); 84 } 85 })(window); -
expertfile-expert-content-templates/trunk/public/js/expertanswer.js
r2787175 r2940918 9 9 10 10 Share(); 11 Track(' expertanswer');11 Track('qanda'); 12 12 }, 13 13 search: () => { -
expertfile-expert-content-templates/trunk/public/js/spotlight.js
r2787175 r2940918 5 5 spotlight: { 6 6 init: () => { 7 7 8 expertfile.spotlight.search(); 8 9 expertfile.spotlight.setIframeHeight(); -
expertfile-expert-content-templates/trunk/public/js/util.js
r2787175 r2940918 583 583 584 584 export const Track = (type) => { 585 585 586 let obj = {}; 586 587 let corporate_username = document.querySelector('#expertfile-corp-username')?.value; 587 588 let username = document.querySelector('#expertfile-username')?.value; 588 589 let spotlightId = document.querySelector('#spotlight-id')?.value; 589 let expertanswerId = document.querySelector('# expertanswer-id')?.value;590 let expertanswerId = document.querySelector('#qanda-id')?.value; 590 591 591 592 switch (type) { … … 601 602 } 602 603 break; 603 case ' expertanswer':604 case 'qanda': 604 605 obj = { 605 606 asset_type: analyticly.TYPES.QANDA, … … 628 629 break; 629 630 } 631 630 632 analyticly.track(obj); 631 633 }; -
expertfile-expert-content-templates/trunk/public/partials/expert/directory.php
r2833229 r2940918 190 190 <h2 class="exfl-sr-only">Filters</h2> 191 191 <div class="clearfix"> 192 <div class="exfl-text-sm exfl-float-right"> 193 <button id="sm-filter-heading" type="button" class="lg:exfl-hidden exfl-inline-flex exfl-items-center exfl-px-4 exfl-py-2 exfl-border exfl-shadow-sm exfl-text-base exfl-font-medium exfl-border exfl-border-gray-200 exfl-rounded-md focus:exfl-outline-none focus:exfl-ring-2 focus:exfl-gray-offset-2 focus:exfl-ring-gray-400"> 194 <span>Show Filters</span> 195 <svg class="exfl-flex-none exfl-w-5 exfl-h-5 exfl-ml-2 exfl-mr-2 exfl-text-gray-400 group-hover:exfl-text-gray-500" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor"> 196 <path fill-rule="evenodd" d="M3 3a1 1 0 011-1h12a1 1 0 011 1v3a1 1 0 01-.293.707L12 11.414V15a1 1 0 01-.293.707l-2 2A1 1 0 018 17v-5.586L3.293 6.707A1 1 0 013 6V3z" clip-rule="evenodd" /> 197 </svg> 198 </button> 192 193 <div id="sm-filter-heading" class="exfl-text-sm exfl-float-right"> 194 <?php if (count($filter_state['filters']) > 0) { ?> 195 <button type="button" class="lg:exfl-hidden exfl-inline-flex exfl-items-center exfl-px-4 exfl-py-2 exfl-border exfl-shadow-sm exfl-text-base exfl-font-medium exfl-border exfl-border-gray-200 exfl-rounded-md focus:exfl-outline-none focus:exfl-ring-2 focus:exfl-gray-offset-2 focus:exfl-ring-gray-400"> 196 <span>Show Filters</span> 197 <svg class="exfl-flex-none exfl-w-5 exfl-h-5 exfl-ml-2 exfl-mr-2 exfl-text-gray-400 group-hover:exfl-text-gray-500" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor"> 198 <path fill-rule="evenodd" d="M3 3a1 1 0 011-1h12a1 1 0 011 1v3a1 1 0 01-.293.707L12 11.414V15a1 1 0 01-.293.707l-2 2A1 1 0 018 17v-5.586L3.293 6.707A1 1 0 013 6V3z" clip-rule="evenodd" /> 199 </svg> 200 </button> 201 <?php } ?> 199 202 </div> 200 203 </div> -
expertfile-expert-content-templates/trunk/public/partials/expert/profile.php
r2798968 r2940918 514 514 <h3 class="exfl-my-0 exfl-text-xl exfl-font-semibold exfl-text-gray-900 exfl-normal-case"><?php echo esc_attr($accomplishment->title) ?></h3> 515 515 <?php } ?> 516 <?php if ( !is_null($accomplishment->start) && trim(date('Y-m-d', $accomplishment->start)) != "1970-01-01") { ?>516 <?php if (isset($accomplishment->start) && trim(date('Y-m-d', $accomplishment->start)) != "1970-01-01") { ?> 517 517 <p class="exfl-my-0"> 518 518 <svg class="exfl-h-3 exfl-w-3 exfl-inline" fill="none" viewBox="0 0 24 24" stroke="currentColor"> … … 522 522 </p> 523 523 <?php } ?> 524 <?php if ( !is_null($accomplishment->description)) { ?>524 <?php if (isset($accomplishment->description)) { ?> 525 525 <p class="exfl-my-0"><?php echo esc_attr($accomplishment->description) ?></p> 526 526 <?php } ?> -
expertfile-expert-content-templates/trunk/public/partials/expertanswer/post.php
r2798968 r2940918 182 182 </div> 183 183 </div> 184 <input type="hidden" id="q uestion-id" value="<?php echo esc_attr($question->id) ?>">184 <input type="hidden" id="qanda-id" value="<?php echo esc_attr($question->id) ?>"> 185 185 <input type="hidden" id="expertfile-corp-username" value="<?php echo esc_attr($organization_username) ?>"> 186 186 <a href="https://expertfile.com/" target="_blank" class="exfl-mt-8 exfl-no-underline hover:exfl-opacity-50 exfl-flex exfl-items-center exfl-text-base exfl-text-white exfl-justify-end <?php echo filter_var(esc_attr($show_powered_by), FILTER_VALIDATE_BOOLEAN) ? "exfl-block" : "exfl-hidden" ?>">
Note: See TracChangeset
for help on using the changeset viewer.