File: /var/www/doco/keytest/wp-content/themes/ormedia/keyAlertData/alert/r_alert_1.php
<?php
ini_set('display_errors', 1);
require_once '/var/www/html/wp-content/themes/ormedia/key_alert_functions.php';
require_once '/var/www/html/wp-load.php';
if (isset($_REQUEST['checking_api_file'])){
exit();
}
$uid = $_REQUEST['uid'];
$id = $_REQUEST['id'];
$status = $_REQUEST['status'];
$limit = $_REQUEST['al'];
$page = $_REQUEST['ap'];
$limit = $limit>0?$limit:10;
$page = $page>0?$page:1;
$offset = ($page-1)*$limit;
$status = (empty($status)||!is_numeric($status))?-1:$status;
if(empty($uid)&&empty($id)){
$rv->rc = -1;
$rv->msg = "missing params";
}else{
$rv->rc = 1;
$rv->msg = "success";
if(empty($id)){
$alerts = get_alerts_by_uid($status,$uid,$offset,$limit);
}else{
$alerts = [get_alert_by_id($id)];
}
foreach ($alerts as $alert) {
// if(empty($alert->image)){
// $alert->image = 'http://keylab.cc/wp-content/uploads/2020/01/Rectangle-2.1.png';
// }else{
// $alert->image = wp_get_attachment_image_url($alert->image,'large');
// }
if(empty($alert->uid)) $alert->uid = "";
if(empty($alert->opened_time)) $alert->opened_time = "";
$alert->strip_content = strip_tags($alert->content);
}
$rv->data = $alerts;
}
echo json_encode($rv);
?>