Zeile 6 | Zeile 6 |
---|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/eula.html *
|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/eula.html *
|
* $Id: functions.php 3177 2007-06-29 07:51:12Z chris $
| * $Id: functions.php 3508 2007-11-23 16:10:16Z Tikitiki $
|
*/
/**
| */
/**
|
Zeile 18 | Zeile 18 |
---|
{ global $db, $lang, $theme, $plugins, $mybb; global $querytime, $debug, $templatecache, $templatelist, $maintimer, $globaltime, $parsetime;
|
{ global $db, $lang, $theme, $plugins, $mybb; global $querytime, $debug, $templatecache, $templatelist, $maintimer, $globaltime, $parsetime;
|
| |
$contents = parse_page($contents); $totaltime = $maintimer->stop(); if($mybb->usergroup['cancp'] == "yes")
| $contents = parse_page($contents); $totaltime = $maintimer->stop(); if($mybb->usergroup['cancp'] == "yes")
|
Zeile 32 | Zeile 31 |
---|
if(strstr(getenv("REQUEST_URI"), "?")) { $debuglink = htmlspecialchars(getenv("REQUEST_URI")) . "&debug=1";
|
if(strstr(getenv("REQUEST_URI"), "?")) { $debuglink = htmlspecialchars(getenv("REQUEST_URI")) . "&debug=1";
|
}
| }
|
else
|
else
|
{
| {
|
$debuglink = htmlspecialchars(getenv("REQUEST_URI")) . "?debug=1"; } if($mybb->settings['gzipoutput'] != "no")
|
$debuglink = htmlspecialchars(getenv("REQUEST_URI")) . "?debug=1"; } if($mybb->settings['gzipoutput'] != "no")
|
{
| {
|
$gzipen = "Enabled"; } else
| $gzipen = "Enabled"; } else
|
Zeile 58 | Zeile 57 |
---|
if(isset($mybb->input['debug'])) { debug_page();
|
if(isset($mybb->input['debug'])) { debug_page();
|
}
| }
|
} $contents = str_replace("<debugstuff>", "", $contents); $contents = $plugins->run_hooks("pre_output_page", $contents);
| } $contents = str_replace("<debugstuff>", "", $contents); $contents = $plugins->run_hooks("pre_output_page", $contents);
|
Zeile 72 | Zeile 71 |
---|
else { $contents = gzip_encode($contents);
|
else { $contents = gzip_encode($contents);
|
} }
header("Content-type: text/html; charset={$lang->settings['charset']}");
echo $contents;
| } }
@header("Content-type: text/html; charset={$lang->settings['charset']}");
echo $contents;
|
$plugins->run_hooks("post_output_page");
| $plugins->run_hooks("post_output_page");
|
Zeile 194 | Zeile 193 |
---|
$db->delete_query(TABLE_PREFIX."mailqueue", "mid='{$email['mid']}'");
my_mail($email['mailto'], $email['subject'], $email['message'], $email['mailfrom'], "", $email['headers']);
|
$db->delete_query(TABLE_PREFIX."mailqueue", "mid='{$email['mid']}'");
my_mail($email['mailto'], $email['subject'], $email['message'], $email['mailfrom'], "", $email['headers']);
|
}
| }
|
// Update the mailqueue cache and remove the lock $cache->updatemailqueue(time(), 0); }
| // Update the mailqueue cache and remove the lock $cache->updatemailqueue(time(), 0); }
|
Zeile 215 | Zeile 214 |
---|
$contents = str_replace('<archive_url>', $archive_url, $contents);
if($htmldoctype)
|
$contents = str_replace('<archive_url>', $archive_url, $contents);
if($htmldoctype)
|
{
| {
|
$contents = $htmldoctype.$contents; } else { $contents = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n".$contents; }
|
$contents = $htmldoctype.$contents; } else { $contents = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n".$contents; }
|
| $contents = str_replace("<html", "<html xmlns=\"http://www.w3.org/1999/xhtml\"", $contents);
|
if($lang->settings['rtl'] == 1) { $contents = str_replace("<html", "<html dir=\"rtl\"", $contents); } if($lang->settings['htmllang']) {
|
if($lang->settings['rtl'] == 1) { $contents = str_replace("<html", "<html dir=\"rtl\"", $contents); } if($lang->settings['htmllang']) {
|
$contents = str_replace("<html", "<html lang=\"".$lang->settings['htmllang']."\"", $contents);
| $contents = str_replace("<html", "<html xml:lang=\"".$lang->settings['htmllang']."\" lang=\"".$lang->settings['htmllang']."\"", $contents);
|
}
if($loadpmpopup)
| }
if($loadpmpopup)
|
Zeile 356 | Zeile 358 |
---|
$headers .= "X-Priority: 3\n"; $headers .= "X-MSMail-Priority: Normal\n"; $headers .= "X-Mailer: MyBB\n";
|
$headers .= "X-Priority: 3\n"; $headers .= "X-MSMail-Priority: Normal\n"; $headers .= "X-Mailer: MyBB\n";
|
| if(defined("IN_ADMINCP")) { $_SERVER['PHP_SELF'] = str_replace($mybb->config['admin_dir']."/", "admin-", $_SERVER['PHP_SELF']); }
|
$headers .= "X-MyBB-Script: {$http_host}{$_SERVER['PHP_SELF']}\n";
// For some reason sendmail/qmail doesn't like \r\n
| $headers .= "X-MyBB-Script: {$http_host}{$_SERVER['PHP_SELF']}\n";
// For some reason sendmail/qmail doesn't like \r\n
|
Zeile 488 | Zeile 494 |
---|
* @return string The inline error HTML */ function inline_error($errors, $title="")
|
* @return string The inline error HTML */ function inline_error($errors, $title="")
|
{
| {
|
global $theme, $mybb, $db, $lang, $templates; if(!$title) {
| global $theme, $mybb, $db, $lang, $templates; if(!$title) {
|
Zeile 520 | Zeile 526 |
---|
"location1" => 0, "location2" => 0 );
|
"location1" => 0, "location2" => 0 );
|
$db->update_query(TABLE_PREFIX."sessions", $noperm_array, "sid='".$session->sid."'");
| $db->update_query(TABLE_PREFIX."sessions", $noperm_array, "sid='".$session->sid."'", 1);
|
$url = htmlspecialchars_uni($_SERVER['REQUEST_URI']); if($mybb->user['uid']) {
| $url = htmlspecialchars_uni($_SERVER['REQUEST_URI']); if($mybb->user['uid']) {
|
Zeile 645 | Zeile 651 |
---|
global $mybb, $cache, $groupscache, $user_cache;
// If no user id is specified, assume it is the current user
|
global $mybb, $cache, $groupscache, $user_cache;
// If no user id is specified, assume it is the current user
|
if($uid == 0) { $uid = $mybb->user['uid']; }
| if($uid == 0) { $uid = $mybb->user['uid']; }
|
// User id does not match current user, fetch permissions if($uid != $mybb->user['uid']) { // We've already cached permissions for this user, return them. if($user_cache[$uid]['permissions'])
|
// User id does not match current user, fetch permissions if($uid != $mybb->user['uid']) { // We've already cached permissions for this user, return them. if($user_cache[$uid]['permissions'])
|
{
| {
|
return $user_cache[$uid]['permissions']; }
| return $user_cache[$uid]['permissions']; }
|
Zeile 701 | Zeile 707 |
---|
$groups = explode(",", $gid); if(count($groups) == 1)
|
$groups = explode(",", $gid); if(count($groups) == 1)
|
{
| {
|
return $groupscache[$gid]; } foreach($groups as $gid)
| return $groupscache[$gid]; } foreach($groups as $gid)
|
Zeile 715 | Zeile 721 |
---|
if(!in_array($perm, $grouppermignore)) { if(isset($usergroup[$perm]))
|
if(!in_array($perm, $grouppermignore)) { if(isset($usergroup[$perm]))
|
{
| {
|
$permbit = $usergroup[$perm]; } else { $permbit = ""; }
|
$permbit = $usergroup[$perm]; } else { $permbit = ""; }
|
$zerogreater = 0;
|
|
if(in_array($perm, $groupzerogreater)) { if($access == 0) { $usergroup[$perm] = 0;
|
if(in_array($perm, $groupzerogreater)) { if($access == 0) { $usergroup[$perm] = 0;
|
| continue;
|
}
|
}
|
$zerogreater = 1;
| |
}
|
}
|
if(($access > $permbit || ($access == "yes" && $permbit == "no") || !$permbit) && $zerogreater != 1)
| if($access > $permbit || ($access == "yes" && $permbit == "no") || !$permbit)
|
{ $usergroup[$perm] = $access; }
| { $usergroup[$perm] = $access; }
|
Zeile 863 | Zeile 870 |
---|
{ // If this forum has permissions set if($fpermcache[$fid][$gid])
|
{ // If this forum has permissions set if($fpermcache[$fid][$gid])
|
{
| {
|
$level_permissions = $fpermcache[$fid][$gid]; foreach($level_permissions as $permission => $access) {
| $level_permissions = $fpermcache[$fid][$gid]; foreach($level_permissions as $permission => $access) {
|
Zeile 887 | Zeile 894 |
---|
* Check the password given on a certain forum for validity * * @param int The forum ID
|
* Check the password given on a certain forum for validity * * @param int The forum ID
|
* @param string The plain text password for the forum
| * @param boolean The Parent ID
|
*/
|
*/
|
function check_forum_password($fid, $password="")
| function check_forum_password($fid, $pid=0)
|
{
|
{
|
global $mybb, $header, $footer, $headerinclude, $theme, $templates, $lang; $showform = 1;
| global $mybb, $header, $footer, $headerinclude, $theme, $templates, $lang, $forum_cache; $showform = true; if(!is_array($forum_cache)) { $forum_cache = cache_forums(); if(!$forum_cache) { return false; } }
// Loop through each of parent forums to ensure we have a password for them too $parents = explode(',', $forum_cache[$fid]['parentlist']); rsort($parents); if(!empty($parents)) { foreach($parents as $parent_id) { if($parent_id == $fid || $parent_id == $pid) { continue; } if($forum_cache[$parent_id]['password'] != "") { check_forum_password($parent_id, $fid); } } } $password = $forum_cache[$fid]['password'];
|
if($password) { if($mybb->input['pwverify'])
| if($password) { if($mybb->input['pwverify'])
|
Zeile 901 | Zeile 938 |
---|
if($password == $mybb->input['pwverify']) { my_setcookie("forumpass[$fid]", md5($mybb->user['uid'].$mybb->input['pwverify']), null, true);
|
if($password == $mybb->input['pwverify']) { my_setcookie("forumpass[$fid]", md5($mybb->user['uid'].$mybb->input['pwverify']), null, true);
|
$showform = 0;
| $showform = false;
|
} else { eval("\$pwnote = \"".$templates->get("forumdisplay_password_wrongpass")."\";");
|
} else { eval("\$pwnote = \"".$templates->get("forumdisplay_password_wrongpass")."\";");
|
$showform = 1; } }
| $showform = true; } }
|
else { if(!$_COOKIE['forumpass'][$fid] || ($_COOKIE['forumpass'][$fid] && md5($mybb->user['uid'].$password) != $_COOKIE['forumpass'][$fid])) {
|
else { if(!$_COOKIE['forumpass'][$fid] || ($_COOKIE['forumpass'][$fid] && md5($mybb->user['uid'].$password) != $_COOKIE['forumpass'][$fid])) {
|
$showform = 1;
| $showform = true;
|
} else {
|
} else {
|
$showform = 0;
| $showform = false;
|
} } } else {
|
} } } else {
|
$showform = 0;
| $showform = false;
|
}
|
}
|
|
|
if($showform) { $_SERVER['REQUEST_URI'] = htmlspecialchars_uni($_SERVER['REQUEST_URI']);
| if($showform) { $_SERVER['REQUEST_URI'] = htmlspecialchars_uni($_SERVER['REQUEST_URI']);
|
Zeile 1205 | Zeile 1243 |
---|
} if(!$serverload) {
|
} if(!$serverload) {
|
| // Suhosin likes to throw a warning if exec is disabled then die - weird if($func_blacklist = @ini_get('suhosin.executor.func.blacklist')) { if(strpos(",".$func_blacklist.",", 'exec') !== false) { return $lang->unknown; } } // PHP disabled functions? if($func_blacklist = @ini_get('disabled_functions')) { if(strpos(",".$func_blacklist.",", 'exec') !== false) { return $lang->unknown; } }
|
$load = @exec("uptime"); $load = split("load averages?: ", $load); $serverload = explode(",", $load[1]);
| $load = @exec("uptime"); $load = split("load averages?: ", $load); $serverload = explode(",", $load[1]);
|
Zeile 1222 | Zeile 1276 |
---|
$returnload = trim($serverload[0]);
return $returnload;
|
$returnload = trim($serverload[0]);
return $returnload;
|
}
| }
|
/** * Updates the forum statistics with specific values (or addition/subtraction of the previous value) *
|
/** * Updates the forum statistics with specific values (or addition/subtraction of the previous value) *
|
* @param array Array of items being updated (numthreads,numposts,numusers)
| * @param array Array of items being updated (numthreads,numposts,numusers,lastuser)
|
*/ function update_stats($changes=array()) { global $cache, $db;
|
*/ function update_stats($changes=array()) { global $cache, $db;
|
|
|
$stats = $cache->read("stats");
|
$stats = $cache->read("stats");
|
$counters = array('numthreads','numposts','numusers');
| $counters = array('numthreads', 'numposts', 'numusers');
|
$update = array();
|
$update = array();
|
foreach($counters as $counter) { if(array_key_exists($counter, $changes)) { // Adding or subtracting from previous value? if(substr($changes[$counter], 0, 1) == "+" || substr($changes[$counter], 0, 1) == "-")
| foreach($counters as $counter) { if(array_key_exists($counter, $changes)) { // Adding or subtracting from previous value? if(substr($changes[$counter], 0, 1) == "+" || substr($changes[$counter], 0, 1) == "-")
|
{ $new_stats[$counter] = $stats[$counter] + $changes[$counter]; }
| { $new_stats[$counter] = $stats[$counter] + $changes[$counter]; }
|
Zeile 1260 | Zeile 1314 |
---|
}
// Fetch latest user if the user count is changing
|
}
// Fetch latest user if the user count is changing
|
if(array_key_exists('numusers', $changes))
| if(array_key_exists('numusers', $changes) || array_key_exists('lastuser', $changes))
|
{ $query = $db->simple_select(TABLE_PREFIX."users", "uid, username", "", array('order_by' => 'uid', 'order_dir' => 'DESC', 'limit' => 1)); $lastmember = $db->fetch_array($query);
| { $query = $db->simple_select(TABLE_PREFIX."users", "uid, username", "", array('order_by' => 'uid', 'order_dir' => 'DESC', 'limit' => 1)); $lastmember = $db->fetch_array($query);
|
Zeile 1313 | Zeile 1367 |
---|
if($update_query[$counter] < 0) { $update_query[$counter] = 0;
|
if($update_query[$counter] < 0) { $update_query[$counter] = 0;
|
} } }
| } } }
|
// Only update if we're actually doing something if(count($update_query) > 0)
|
// Only update if we're actually doing something if(count($update_query) > 0)
|
{
| {
|
$db->update_query(TABLE_PREFIX."forums", $update_query, "fid='".intval($fid)."'"); }
// Guess we should update the statistics too?
|
$db->update_query(TABLE_PREFIX."forums", $update_query, "fid='".intval($fid)."'"); }
// Guess we should update the statistics too?
|
if($update_query['threads'] || $update_query['posts'])
| if(isset($update_query['threads']) || isset($update_query['posts']))
|
{ $new_stats = array(); if(array_key_exists('threads', $update_query))
| { $new_stats = array(); if(array_key_exists('threads', $update_query))
|
Zeile 1333 | Zeile 1387 |
---|
if($threads_diff > -1) { $new_stats['numthreads'] = "+{$threads_diff}";
|
if($threads_diff > -1) { $new_stats['numthreads'] = "+{$threads_diff}";
|
} else {
| } else {
|
$new_stats['numthreads'] = "{$threads_diff}"; } }
| $new_stats['numthreads'] = "{$threads_diff}"; } }
|
Zeile 1350 | Zeile 1404 |
---|
{ $new_stats['numposts'] = "{$posts_diff}"; }
|
{ $new_stats['numposts'] = "{$posts_diff}"; }
|
}
| }
|
update_stats($new_stats); }
|
update_stats($new_stats); }
|
|
|
// Update last post info update_forum_lastpost($fid); }
| // Update last post info update_forum_lastpost($fid); }
|
Zeile 1553 | Zeile 1608 |
---|
*/ function build_forum_jump($pid="0", $selitem="", $addselect="1", $depth="", $showextras="1", $permissions="", $name="fid") {
|
*/ function build_forum_jump($pid="0", $selitem="", $addselect="1", $depth="", $showextras="1", $permissions="", $name="fid") {
|
global $db, $forum_cache, $fjumpcache, $permissioncache, $mybb, $selecteddone, $forumjump, $forumjumpbits, $gobutton, $theme, $templates, $lang;
| global $db, $forum_cache, $jumpfcache, $permissioncache, $mybb, $selecteddone, $forumjump, $forumjumpbits, $gobutton, $theme, $templates, $lang;
|
$pid = intval($pid); if($permissions)
| $pid = intval($pid); if($permissions)
|
Zeile 1593 | Zeile 1648 |
---|
$optionselected = "selected=\"selected\""; $selecteddone = 1; }
|
$optionselected = "selected=\"selected\""; $selecteddone = 1; }
|
| $forum['name'] = htmlspecialchars_uni($forum['name']);
|
eval("\$forumjumpbits .= \"".$templates->get("forumjump_bit")."\";"); if($forum_cache[$forum['fid']]) {
| eval("\$forumjumpbits .= \"".$templates->get("forumjump_bit")."\";"); if($forum_cache[$forum['fid']]) {
|
Zeile 2063 | Zeile 2121 |
---|
{ $attachtypes = $cache->read("attachtypes"); }
|
{ $attachtypes = $cache->read("attachtypes"); }
|
| $directory = ""; if(defined("IN_PORTAL")) { global $change_dir; $directory = $change_dir."/"; }
|
$ext = strtolower($ext); if($attachtypes[$ext]['icon']) {
|
$ext = strtolower($ext); if($attachtypes[$ext]['icon']) {
|
return "<img src=\"".$attachtypes[$ext]['icon']."\" border=\"0\" alt=\".$ext File\" />";
| return "<img src=\"{$directory}".$attachtypes[$ext]['icon']."\" border=\"0\" alt=\".$ext File\" />";
|
} else {
|
} else {
|
return "<img src=\"images/attachtypes/unknown.gif\" border=\"0\" alt=\".$ext File\" />";
| return "<img src=\"{$directory}images/attachtypes/unknown.gif\" border=\"0\" alt=\".$ext File\" />";
|
} }
| } }
|
Zeile 2094 | Zeile 2161 |
---|
cache_forums(); } if(!is_array($permissioncache))
|
cache_forums(); } if(!is_array($permissioncache))
|
{
| {
|
$permissioncache = forum_permissions(); } foreach($forum_cache as $fid => $forum)
| $permissioncache = forum_permissions(); } foreach($forum_cache as $fid => $forum)
|
Zeile 2104 | Zeile 2171 |
---|
$perms = $permissioncache[$forum['fid']]; } else
|
$perms = $permissioncache[$forum['fid']]; } else
|
{
| {
|
$perms = $mybb->usergroup; } $pwverified = 1;
| $perms = $mybb->usergroup; } $pwverified = 1;
|
Zeile 2183 | Zeile 2250 |
---|
* @param string The URL of the item to add */ function add_breadcrumb($name, $url="")
|
* @param string The URL of the item to add */ function add_breadcrumb($name, $url="")
|
{
| {
|
global $navbits;
$navsize = count($navbits);
| global $navbits;
$navsize = count($navbits);
|
Zeile 2319 | Zeile 2386 |
---|
$gzipen = "Disabled"; } echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
|
$gzipen = "Disabled"; } echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
|
echo "<html lang=\"en\">";
| echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">";
|
echo "<head>"; echo "<title>MyBB Debug Information</title>"; echo "</head>";
| echo "<head>"; echo "<title>MyBB Debug Information</title>"; echo "</head>";
|
Zeile 2341 | Zeile 2408 |
---|
echo "<td bgcolor=\"#FEFEFE\" width=\"25%\"><font face=\"Tahoma\" size=\"2\">$phptime seconds ($percentphp%)</font></td>\n"; echo "<td bgcolor=\"#EFEFEF\" width=\"25%\"><b><font face=\"Tahoma\" size=\"2\">MySQL Processing Time:</font></b></td>\n"; echo "<td bgcolor=\"#FEFEFE\" width=\"25%\"><font face=\"Tahoma\" size=\"2\">$querytime seconds ($percentsql%)</font></td>\n";
|
echo "<td bgcolor=\"#FEFEFE\" width=\"25%\"><font face=\"Tahoma\" size=\"2\">$phptime seconds ($percentphp%)</font></td>\n"; echo "<td bgcolor=\"#EFEFEF\" width=\"25%\"><b><font face=\"Tahoma\" size=\"2\">MySQL Processing Time:</font></b></td>\n"; echo "<td bgcolor=\"#FEFEFE\" width=\"25%\"><font face=\"Tahoma\" size=\"2\">$querytime seconds ($percentsql%)</font></td>\n";
|
echo "</tr>\n"; echo "<tr>\n";
| echo "</tr>\n"; echo "<tr>\n";
|
echo "<td bgcolor=\"#EFEFEF\" width=\"25%\"><b><font face=\"Tahoma\" size=\"2\">Extensions Used:</font></b></td>\n"; echo "<td bgcolor=\"#FEFEFE\" width=\"25%\"><font face=\"Tahoma\" size=\"2\">{$mybb->config['dbtype']}, xml</font></td>\n"; echo "<td bgcolor=\"#EFEFEF\" width=\"25%\"><b><font face=\"Tahoma\" size=\"2\">Global.php Processing Time:</font></b></td>\n"; echo "<td bgcolor=\"#FEFEFE\" width=\"25%\"><font face=\"Tahoma\" size=\"2\">$globaltime seconds</font></td>\n";
|
echo "<td bgcolor=\"#EFEFEF\" width=\"25%\"><b><font face=\"Tahoma\" size=\"2\">Extensions Used:</font></b></td>\n"; echo "<td bgcolor=\"#FEFEFE\" width=\"25%\"><font face=\"Tahoma\" size=\"2\">{$mybb->config['dbtype']}, xml</font></td>\n"; echo "<td bgcolor=\"#EFEFEF\" width=\"25%\"><b><font face=\"Tahoma\" size=\"2\">Global.php Processing Time:</font></b></td>\n"; echo "<td bgcolor=\"#FEFEFE\" width=\"25%\"><font face=\"Tahoma\" size=\"2\">$globaltime seconds</font></td>\n";
|
echo "</tr>\n";
| echo "</tr>\n";
|
echo "<tr>\n"; echo "<td bgcolor=\"#EFEFEF\" width=\"25%\"><b><font face=\"Tahoma\" size=\"2\">PHP Version:</font></b></td>\n"; echo "<td bgcolor=\"#FEFEFE\" width=\"25%\"><font face=\"Tahoma\" size=\"2\">$phpversion</font></td>\n";
| echo "<tr>\n"; echo "<td bgcolor=\"#EFEFEF\" width=\"25%\"><b><font face=\"Tahoma\" size=\"2\">PHP Version:</font></b></td>\n"; echo "<td bgcolor=\"#FEFEFE\" width=\"25%\"><font face=\"Tahoma\" size=\"2\">$phpversion</font></td>\n";
|
Zeile 2381 | Zeile 2448 |
---|
echo "<table style=\"background-color: #666;\" width=\"95%\" cellpadding=\"4\" cellspacing=\"1\" align=\"center\">\n"; echo "<tr>\n"; echo "<td style=\"background-color: #ccc;\"><strong>Templates Used (Loaded for this Page) - ".count($templates->cache)." Total</strong></td>\n";
|
echo "<table style=\"background-color: #666;\" width=\"95%\" cellpadding=\"4\" cellspacing=\"1\" align=\"center\">\n"; echo "<tr>\n"; echo "<td style=\"background-color: #ccc;\"><strong>Templates Used (Loaded for this Page) - ".count($templates->cache)." Total</strong></td>\n";
|
echo "</tr>\n";
| echo "</tr>\n";
|
echo "<tr>\n"; echo "<td style=\"background: #fff;\">".implode(", ", array_keys($templates->cache))."</td>\n"; echo "</tr>\n";
| echo "<tr>\n"; echo "<td style=\"background: #fff;\">".implode(", ", array_keys($templates->cache))."</td>\n"; echo "</tr>\n";
|
Zeile 2847 | Zeile 2914 |
---|
*/ function htmlspecialchars_uni($message) {
|
*/ function htmlspecialchars_uni($message) {
|
$message = preg_replace("#&([^\#])(?![a-z1-4]{1,10};)#i", "&$1", $message); // Fix & but allow unicode
| $message = preg_replace("#&(?!\#[0-9]+;)#si", "&", $message); // Fix & but allow unicode
|
$message = str_replace("<","<",$message); $message = str_replace(">",">",$message); $message = str_replace("\"",""",$message);
| $message = str_replace("<","<",$message); $message = str_replace(">",">",$message); $message = str_replace("\"",""",$message);
|
Zeile 3302 | Zeile 3369 |
---|
}
/**
|
}
/**
|
* Get the username of a user id.
| * Get the user data of a user id.
|
* * @param int The user id of the user.
|
* * @param int The user id of the user.
|
* @return string The username of the user.
| * @return array The user data.
|
*/ function get_user($uid) {
| */ function get_user($uid) {
|
Zeile 3318 | Zeile 3385 |
---|
} elseif(isset($user_cache[$uid])) {
|
} elseif(isset($user_cache[$uid])) {
|
return $user_cache[$uid]; } else {
| return $user_cache[$uid]; } else {
|
$query = $db->query(" SELECT * FROM ".TABLE_PREFIX."users
| $query = $db->query(" SELECT * FROM ".TABLE_PREFIX."users
|
Zeile 3547 | Zeile 3614 |
---|
return false; } // Valid local characters for email addresses: http://www.remote.org/jochen/mail/info/chars.html
|
return false; } // Valid local characters for email addresses: http://www.remote.org/jochen/mail/info/chars.html
|
return preg_match("/^[a-zA-Z0-9&*+\-_.{}~^?=\/]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9.-]+$/si", $email);
| return preg_match("/^[a-zA-Z0-9&*+\-_.{}~^\?=\/]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9.-]+$/si", $email);
|
}
/**
| }
/**
|
Zeile 3614 | Zeile 3681 |
---|
$dest .= chr(0x80 | ($src & 0x003f)); } elseif($src <= 0x10ffff)
|
$dest .= chr(0x80 | ($src & 0x003f)); } elseif($src <= 0x10ffff)
|
{
| {
|
$dest .= chr(0xf0 | ($src >> 18)); $dest .= chr(0x80 | (($src >> 12) & 0x3f)); $dest .= chr(0x80 | (($src >> 6) & 0x3f));
| $dest .= chr(0xf0 | ($src >> 18)); $dest .= chr(0x80 | (($src >> 12) & 0x3f)); $dest .= chr(0x80 | (($src >> 6) & 0x3f));
|
Zeile 3644 | Zeile 3711 |
---|
/** * Checks if a username has been disallowed for registration/use.
|
/** * Checks if a username has been disallowed for registration/use.
|
*
| *
|
* @param string The username * @return boolean True if banned, false if not banned */
| * @param string The username * @return boolean True if banned, false if not banned */
|
Zeile 3673 | Zeile 3740 |
---|
$banned_emails = array_map("trim", $banned_emails); $banned_emails = array_map("strtolower", $banned_emails); return $banned_emails;
|
$banned_emails = array_map("trim", $banned_emails); $banned_emails = array_map("strtolower", $banned_emails); return $banned_emails;
|
}
| }
|
/** * Check if a specific email address has been banned.
| /** * Check if a specific email address has been banned.
|
Zeile 3790 | Zeile 3857 |
---|
{ return @implode("", @file($url)); }
|
{ return @implode("", @file($url)); }
|
| }
/** * Unicode function for php function chr() * * @param string The character * @return mixed The unicoded chr() */ function unicode_chr($c) { if($c <= 0x7F) { return chr($c); } elseif($c <= 0x7FF) { return chr(0xC0 | $c >> 6) . chr(0x80 | $c & 0x3F); } elseif($c <= 0xFFFF) { return chr(0xE0 | $c >> 12) . chr(0x80 | $c >> 6 & 0x3F) . chr(0x80 | $c & 0x3F); } elseif($c <= 0x10FFFF) { return chr(0xF0 | $c >> 18) . chr(0x80 | $c >> 12 & 0x3F) . chr(0x80 | $c >> 6 & 0x3F) . chr(0x80 | $c & 0x3F); } else { return false; }
|
}
/**
| }
/**
|