Zeile 6 | Zeile 6 |
---|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* $Id: functions.php 4058 2008-08-03 00:37:09Z Tikitiki $
| * $Id: functions.php 4182 2008-09-07 18:05:30Z Tikitiki $
|
*/
/**
| */
/**
|
Zeile 162 | Zeile 162 |
---|
if(isset($config)) { require_once MYBB_ROOT."inc/db_".$config['database']['type'].".php";
|
if(isset($config)) { require_once MYBB_ROOT."inc/db_".$config['database']['type'].".php";
|
$db = new databaseEngine;
| switch($config['database']['type']) { case "sqlite3": $db = new DB_SQLite3; break; case "sqlite2": $db = new DB_SQLite2; break; case "pgsql": $db = new DB_PgSQL; break; case "mysqli": $db = new DB_MySQLi; break; default: $db = new DB_MySQL; }
|
$db->connect($config['database']); define("TABLE_PREFIX", $config['database']['table_prefix']); $db->set_table_prefix(TABLE_PREFIX);
| $db->connect($config['database']); define("TABLE_PREFIX", $config['database']['table_prefix']); $db->set_table_prefix(TABLE_PREFIX);
|
Zeile 192 | Zeile 210 |
---|
foreach($shutdown_queries as $query) { $db->query($query);
|
foreach($shutdown_queries as $query) { $db->query($query);
|
} }
| } }
|
// Run any shutdown functions if we have them if(is_array($shutdown_functions))
| // Run any shutdown functions if we have them if(is_array($shutdown_functions))
|
Zeile 201 | Zeile 219 |
---|
foreach($shutdown_functions as $function) { $function();
|
foreach($shutdown_functions as $function) { $function();
|
} }
| } }
|
$done_shutdown = true; }
| $done_shutdown = true; }
|
Zeile 242 | Zeile 260 |
---|
}
$plugins->run_hooks("send_mail_queue_end");
|
}
$plugins->run_hooks("send_mail_queue_end");
|
}
| }
|
/** * Parses the contents of a page before outputting it.
| /** * Parses the contents of a page before outputting it.
|
Zeile 262 | Zeile 280 |
---|
$contents = $htmldoctype.$contents; } else
|
$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 = "<!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);
|
$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['rtl'] == 1) { $contents = str_replace("<html", "<html dir=\"rtl\"", $contents);
|
}
| }
|
if($lang->settings['htmllang']) { $contents = str_replace("<html", "<html xml:lang=\"".$lang->settings['htmllang']."\" lang=\"".$lang->settings['htmllang']."\"", $contents);
| if($lang->settings['htmllang']) { $contents = str_replace("<html", "<html xml:lang=\"".$lang->settings['htmllang']."\" lang=\"".$lang->settings['htmllang']."\"", $contents);
|
Zeile 302 | Zeile 320 |
---|
// If the stamp isn't set, use TIME_NOW if(empty($stamp))
|
// If the stamp isn't set, use TIME_NOW if(empty($stamp))
|
{
| {
|
$stamp = TIME_NOW; }
| $stamp = TIME_NOW; }
|
Zeile 312 | Zeile 330 |
---|
{ $offset = $mybb->user['timezone']; $dstcorrection = $mybb->user['dst'];
|
{ $offset = $mybb->user['timezone']; $dstcorrection = $mybb->user['dst'];
|
}
| }
|
elseif(defined("IN_ADMINCP"))
|
elseif(defined("IN_ADMINCP"))
|
{
| {
|
$offset = $mybbadmin['timezone']; $dstcorrection = $mybbadmin['dst']; }
| $offset = $mybbadmin['timezone']; $dstcorrection = $mybbadmin['dst']; }
|
Zeile 322 | Zeile 340 |
---|
{ $offset = $mybb->settings['timezoneoffset']; $dstcorrection = $mybb->settings['dstcorrection'];
|
{ $offset = $mybb->settings['timezoneoffset']; $dstcorrection = $mybb->settings['dstcorrection'];
|
}
| }
|
// If DST correction is enabled, add an additional hour to the timezone. if($dstcorrection == 1)
| // If DST correction is enabled, add an additional hour to the timezone. if($dstcorrection == 1)
|
Zeile 452 | Zeile 470 |
---|
// Guests get a special string else {
|
// Guests get a special string else {
|
return md5($mybb->config['database']['hostname'].$mybb->config['database']['username'].$mybb->config['database']['password']);
| return md5($mybb->config['database']['hostname'].$mybb->config['database']['username'].md5($mybb->config['database']['password']));
|
} }
| } }
|
Zeile 642 | Zeile 660 |
---|
eval("\$errorpage = \"".$templates->get("error")."\";"); output_page($errorpage);
|
eval("\$errorpage = \"".$templates->get("error")."\";"); output_page($errorpage);
|
exit; }
| exit; }
|
/** * Produce an error message for displaying inline on a page *
| /** * Produce an error message for displaying inline on a page *
|
Zeile 747 | Zeile 765 |
---|
echo "<script type=\"text/javascript\">\n"; if($message != "") {
|
echo "<script type=\"text/javascript\">\n"; if($message != "") {
|
echo "alert('{$message}');\n";
| echo 'alert("'.addslashes($message).'");';
|
} $url = str_replace("#", "&#", $url); $url = htmlspecialchars_decode($url); $url = str_replace(array("\n","\r",";"), "", $url);
|
} $url = str_replace("#", "&#", $url); $url = htmlspecialchars_decode($url); $url = str_replace(array("\n","\r",";"), "", $url);
|
echo "window.location = '{$url}';\n";
| echo 'window.location = "'.addslashes($url).'";'."\n";
|
echo "</script>\n"; exit; }
| echo "</script>\n"; exit; }
|
Zeile 804 | Zeile 822 |
---|
function multipage($count, $perpage, $page, $url) { global $theme, $templates, $lang, $mybb;
|
function multipage($count, $perpage, $page, $url) { global $theme, $templates, $lang, $mybb;
|
|
|
if($count <= $perpage) { return;
| if($count <= $perpage) { return;
|
Zeile 960 | Zeile 978 |
---|
else { return $mybb->usergroup;
|
else { return $mybb->usergroup;
|
} }
| } }
|
/** * Fetch the usergroup permissions for a specic group or series of groups combined *
| /** * Fetch the usergroup permissions for a specic group or series of groups combined *
|
Zeile 1071 | Zeile 1089 |
---|
if(!$gid || $gid == 0) // If no group, we need to fetch it {
|
if(!$gid || $gid == 0) // If no group, we need to fetch it {
|
if($uid != $mybb->user['uid'])
| if($uid != 0 && $uid != $mybb->user['uid'])
|
{ if($usercache[$uid]) {
| { if($usercache[$uid]) {
|
Zeile 1279 | Zeile 1297 |
---|
eval("\$pwform = \"".$templates->get("forumdisplay_password")."\";"); output_page($pwform); exit;
|
eval("\$pwform = \"".$templates->get("forumdisplay_password")."\";"); output_page($pwform); exit;
|
} }
| } }
|
/** * Return the permissions for a moderator in a specific forum *
| /** * Return the permissions for a moderator in a specific forum *
|
Zeile 1440 | Zeile 1458 |
---|
{ $iconlist .= "<br />"; $listed = 0;
|
{ $iconlist .= "<br />"; $listed = 0;
|
} }
eval("\$posticons = \"".$templates->get("posticons")."\";");
| } }
eval("\$posticons = \"".$templates->get("posticons")."\";");
|
return $posticons; }
| return $posticons; }
|
Zeile 1463 | Zeile 1481 |
---|
if(!$mybb->settings['cookiepath']) { $mybb->settings['cookiepath'] = "/";
|
if(!$mybb->settings['cookiepath']) { $mybb->settings['cookiepath'] = "/";
|
}
| }
|
if($expires == -1)
|
if($expires == -1)
|
{
| {
|
$expires = 0; } elseif($expires == "" || $expires == null)
| $expires = 0; } elseif($expires == "" || $expires == null)
|
Zeile 1474 | Zeile 1492 |
---|
if($mybb->user['remember'] == 0) { $expires = 0;
|
if($mybb->user['remember'] == 0) { $expires = 0;
|
}
| }
|
else { $expires = TIME_NOW + (60*60*24*365); // Make the cookie expire in a years time }
|
else { $expires = TIME_NOW + (60*60*24*365); // Make the cookie expire in a years time }
|
}
| }
|
else { $expires = TIME_NOW + intval($expires);
|
else { $expires = TIME_NOW + intval($expires);
|
}
| }
|
$mybb->settings['cookiepath'] = str_replace(array("\n","\r"), "", $mybb->settings['cookiepath']); $mybb->settings['cookiedomain'] = str_replace(array("\n","\r"), "", $mybb->settings['cookiedomain']); $mybb->settings['cookieprefix'] = str_replace(array("\n","\r", " "), "", $mybb->settings['cookieprefix']);
| $mybb->settings['cookiepath'] = str_replace(array("\n","\r"), "", $mybb->settings['cookiepath']); $mybb->settings['cookiedomain'] = str_replace(array("\n","\r"), "", $mybb->settings['cookiedomain']); $mybb->settings['cookieprefix'] = str_replace(array("\n","\r", " "), "", $mybb->settings['cookieprefix']);
|
Zeile 1523 | Zeile 1541 |
---|
* @param string The cookie identifier. */ function my_unsetcookie($name)
|
* @param string The cookie identifier. */ function my_unsetcookie($name)
|
{ global $mybb;
| { global $mybb;
|
$expires = -3600; my_setcookie($name, "", $expires);
| $expires = -3600; my_setcookie($name, "", $expires);
|
Zeile 1684 | Zeile 1702 |
---|
} if(is_array($stats))
|
} if(is_array($stats))
|
{
| {
|
$stats = array_merge($stats, $new_stats); } else
| $stats = array_merge($stats, $new_stats); } else
|
Zeile 1721 | Zeile 1739 |
---|
// Fetch above counters for this forum $query = $db->simple_select("forums", implode(",", $counters), "fid='{$fid}'"); $forum = $db->fetch_array($query);
|
// Fetch above counters for this forum $query = $db->simple_select("forums", implode(",", $counters), "fid='{$fid}'"); $forum = $db->fetch_array($query);
|
|
|
foreach($counters as $counter) { if(array_key_exists($counter, $changes))
| foreach($counters as $counter) { if(array_key_exists($counter, $changes))
|
Zeile 1730 | Zeile 1748 |
---|
if(substr($changes[$counter], 0, 1) == "+" || substr($changes[$counter], 0, 1) == "-") { $update_query[$counter] = $forum[$counter] + $changes[$counter];
|
if(substr($changes[$counter], 0, 1) == "+" || substr($changes[$counter], 0, 1) == "-") { $update_query[$counter] = $forum[$counter] + $changes[$counter];
|
}
| }
|
else { $update_query[$counter] = $changes[$counter];
| else { $update_query[$counter] = $changes[$counter];
|
Zeile 1759 | Zeile 1777 |
---|
if($threads_diff > -1) { $new_stats['numthreads'] = "+{$threads_diff}";
|
if($threads_diff > -1) { $new_stats['numthreads'] = "+{$threads_diff}";
|
} else { $new_stats['numthreads'] = "{$threads_diff}"; }
| } else { $new_stats['numthreads'] = "{$threads_diff}"; }
|
} if(array_key_exists('unapprovedthreads', $update_query))
| } if(array_key_exists('unapprovedthreads', $update_query))
|
Zeile 1772 | Zeile 1790 |
---|
if($unapprovedthreads_diff > -1) { $new_stats['numunapprovedthreads'] = "+{$unapprovedthreads_diff}";
|
if($unapprovedthreads_diff > -1) { $new_stats['numunapprovedthreads'] = "+{$unapprovedthreads_diff}";
|
} else
| } else
|
{ $new_stats['numunapprovedthreads'] = "{$unapprovedthreads_diff}"; }
| { $new_stats['numunapprovedthreads'] = "{$unapprovedthreads_diff}"; }
|
Zeile 1783 | Zeile 1801 |
---|
{ $posts_diff = $update_query['posts'] - $forum['posts']; if($posts_diff > -1)
|
{ $posts_diff = $update_query['posts'] - $forum['posts']; if($posts_diff > -1)
|
{
| {
|
$new_stats['numposts'] = "+{$posts_diff}"; } else
| $new_stats['numposts'] = "+{$posts_diff}"; } else
|
Zeile 1843 | Zeile 1861 |
---|
/** * Updates the thread counters with a specific value (or addition/subtraction of the previous value)
|
/** * Updates the thread counters with a specific value (or addition/subtraction of the previous value)
|
*
| *
|
* @param int The thread ID * @param array Array of items being updated (replies, unapprovedposts, attachmentcount) and their value (ex, 1, +1, -1) */
| * @param int The thread ID * @param array Array of items being updated (replies, unapprovedposts, attachmentcount) and their value (ex, 1, +1, -1) */
|
Zeile 1853 | Zeile 1871 |
---|
$update_query = array();
|
$update_query = array();
|
$counters = array('replies','unapprovedposts','attachmentcount');
| $counters = array('replies','unapprovedposts','attachmentcount', 'attachmentcount');
|
// Fetch above counters for this thread $query = $db->simple_select("threads", implode(",", $counters), "tid='{$tid}'");
| // Fetch above counters for this thread $query = $db->simple_select("threads", implode(",", $counters), "tid='{$tid}'");
|
Zeile 2082 | Zeile 2100 |
---|
}
$jumpsel[$selitem] = 'selected="selected"';
|
}
$jumpsel[$selitem] = 'selected="selected"';
|
}
| }
|
if($showextras == 0) { $template = "special";
| if($showextras == 0) { $template = "special";
|
Zeile 3062 | Zeile 3080 |
---|
if($mybb->settings['nocacheheaders'] == 1 && $mybb->settings['standardheaders'] != 1) { header("Expires: Sat, 1 Jan 2000 01:00:00 GMT");
|
if($mybb->settings['nocacheheaders'] == 1 && $mybb->settings['standardheaders'] != 1) { header("Expires: Sat, 1 Jan 2000 01:00:00 GMT");
|
header("Last-Modified: ".gmdate("D, d M Y H:i:s")."GMT");
| header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache"); }
| header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache"); }
|
Zeile 3300 | Zeile 3318 |
---|
} else {
|
} else {
|
$query = $db->simple_select("users", "additionalgroups, usergroup", "uid='{$uid}'");
| $query = $db->simple_select("users", "additionalgroups, usergroup", "uid='".intval($uid)."'");
|
$user = $db->fetch_array($query); }
| $user = $db->fetch_array($query); }
|
Zeile 3323 | Zeile 3341 |
---|
} }
|
} }
|
$db->update_query("users", array('additionalgroups' => $groupslist), "uid='$uid'");
| $db->update_query("users", array('additionalgroups' => $groupslist), "uid='".intval($uid)."'");
|
}
/**
| }
/**
|
Zeile 3342 | Zeile 3360 |
---|
} else {
|
} else {
|
$query = $db->simple_select("users", "*", "uid='{$uid}'");
| $query = $db->simple_select("users", "*", "uid='".intval($uid)."'");
|
$user = $db->fetch_array($query); }
$usergroups = "";
|
$user = $db->fetch_array($query); }
$usergroups = "";
|
| $groupslist = "";
|
$usergroups = $user['additionalgroups'].",";
$groups = explode(",", $user['additionalgroups']);
| $usergroups = $user['additionalgroups'].",";
$groups = explode(",", $user['additionalgroups']);
|
Zeile 3364 | Zeile 3383 |
---|
} }
|
} }
|
| $dispupdate = "";
|
if($leavegroup == $user['displaygroup']) { $dispupdate = ", displaygroup=usergroup";
| if($leavegroup == $user['displaygroup']) { $dispupdate = ", displaygroup=usergroup";
|
Zeile 3372 | Zeile 3392 |
---|
$db->write_query(" UPDATE ".TABLE_PREFIX."users SET additionalgroups='$groupslist' $dispupdate
|
$db->write_query(" UPDATE ".TABLE_PREFIX."users SET additionalgroups='$groupslist' $dispupdate
|
WHERE uid='$uid'
| WHERE uid='".intval($uid)."'
|
"); $cache->update_moderators();
| "); $cache->update_moderators();
|
Zeile 3394 | Zeile 3414 |
---|
if(!empty($_SERVER['PATH_INFO'])) {
|
if(!empty($_SERVER['PATH_INFO'])) {
|
$location = $_SERVER['PATH_INFO'];
| $location = htmlspecialchars_uni($_SERVER['PATH_INFO']);
|
} elseif(!empty($_ENV['PATH_INFO'])) {
|
} elseif(!empty($_ENV['PATH_INFO'])) {
|
$location = $_ENV['PATH_INFO'];
| $location = htmlspecialchars_uni($_ENV['PATH_INFO']);
|
} elseif(!empty($_ENV['PHP_SELF'])) {
|
} elseif(!empty($_ENV['PHP_SELF'])) {
|
$location = $_ENV['PHP_SELF'];
| $location = htmlspecialchars_uni($_ENV['PHP_SELF']);
|
} else {
|
} else {
|
$location = $_SERVER['PHP_SELF'];
| $location = htmlspecialchars_uni($_SERVER['PHP_SELF']);
|
}
if($fields == true)
| }
if($fields == true)
|
Zeile 3440 | Zeile 3460 |
---|
{ if(isset($_SERVER['QUERY_STRING'])) {
|
{ if(isset($_SERVER['QUERY_STRING'])) {
|
$location .= "?".$_SERVER['QUERY_STRING'];
| $location .= "?".htmlspecialchars_uni($_SERVER['QUERY_STRING']);
|
} else if(isset($_ENV['QUERY_STRING'])) {
|
} else if(isset($_ENV['QUERY_STRING'])) {
|
$location = "?".$_ENV['QUERY_STRING'];
| $location .= "?".htmlspecialchars_uni($_ENV['QUERY_STRING']);
|
} if((isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == "POST") || (isset($_ENV['REQUEST_METHOD']) && $_ENV['REQUEST_METHOD'] == "POST"))
| } if((isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == "POST") || (isset($_ENV['REQUEST_METHOD']) && $_ENV['REQUEST_METHOD'] == "POST"))
|
Zeile 3455 | Zeile 3475 |
---|
{ if(isset($_POST[$var])) {
|
{ if(isset($_POST[$var])) {
|
$addloc[] = $var.'='.$_POST[$var];
| $addloc[] = urlencode($var).'='.urlencode($_POST[$var]);
|
} }
|
} }
|
if(isset($addlock) && is_array($addloc))
| if(isset($addloc) && is_array($addloc))
|
{ $location .= "?".implode("&", $addloc); } }
|
{ $location .= "?".implode("&", $addloc); } }
|
| |
return $location; }
| return $location; }
|
Zeile 3756 | Zeile 3775 |
---|
my_substr($by, 2), $by, ($bd[0] == 0 ? my_substr($bd, 1) : $bd),
|
my_substr($by, 2), $by, ($bd[0] == 0 ? my_substr($bd, 1) : $bd),
|
($db == 1 || $db == 21 || $db == 31 ? 'st' : ($db == 2 || $db == 22 ? 'nd' : ($db == 3 || $db == 23 ? 'rd' : 'th'))),
| ($bd == 1 || $bd == 21 || $bd == 31 ? 'st' : ($bd == 2 || $bd == 22 ? 'nd' : ($bd == 3 || $bd == 23 ? 'rd' : 'th'))),
|
$bdays[$wd], $bmonth[$bm-1], );
| $bdays[$wd], $bmonth[$bm-1], );
|
Zeile 3798 | Zeile 3817 |
---|
{ global $db;
|
{ global $db;
|
$query = $db->simple_select("posts", "pid", "tid='{$tid}'", array('order_by' => 'dateline', 'limit' => 1));
| $query = $db->simple_select("posts", "pid,replyto", "tid='{$tid}'", array('order_by' => 'dateline', 'limit' => 1));
|
$post = $db->fetch_array($query);
if($post['replyto'] != 0)
| $post = $db->fetch_array($query);
if($post['replyto'] != 0)
|
Zeile 3806 | Zeile 3825 |
---|
$replyto_update = array( "replyto" => 0 );
|
$replyto_update = array( "replyto" => 0 );
|
$db->update_query("threads", $replyto_update, "pid='{$post['pid']}'");
| $db->update_query("posts", $replyto_update, "pid='{$post['pid']}'");
|
}
$firstpostup = array(
| }
$firstpostup = array(
|
Zeile 3825 | Zeile 3844 |
---|
{ global $lang;
|
{ global $lang;
|
$string = preg_replace("#&\#(0-9]+);#", "-", $string);
| $string = preg_replace("#&\#([0-9]+);#", "-", $string);
|
if(strtolower($lang->settings['charset']) == "utf-8") {
| if(strtolower($lang->settings['charset']) == "utf-8") {
|
Zeile 3835 | Zeile 3854 |
---|
// Remove dodgy whitespaces $string = str_replace(chr(0xCA), "", $string);
|
// Remove dodgy whitespaces $string = str_replace(chr(0xCA), "", $string);
|
$string = str_replace(" ", " ", $string);
| |
} $string = trim($string);
| } $string = trim($string);
|
Zeile 4613 | Zeile 4631 |
---|
*/ function build_highlight_array($terms) {
|
*/ function build_highlight_array($terms) {
|
$terms = htmlspecialchars_uni($terms);
| |
// Strip out any characters that shouldn't be included $bad_characters = array( "(",
| // Strip out any characters that shouldn't be included $bad_characters = array( "(",
|
Zeile 4632 | Zeile 4648 |
---|
$terms = explode("\"", $terms); foreach($terms as $phrase) {
|
$terms = explode("\"", $terms); foreach($terms as $phrase) {
|
| $phrase = htmlspecialchars_uni($phrase);
|
if($phrase != "") { if($inquote)
|
if($phrase != "") { if($inquote)
|
{
| {
|
$words[] = "\"".trim($phrase)."\""; } else
| $words[] = "\"".trim($phrase)."\""; } else
|
Zeile 4656 | Zeile 4673 |
---|
} } $inquote = !$inquote;
|
} } $inquote = !$inquote;
|
}
| }
|
} // Otherwise just a simple search query with no phrases else {
|
} // Otherwise just a simple search query with no phrases else {
|
| $terms = htmlspecialchars_uni($terms);
|
$split_words = preg_split("#\s{1,}#", $terms, -1); if(!is_array($split_words)) {
| $split_words = preg_split("#\s{1,}#", $terms, -1); if(!is_array($split_words)) {
|
Zeile 5055 | Zeile 5073 |
---|
if($string != "") { if($in_escape)
|
if($string != "") { if($in_escape)
|
{
| {
|
$strings[] = trim($string); } else
| $strings[] = trim($string); } else
|
Zeile 5244 | Zeile 5262 |
---|
* Custom chmod function to fix problems with hosts who's server configurations screw up umasks * * @param string The file to chmod
|
* Custom chmod function to fix problems with hosts who's server configurations screw up umasks * * @param string The file to chmod
|
* @param octal The mode to chmod(i.e. 0666)
| * @param string The mode to chmod(i.e. 0666)
|
*/ function my_chmod($file, $mode) {
|
*/ function my_chmod($file, $mode) {
|
| // Passing $mode as an octal number causes strlen and substr to return incorrect values. Instead pass as a string
|
if(substr($mode, 0, 1) != '0' || strlen($mode) !== 4) { return false; } $old_umask = umask(0);
|
if(substr($mode, 0, 1) != '0' || strlen($mode) !== 4) { return false; } $old_umask = umask(0);
|
$result = chmod($file, $mode);
| // We convert the octal string to a decimal number because passing a octal string doesn't work with chmod // and type casting subsequently removes the prepended 0 which is needed for octal numbers $result = chmod($file, octdec($mode));
|
umask($old_umask); return $result; }
| umask($old_umask); return $result; }
|
Zeile 5286 | Zeile 5308 |
---|
} @closedir($dh); }
|
} @closedir($dh); }
|
|
|
// Are we done? Don't delete the main folder too and return true if($path == $orig_dir) {
| // Are we done? Don't delete the main folder too and return true if($path == $orig_dir) {
|
Zeile 5297 | Zeile 5319 |
---|
} return @unlink($path);
|
} return @unlink($path);
|
| }
/** * Counts the number of subforums in a array([pid][disporder][fid]) starting from the pid * * @param array The array of forums * @return integer The number of sub forums */ function subforums_count($array) { $count = 0; foreach($array as $array2) { $count += count($array2); } return $count;
|
}
?>
| }
?>
|