| @@ 377-395 (lines=19) @@ | ||
| 374 | * @param int $error |
|
| 375 | * @param string $error_message |
|
| 376 | */ |
|
| 377 | public static function planetRespondToTrackback($error = 0, $error_message = '') |
|
| 378 | { |
|
| 379 | $charset = 'utf-8'; |
|
| 380 | $error_message = xoops_utf8_encode($error_message); |
|
| 381 | header('Content-Type: text/xml; charset="' . $charset . '"'); |
|
| 382 | if ($error) { |
|
| 383 | echo '<?xml version="1.0" encoding="' . $charset . '"?' . ">\n"; |
|
| 384 | echo "<response>\n"; |
|
| 385 | echo "<error>1</error>\n"; |
|
| 386 | echo "<message>$error_message</message>\n"; |
|
| 387 | echo '</response>'; |
|
| 388 | die(); |
|
| 389 | } else { |
|
| 390 | echo '<?xml version="1.0" encoding="' . $charset . '"?' . ">\n"; |
|
| 391 | echo "<response>\n"; |
|
| 392 | echo "<error>0</error>\n"; |
|
| 393 | echo '</response>'; |
|
| 394 | } |
|
| 395 | } |
|
| 396 | ||
| 397 | /** |
|
| 398 | * Function to set a cookie with module-specified name |
|
| @@ 370-388 (lines=19) @@ | ||
| 367 | * @param int $error |
|
| 368 | * @param string $error_message |
|
| 369 | */ |
|
| 370 | function planetRespondToTrackback($error = 0, $error_message = '') |
|
| 371 | { |
|
| 372 | $charset = 'utf-8'; |
|
| 373 | $error_message = xoops_utf8_encode($error_message); |
|
| 374 | header('Content-Type: text/xml; charset="' . $charset . '"'); |
|
| 375 | if ($error) { |
|
| 376 | echo '<?xml version="1.0" encoding="' . $charset . '"?' . ">\n"; |
|
| 377 | echo "<response>\n"; |
|
| 378 | echo "<error>1</error>\n"; |
|
| 379 | echo "<message>$error_message</message>\n"; |
|
| 380 | echo '</response>'; |
|
| 381 | die(); |
|
| 382 | } else { |
|
| 383 | echo '<?xml version="1.0" encoding="' . $charset . '"?' . ">\n"; |
|
| 384 | echo "<response>\n"; |
|
| 385 | echo "<error>0</error>\n"; |
|
| 386 | echo '</response>'; |
|
| 387 | } |
|
| 388 | } |
|
| 389 | ||
| 390 | /** |
|
| 391 | * Function to set a cookie with module-specified name |
|