PHP74 Knight locomotive picking resume interface and collection rules

Source: Internet
Author: User
PHP74 Knight Locomotive acquisition resume interface and collection rules
Studied the official launch of the next Knight Locomotive acquisition Interface API and no relevant resume corresponding to the acquisition interface

So I wrote a method corresponding to the resume collection interface implementation can be queried. Related field matches, and so on. and enterprise acquisition interface matching is basically the same.

Support Image capture.

The file directory collected by the image needs to be modified by the collection rules.



Now modify the API file as follows

\admin\api\locoyspider.php This file is the interface file exists now there are common article acquisition interface and Enterprise acquisition interface is not established acquisition interface. So we're going to add a resume acquisition interface.

and add the code to the bottom.

<textarea readonly="" name="code" class="php">ElseIf ($act = = "Resumes") {locoyspider_addresumes (); Exit ("Add failed");}</textarea>
And then find

/admin/include/admin_locoyspider_fun.php

File. This file is the method file that processes the locomotive data

Can be added at the bottom

<textarea readonly="" name="code" class="php">//Match Resume Marital status function locoyspider_resumes_marriage ($str =null) {return get_locoyspider_resumes_marriage ($STR);} function Get_locoyspider_resumes_marriage ($marriage _cn=null, $marriage =null) {if ($marriage _cn== "Unmarried" | | $marriage = = " 1 ") {return array (" id "=>1," cn "=" unmarried ");} ElseIf ($marriage _cn== "Married" | | $marriage = = "2") {return array ("id" =>2, "cn" = "unmarried");} ElseIf ($marriage _cn== "Confidential" | | $marriage = = "3") {return array ("id" =>3, "cn" = "Confidential");} Else{return get_locoyspider_resumes_marriage ("", 3);//The protection is not in the case of a confidential state}}</textarea>
Found it

Add a parameter to the re-pass argument

<textarea readonly="" name="code" class="php">$utype =1</textarea>

<textarea readonly="" name="code" class="php">//Collect registered member function Locoyspider_user_register ($email =null, $utype =1) {...}</textarea>

and find it in the method body.

$setsqlarr [' Utype ']=1; modified to $setsqlarr [' Utype ']= $utype;


Then add a Resume method

Add Resume function Locoyspider_addresumes () {global $locoyspider;//Add Member individual member type $setsqlarr[' UID ']=locoyspider_user_ Register ($_post[' email '), 2), if ($setsqlarr [' uid ']== ' ") exit (" Add Member Error "), $uid = $setsqlarr [' uid '];//user id// Step1 Add resume basic information $setsqlarr[' title ']=trim ($_post[' title ') "Trim ($_post[' title ']): Exit (' Please fill in the Resume name! $setsqlarr [' FullName ']=trim ($_post[' fullname ')) Trim ($_post[' fullname ']): Exit (' Please fill in your name! '//Match CV gender $sex=locoyspider_jobs_sex (Trim ($_post[' sex_cn ')); $setsqlarr [' Sex ']= $sex [' id ']; $setsqlarr [' SEX_CN '] = $sex [' cn ']; $birthage =intval ($_post[' birthdate ')), if ($birthage <100) {$setsqlarr [' Birthdate ']=intval (2012-$ Birthage);} else{$setsqlarr [' Birthdate ']=intval ($_post[' birthdate ']) >1945?intval ($_post[' birthdate ')): Exit (' Please fill in the year of birth correctly ') ;} $setsqlarr [' Height ']=intval ($_post[' height ');//Match Marital status $marriage=locoyspider_resumes_marriage ($_post[' Marriage_ CN ']); $setsqlarr [' Marriage ']= $marriage [' id '];//marital status 1 unmarried 2 married 3 confidential $setsqlarr[' MARRIAGE_CN ']= $marriage [' CN '];// Matching Requirements Working experience $experience=locoyspider_jobs_experieNCE (Trim ($_post[' experience_cn ')); $setsqlarr [' Experience ']= $experience [' id ']; $setsqlarr [' Experience_cn ']=$ Experience[' CN '];//account location $setsqlarr[' householdaddress ']=trim ($_post[' householdaddress ')? Trim ($_post[') Householdaddress ']): Exit (' Please fill in the account location! '//Match required academic $education=locoyspider_jobs_education (Trim ($_post[' education_cn ')); $setsqlarr [' Education ']=$ education[' id ']; $setsqlarr [' Education_cn ']= $education [' cn ']; $setsqlarr [' tag ']= '; $setsqlarr [' Telephone ']=trim ( $_post[' telephone '); $setsqlarr [' Email ']=trim ($_post[' email '); $setsqlarr [' email_notify ']=0; $setsqlarr [' Address ']=trim ($_post[' address '), $setsqlarr [' website ']=trim ($_post[' website '); $setsqlarr [' QQ ']=trim ($_post[') QQ ']); $setsqlarr [' Addtime ']= $timestamp; $setsqlarr [' Refreshtime ']= $timestamp; $setsqlarr [' subsite_id ']=0;// Picture path Problem if (!empty ($_post[' photosrc ')) {$imgurllength =strpos ($_post[' photosrc '], "style")-strpos ($_post[' photosrc ') ], "thumb")-9; $imgurl =substr ($_post[' photosrc '],strpos ($_post[' photosrc '], "thumb") +6, $imgurllength); $setsqlarr [ ' PhoTo_img ']=trim ($_post[' photosrc ') = = '? ': $imgurl;} $setsqlarr [' Display_name ']= (Trim ($setsqlarr [' fullname ']) = = "xxx"? " 2 ":" 3 ");//Name Display Method 1 real name 2 Number 3 surname **if (Trim ($setsqlarr [' fullname ']) = =" xxx ") {$setsqlarr [' FullName ']=trim ($setsqlarr [' FullName ']). RES_RANDSTR (4);} $setsqlarr [' Audit ']=1;//audit status 1 via 2 failed 3 delete $pid=inserttable (table (' Resume '), $setsqlarr, 1);//CV Idif (Empty ($pid)) exit ("Resume Save failed!") Unset ($setsqlarr);//step2//update details $resumearr[' recentjobs ']=trim ($_post[' recentjobs ');//Jobs recently worked//expected post nature $ Nature=locoyspider_jobs_nature (Trim ($_post[' nature_cn ')); $resumearr [' Nature ']= $nature [' id ']; $resumearr [' NATURE_CN ']= $nature [' CN '];//expected work area $district=locoyspider_jobs_district (Trim ($_post[' district_cn ')); $resumearr [ ' District ']= $district [' District ']; $resumearr [' Sdistrict ']= $district [' sdistrict ']; $resumearr [' District_cn ']=$ district[' DISTRICT_CN '];//expected monthly salary $wage=locoyspider_jobs_wage (Trim ($_post[' wage_cn ')); $resumearr [' wage ']= $wage [' Id ']; $resumearr [' Wage_cn ']= $wage [' CN '];//expected to engage in industry $trade=locoyspider_company_trade (tRim ($_post[' trade_cn ')); $resumearr [' Trade ']= $trade [' id ']; $resumearr [' Trade_cn ']= $trade [' cn ']; $resumearr [' Audit ']=1;//match position a position require_once (qishi_root_path. ' include/fun_personal.php '); $category =locoyspider_jobs_ Category (Trim ($_post[' intention_jobs ')),//$_post[' jobs_category '] $resumearr [' Intention_jobs ']=trim ($category [ ' CATEGORY_CN '); Add_resume_jobs ($pid, $uid, $category [' Category ']. $category [' subclass '])? ": Exit (' Job Seeker update failed ');// Update a job Search Intent updatetable (table (' Resume '), $resumearr, "Id= ' {$pid} ' and uid= ' {$uid} '); Updatetable (table (' Resume_tmp '), $ Resumearr, "Id= ' {$pid} ' and uid= ' {$uid} '); unset ($resumearr)//step3//skills $setsqlarrspecialty[' specialty ']=!empty ($_post[' specialty '])? $_post[' Specialty ']: ' not filled out job intent! '; $setsqlarrspecialty [' Audit ']=1;updatetable (table (' Resume '), $setsqlarrspecialty, "id=". Intval ($pid). "' and Uid= ' ". Intval ($uid)." ' "); Updatetable (Table (' resume_tmp '), $setsqlarrspecialty, "id=". Intval ($pid). "' and Uid= ' ". Intval ($uid)." ' "); Unset ($setsqlarrspecialty);//step4//Education Experience $seteducationarr[' uid ']= $uid; $seteducationarr [' pid ']= $pid; $seteducationarr [' Start ']=trim ($_post[' Educationstart ']); $ seteducationarr[' Endtime ']=trim (!empty ($_post[' educationendtime '])? $_post[' Educationendtime ']: ' No educational experience added '); $ seteducationarr[' School ']=trim ($_post[' Educationschool '); $seteducationarr [' Speciality ']=trim ($_post[') Educationspeciality ']); $educationstep 4=locoyspider_jobs_education (Trim ($_post[' educationstep4 ')); $ seteducationarr[' education ']= $educationstep 4[' id ']; $seteducationarr [' Education_cn ']= $educationstep 4[' cn '];if (! Inserttable (Table (' Resume_education '), $seteducationarr)) {exit ("failed to save the diploma! ");} Unset ($seteducationarr);//step5//work experience $setworkarr[' uid ']= $uid; $setworkarr [' pid ']= $pid; $setworkarr [' Start ']=trim ($_post[' Workstart '); $setworkarr [' Endtime ']=trim ($_post[' workendtime ']); $setworkarr [' CompanyName ']=trim (! Empty ($_post[' workcompanyname ')? $_post[' Workcompanyname ']: ' No work experience added '); $setworkarr [' Jobs ']=trim ($_post[' Workjobs '); $setworkarr [' Companyprofile ']=trim ($_post[' workcompanyprofile ']); $setworkarr[' achievements ']=trim ($_post[' workachievements ')), if (!inserttable (table (' Resume_work '), $setworkarr)) { Exit ("Save work Experience Failed");} Unset ($setworkarr);//step6//training Experience $settrainingarr[' uid ']= $uid; $settrainingarr [' pid ']= $pid; $settrainingarr [' Start ']=trim ($_post[' Trainingstart '); $settrainingarr [' Endtime ']=trim ($_post[' trainingendtime ']); $ settrainingarr[' Agency ']=trim (!empty ($_post[' trainingagency '])? $_post[' trainingagency ']: ' No training experience added '); $ settrainingarr[' Course ']=trim ($_post[' trainingcourse '); $settrainingarr [' Description ']=trim ($_post[') Trainingdescription ']), if (!inserttable (table (' resume_training '), $settrainingarr)) {exit ("Save training Experience failed! ");} Unset ($settrainingarr);//step7//Avatar photo require_once (qishi_root_path. ' include/upload.php '); global $db; $j = $db GetOne ("SELECT * from". Table (' Resume '). "Where id= ' {$pid} ' and uid= ' {$uid} ' LIMIT 1 '); $searchtab [' id ']= $j [' ID '];$ searchtab[' uid ']= $j [' uid ']; $searchtab [' subsite_id ']= $j [' subsite_id ']; $searchtab [' Sex ']= $j [' sex ']; $searchtab [' Nature ']= $j [' nature ']; $searchtab [' MArriage ']= $j [' marriage ']; $searchtab [' Experience ']= $j [' experience ']; $searchtab [' District ']= $j [' District '];$ searchtab[' sdistrict ']= $j [' sdistrict ']; $searchtab [' wage ']= $j [' wage ']; $searchtab [' Education ']= $j [' Education '];$ searchtab[' photo ']= $j [' photo ']; $searchtab [' Refreshtime ']= $j [' refreshtime ']; $searchtab [' Talent ']= $j [' talent ']; if (!inserttable (table (' Resume_search_rtime '), $searchtab)) {exit ("Resume_search_rtime failed");} $searchtab [' key ']= $j [' Key '];if (!inserttable (Table (' Resume_search_key '), $searchtab)} {exit ("Resume_search_key failed" );} Unset ($searchtab); $tag =explode (' | ', $j [' tag ']) $tagindex =1; $tagsql [' Tag1 ']= $tagsql [' Tag2 ']= $tagsql [' Tag3 ']=$ tagsql[' Tag4 ']= $tagsql [' Tag5 ']=0;if (!empty ($tag) && Is_array ($tag)) {foreach ($tag as $v) {$vid =explode (', ', $ v); $tagsql [' tag '. $tagindex]=intval ($vid [0]); $tagindex + +;}} $tagsql the [' ID ']= $j [' id ']; $tagsql [' uid ']= $j [' the "]; $tagsql [' subsite_id ']= $j [' subsite_id ']; $tagsql [' Experience ']=$ j[' experience '; $tagsql [' District ']= $j [' District ']; $tagsql [' Sdistrict ']= $j [' SdistRict ']; $tagsql [' Education ']= $j [' Education '];if (!inserttable (Table (' Resume_search_tag '), $tagsql)) {exit ("Resume_ Search_tag failed ");} Update Complete Check_resume ($uid, $pid); exit ("Resume saved successfully! ");}

In the re-method for some sites can not collect the name of the resume may be directly passed in such two words. And some of the Avatar pictures can look at the code.


Introduction to this modification.

For modified documents and locomotive acquisition rules, please find it in my resources. Articles cannot upload files

Name is PHP Knight locomotive resume Acquisition interface and publishing rules

http://download.csdn.net/detail/lihaiboas1/4401542




  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.