This commit is contained in:
2022-11-05 09:37:57 -04:00
parent 48f30e9dfe
commit 7abf541bce
3 changed files with 53 additions and 2 deletions
+1
View File
@@ -123,6 +123,7 @@ define('WRENCHBOARD_JOB_SEND_QUESTION',13036);
define('WRENCHBOARD_JOB_MRKTINT_QUEST',13037);
define('WRENCHBOARD_JOB_REPLY_QUESTION',13038);
//define('WRENCHBOARD_JOB_SEND_QUESTION',13036);
define('WRENCHBOARD_GROUP_START', 12000);
+41 -2
View File
@@ -32,7 +32,45 @@ function formatCreateTranspData($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('"&quot;\"','',$text);
$text = str_replace('&quot;\""','',$text);
$text = str_replace('&nbsp;','',$text);
$text = str_replace('href=\\&quot;\"http://','',$text);
$text = str_replace('href=\\&quot;\"https://','',$text);
return $text;
}
function processOutJson($in, $out) {
@@ -121,11 +159,12 @@ function processOutJson($in, $out) {
"title" => $out["title_${key}"],
"description" => $out["description_${key}"],
"id" => $out["id_${key}"],
"job_description" => $out["job_description_${key}"],
"job_description" => cleanUpDescription($out["job_description_${key}"]),
"price" => $out["price_${key}"],
"timeline_days" => $out["timeline_days_${key}"],
"expire" => $out["expire_${key}"],
"sent" => $out["sent_${key}"]
"sent" => $out["sent_${key}"],
"offer_code" => $out["offer_code_${key}"]
);
}
+11
View File
@@ -39,6 +39,7 @@ $endpoints = array(
'couponhx' => array('POST'),
'couponpending' => array('POST'),
'couponredeem' => array('POST'),
'sendinterestmessage' => array('POST'),
);
$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"];
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':
$in["action"] = WRENCHBOARD_COUPON_REDEEM;
break;