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