Exemplo n.º 1
0
 /**
  * fetchContentValue
  * Fetch Column for post/page
  *
  * @param int $content_id
  * @param string $col
  * @return mixed
  */
 public function fetchContentValue($content_id, $col)
 {
     $result = $this->fetchValue(array('cols' => array($col), 'where' => array('id = ?' => $content_id)));
     Foresmo::escape($result);
     return $result;
 }
Exemplo n.º 2
0
 /**
  * processAdminRequest
  *
  * handle module admin request, and return output
  *
  * @param string $name module name
  * @param array $data request data: POST, GET, PARAMS(from url)
  *
  * @return mixed;
  */
 public function processAdminRequest($name, $data)
 {
     $module = $this->loadModule($name);
     if (method_exists($module, 'admin_request')) {
         try {
             $module->admin_request($data);
             if (isset($module->output)) {
                 Foresmo::escape($module->output);
                 return $module->output;
             } else {
                 return null;
             }
         } catch (Exception $e) {
             return null;
         }
     }
     return null;
 }
Exemplo n.º 3
0
 /**
  * fetchSpam
  * Fetch all spam comments
  *
  * @return array result set
  */
 public function fetchSpam()
 {
     $results = $this->fetchAllAsArray(array('where' => array('comments.status = ?' => array(2)), 'eager' => array('commentinfo', 'post'), 'order' => array('id DESC')));
     Foresmo::dateFilter($results);
     Foresmo::escape($results);
     return $results;
 }