boards
[ class tree: boards ] [ index: boards ] [ all elements ]

Source for file ajax.php

Documentation is available at ajax.php

  1. <?php
  2. /**
  3.  * AJAX Function Call Stuff
  4.  *
  5.  * reqs:
  6.  *   1 - list all boards
  7.  *   2 - switch lock state on a given topic
  8.  *   3 - switch sticky state on a given topic
  9.  * @package boards
  10.  * @subpackage functions
  11.  */
  12.  
  13. /**
  14.  * required setup
  15.  */
  16. require_once'../kernel/setup_inc.php' );
  17.  
  18. // Is package installed and enabled
  19. $gBitSystem->verifyPackage'boards' );
  20.  
  21. // Now check permissions to access this page
  22. $gBitSystem->verifyPermission'p_boards_read' );
  23.  
  24. function ajax_nice_error($errno$errstr$errfile$errline{
  25.     $errortype array (
  26.     E_ERROR => array(
  27.     'desc'=>"Error",
  28.     'ignore'=>false),
  29.     E_WARNING => array(
  30.     'desc'=> "Warning",
  31.     'ignore'=>false),
  32.     E_PARSE => array(
  33.     'desc'=> "Parsing Error",
  34.     'ignore'=>false),
  35.     E_NOTICE => array(
  36.     'desc'=> "Notice",
  37.     'ignore'=>true),
  38.     E_CORE_ERROR => array(
  39.     'desc'=> "Core Error",
  40.     'ignore'=>false),
  41.     E_CORE_WARNING => array(
  42.     'desc'=> "Core Warning",
  43.     'ignore'=>false),
  44.     E_COMPILE_ERROR => array(
  45.     'desc'=> "Compile Error",
  46.     'ignore'=>false),
  47.     E_COMPILE_WARNING => array(
  48.     'desc'=> "Compile Warning",
  49.     'ignore'=>false),
  50.     E_USER_ERROR => array(
  51.     'desc'=> "User Error",
  52.     'ignore'=>false),
  53.     E_USER_WARNING => array(
  54.     'desc'=> "User Warning",
  55.     'ignore'=>false),
  56.     E_USER_NOTICE => array(
  57.     'desc'=> "User Notice",
  58.     'ignore'=>false),
  59.     E_STRICT => array(
  60.     'desc'=> "Runtime Notice",
  61.     'ignore'=>true),
  62.     );
  63.     // set of errors for which a var trace will be saved
  64.  
  65.     if(!$errortype[$errno]['ignore']{
  66.         $l ob_get_level();
  67.         if ($l>0{
  68.             $body ob_get_contents();
  69.             ob_end_clean();
  70.         }
  71.         static $sent=false;
  72.         if (!$sent{
  73.             header("HTTP/1.0 500 Internal Server Error");
  74.             echo "<h1>PHP Exception</h1>";
  75.             $sent=true;
  76.         }
  77.         $str"<br />\n<b>{$errortype[$errno]['desc']}</b>: $errstr in <b>$errfile</b> on line <b>$errline</b>\n<br />\n";
  78.         echo $str;//. "<pre>". htmlspecialchars(var_export($vars,true))."</pre>";
  79.         if ($l>0{
  80.             ob_start();
  81.             echo $body;
  82.         }
  83.     }
  84. }
  85.  
  86. set_error_handler("ajax_nice_error");
  87.  
  88. switch ($_GET['req']{
  89.     case 10:
  90.         require_onceBOARDS_PKG_PATH.'BitBoardPost.php' );
  91.         $comment new BitBoardPost($_GET['comment_id']);
  92.         $comment->loadMetaData();
  93.         if (@$comment->verifyId($comment->mCommentId)) {
  94.             print $comment->mInfo['warned_message'];
  95.         else {
  96.             trigger_error(var_export($comment->mErrors,true ));
  97.         }
  98.         break;
  99.     default:
  100.         break;
  101. }
  102. ?>

Documentation generated on Wed, 29 Jul 2015 13:55:33 +0000 by phpDocumentor 1.5.0-lsces