57 lines
1.0 KiB
PHP
57 lines
1.0 KiB
PHP
<?php header('Content-type: application/json');
|
|
|
|
if ( !defined('PATHTOINCLUDES') ) define('PATHTOINCLUDES', $_SERVER["DOCUMENT_ROOT"] . '/include/analytics/');
|
|
|
|
include(PATHTOINCLUDES."base.php");
|
|
|
|
$em="";
|
|
|
|
|
|
|
|
$isactive=$_POST["isactive"];
|
|
|
|
$ctpid=$_POST["theid"];
|
|
|
|
$blogid=$_POST["blogid"];
|
|
|
|
if($isactive=="true")
|
|
|
|
{
|
|
|
|
if($blogid != "")
|
|
|
|
{
|
|
|
|
$sql="UPDATE `caption_this_pic` SET `caption_this_pic`.`ctpactive` = 'no'";
|
|
|
|
$query=$database->database_query($sql) or $em .= $database->database_error();
|
|
|
|
$sql2="UPDATE `caption_this_pic` SET `caption_this_pic`.`ctpactive` = 'yes', `caption_this_pic`.`ctpused` = 'yes' WHERE `caption_this_pic`.`hcidu` = ".$ctpid;
|
|
|
|
$query2=$database->database_query($sql2) or $em .= $database->database_error();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$sql="UPDATE `caption_this_pic` SET `caption_this_pic`.`ctpactive` = 'no' WHERE `caption_this_pic`.`hcidu` = ".$ctpid;
|
|
|
|
$query=$database->database_query($sql) or $em .= $database->database_error();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
$arr = array ('error'=>$em);
|
|
|
|
echo json_encode($arr);
|
|
|
|
|
|
|
|
?>
|