/** * Constructor * */ public function __construct() { global $PMF_LANG; $this->db = PMF_Db::getInstance(); $this->language = PMF_Language::$language; $this->pmf_lang = $PMF_LANG; }
/** * Constructor * * @param resource$result Resultset */ public function __construct($result) { $this->db = PMF_Db::getInstance(); $arrayObject = new ArrayObject(); while ($row = $this->db->fetch_assoc($result)) { $arrayObject[] = $row; } $this->iterator = $arrayObject->getIterator(); }
/** * Constructor * * @since 2007-03-31 * @author Thorsten Rinne <*****@*****.**> */ function __construct() { global $DB, $PMF_LANG, $plr; $this->db = PMF_Db::getInstance(); $this->language = PMF_Language::$language; $this->type = $DB['type']; $this->pmf_lang = $PMF_LANG; $this->plr = $plr; }
/** * Constructor * * @param integer $user User * @param array $groups Groupss * @since 2007-03-30 * @author Thorsten Rinne <*****@*****.**> */ public function __construct($user = null, $groups = null) { global $DB, $faqconfig; $this->db = PMF_Db::getInstance(); $this->language = PMF_Language::$language; $this->type = $DB['type']; if (is_null($user)) { $this->user = -1; } else { $this->user = $user; } if (is_null($groups)) { $this->groups = array(-1); } else { $this->groups = $groups; } if ($faqconfig->get('main.permLevel') == 'medium') { $this->groupSupport = true; } }
/** * Returns an array of country codes for a specific FAQ record ID, * specific category ID or all languages used by FAQ records , categories * * @param integer $id ID * @param string $table Specifies table * @return array */ public static function languageAvailable($id, $table = 'faqdata') { $db = PMF_Db::getInstance(); $output = array(); if (isset($id)) { if ($id == 0) { // get languages for all ids $distinct = ' DISTINCT '; $where = ''; } else { // get languages for specified id $distinct = ''; $where = " WHERE id = " . $id; } $query = sprintf("\n SELECT %s\n lang\n FROM\n %s%s\n %s", $distinct, SQLPREFIX, $table, $where); $result = $db->query($query); if ($db->numRows($result) > 0) { while ($row = $db->fetchObject($result)) { $output[] = $row->lang; } } } return $output; }
/** * Constructor */ private function __construct() { $this->db = PMF_Db::getInstance(); $this->language = PMF_Language::$language; $this->table_name = SQLPREFIX . "faqstopwords"; }
/** * Constructor * * @return void */ protected function __construct() { $this->db = PMF_Db::getInstance(); }
/** * Constructor * */ public function __construct() { $this->db = PMF_Db::getInstance(); $this->language = PMF_Language::$language; $this->_table = SQLPREFIX . 'faqsearches'; }
/** * Administrator logging * * @param string * @return void * @access public * @since 2001-02-18 * @author Bastian Poettner <*****@*****.**> * @author Thorsten Rinne <*****@*****.**> */ function adminlog($text) { global $auth, $user; $faqconfig = PMF_Configuration::getInstance(); $db = PMF_Db::getInstance(); if ($faqconfig->get('main.enableAdminLog') && $auth && isset($user)) { $query = sprintf('INSERT INTO %sfaqadminlog (id, time, usr, text, ip) VALUES (%d, %d, %d, %s, %s)', SQLPREFIX, $db->nextID(SQLPREFIX . 'faqadminlog', 'id'), $_SERVER['REQUEST_TIME'], $user->userdata->get('user_id'), "'" . nl2br($text) . "'", "'" . $_SERVER['REMOTE_ADDR'] . "'"); $db->query($query); } }
/** * Constructor * * @param PMF_Perm $perm Permission object * @param array $auth Authorization array * @return void */ public function __construct(PMF_Perm $perm = null, array $auth = array()) { $this->db = PMF_Db::getInstance(); if ($perm !== null) { if (!$this->addPerm($perm)) { return false; } } else { $permLevel = PMF_Configuration::getInstance()->get('security.permLevel'); $perm = PMF_Perm::selectPerm($permLevel); if (!$this->addPerm($perm)) { return false; } } // authentication objects // always make a 'local' $auth object (see: $auth_data) $this->auth_container = array(); $authLocal = PMF_Auth::selectAuth($this->auth_data['authSource']['name']); $authLocal->selectEncType($this->auth_data['encType']); $authLocal->setReadOnly($this->auth_data['readOnly']); if (!$this->addAuth($authLocal, $this->auth_data['authSource']['type'])) { return false; } // additionally, set given $auth objects if (count($auth) > 0) { foreach ($auth as $name => $auth_object) { if (!$this->addAuth($auth_object, $name)) { break; } } } // user data object $this->userdata = new PMF_User_UserData(); }
/** * Constructor * * @param integer $user User * @param array $groups Groups * @return void */ public function __construct($user = null, $groups = null) { global $PMF_LANG, $plr; $this->db = PMF_Db::getInstance(); $this->language = PMF_Language::$language; $this->pmf_lang = $PMF_LANG; $this->plr = $plr; if (is_null($user)) { $this->user = -1; } else { $this->user = $user; } if (is_null($groups)) { $this->groups = array(-1); } else { $this->groups = $groups; } $faqconfig = PMF_Configuration::getInstance(); if ($faqconfig->get('main.permLevel') == 'medium') { $this->groupSupport = true; } }
/** * Wrapper for the PMF_Export_Docbook class * */ private static function _generateDocBookExport2() { // TODO: check/refine/improve/fix docbook.php and add toString method before recoding the method in order to use faq and news classes. global $PMF_CONF, $PMF_LANG; // XML DocBook export $parentID = 0; $rubrik = 0; $sql = ''; $selectString = ''; $db = PMF_Db::getInstance(); $export = new PMF_Export_Docbook(); $export->delete_file(); // Set the FAQ title $faqtitel = PMF_String::htmlspecialchars($PMF_CONF['main.titleFAQ']); // Print the title of the FAQ $export->xmlContent = '<?xml version="1.0" encoding="' . $PMF_LANG['metaCharset'] . '"?>' . '<book lang="en">' . '<title>phpMyFAQ</title>' . '<bookinfo>' . '<title>' . $faqtitel . '</title>' . '</bookinfo>'; // include the news $result = $db->query("SELECT id, header, artikel, datum FROM " . SQLPREFIX . "faqnews"); // Write XML file $export->write_file(); // Transformation of the news entries if ($db->num_rows($result) > 0) { $export->xmlContent .= '<part><title>News</title>'; while ($row = $db->fetch_object($result)) { $datum = $export->aktually_date($row->datum); $export->xmlContent .= '<article>' . '<title>' . $row->header . '</title>' . '<para>' . wordwrap($datum, 20) . '</para>'; $replacedString = ltrim(str_replace('<br />', '', $row->artikel)); $export->TableImageText($replacedString); $export->xmlContent .= '</article>'; } $export->xmlContent .= '</part>'; } $export->write_file(); // Transformation of the articles $export->xmlContent .= '<part>' . '<title>Artikel</title>' . '<preface>' . '<title>Rubriken</title>'; // Selection of the categories $export->recursive_category($parentID); $export->xmlContent .= '</preface>' . '</part>' . '</book>'; $export->write_file(); }
/** * Constructor * * @param string $sids Session ID * @param integer $caplength Length of captch code * @return void */ public function __construct($sids, $caplength = 6) { $this->db = PMF_Db::getInstance(); $this->language = PMF_Language::$language; if ($sids > 0) { $this->sids = $sids; } else { $this->sids = ''; } $this->userAgent = $_SERVER['HTTP_USER_AGENT']; $this->ip = $_SERVER['REMOTE_ADDR']; $this->caplength = $caplength; $this->letters = array('1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'); $this->code = ''; $this->quality = 60; $this->fonts = $this->getFonts(); $this->width = 200; $this->height = 40; $this->timestamp = $_SERVER['REQUEST_TIME']; }
/** * Constructor * * @param integer $user User * @param array $groups Group * @param boolean $withperm With or without permission check * @return void */ public function __construct($user = null, $groups = null, $withperm = true) { $this->language = PMF_Language::$language; $this->db = PMF_Db::getInstance(); $this->categories = array(); if (is_null($user)) { $this->user = -1; } else { $this->user = $user; } if (is_null($groups)) { $this->groups = array(-1); } else { $this->groups = $groups; } $this->lineTab = $this->getOrderedCategories($withperm); for ($i = 0; $i < count($this->lineTab); $i++) { $this->lineTab[$i]['level'] = $this->levelOf($this->lineTab[$i]['id']); } }
/** * Constructor * * @param integer $id attachment id * * @return null */ public function __construct($id = null) { $this->db = PMF_Db::getInstance(); if (null !== $id) { $this->id = $id; $this->getMeta(); } }
/** * Constructor * * @return void */ private function __construct() { $this->db = PMF_Db::getInstance(); $this->language = PMF_Language::$language; }
/** * Constructor * * @param string $enctype Type of encoding * @param boolean $read_only Readonly? * @return void */ function __construct($enctype = 'none', $read_only = false) { parent::__construct($enctype, $read_only); $this->db = PMF_Db::getInstance(); }
/** * Constructor * * @param string $user User */ public function __construct($user = null) { global $PMF_LANG; $this->db = PMF_Db::getInstance(); $this->user = $user; if (!@extension_loaded('openssl')) { // PHP 4.3.0+: fsockopen needs OpenSSL $this->addIgnoreProtocol("https:", sprintf($PMF_LANG['ad_linkcheck_protocol_unsupported'], "https")); } $this->addIgnoreProtocol("ftp:", sprintf($PMF_LANG['ad_linkcheck_protocol_unsupported'], "ftp")); $this->addIgnoreProtocol("gopher:", sprintf($PMF_LANG['ad_linkcheck_protocol_unsupported'], "gopher")); $this->addIgnoreProtocol("mailto:", sprintf($PMF_LANG['ad_linkcheck_protocol_unsupported'], "mailto")); $this->addIgnoreProtocol("telnet:", sprintf($PMF_LANG['ad_linkcheck_protocol_unsupported'], "telnet")); $this->addIgnoreProtocol("feed:", sprintf($PMF_LANG['ad_linkcheck_protocol_unsupported'], "feed")); // Hack: these below are not real scheme for defining protocols like the ones above $this->addIgnoreProtocol("file:", sprintf($PMF_LANG['ad_linkcheck_protocol_unsupported'], "file")); $this->addIgnoreProtocol("javascript:", sprintf($PMF_LANG['ad_linkcheck_protocol_unsupported'], "javascript")); // load list of URLs to ignore / fail $this->loadConfigurationFromDB(); }
/** * This function builds the the queries for the backup * * @param string query * @param string table name * @return array * @access public * @author Meikel Katzengreis <*****@*****.**> * @author Thorsten Rinne <*****@*****.**> * @since 2003-03-24 */ function build_insert($query, $table) { $db = PMF_Db::getInstance(); if (!($result = $db->query($query))) { return; } $ret = array(); $ret[] = "\r\n-- Table: " . $table; while ($row = $db->fetch_assoc($result)) { $p1 = array(); $p2 = array(); foreach ($row as $key => $val) { $p1[] = $key; if ('rights' != $key && is_numeric($val)) { $p2[] = $val; } else { if (is_null($val)) { $p2[] = 'NULL'; } else { $p2[] = sprintf("'%s'", $db->escape_string($val)); } } } $ret[] = "INSERT INTO " . $table . " (" . implode(",", $p1) . ") VALUES (" . implode(",", $p2) . ");"; } return $ret; }
/** * Fetch all record attachments * * @param integer $recordId ID of the record * * @return array */ public static function fetchByRecordId($recordId) { $retval = array(); $db = PMF_Db::getInstance(); $sql = sprintf("\n SELECT\n id\n FROM \n %sfaqattachment\n WHERE \n record_id = %d\n AND\n record_lang = '%s'", SQLPREFIX, $recordId, PMF_Language::$language); $result = $db->fetchAll($db->query($sql)); if ($result) { foreach ($result as $item) { $retval[] = self::create($item->id); } } reset($retval); return $retval; }
/** * Constructor * * @return null */ public function __construct() { $this->db = PMF_Db::getInstance(); }