Empty commit

This commit is contained in:
Git 2013-10-15 08:01:05 +00:00
parent 4a141a9ed9
commit 371dc874c0
20 changed files with 100 additions and 88 deletions

View File

@ -89,6 +89,7 @@ define('DONOR', '20');
define('FLS_TEAM', '21');
define('POWER_TM', '22');
define('ELITE_TM', '23');
define('FORUM_MOD', '28');
// Pagination
define('TORRENT_COMMENTS_PER_PAGE', 10);

View File

@ -49,7 +49,7 @@ function text($x, $y, $Color, $Text) {
return imagettftext ($this->Image, $this->FontSize, $this->TextAngle, $x, $y, $Color, $this->Font, $Text);
}
function make_png($FileName = NULL) {
function make_png($FileName = null) {
return imagepng($this->Image, $FileName);
}

View File

@ -339,17 +339,17 @@ public static function in_array_partial($Needle, $Haystack) {
* @param boolean $AllowEmpty If set to true, a key that is in the request but blank will not throw an error.
* @param int $Error The error code to throw if one of the keys isn't in the array.
*/
public static function assert_isset_request($Request, $Keys = NULL, $AllowEmpty = False, $Error = 0) {
public static function assert_isset_request($Request, $Keys = null, $AllowEmpty = false, $Error = 0) {
if (isset($Keys)) {
foreach ($Keys as $K) {
if (!isset($Request[$K]) || ($AllowEmpty == False && $Request[$K] == '')) {
if (!isset($Request[$K]) || ($AllowEmpty == false && $Request[$K] == '')) {
error($Error);
break;
}
}
} else {
foreach ($Request as $R) {
if (!isset($R) || ($AllowEmpty == False && $R == '')) {
if (!isset($R) || ($AllowEmpty == false && $R == '')) {
error($Error);
break;
}
@ -367,7 +367,7 @@ public static function assert_isset_request($Request, $Keys = NULL, $AllowEmpty
public static function get_tags($TagNames) {
$TagIDs = array();
foreach ($TagNames as $Index => $TagName) {
$Tag = G::$Cache->get_value('tag_id_'.$TagName);
$Tag = G::$Cache->get_value("tag_id_$TagName");
if (is_array($Tag)) {
unset($TagNames[$Index]);
$TagIDs[$Tag['ID']] = $Tag['Name'];

View File

@ -62,7 +62,7 @@ function assert_numbers(&$Base, $Keys, $Error = 0) {
* @return string escaped string.
*/
function display_str($Str) {
if ($Str === NULL || $Str === false || is_array($Str)) {
if ($Str === null || $Str === false || is_array($Str)) {
return '';
}
if ($Str != '' && !is_number($Str)) {

View File

@ -121,7 +121,7 @@ private function inverse_ncdf($p) {
//Define/list variables (doesn't really need a definition)
//$p (probability), $sigma (std. deviation), and $mu (mean) are user inputs
$q = NULL; $x = NULL; $y = NULL; $r = NULL;
$q = null; $x = null; $y = null; $r = null;
//Rational approximation for lower region.
if (0 < $p && $p < $p_low) {
@ -150,7 +150,7 @@ private function inverse_ncdf($p) {
//If 0 < p < 1, return a null value
else {
$x = NULL;
$x = null;
}
return $x;
@ -186,9 +186,10 @@ public static function get_ranking($GroupID, $Year) {
return false;
}
return array('overall'=>Votes::get_rank_all($GroupID),
'year' =>Votes::get_rank_year($GroupID, $Year),
'decade' =>Votes::get_rank_decade($GroupID, $Year));
return array(
'overall' => Votes::get_rank_all($GroupID),
'year' => Votes::get_rank_year($GroupID, $Year),
'decade' => Votes::get_rank_decade($GroupID, $Year));
}
/**

View File

@ -508,7 +508,7 @@
<input id="torrentssearch" accesskey="t" spellcheck="false"
onfocus="if (this.value == 'Torrents') { this.value = ''; }"
onblur="if (this.value == '') { this.value = 'Torrents'; }"
value="Torrents" type="text" name="<?=$UseAdvancedSearch ? 'groupname' : 'searchstr' ?>" size="17" />
value="Torrents" placeholder="Torrents" type="text" name="<?=$UseAdvancedSearch ? 'groupname' : 'searchstr' ?>" size="17" />
</form>
</li>
<li id="searchbar_artists">
@ -519,7 +519,7 @@
spellcheck="false" autocomplete="off"
onfocus="if (this.value == 'Artists') { this.value = ''; }"
onblur="if (this.value == '') { this.value = 'Artists'; }"
value="Artists" type="text" name="artistname" size="17" />
value="Artists" placeholder="Artists" type="text" name="artistname" size="17" />
</form>
</li>
<li id="searchbar_requests">
@ -528,7 +528,7 @@
<input id="requestssearch" spellcheck="false"
onfocus="if (this.value == 'Requests') { this.value = ''; }"
onblur="if (this.value == '') { this.value = 'Requests'; }"
value="Requests" type="text" name="search" size="17" />
value="Requests" placeholder="Requests" type="text" name="search" size="17" />
</form>
</li>
<li id="searchbar_forums">
@ -538,7 +538,7 @@
<input id="forumssearch"
onfocus="if (this.value == 'Forums') { this.value = ''; }"
onblur="if (this.value == '') { this.value = 'Forums'; }"
value="Forums" type="text" name="search" size="17" />
value="Forums" placeholder="Forums" type="text" name="search" size="17" />
</form>
</li>
<!--
@ -549,7 +549,7 @@
<input
onfocus="if (this.value == 'Wiki') { this.value = ''; }"
onblur="if (this.value == '') { this.value = 'Wiki'; }"
value="Wiki" type="text" name="search" size="17" />
value="Wiki" placeholder="Wiki" type="text" name="search" size="17" />
</form>
</li>
-->
@ -559,7 +559,7 @@
<input id="logsearch"
onfocus="if (this.value == 'Log') { this.value = ''; }"
onblur="if (this.value == '') { this.value = 'Log'; }"
value="Log" type="text" name="search" size="17" />
value="Log" placeholder="Log" type="text" name="search" size="17" />
</form>
</li>
<li id="searchbar_users">
@ -570,7 +570,7 @@
id="userssearch"
onfocus="if (this.value == 'Users') { this.value = ''; }"
onblur="if (this.value == '') { this.value = 'Users'; }"
value="Users" type="text" name="search" size="20" />
value="Users" placeholder="Users" type="text" name="search" size="20" />
</form>
</li>
</ul>

View File

@ -1,16 +1,15 @@
COPYRIGHTED AND PATENTED PENDING BY WHAT.CD INCORPORATED, DBA/AKA PROJECT
GAZELLE
COPYRIGHTED BY WHAT.CD INCORPORATED, DBA/AKA PROJECT GAZELLE
END-USER LICENSE AGREEMENT
The Gazelle Source Code (hereinafter referred to as the Software) is made
publically available free of charge by Project Gazelle (sometimes a trade and
business name for the legally consituted entity known as What.CD Incorporated,
a Panamanian Corporation), copyright and patent pending owner (hereinafter
referred to as the Licensor or Original Licensor) to anyone who wishes to use
and/or share or distribute and/or change or modify it (hereinafter referred to
as either the Licensee and/or End-User) FOR NONCOMMERCIAL PURPOSES ONLY under
the following terms and conditions (hereinafter referred to as the "License"):
publicly available free of charge by Project Gazelle (sometimes a trade and
business name for the legally constituted entity known as What.CD Incorporated,
a Panamanian Corporation), copyright owner (hereinafter referred to as the
Licensor or Original Licensor) to anyone who wishes to use and/or share or
distribute and/or change or modify it (hereinafter referred to as either the
Licensee and/or End-User) FOR NONCOMMERCIAL PURPOSES ONLY under the following
terms and conditions (hereinafter referred to as the "License"):
Section 1. You may copy and distribute verbatim copies of the Software's
source code as you receive it, in any medium, provided that you conspicuously
@ -82,7 +81,7 @@ Section 7: NO WARRANTY
7.1: BECAUSE THE SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT
WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT/PATENT HOLDERS AND/OR OTHER
WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER
PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO
@ -92,7 +91,7 @@ CORRECTION.
7.2:. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT/PATENT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED ABOVE, BE LIABLE TO YOU FOR
DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT

View File

@ -140,9 +140,9 @@
'catalogueNumber' => $Request['CatalogueNumber'],
'releaseType' => (int)$Request['ReleaseType'],
'releaseName' => $ReleaseName,
'bitrateList' => preg_split('/\|/', $Request['BitrateList'], NULL, PREG_SPLIT_NO_EMPTY),
'formatList' => preg_split('/\|/', $Request['FormatList'], NULL, PREG_SPLIT_NO_EMPTY),
'mediaList' => preg_split('/\|/', $Request['MediaList'], NULL, PREG_SPLIT_NO_EMPTY),
'bitrateList' => preg_split('/\|/', $Request['BitrateList'], null, PREG_SPLIT_NO_EMPTY),
'formatList' => preg_split('/\|/', $Request['FormatList'], null, PREG_SPLIT_NO_EMPTY),
'mediaList' => preg_split('/\|/', $Request['MediaList'], null, PREG_SPLIT_NO_EMPTY),
'logCue' => html_entity_decode($Request['LogCue']),
'isFilled' => $IsFilled,
'fillerId' => (int)$Request['FillerID'],

View File

@ -61,19 +61,19 @@
);
}
else {
$JsonMusicInfo = NULL;
$JsonMusicInfo = null;
}
$JsonTorrentDetails = array(
'wikiBody' => $Text->full_format($TorrentDetails['WikiBody']),
'wikiImage' => $TorrentDetails['WikiImage'],
'id' => (int) $TorrentDetails['ID'],
'id' => (int)$TorrentDetails['ID'],
'name' => $TorrentDetails['Name'],
'year' => (int) $TorrentDetails['Year'],
'year' => (int)$TorrentDetails['Year'],
'recordLabel' => $TorrentDetails['RecordLabel'],
'catalogueNumber' => $TorrentDetails['CatalogueNumber'],
'releaseType' => (int) $TorrentDetails['ReleaseType'],
'categoryId' => (int) $TorrentDetails['CategoryID'],
'releaseType' => (int)$TorrentDetails['ReleaseType'],
'categoryId' => (int)$TorrentDetails['CategoryID'],
'categoryName' => $CategoryName,
'time' => $TorrentDetails['Time'],
'vanityHouse' => $TorrentDetails['VanityHouse'] == 1,
@ -98,32 +98,32 @@
$FileList = implode('|||', $FileList);
$Userinfo = Users::user_info($Torrent['UserID']);
$JsonTorrentList[] = array(
'id' => (int) $Torrent['ID'],
'id' => (int)$Torrent['ID'],
'infoHash' => $Torrent['InfoHash'],
'media' => $Torrent['Media'],
'format' => $Torrent['Format'],
'encoding' => $Torrent['Encoding'],
'remastered' => $Torrent['Remastered'] == 1,
'remasterYear' => (int) $Torrent['RemasterYear'],
'remasterYear' => (int)$Torrent['RemasterYear'],
'remasterTitle' => $Torrent['RemasterTitle'],
'remasterRecordLabel' => $Torrent['RemasterRecordLabel'],
'remasterCatalogueNumber' => $Torrent['RemasterCatalogueNumber'],
'scene' => $Torrent['Scene'] == 1,
'hasLog' => $Torrent['HasLog'] == 1,
'hasCue' => $Torrent['HasCue'] == 1,
'logScore' => (int) $Torrent['LogScore'],
'fileCount' => (int) $Torrent['FileCount'],
'size' => (int) $Torrent['Size'],
'seeders' => (int) $Torrent['Seeders'],
'leechers' => (int) $Torrent['Leechers'],
'snatched' => (int) $Torrent['Snatched'],
'logScore' => (int)$Torrent['LogScore'],
'fileCount' => (int)$Torrent['FileCount'],
'size' => (int)$Torrent['Size'],
'seeders' => (int)$Torrent['Seeders'],
'leechers' => (int)$Torrent['Leechers'],
'snatched' => (int)$Torrent['Snatched'],
'freeTorrent' => $Torrent['FreeTorrent'] == 1,
'reported' => $Torrent['Reported'],
'time' => $Torrent['Time'],
'description' => $Torrent['Description'],
'fileList' => $FileList,
'filePath' => $Torrent['FilePath'],
'userId' => (int) $Torrent['UserID'],
'userId' => (int)$Torrent['UserID'],
'username' => $Userinfo['Username']
);

View File

@ -13,41 +13,47 @@
if (is_number($_GET['id'])) {
$DB->query("
UPDATE blog
SET ThreadID=NULL
WHERE ID=".$_GET['id']);
SET ThreadID = NULL
WHERE ID = ".$_GET['id']);
$Cache->delete_value('blog');
$Cache->delete_value('feed_blog');
}
header('Location: blog.php');
break;
case 'takeeditblog':
authorize();
if (is_number($_POST['blogid']) && is_number($_POST['thread'])) {
$DB->query("
UPDATE blog
SET Title='".db_string($_POST['title'])."', Body='".db_string($_POST['body'])."', ThreadID=".$_POST['thread']."
WHERE ID='".db_string($_POST['blogid'])."'");
SET
Title = '".db_string($_POST['title'])."',
Body = '".db_string($_POST['body'])."',
ThreadID = ".$_POST['thread']."
WHERE ID = '".db_string($_POST['blogid'])."'");
$Cache->delete_value('blog');
$Cache->delete_value('feed_blog');
}
header('Location: blog.php');
break;
case 'editblog':
if (is_number($_GET['id'])) {
$BlogID = $_GET['id'];
$DB->query("
SELECT Title, Body, ThreadID
FROM blog
WHERE ID=$BlogID");
WHERE ID = $BlogID");
list($Title, $Body, $ThreadID) = $DB->next_record();
}
break;
case 'deleteblog':
if (is_number($_GET['id'])) {
authorize();
$DB->query("
DELETE FROM blog
WHERE ID='".db_string($_GET['id'])."'");
WHERE ID = '".db_string($_GET['id'])."'");
$Cache->delete_value('blog');
$Cache->delete_value('feed_blog');
}
@ -76,13 +82,15 @@
}
$DB->query("
INSERT INTO blog (UserID, Title, Body, Time, ThreadID, Important)
VALUES ('".$LoggedUser['ID']."',
'".db_string($_POST['title'])."',
'".db_string($_POST['body'])."',
'".sqltime()."',
$ThreadID,
'".(($_POST['important'] == '1') ? '1' : '0')."')");
INSERT INTO blog
(UserID, Title, Body, Time, ThreadID, Important)
VALUES
('".$LoggedUser['ID']."',
'".db_string($_POST['title'])."',
'".db_string($_POST['body'])."',
'".sqltime()."',
$ThreadID,
'".($_POST['important'] == '1' ? '1' : '0')."')");
$Cache->delete_value('blog');
if ($_POST['important'] == '1') {
$Cache->delete_value('blog_latest_id');
@ -101,11 +109,11 @@
?>
<div class="box thin">
<div class="head">
<?=((empty($_GET['action'])) ? 'Create a blog post' : 'Edit blog post')?>
<?=(empty($_GET['action']) ? 'Create a blog post' : 'Edit blog post')?>
</div>
<form class="<?=empty($_GET['action'])?'create_form':'edit_form'?>" name="blog_post" action="blog.php" method="post">
<form class="<?=empty($_GET['action']) ? 'create_form' : 'edit_form'?>" name="blog_post" action="blog.php" method="post">
<div class="pad">
<input type="hidden" name="action" value="<?=((empty($_GET['action'])) ? 'takenewblog' : 'takeeditblog')?>" />
<input type="hidden" name="action" value="<?=(empty($_GET['action']) ? 'takenewblog' : 'takeeditblog')?>" />
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
<? if (!empty($_GET['action']) && $_GET['action'] == 'editblog') { ?>
<input type="hidden" name="blogid" value="<?=$BlogID; ?>" />
@ -123,7 +131,7 @@
<label for="subscribebox">Subscribe</label>
<div class="center">
<input type="submit" value="<?=((!isset($_GET['action'])) ? 'Create blog post' : 'Edit blog post') ?>" />
<input type="submit" value="<?=(!isset($_GET['action']) ? 'Create blog post' : 'Edit blog post') ?>" />
</div>
</div>
</form>

View File

@ -146,9 +146,12 @@
// quote notifications
Subscriptions::flush_quote_notifications('forums', $TopicID);
$DB->query("DELETE FROM users_notify_quoted WHERE Page = 'forums' AND PageID = '".$TopicID."'");
$DB->query("
DELETE FROM users_notify_quoted
WHERE Page = 'forums'
AND PageID = '$TopicID'");
header('Location: forums.php?action=viewforum&forumid='.$ForumID);
header("Location: forums.php?action=viewforum&forumid=$ForumID");
} else { // If we're just editing it
$Action = 'editing';
@ -374,10 +377,10 @@
break;
}
if (isset($Notification)) {
NotificationsManager::notify_user($ThreadAuthorID, NotificationsManager::FORUMALERTS, $Notification, 'forums.php?action=viewthread&threadid='.$TopicID);
NotificationsManager::notify_user($ThreadAuthorID, NotificationsManager::FORUMALERTS, $Notification, "forums.php?action=viewthread&threadid=$TopicID");
}
if (count($TopicNotes) > 0) {
Forums::add_topic_note($TopicID, implode("\n", $TopicNotes));
}
header('Location: forums.php?action=viewthread&threadid='.$TopicID.'&page='.$Page);
header("Location: forums.php?action=viewthread&threadid=$TopicID&page=$Page");
}

View File

@ -22,7 +22,7 @@
if (!Forums::check_forumperm($ForumID, 'Write') || !Forums::check_forumperm($ForumID, 'Create')) {
error(403);
}
View::show_header('Forums &gt; '.$Forum['Name'].' &gt; New Topic','comments,bbcode,jquery.validate,form_validate');
View::show_header('Forums &gt; '.$Forum['Name'].' &gt; New Topic', 'comments,bbcode,jquery.validate,form_validate');
?>
<div class="thin">
<h2><a href="forums.php">Forums</a> &gt; <a href="forums.php?action=viewforum&amp;forumid=<?=$ForumID?>"><?=$Forum['Name']?></a> &gt; <span id="newthreadtitle">New Topic</span></h2>

View File

@ -26,13 +26,13 @@
<tr>
<td>Username&nbsp;</td>
<td colspan="2">
<input type="text" name="username" id="username" class="inputtext" required="required" maxlength="20" pattern="[A-Za-z0-9_?]{1,20}" autofocus="autofocus" />
<input type="text" name="username" id="username" class="inputtext" required="required" maxlength="20" pattern="[A-Za-z0-9_?]{1,20}" autofocus="autofocus" placeholder="Username" />
</td>
</tr>
<tr>
<td>Password&nbsp;</td>
<td colspan="2">
<input type="password" name="password" id="password" class="inputtext" required="required" maxlength="100" pattern=".{6,100}" />
<input type="password" name="password" id="password" class="inputtext" required="required" maxlength="100" pattern=".{6,100}" placeholder="Password" />
</td>
</tr>
<tr>

View File

@ -157,7 +157,7 @@
// Manage invite trees, delete invite
if ($InviterID !== NULL) {
if ($InviterID !== null) {
$DB->query("
SELECT TreePosition, TreeID, TreeLevel
FROM invite_tree

View File

@ -21,26 +21,26 @@
<tr valign="top">
<td align="right" style="width: 100px;">Username&nbsp;</td>
<td align="left">
<input type="text" name="username" id="username" class="inputtext" value="<?=(!empty($_REQUEST['username']) ? display_str($_REQUEST['username']) : '')?>" />
<input type="text" name="username" id="username" class="inputtext" placeholder="Username" value="<?=(!empty($_REQUEST['username']) ? display_str($_REQUEST['username']) : '')?>" />
<p>Use common sense when choosing your username. Offensive usernames will not be tolerated. <strong>Do not choose a username that can be associated with your real name.</strong> If you do so, we will not be changing it for you.</p>
</td>
</tr>
<tr valign="top">
<td align="right">Email&nbsp;</td>
<td align="left">
<input type="text" name="email" id="email" class="inputtext" value="<?=(!empty($_REQUEST['email']) ? display_str($_REQUEST['email']) : (!empty($InviteEmail) ? display_str($InviteEmail) : ''))?>" />
<input type="text" name="email" id="email" class="inputtext" placeholder="Email" value="<?=(!empty($_REQUEST['email']) ? display_str($_REQUEST['email']) : (!empty($InviteEmail) ? display_str($InviteEmail) : ''))?>" />
</td>
</tr>
<tr valign="top">
<td align="right">Password&nbsp;</td>
<td align="left">
<input type="password" name="password" id="new_pass_1" class="inputtext" /> <strong id="pass_strength"></strong>
<input type="password" name="password" id="new_pass_1" class="inputtext" placeholder="Password" /> <strong id="pass_strength"></strong>
</td>
</tr>
<tr valign="top">
<td align="right">Verify password&nbsp;</td>
<td align="left">
<input type="password" name="confirm_password" id="new_pass_2" class="inputtext" /> <strong id="pass_match"></strong>
<input type="password" name="confirm_password" id="new_pass_2" class="inputtext" placeholder="Verify password" /> <strong id="pass_match"></strong>
<p>A strong password is 8 characters or longer, contains at least 1 lowercase and uppercase letter, and contains at least a number or a symbol.</p>
</td>
</tr>

View File

@ -295,7 +295,7 @@ function next_hour() {
WHERE PermissionID = ".$L['From']."
AND Warned = '0000-00-00 00:00:00'
AND Uploaded >= '$L[MinUpload]'
AND (Uploaded / Downloaded >='$L[MinRatio]' OR (Uploaded / Downloaded IS NULL))
AND (Uploaded / Downloaded >= '$L[MinRatio]' OR (Uploaded / Downloaded IS NULL))
AND JoinDate < '$L[MaxTime]'
AND (
SELECT COUNT(ID)

View File

@ -116,7 +116,7 @@ function get_group_info($GroupID, $Return = true, $RevisionID = 0, $PersonalProp
header('Location: log.php?search='.(empty($_GET['torrentid']) ? "Group+$GroupID" : "Torrent+$_GET[torrentid]"));
die();
} elseif (count($TorrentList) === 0 && $ApiCall == true) {
return NULL;
return null;
}
if (in_array(0, $DB->collect('Seeders'))) {
$CacheTime = 600;
@ -161,7 +161,7 @@ function get_torrent_info($TorrentID, $Return = true, $RevisionID = 0, $Personal
}
} else {
if ($Return) {
return NULL;
return null;
}
}
}
@ -187,7 +187,7 @@ function torrenthash_to_torrentid($Str) {
if ($TorrentID) {
return $TorrentID;
}
return NULL;
return null;
}
function torrenthash_to_groupid($Str) {
@ -200,7 +200,7 @@ function torrenthash_to_groupid($Str) {
if ($GroupID) {
return $GroupID;
}
return NULL;
return null;
}
function torrentid_to_groupid($TorrentID) {
@ -213,7 +213,7 @@ function torrentid_to_groupid($TorrentID) {
if ($GroupID) {
return $GroupID;
}
return NULL;
return null;
}
//After adjusting / deleting logs, recalculate the score for the torrent.

View File

@ -43,7 +43,7 @@ function inverse_ncdf($p) {
//Define/list variables (doesn't really need a definition)
//$p (probability), $sigma (std. deviation), and $mu (mean) are user inputs
$q = NULL; $x = NULL; $y = NULL; $r = NULL;
$q = null; $x = null; $y = null; $r = null;
//Rational approximation for lower region.
if (0 < $p && $p < $p_low) {
@ -72,7 +72,7 @@ function inverse_ncdf($p) {
//If 0 < p < 1, return a null value
else {
$x = NULL;
$x = null;
}
return $x;
@ -80,7 +80,7 @@ function inverse_ncdf($p) {
}
// Confidence level for binomial scoring. Just compute this once.
define('Z_VAL', inverse_ncdf(1-(1-.95)/2));
define('Z_VAL', inverse_ncdf(1 - (1 - 0.95) / 2));
// Implementation of the algorithm described at http://www.evanmiller.org/how-not-to-sort-by-average-rating.html
function binomial_score($Ups, $Total) {
@ -88,6 +88,6 @@ function binomial_score($Ups, $Total) {
return 0;
}
$phat = $Ups/$Total;
return ($phat + Z_VAL*Z_VAL/(2*$Total) - Z_VAL*sqrt(($phat*(1-$phat)+Z_VAL*Z_VAL/(4*$Total))/$Total))/(1+Z_VAL*Z_VAL/$Total);
return ($phat + Z_VAL * Z_VAL / (2 * $Total) - Z_VAL * sqrt(($phat * (1 - $phat) + Z_VAL * Z_VAL / (4 * $Total)) / $Total)) / (1 + Z_VAL * Z_VAL / $Total);
}
?>
?>

View File

@ -231,7 +231,7 @@
foreach ($Properties as $Key => $Value) {
$T[$Key] = "'".db_string(trim($Value))."'";
if (!$T[$Key]) {
$T[$Key] = NULL;
$T[$Key] = null;
}
}

View File

@ -344,7 +344,7 @@
foreach ($Properties as $Key => $Value) {
$T[$Key] = "'".db_string(trim($Value))."'";
if (!$T[$Key]) {
$T[$Key] = NULL;
$T[$Key] = null;
}
}