function updateMailXML($what, $postarray) { global $sql, $reseller_id; $changeCount = 0; if (isset($postarray["languages-{$what}"])) { $query = $sql->prepare("INSERT INTO `translations` (`type`,`transID`,`lang`,`text`,`resellerID`) VALUES ('em',?,?,?,?) ON DUPLICATE KEY UPDATE `text`=VALUES(`text`)"); foreach ($postarray["languages-{$what}"] as $language) { if (small_letters_check($language, 2)) { $xml = $postarray[$what . '_xml_' . $language]; $query->execute(array($what, $language, $xml, $reseller_id)); $changeCount += $query->rowCount(); } } $query = $sql->prepare("SELECT `lang` FROM `translations` WHERE `type`='em' AND `transID`=? AND `resellerID`=?"); $query2 = $sql->prepare("DELETE FROM `translations` WHERE `lang`=? AND `transID`=? AND `resellerID`=? LIMIT 1"); $query->execute(array($what, $reseller_id)); while ($row = $query->fetch(PDO::FETCH_ASSOC)) { if (!in_array($row['lang'], (array) $postarray["languages-{$what}"])) { $query2->execute(array($row['lang'], $what, $reseller_id)); $changeCount += $query2->rowCount(); } } } else { $query = $sql->prepare("DELETE FROM `translations` WHERE `lang`=? AND `resellerID`=?"); $query->execute(array($what, $reseller_id)); $changeCount += $query->rowCount(); } return $changeCount; }
$amount = $a; $_SESSION['amount'] = $a; } else { $amount = (isset($_SESSION['amount']) and is_int($_SESSION['amount'])) ? $_SESSION['amount'] : 20; } $dirs = array(); $languages = array(); if (is_dir(EASYWIDIR . '/languages/' . $template_to_use . '/')) { $dirs = array_merge($dirs, scandir(EASYWIDIR . '/languages/' . $template_to_use . '/')); } if (is_dir(EASYWIDIR . '/languages/default/')) { $dirs = array_merge($dirs, scandir(EASYWIDIR . '/languages/default/')); } if (is_dir(EASYWIDIR . '/languages/')) { $dirs = array_merge($dirs, scandir(EASYWIDIR . '/languages/')); } $dirs = array_unique($dirs); foreach ($dirs as $row) { if (small_letters_check($row, 2)) { $languages[] = $row; } } if ($ui->escaped('HTTP_REFERER', 'server')) { $referrer = $ui->escaped('HTTP_REFERER', 'server'); } if (!isset($reseller_id)) { $reseller_id = 0; } if (!isset($resellerLockupID)) { $resellerLockupID = $reseller_id; }
} else { if (count($errors) == 0 and $ui->st('action', 'post') == 'ad') { $query = $sql->prepare("INSERT INTO `modules` (`get`,`file`,`sub`,`active`,`type`) VALUES (?,?,?,?,?)"); $query->execute(array($get, $file, $sub, $active, $type)); if ($query->rowCount() > 0) { $dbSuccess = true; } $id = $sql->lastInsertId(); } } if (!$coreModuleFound) { if ($ui->smallletters('lang', 2, 'post')) { $array = (array) $ui->smallletters('lang', 2, 'post'); $query = $sql->prepare("INSERT INTO `translations` (`type`,`transID`,`lang`,`text`,`resellerID`) VALUES ('mo',?,?,?,?) ON DUPLICATE KEY UPDATE `text`=VALUES(`text`)"); foreach ($array as $lang) { if (small_letters_check($lang, 2)) { $query->execute(array($id, $lang, $ui->description('translation', 'post', $lang), 0)); if ($dbSuccess === false and $query->rowCount() > 0) { $dbSuccess = true; } } } $query = $sql->prepare("SELECT `lang` FROM `translations` WHERE `type`='mo' AND `transID`=? AND `resellerID`=?"); $query2 = $sql->prepare("DELETE FROM `translations` WHERE `type`='mo' AND `transID`=? AND `lang`=? AND `resellerID`=? LIMIT 1"); $query->execute(array($id, 0)); while ($row = $query->fetch(PDO::FETCH_ASSOC)) { if (!in_array($row['lang'], $array)) { $query2->execute(array($id, $row['lang'], 0)); if ($dbSuccess === false and $query2->rowCount() > 0) { $dbSuccess = true; }
$allowedTypes = array('avi' => 'video/x-msvideo', 'doc' => 'application/msword', 'gz' => 'application/x-gzip', 'mov' => 'video/quicktime', 'movie' => 'video/x-sgi-movie', 'mpe' => 'video/mpeg', 'mpeg' => 'video/mpeg', 'mpg' => 'video/mpeg', 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', 'pdf' => array('application/pdf', 'application/x-download'), 'ppt' => 'application/powerpoint', 'qt' => 'video/quicktime', 'rar' => 'application/x-rar-compressed', 'tar' => 'application/x-tar', 'tgz' => 'application/x-tar', 'txt' => 'text/plain', 'word' => array('application/msword', 'application/octet-stream'), 'xl' => 'application/excel', 'xls' => array('application/excel', 'application/vnd.ms-excel'), 'xml' => 'text/xml', 'xsl' => 'text/xml', 'zip' => array('application/x-zip', 'application/zip', 'application/x-zip-compressed', 'application/octet-stream')); $exploded = explode('.', $_FILES['upload']['name']); $extension = $exploded[count($exploded) - 1]; if (isset($allowedTypes[$extension]) and (is_array($allowedTypes[$extension]) and in_array($_FILES["upload"]["type"], $allowedTypes[$extension]) or !is_array($allowedTypes[$extension]) and $_FILES["upload"]["type"] == $allowedTypes[$extension])) { if (move_uploaded_file($_FILES["upload"]["tmp_name"], EASYWIDIR . '/downloads/' . $id . '.' . $extension)) { $changed = true; $query = $sql->prepare("UPDATE `page_downloads` SET `fileExtension`=? WHERE `fileID`=? AND `resellerID`=?"); $query->execute(array($extension, $id, $reseller_id)); } } } if ($ui->smallletters('language', 2, 'post')) { $array = (array) $ui->smallletters('language', 2, 'post'); $query = $sql->prepare("INSERT INTO `translations` (`type`,`transID`,`lang`,`text`,`resellerID`) VALUES ('pd',?,?,?,?) ON DUPLICATE KEY UPDATE `text`=VALUES(`text`)"); foreach ($array as $language) { if (small_letters_check($language, 2)) { $query->execute(array($id, $language, $ui->description('text', 'post', $language), $reseller_id)); if ($query->rowCount() > 0) { $changed = true; } } } $query = $sql->prepare("SELECT `lang` FROM `translations` WHERE `type`='pd' AND `transID`=? AND `resellerID`=?"); $query->execute(array($id, $reseller_id)); $query2 = $sql->prepare("DELETE FROM `translations` WHERE `type`='pd' AND `transID`=? AND `lang`=? AND `resellerID`=? LIMIT 1"); while ($row = $query->fetch(PDO::FETCH_ASSOC)) { if (!in_array($row['lang'], $array)) { $query2->execute(array($addonid, $row['lang'], $reseller_id)); if ($query2->rowCount() > 0) { $changed = true; }
function language($user_id) { global $sql, $ui; if (!isset($_SESSION['language'])) { $query = $sql->prepare("SELECT `language` FROM `userdata` WHERE `id`=? LIMIT 1"); $query->execute(array($user_id)); $language = $query->fetchColumn(); if ($language == '') { $lang_detect = isset($ui->server['HTTP_ACCEPT_LANGUAGE']) ? small_letters_check(substr($ui->server['HTTP_ACCEPT_LANGUAGE'], 0, 2), 2) : 'uk'; if (is_dir(EASYWIDIR . '/languages/' . $lang_detect)) { $language = $lang_detect; } else { $query = $sql->prepare("SELECT `language` FROM `settings` LIMIT 1"); $query->execute(); $language = $query->fetchColumn(); } } else { if (!is_dir(EASYWIDIR . '/languages/' . $language)) { $query = $sql->prepare("SELECT `language` FROM `settings` LIMIT 1"); $query->execute(); $language = $query->fetchColumn(); } } $query = $sql->prepare("UPDATE `userdata` SET `language`=? WHERE `id`=? LIMIT 1"); $query->execute(array($language, $user_id)); $_SESSION['language'] = $language; } else { $language = $_SESSION['language']; } return $language; }
* Sie sollten eine Kopie der GNU General Public License zusammen mit diesem * Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>. */ if (!isset($admin_id) or $main != 1 or isset($admin_id) and !$pa['traffic']) { header('Location: admin.php'); die('No Access'); } $sprache = getlanguagefile('traffic', $user_language, $reseller_id); if ($d == 'se' and $reseller_id == 0) { include EASYWIDIR . '/stuff/keyphrasefile.php'; if ($ui->w('action', 4, 'post') and !token(true)) { $template_file = $spracheResponse->token; } else { if (isset($ui->post['type']) and $ui->w('action', 4, 'post') == 'md') { $error = 0; if (!isset($ui->post['type']) or !small_letters_check($ui->post['type'], '30')) { $error = 1; } if (!isset($ui->post['statip']) or !isip($ui->post['statip'], 'all') and !isurl($ui->post['statip'])) { $error = 1; } if (!isset($ui->post['dbname']) or !gamestring($ui->post['dbname'])) { $error = 1; } if (!isset($ui->post['dbuser']) or !gamestring($ui->post['dbuser'])) { $error = 1; } if (!isset($ui->post['dbpassword']) or !gamestring($ui->post['dbpassword'])) { $error = 1; } if (!isset($ui->post['table_name']) or !gamestring($ui->post['table_name'])) {