本文整理汇总了PHP中my_strtolower函数的典型用法代码示例。如果您正苦于以下问题:PHP my_strtolower函数的具体用法?PHP my_strtolower怎么用?PHP my_strtolower使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了my_strtolower函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: check_for_duplicates
public function check_for_duplicates(&$user)
{
global $db, $output, $import_session;
if (!$this->total_users) {
// Count the total number of users so we can generate a unique id if we have a duplicate user
$query = $db->simple_select("users", "COUNT(*) as totalusers");
$this->total_users = $db->fetch_field($query, "totalusers");
$db->free_result($query);
}
$username = $user[$this->settings['username_column']];
$encoded_username = encode_to_utf8($user[$this->settings['username_column']], $this->settings['encode_table'], "users");
// Check for duplicate users
$where = "username='" . $db->escape_string($username) . "' OR username='" . $db->escape_string($encoded_username) . "'";
$query = $db->simple_select("users", "username,email,uid,postnum", $where, array('limit' => 1));
$duplicate_user = $db->fetch_array($query);
$db->free_result($query);
// Using strtolower and my_strtolower to check, instead of in the query, is exponentially faster
// If we used LOWER() function in the query the index wouldn't be used by MySQL
if (strtolower($duplicate_user['username']) == strtolower($username) || my_strtolower($duplicate_user['username']) == strtolower($encoded_username)) {
if ($user[$this->settings['email_column']] == $duplicate_user['email']) {
$output->print_progress("start");
$output->print_progress("merge_user", array('import_uid' => $user[$this->settings['progress_column']], 'duplicate_uid' => $duplicate_user['uid']));
$db->update_query("users", array('import_uid' => $user[$this->settings['progress_column']], 'postnum' => $duplicate_user['postnum'] + $user[$this->settings['postnum_column']]), "uid = '{$duplicate_user['uid']}'");
return false;
} else {
$user[$this->settings['username_column']] = $duplicate_user['username'] . "_" . $import_session['board'] . "_import" . $this->total_users;
}
}
return true;
}
示例2: validate_password_from_username
/**
* Checks a password with a supplied username.
*
* @param string The username of the user.
* @param string The plain-text password.
* @return boolean|array False when no match, array with user info when match.
*/
function validate_password_from_username($username, $password)
{
global $db, $mybb;
$username = $db->escape_string(my_strtolower($username));
switch ($mybb->settings['username_method']) {
case 0:
$query = $db->simple_select("users", "uid,username,password,salt,loginkey,coppauser,usergroup", "LOWER(username)='" . $username . "'", array('limit' => 1));
break;
case 1:
$query = $db->simple_select("users", "uid,username,password,salt,loginkey,coppauser,usergroup", "LOWER(email)='" . $username . "'", array('limit' => 1));
break;
case 2:
$query = $db->simple_select("users", "uid,username,password,salt,loginkey,coppauser,usergroup", "LOWER(username)='" . $username . "' OR LOWER(email)='" . $username . "'", array('limit' => 1));
break;
default:
$query = $db->simple_select("users", "uid,username,password,salt,loginkey,coppauser,usergroup", "LOWER(username)='" . $username . "'", array('limit' => 1));
break;
}
$user = $db->fetch_array($query);
if (!$user['uid']) {
return false;
} else {
return validate_password_from_uid($user['uid'], $password, $user);
}
}
示例3: get_board_stat_func
function get_board_stat_func()
{
global $mybb, $cache, $db;
// Get the online users.
$timesearch = TIME_NOW - $mybb->settings['wolcutoff'];
$query = $db->query("\n SELECT s.sid, s.uid, s.time\n FROM " . TABLE_PREFIX . "sessions s\n WHERE s.time>'{$timesearch}'\n ORDER BY s.time DESC\n ");
$membercount = 0;
$guestcount = 0;
$doneusers = array();
// Fetch spiders
$spiders = $cache->read("spiders");
// Loop through all users.
while ($user = $db->fetch_array($query)) {
// Create a key to test if this user is a search bot.
$botkey = my_strtolower(str_replace("bot=", '', $user['sid']));
// Decide what type of user we are dealing with.
if ($user['uid'] > 0) {
// The user is registered.
if ($doneusers[$user['uid']] < $user['time'] || !$doneusers[$user['uid']]) {
++$membercount;
$doneusers[$user['uid']] = $user['time'];
}
} elseif (my_strpos($user['sid'], "bot=") !== false && $spiders[$botkey]) {
} else {
++$guestcount;
}
}
$onlinecount = $membercount + $guestcount;
$stats = $cache->read("stats");
$board_stat = array('total_threads' => new xmlrpcval($stats['numthreads'], 'int'), 'total_posts' => new xmlrpcval($stats['numposts'], 'int'), 'total_members' => new xmlrpcval($stats['numusers'], 'int'), 'guest_online' => new xmlrpcval($guestcount, 'int'), 'total_online' => new xmlrpcval($onlinecount, 'int'));
$response = new xmlrpcval($board_stat, 'struct');
return new xmlrpcresp($response);
}
示例4: action
/**
This is where you perform the action when the API is called, the parameter given is an instance of stdClass, this method should return an instance of stdClass.
*/
public function action()
{
global $mybb, $db, $cache;
require_once MYBB_ROOT . "inc/functions_online.php";
$timesearch = TIME_NOW - $mybb->settings['wolcutoffmins'] * 60;
switch ($db->type) {
case "sqlite":
$sessions = array();
$query = $db->simple_select("sessions", "sid", "time > {$timesearch}");
while ($sid = $db->fetch_field($query, "sid")) {
$sessions[$sid] = 1;
}
$online_count = count($sessions);
unset($sessions);
break;
case "pgsql":
default:
$query = $db->simple_select("sessions", "COUNT(sid) as online", "time > {$timesearch}");
$online_count = $db->fetch_field($query, "online");
break;
}
$query = $db->query("\n\t\t\tSELECT DISTINCT s.sid, s.ip, s.uid, s.time, s.location, u.username, s.nopermission, u.invisible, u.usergroup, u.displaygroup\n\t\t\tFROM " . TABLE_PREFIX . "sessions s\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "users u ON (s.uid=u.uid)\n\t\t\tWHERE s.time>'{$timesearch}'\n\t\t\t");
//ORDER BY $sql
// LIMIT {$start}, {$perpage}
$users = array();
$guests = array();
$spiders = $cache->read("spiders");
while ($user = $db->fetch_array($query)) {
// Fetch the WOL activity
$user['activity'] = fetch_wol_activity($user['location'], $user['nopermission']);
$botkey = my_strtolower(str_replace("bot=", '', $user['sid']));
// Have a registered user
if ($user['uid'] > 0) {
if ($users[$user['uid']]['time'] < $user['time'] || !$users[$user['uid']]) {
$users[$user['uid']] = $user;
}
} else {
if (my_strpos($user['sid'], "bot=") !== false && $spiders[$botkey]) {
$user['bot'] = $spiders[$botkey]['name'];
$user['usergroup'] = $spiders[$botkey]['usergroup'];
$guests[] = $user;
} else {
$guests[] = $user;
}
}
}
foreach ($users as &$user) {
$user["display"] = format_name($user["username"], $user["usergroup"], $user["displaygroup"]);
}
$stdClass = new stdClass();
// remove keys from this otherwise we will get an object of objects, sigh!
$stdClass->users = array_values($users);
$stdClass->guests = $guests;
$stdClass->count = $online_count;
$stdClass->wolcutoffmins = $mybb->settings["wolcutoffmins"];
$stdClass->mostonline = $cache->read("mostonline");
return $stdClass;
}
示例5: ajout_fichier
function ajout_fichier($doc_file, $dest, $cpt_doc, $id_groupe)
{
global $max_size, $total_max_size;
/* Vérification du type de fichier */
$ext = '';
//if (my_ereg("\.([^.]+)$", $doc_file['name'][$cpt_doc], $match)) {
if (function_exists("mb_ereg") && mb_ereg("\\.([^.]+)\$", $doc_file['name'][$cpt_doc], $match) || function_exists("ereg") && ereg("\\.([^.]+)\$", $doc_file['name'][$cpt_doc], $match)) {
$ext = corriger_caracteres(my_strtolower($match[1]));
$ext = corriger_extension($ext);
}
$query = "SELECT id_type FROM ct_types_documents WHERE extension='{$ext}' AND upload='oui'";
$result = sql_query($query);
if ($row = @sql_row($result, 0)) {
$id_type = $row[0];
} else {
echo "Erreur : Ce type de fichier n'est pas autorisé en téléchargement.\nSi vous trouvez cela regrettable, contactez l'administrateur.\nIl pourra modifier ce paramétrage dans\n *Gestion des modules/Cahiers de textes/Types de fichiers autorisés en téléchargement*.";
die;
}
/* Vérification de la taille du fichier */
$max_size_ko = $max_size / 1024;
$taille = $doc_file['size'][$cpt_doc];
if ($taille > $max_size) {
echo "Erreur : Téléchargement impossible : taille maximale autorisée : " . $max_size_ko . " Ko";
die;
}
if ($taille == 0) {
echo "Le fichier sélectionné semble vide : transfert impossible.";
die;
}
$query = "SELECT DISTINCT sum(taille) somme FROM ct_documents d, ct_entry e WHERE (e.id_groupe='" . $id_groupe . "' and e.id_ct = d.id_ct)";
$total = sql_query1($query);
if ($total + $taille > $total_max_size) {
echo "Erreur : Téléchargement impossible : espace disque disponible (" . ($total_max_size - $total) / 1024 . " Ko) insuffisant.";
die;
}
/* Crétion du répertoire de destination */
if (!creer_repertoire($dest)) {
echo "Erreur : Problème d'écriture sur le répertoire. Veuillez signaler ce problème à l'administrateur du site";
echo $dest;
die;
}
/* Recopier le fichier */
$nom_sans_ext = mb_substr(basename($doc_file['name'][$cpt_doc]), 0, mb_strlen(basename($doc_file['name'][$cpt_doc])) - (mb_strlen($ext) + 1));
$nom_sans_ext = my_ereg_replace("[^.a-zA-Z0-9_=-]+", "_", $nom_sans_ext);
if (strstr($nom_sans_ext, "..")) {
echo "Erreur : Problème de transfert : le fichier n'a pas pu être transféré sur le répertoire. Veuillez signaler ce problème à l'administrateur du site";
die;
}
$n = 0;
while (file_exists($newFile = $dest . "/" . $nom_sans_ext . ($n++ ? '-' . $n : '') . '.' . $ext)) {
}
$dest_file_path = $newFile;
if (!deplacer_fichier_upload($doc_file['tmp_name'][$cpt_doc], $dest_file_path)) {
echo "Erreur : Problème de transfert : le fichier n'a pas pu être transféré sur le répertoire. Veuillez signaler ce problème à l'administrateur du site";
die;
}
return $dest_file_path;
}
示例6: login_func
function login_func($xmlrpc_params)
{
global $db, $lang, $theme, $plugins, $mybb, $session, $settings, $cache, $time, $mybbgroups, $mobiquo_config, $user, $register;
$lang->load("member");
$input = Tapatalk_Input::filterXmlInput(array('username' => Tapatalk_Input::STRING, 'password' => Tapatalk_Input::STRING, 'anonymous' => Tapatalk_Input::INT, 'push' => Tapatalk_Input::STRING), $xmlrpc_params);
$logins = login_attempt_check(1);
$login_text = '';
if (!username_exists($input['username'])) {
my_setcookie('loginattempts', $logins + 1);
$status = 2;
$response = new xmlrpcval(array('result' => new xmlrpcval(0, 'boolean'), 'result_text' => new xmlrpcval(strip_tags($lang->error_invalidpworusername), 'base64'), 'status' => new xmlrpcval($status, 'string')), 'struct');
return new xmlrpcresp($response);
}
$query = $db->simple_select("users", "loginattempts", "LOWER(username)='" . my_strtolower($input['username_esc']) . "'", array('limit' => 1));
$loginattempts = $db->fetch_field($query, "loginattempts");
$errors = array();
$user = validate_password_from_username($input['username'], $input['password']);
$correct = false;
if (!$user['uid']) {
if (validate_email_format($input['username'])) {
$mybb->settings['username_method'] = 1;
$user = validate_password_from_username($input['username'], $input['password']);
}
if (!$user['uid']) {
my_setcookie('loginattempts', $logins + 1);
$db->update_query("users", array('loginattempts' => 'loginattempts+1'), "LOWER(username) = '" . my_strtolower($input['username_esc']) . "'", 1, true);
if ($mybb->settings['failedlogincount'] != 0 && $mybb->settings['failedlogintext'] == 1) {
$login_text = $lang->sprintf($lang->failed_login_again, $mybb->settings['failedlogincount'] - $logins);
}
$errors[] = $lang->error_invalidpworusername . $login_text;
} else {
$correct = true;
}
} else {
$correct = true;
}
if (!empty($errors)) {
return xmlrespfalse(implode(" :: ", $errors));
} else {
if ($correct) {
$register = 0;
return tt_login_success();
}
}
return xmlrespfalse("Invalid login details");
}
示例7: tags_string2tag
function tags_string2tag($s)
{
global $mybb;
$s = my_strtolower($s);
$s = ltrim(rtrim(trim($s)));
$s = str_replace(array("`", "~", "!", "@", "#", "\$", "%", "^", "&", "*", "(", ")", "_", "+", "-", "=", "\\", "|", "]", "[", "{", "}", '"', "'", ";", ":", "/", ".", " ", ">", "<"), ",", $s);
$s = ltrim(rtrim(trim($s, ','), ','), ',');
$s = preg_replace("#([,]+)#si", ',', $s);
// https://github.com/ATofighi/MyBB-Tags/issues/33
$mybb->settings['tags_charreplace'] = ltrim(rtrim(trim(str_replace(array("\r\n", "\r"), "\n", $mybb->settings['tags_charreplace']))));
$translations = explode("\n", $mybb->settings['tags_charreplace']);
foreach ($translations as $translation) {
$translation = explode('=>', $translation, 2);
$s = str_replace($translation[0], $translation[1], $s);
}
return $s;
}
示例8: init
/**
* Initialize a session
*/
function init()
{
global $db, $mybb, $cache;
// Get our visitor's IP.
$this->ipaddress = get_ip();
$this->packedip = my_inet_pton($this->ipaddress);
// Find out the user agent.
$this->useragent = $_SERVER['HTTP_USER_AGENT'];
// Attempt to find a session id in the cookies.
if (isset($mybb->cookies['sid']) && !defined('IN_UPGRADE')) {
$sid = $db->escape_string($mybb->cookies['sid']);
// Load the session
$query = $db->simple_select("sessions", "*", "sid='{$sid}' AND ip=" . $db->escape_binary($this->packedip));
$session = $db->fetch_array($query);
if ($session['sid']) {
$this->sid = $session['sid'];
}
}
// If we have a valid session id and user id, load that users session.
if (!empty($mybb->cookies['mybbuser'])) {
$logon = explode("_", $mybb->cookies['mybbuser'], 2);
$this->load_user($logon[0], $logon[1]);
}
// If no user still, then we have a guest.
if (!isset($mybb->user['uid'])) {
// Detect if this guest is a search engine spider. (bots don't get a cookied session ID so we first see if that's set)
if (!$this->sid) {
$spiders = $cache->read("spiders");
if (is_array($spiders)) {
foreach ($spiders as $spider) {
if (my_strpos(my_strtolower($this->useragent), my_strtolower($spider['useragent'])) !== false) {
$this->load_spider($spider['sid']);
}
}
}
}
// Still nothing? JUST A GUEST!
if (!$this->is_spider) {
$this->load_guest();
}
}
// As a token of our appreciation for getting this far (and they aren't a spider), give the user a cookie
if ($this->sid && (!isset($mybb->cookies['sid']) || $mybb->cookies['sid'] != $this->sid) && $this->is_spider != true) {
my_setcookie("sid", $this->sid, -1, true);
}
}
示例9: error
/**
* Parses a error for processing.
*
* @param string The error type (i.e. E_ERROR, E_FATAL)
* @param string The error message
* @param string The error file
* @param integer The error line
* @return boolean True if parsing was a success, otherwise assume a error
*/
function error($type, $message, $file = null, $line = 0)
{
global $mybb;
// Error reporting turned off (either globally or by @ before erroring statement)
if (error_reporting() == 0) {
return true;
}
if (in_array($type, $this->ignore_types)) {
return true;
}
$file = str_replace(MYBB_ROOT, "", $file);
// Do we have a PHP error?
if (my_strpos(my_strtolower($this->error_types[$type]), 'warning') === false) {
$this->debug->log->error("\$type: {$type} \$message: {$message} \$file: {$file} \$line: {$line}");
} else {
$this->debug->log->warning("\$type: {$type} \$message: {$message} \$file: {$file} \$line: {$line}");
}
return parent::error($type, $message, $file, $line);
}
示例10: jour_en_fr
function jour_en_fr($en)
{
if (mb_substr(my_strtolower($en), 0, 3) == 'mon') {
return 'lundi';
} elseif (mb_substr(my_strtolower($en), 0, 3) == 'tue') {
return 'mardi';
} elseif (mb_substr(my_strtolower($en), 0, 3) == 'wed') {
return 'mercredi';
} elseif (mb_substr(my_strtolower($en), 0, 3) == 'thu') {
return 'jeudi';
} elseif (mb_substr(my_strtolower($en), 0, 3) == 'fri') {
return 'vendredi';
} elseif (mb_substr(my_strtolower($en), 0, 3) == 'sat') {
return 'samedi';
} elseif (mb_substr(my_strtolower($en), 0, 3) == 'sun') {
return 'dimanche';
} else {
return "";
}
}
示例11: AfficheIconePlusNew_CDT
function AfficheIconePlusNew_CDT($id_groupe, $login_edt, $type_edt, $heuredeb_dec, $jour, $id_ct)
{
// On envoie le lien si et seulement si c'est un administrateur ou un scolarite ou si l'admin a donné le droit aux professeurs
if (($_SESSION["statut"] == "administrateur" or $_SESSION["statut"] == "scolarite" or $_SESSION["statut"] == "professeur" and my_strtolower($login_edt) == my_strtolower($_SESSION["login"])) and $type_edt == "prof") {
$deb = "milieu";
if ($heuredeb_dec == 0) {
$deb = "debut";
}
if ($id_ct == 0) {
echo "<span class=\"image\">";
$MaDate = RecupereTimestampJour_CDT2($jour);
echo "<a href=\"#\" style=\"font-size: 11pt;\" onclick=\"javascript:\r\n\t\t\t\t\tid_groupe = '" . $id_groupe . "';\r\n\t\t\t\t\tgetWinDernieresNotices().hide();\r\n\t\t\t\t\tgetWinListeNotices();\r\n\t\t\t\t\tnew Ajax.Updater('affichage_liste_notice', './ajax_affichages_liste_notices.php?id_groupe=" . $id_groupe . "', {encoding: 'utf-8'});\r\n\t\t\t\t\tgetWinEditionNotice().setAjaxContent('./ajax_edition_compte_rendu.php?id_groupe=" . $id_groupe . "&today=" . $MaDate . "', { \r\n\t\t\t\t\t\t\t\tencoding: 'utf-8',\r\n\t\t\t\t\t\t\t\tonComplete : \r\n\t\t\t\t\t\t\t\tfunction() {\r\n\t\t\t\t\t\t\t\t\tinitWysiwyg();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t\">\r\n\t\t\t\t<img src=\"../templates/" . NameTemplateEDT() . "/images/cdt_vide.png\" title=\"Ajouter Compte-rendu\" alt=\"Ajouter Compte-rendu\" /></a>";
echo "</span>\n";
} else {
echo "<span class=\"image\">";
$MaDate = RecupereTimestampJour_CDT2($jour);
echo "<a href=\"#\" style=\"font-size: 11pt;\" onclick=\"javascript:\r\n\t\t\t\t\tid_groupe = '" . $id_groupe . "';\r\n\t\t\t\t\tgetWinDernieresNotices().hide();\r\n\t\t\t\t\tgetWinListeNotices();\r\n\t\t\t\t\tnew Ajax.Updater('affichage_liste_notice', './ajax_affichages_liste_notices.php?id_groupe=" . $id_groupe . "', {encoding: 'utf-8'});\r\n\t\t\t\t\tgetWinEditionNotice().setAjaxContent('./ajax_edition_compte_rendu.php?id_ct=" . $id_ct . "&id_groupe=" . $id_groupe . "&today=" . $MaDate . "', { \r\n\t\t\t\t\t\t\t\tencoding: 'utf-8',\r\n\t\t\t\t\t\t\t\tonComplete : \r\n\t\t\t\t\t\t\t\tfunction() {\r\n\t\t\t\t\t\t\t\t\tinitWysiwyg();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t\">\r\n\t\t\t\t<img src=\"../templates/" . NameTemplateEDT() . "/images/cdt_rempli.png\" title=\"Editer Compte-rendu\" alt=\"Ajouter Compte-rendu\" /></a>";
echo "</span>\n";
}
}
}
示例12: switch
$perpage = $mybb->get_input('perpage', MyBB::INPUT_INT);
if (!$perpage || $perpage <= 0) {
$perpage = $mybb->settings['threadsperpage'];
}
$where = '';
if (isset($mybb->input['username'])) {
switch ($db->type) {
case 'mysql':
case 'mysqli':
$field = 'username';
break;
default:
$field = 'LOWER(username)';
break;
}
$where = " AND {$field} LIKE '%" . my_strtolower($db->escape_string_like($mybb->get_input('username'))) . "%'";
}
// Sort order & direction
switch ($mybb->get_input('sortby')) {
case "lastvisit":
$sortby = "lastvisit";
break;
case "postnum":
$sortby = "postnum";
break;
case "username":
$sortby = "username";
break;
default:
$sortby = "regdate";
}
示例13: verify_time
/**
* @param string $time
*
* @return array|bool
*/
function verify_time($time)
{
preg_match('#^(0?[1-9]|1[012])\\s?([:\\.]?)\\s?([0-5][0-9])?(\\s?[ap]m)|([01][0-9]|2[0-3])\\s?([:\\.])\\s?([0-5][0-9])$#i', $time, $matches);
if (count($matches) == 0) {
return false;
}
// 24h time
if (count($matches) == 8) {
$hour = $matches[5];
$min = $matches[7];
} else {
$hour = $matches[1];
$min = (int) $matches[3];
$matches[4] = trim($matches[4]);
if (my_strtolower($matches[4]) == "pm" && $hour != 12) {
$hour += 12;
} else {
if (my_strtolower($matches[4]) == "am" && $hour == 12) {
$hour = 0;
}
}
}
return array("hour" => $hour, "min" => $min);
}
示例14: build_postbit
//.........这里部分代码省略.........
}
if ($usergroup['stars']) {
$post['stars'] = $usergroup['stars'];
}
if (empty($post['starimage'])) {
$post['starimage'] = $usergroup['starimage'];
}
if ($post['starimage'] && $post['stars']) {
// Only display stars if we have an image to use...
$post['starimage'] = str_replace("{theme}", $theme['imgdir'], $post['starimage']);
$post['userstars'] = '';
for ($i = 0; $i < $post['stars']; ++$i) {
$post['userstars'] .= "<img src=\"" . $post['starimage'] . "\" border=\"0\" alt=\"*\" />";
}
$post['userstars'] .= "<br />";
}
$postnum = $post['postnum'];
$post['postnum'] = my_number_format($post['postnum']);
// Determine the status to show for the user (Online/Offline/Away)
$timecut = TIME_NOW - $mybb->settings['wolcutoff'];
if ($post['lastactive'] > $timecut && ($post['invisible'] != 1 || $mybb->usergroup['canviewwolinvis'] == 1) && $post['lastvisit'] != $post['lastactive']) {
eval("\$post['onlinestatus'] = \"" . $templates->get("postbit_online") . "\";");
} else {
if ($post['away'] == 1 && $mybb->settings['allowaway'] != 0) {
eval("\$post['onlinestatus'] = \"" . $templates->get("postbit_away") . "\";");
} else {
eval("\$post['onlinestatus'] = \"" . $templates->get("postbit_offline") . "\";");
}
}
if ($post['avatar'] != "" && ($mybb->user['showavatars'] != 0 || !$mybb->user['uid'])) {
$post['avatar'] = htmlspecialchars_uni($post['avatar']);
$avatar_dimensions = explode("|", $post['avatardimensions']);
if ($avatar_dimensions[0] && $avatar_dimensions[1]) {
list($max_width, $max_height) = explode("x", my_strtolower($mybb->settings['postmaxavatarsize']));
if ($avatar_dimensions[0] > $max_width || $avatar_dimensions[1] > $max_height) {
require_once MYBB_ROOT . "inc/functions_image.php";
$scaled_dimensions = scale_image($avatar_dimensions[0], $avatar_dimensions[1], $max_width, $max_height);
$avatar_width_height = "width=\"{$scaled_dimensions['width']}\" height=\"{$scaled_dimensions['height']}\"";
} else {
$avatar_width_height = "width=\"{$avatar_dimensions[0]}\" height=\"{$avatar_dimensions[1]}\"";
}
}
eval("\$post['useravatar'] = \"" . $templates->get("postbit_avatar") . "\";");
$post['avatar_padding'] = "padding-right: 10px;";
} else {
$post['useravatar'] = '';
$post['avatar_padding'] = '';
}
eval("\$post['button_find'] = \"" . $templates->get("postbit_find") . "\";");
if ($mybb->settings['enablepms'] == 1 && $post['receivepms'] != 0 && $mybb->usergroup['cansendpms'] == 1 && my_strpos("," . $post['ignorelist'] . ",", "," . $mybb->user['uid'] . ",") === false) {
eval("\$post['button_pm'] = \"" . $templates->get("postbit_pm") . "\";");
}
if ($post_type != 3 && $mybb->settings['enablereputation'] == 1 && $mybb->settings['postrep'] == 1 && $mybb->usergroup['cangivereputations'] == 1 && $usergroup['usereputationsystem'] == 1 && ($mybb->settings['posrep'] || $mybb->settings['neurep'] || $mybb->settings['negrep']) && $post['uid'] != $mybb->user['uid']) {
if (!$post['pid']) {
$post['pid'] = 0;
}
eval("\$post['button_rep'] = \"" . $templates->get("postbit_rep_button") . "\";");
}
if ($post['website'] != "") {
$post['website'] = htmlspecialchars_uni($post['website']);
eval("\$post['button_www'] = \"" . $templates->get("postbit_www") . "\";");
} else {
$post['button_www'] = "";
}
if ($post['hideemail'] != 1 && $mybb->usergroup['cansendemail'] == 1) {
eval("\$post['button_email'] = \"" . $templates->get("postbit_email") . "\";");
示例15: array
$table->construct_cell($ip['ipaddress']);
$table->construct_cell($controls, array('class' => "align_center"));
$table->construct_row();
}
$table->output($lang->ip_address_for . " {$user['username']}");
$page->output_footer();
}
if ($mybb->input['action'] == "merge") {
$plugins->run_hooks("admin_user_users_merge");
if ($mybb->request_method == "post") {
$query = $db->simple_select("users", "*", "LOWER(username)='" . $db->escape_string(my_strtolower($mybb->input['source_username'])) . "'");
$source_user = $db->fetch_array($query);
if (!$source_user['uid']) {
$errors[] = $lang->error_invalid_user_source;
}
$query = $db->simple_select("users", "*", "LOWER(username)='" . $db->escape_string(my_strtolower($mybb->input['destination_username'])) . "'");
$destination_user = $db->fetch_array($query);
if (!$destination_user['uid']) {
$errors[] = $lang->error_invalid_user_destination;
}
// If we're not a super admin and we're merging a source super admin or a destination super admin then dissallow this action
if (!is_super_admin($mybb->user['uid']) && (is_super_admin($source_user['uid']) || is_super_admin($destination_user['uid']))) {
flash_message($lang->error_no_perms_super_admin, 'error');
admin_redirect("index.php?module=user-users");
}
if ($source_user['uid'] == $destination_user['uid']) {
$errors[] = $lang->error_cannot_merge_same_account;
}
if (empty($errors)) {
// Begin to merge the accounts
$uid_update = array("uid" => $destination_user['uid']);