fix
This commit is contained in:
@@ -123,6 +123,7 @@ define('WRENCHBOARD_JOB_SEND_QUESTION',13036);
|
|||||||
define('WRENCHBOARD_JOB_MRKTINT_QUEST',13037);
|
define('WRENCHBOARD_JOB_MRKTINT_QUEST',13037);
|
||||||
define('WRENCHBOARD_JOB_REPLY_QUESTION',13038);
|
define('WRENCHBOARD_JOB_REPLY_QUESTION',13038);
|
||||||
|
|
||||||
|
//define('WRENCHBOARD_JOB_SEND_QUESTION',13036);
|
||||||
|
|
||||||
define('WRENCHBOARD_GROUP_START', 12000);
|
define('WRENCHBOARD_GROUP_START', 12000);
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,45 @@ function formatCreateTranspData($in) {
|
|||||||
|
|
||||||
return $in;
|
return $in;
|
||||||
}
|
}
|
||||||
|
function cleanUpDescription($job_description){
|
||||||
|
// $job_description = trim($job_description); // trim it first
|
||||||
|
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* $rest = substr("abcdef", -1); // returns "f"
|
||||||
|
$rest = substr("abcdef", -2); // returns "ef"
|
||||||
|
$rest = substr("abcdef", -3, 1); // returns "d"
|
||||||
|
*/
|
||||||
|
|
||||||
|
if ( substr($job_description,0,1)==='"' ){
|
||||||
|
// $job_description = substr($job_description,1);
|
||||||
|
}
|
||||||
|
$job_description =fixtags($job_description);
|
||||||
|
|
||||||
|
if ( substr($job_description,0,1)==='"' ){
|
||||||
|
// $job_description = substr($job_description,2);
|
||||||
|
}
|
||||||
|
return $job_description;
|
||||||
|
}
|
||||||
|
function fixtags($text){
|
||||||
|
$text = htmlspecialchars($text);
|
||||||
|
$text = preg_replace("/=/", "=\"\"", $text);
|
||||||
|
$text = preg_replace("/"/", ""\"", $text);
|
||||||
|
$tags = "/<(\/|)(\w*)(\ |)(\w*)([\\\=]*)(?|(\")\""\"|)(?|(.*)?"(\")|)([\ ]?)(\/|)>/i";
|
||||||
|
$replacement = "<$1$2$3$4$5$6$7$8$9$10>";
|
||||||
|
$text = preg_replace($tags, $replacement, $text);
|
||||||
|
$text = preg_replace("/=\"\"/", "=", $text);
|
||||||
|
$text = str_replace("\\n", "<br />", $text);
|
||||||
|
|
||||||
|
$text = str_replace('""\"','',$text);
|
||||||
|
$text = str_replace('"\""','',$text);
|
||||||
|
$text = str_replace(' ','',$text);
|
||||||
|
|
||||||
|
$text = str_replace('href=\\"\"http://','',$text);
|
||||||
|
$text = str_replace('href=\\"\"https://','',$text);
|
||||||
|
|
||||||
|
return $text;
|
||||||
|
}
|
||||||
function processOutJson($in, $out) {
|
function processOutJson($in, $out) {
|
||||||
|
|
||||||
|
|
||||||
@@ -121,11 +159,12 @@ function processOutJson($in, $out) {
|
|||||||
"title" => $out["title_${key}"],
|
"title" => $out["title_${key}"],
|
||||||
"description" => $out["description_${key}"],
|
"description" => $out["description_${key}"],
|
||||||
"id" => $out["id_${key}"],
|
"id" => $out["id_${key}"],
|
||||||
"job_description" => $out["job_description_${key}"],
|
"job_description" => cleanUpDescription($out["job_description_${key}"]),
|
||||||
"price" => $out["price_${key}"],
|
"price" => $out["price_${key}"],
|
||||||
"timeline_days" => $out["timeline_days_${key}"],
|
"timeline_days" => $out["timeline_days_${key}"],
|
||||||
"expire" => $out["expire_${key}"],
|
"expire" => $out["expire_${key}"],
|
||||||
"sent" => $out["sent_${key}"]
|
"sent" => $out["sent_${key}"],
|
||||||
|
"offer_code" => $out["offer_code_${key}"]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ $endpoints = array(
|
|||||||
'couponhx' => array('POST'),
|
'couponhx' => array('POST'),
|
||||||
'couponpending' => array('POST'),
|
'couponpending' => array('POST'),
|
||||||
'couponredeem' => array('POST'),
|
'couponredeem' => array('POST'),
|
||||||
|
'sendinterestmessage' => array('POST'),
|
||||||
);
|
);
|
||||||
|
|
||||||
$call_backend = true; // sometimes we need to overwite the call to the extenstion API
|
$call_backend = true; // sometimes we need to overwite the call to the extenstion API
|
||||||
@@ -101,6 +102,16 @@ if ($_SERVER["REQUEST_METHOD"] == "GET") {
|
|||||||
}
|
}
|
||||||
$in["loc"] = $_SERVER["REMOTE_ADDR"];
|
$in["loc"] = $_SERVER["REMOTE_ADDR"];
|
||||||
switch ($endpoint) {
|
switch ($endpoint) {
|
||||||
|
case 'sendinterestmessage':
|
||||||
|
|
||||||
|
// $in['offer_code'] = $this->input->get('offer_code');
|
||||||
|
$in['yourmessage'] = $in["question"];
|
||||||
|
//$in['member_id'] = $_SESSION['member_id']; // just maing sure
|
||||||
|
$in['msg_type'] = 'JOB';
|
||||||
|
// $in['action'] = WRENCHBOARD_JOB_SEND_QUESTION;
|
||||||
|
|
||||||
|
$in["action"] = WRENCHBOARD_JOB_SEND_QUESTION;
|
||||||
|
break;
|
||||||
case 'couponredeem':
|
case 'couponredeem':
|
||||||
$in["action"] = WRENCHBOARD_COUPON_REDEEM;
|
$in["action"] = WRENCHBOARD_COUPON_REDEEM;
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user