protected static function getPricing() { if (is_null(self::$pricing)) { self::$pricing = array(); //$pricing = explode("\n", trim(wfMsg('babelfish_mult'))); $pricing = "\n\t\t\t\tfr,1,0,10000\n\t\t\t\tpt,.0085,4,20\n\t\t\t\tru,.0085,5,24\n\t\t\t\tzh,.0075,3,20\n\t\t\t\tit,1,0,10000\n\t\t\t\tde,.015,8,32\n\t\t\t\tnl,.015,8,32\n\t\t\t\tes,.0055,3,15"; $pricing = explode("\n", trim($pricing)); foreach ($pricing as $price) { $price = explode(",", trim($price)); if (sizeof($price) != 4) { throw new Exception(self::MSG_INVALID_PRICING_DATA); } self::$pricing[$price[0]] = array("multiplier" => $price[1], "min" => $price[2], "max" => $price[3]); } } return self::$pricing; }
private function getTranslatedArticles($moreWhere, $lang) { $where = array('tl_from_lang' => 'en', 'tl_to_lang' => $lang, "tl_from_aid = ct_page_id", "tl_to_lang = ct_lang_code"); $where[] = $moreWhere; $dbr = wfGetDB(DB_SLAVE); $res = $dbr->select(array('translation_link', 'babelfish_articles'), array('babelfish_articles.*'), $where, __METHOD__); $articles = array(); foreach ($res as $row) { $articles[] = BabelfishArticle::newFromDBRow($row, $this->dbType); } return $articles; }