Exemplo n.º 1
0
 /**
  * Get an array with minimalistic attachment meta data
  * 
  * @param integer $start Listing start
  * @param integer $limit Listing end
  * 
  * @return array
  */
 public function getBreadcrumbs($start = 0, $limit = 0)
 {
     $retval = array();
     $query = sprintf("\n            SELECT\n                fa.id,\n                fa.record_id,\n                fa.record_lang,\n                fa.filename,\n                fa.filesize,\n                fa.mime_type,\n                fd.thema\n            FROM\n                %s fa\n            JOIN\n                %s fd\n            ON\n                fa.record_id = fd.id", SQLPREFIX . 'faqattachment', SQLPREFIX . 'faqdata');
     $result = $this->db->query($query);
     if ($result) {
         $retval = $this->db->fetchAll($result);
     }
     return $retval;
 }
Exemplo n.º 2
0
 /**
  * Get an array with minimalistic attachment meta data
  * 
  * @param integer $start Listing start
  * @param integer $limit Listing end
  * 
  * @return array
  */
 public function getBreadcrumbs($start = 0, $limit = 0)
 {
     $retval = array();
     $sql = str_replace(array('_t1_', '_t2_'), array(SQLPREFIX . "faqattachment", SQLPREFIX . "faqdata"), "SELECT\n\t\t\t    _t1_.id,\n                _t1_.record_id, _t1_.record_lang,\n                _t1_.filename, _t1_.filesize, _t1_.mime_type,\n                _t2_.thema\n            FROM\n                _t1_\n            JOIN _t2_ ON _t1_.record_id = _t2_.id");
     $result = $this->db->query($sql);
     if ($result) {
         $retval = $this->db->fetchAll($result);
     }
     return $retval;
 }
Exemplo n.º 3
0
 /**
  * Check if a table is filled with data
  * 
  * @param string $tableName Table name
  * 
  * @return boolean true, if table is empty, otherwise false
  */
 public static function checkOnEmptyTable($tableName)
 {
     if (self::$instance->num_rows(self::$instance->query('SELECT * FROM ' . SQLPREFIX . $tableName)) < 1) {
         return true;
     } else {
         return false;
     }
 }
 /**
  * Check if a table is filled with data
  *
  * @param string $tableName Table name
  *
  * @return boolean true, if table is empty, otherwise false
  */
 public static function checkOnEmptyTable($tableName)
 {
     if (self::$instance->numRows(self::$instance->query('SELECT * FROM ' . PMF_Db::getTablePrefix() . $tableName)) < 1) {
         return true;
     } else {
         return false;
     }
 }
Exemplo n.º 5
0
 /**
  * Add new entry into faqlinkverifyrules table
  *
  * @param   string $type
  * @param   string $url
  * @param   string $reason
  * @return  void
  * @access  public
  * @author  Thorsten Rinne <*****@*****.**>
  */
 function addVerifyRule($type = '', $url = '', $reason = '')
 {
     if ($type != '' && $url != '') {
         $query = sprintf("INSERT INTO\n                            %sfaqlinkverifyrules\n                            (id, type, url, reason, enabled, locked, owner, dtInsertDate, dtUpdateDate)\n                        VALUES\n                            (%d, '%s', '%s', '%s', 'y', 'n', '%s', '%s', '%s')", SQLPREFIX, $this->db->nextID(SQLPREFIX . "faqlinkverifyrules", "id"), $this->db->escapeString($type), $this->db->escapeString($url), $this->db->escapeString($reason), $this->db->escapeString($this->user->getLogin()), $this->db->escapeString(date('YmdHis')), $this->db->escapeString(date('YmdHis')));
         $this->db->query($query);
     }
 }
Exemplo n.º 6
0
 /**
  * Remove meta data from the db
  * 
  * @return null
  */
 protected function deleteMeta()
 {
     $sql = sprintf("DELETE FROM\n                             %sfaqattachment\n                        WHERE id = %d", SQLPREFIX, $this->id);
     $this->db->query($sql);
 }
Exemplo n.º 7
0
 /**
  * Remove meta data from the db
  *
  * @return null
  */
 protected function deleteMeta()
 {
     $sql = sprintf("DELETE FROM %sfaqattachment WHERE id = %d", PMF_Db::getTablePrefix(), $this->id);
     $this->db->query($sql);
 }