mirror of
https://github.com/WhatCD/Gazelle.git
synced 2025-01-31 02:21:36 +00:00
Empty commit
This commit is contained in:
parent
4b7153b7c9
commit
f328752fb9
@ -152,6 +152,7 @@
|
|||||||
case 'Tags':
|
case 'Tags':
|
||||||
$FileName = 'tags.class';
|
$FileName = 'tags.class';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'TEXTAREA_PREVIEW':
|
case 'TEXTAREA_PREVIEW':
|
||||||
$FileName = 'textarea_preview.class';
|
$FileName = 'textarea_preview.class';
|
||||||
break;
|
break;
|
||||||
|
@ -290,10 +290,10 @@ function show() {
|
|||||||
<tr id="year_tr">
|
<tr id="year_tr">
|
||||||
<td class="label">
|
<td class="label">
|
||||||
<span id="year_label_not_remaster"<? if ($IsRemaster) { echo ' class="hidden"';} ?>>Year:</span>
|
<span id="year_label_not_remaster"<? if ($IsRemaster) { echo ' class="hidden"';} ?>>Year:</span>
|
||||||
<span id="year_label_remaster"<? if (!$IsRemaster) { echo ' class="hidden"';} ?>>Year of original release</span>
|
<span id="year_label_remaster"<? if (!$IsRemaster) { echo ' class="hidden"';} ?>>Year of original release:</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<p id="yearwarning" class="hidden">You have entered a year for a release which predates the medium's availability. You will need to change the year and enter additional edition information. If this information cannot be provided, check the "Unknown Release" checkbox below</p>
|
<p id="yearwarning" class="hidden">You have entered a year for a release which predates the medium's availability. You will need to change the year and enter additional edition information. If this information cannot be provided, check the "Unknown Release" check box below.</p>
|
||||||
<input type="text" id="year" name="year" size="5" value="<?=display_str($Torrent['Year']) ?>"<?=$this->Disabled?> onblur="CheckYear();" /> This is the year of the original release.
|
<input type="text" id="year" name="year" size="5" value="<?=display_str($Torrent['Year']) ?>"<?=$this->Disabled?> onblur="CheckYear();" /> This is the year of the original release.
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -305,7 +305,8 @@ function show() {
|
|||||||
<td class="label">Catalogue number (optional):</td>
|
<td class="label">Catalogue number (optional):</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="text" id="catalogue_number" name="catalogue_number" size="40" value="<?=display_str($Torrent['CatalogueNumber']) ?>"<?=$this->Disabled?> />
|
<input type="text" id="catalogue_number" name="catalogue_number" size="40" value="<?=display_str($Torrent['CatalogueNumber']) ?>"<?=$this->Disabled?> />
|
||||||
Please double check the record label and catalogue number when using MusicBrainz. See <a href="wiki.php?action=article&id=688" target="_blank">this guide</a> for more details.
|
<br />
|
||||||
|
Please double-check the record label and catalogue number when using MusicBrainz. See <a href="wiki.php?action=article&id=688" target="_blank">this guide</a> for more details.
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr id="releasetype_tr">
|
<tr id="releasetype_tr">
|
||||||
@ -324,7 +325,7 @@ function show() {
|
|||||||
echo ">$Val</option>\n";
|
echo ">$Val</option>\n";
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</select> Please take the time to fill this out properly. Need help? Try reading <a href="wiki.php?action=article&id=202" target="_blank">this wiki article</a> or searching <a href="http://musicbrainz.org/search.html" target="_blank">MusicBrainz</a>.
|
</select> Please take the time to fill this out properly. Need help? Try reading <a href="wiki.php?action=article&id=202" target="_blank">this wiki article</a> or searching <a href="https://musicbrainz.org/search" target="_blank">MusicBrainz</a>.
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
|
@ -73,10 +73,10 @@ function ValidateForm($ValidateArray) {
|
|||||||
|
|
||||||
$Match = '0-9';
|
$Match = '0-9';
|
||||||
if (isset($Field['AllowPeriod'])) {
|
if (isset($Field['AllowPeriod'])) {
|
||||||
$Match.='.';
|
$Match .= '.';
|
||||||
}
|
}
|
||||||
if (isset($Field['AllowComma'])) {
|
if (isset($Field['AllowComma'])) {
|
||||||
$Match.=',';
|
$Match .= ',';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preg_match('/[^'.$Match.']/', $ValidateVar) || strlen($ValidateVar) < 1) {
|
if (preg_match('/[^'.$Match.']/', $ValidateVar) || strlen($ValidateVar) < 1) {
|
||||||
@ -172,124 +172,127 @@ function ValidateForm($ValidateArray) {
|
|||||||
} // function
|
} // function
|
||||||
|
|
||||||
function GenerateJS($FormID) {
|
function GenerateJS($FormID) {
|
||||||
$ReturnJS="<script type=\"text/javascript\" language=\"javascript\">\r\n";
|
$ReturnJS = "<script type=\"text/javascript\" language=\"javascript\">\r\n";
|
||||||
$ReturnJS.="//<![CDATA[\r\n";
|
$ReturnJS .= "//<![CDATA[\r\n";
|
||||||
$ReturnJS.="function formVal() {\r\n";
|
$ReturnJS .= "function formVal() {\r\n";
|
||||||
$ReturnJS.=" clearErrors('".$FormID."');\r\n";
|
$ReturnJS .= " clearErrors('$FormID');\r\n";
|
||||||
|
|
||||||
reset($this->Fields);
|
reset($this->Fields);
|
||||||
foreach ($this->Fields as $FieldKey => $Field) {
|
foreach ($this->Fields as $FieldKey => $Field) {
|
||||||
if ($Field['Type'] == 'string') {
|
if ($Field['Type'] == 'string') {
|
||||||
$ValItem=' if ($(\'#'.$FieldKey.'\').raw().value==""';
|
$ValItem = ' if ($(\'#'.$FieldKey.'\').raw().value == ""';
|
||||||
if (!empty($Field['MaxLength'])) {
|
if (!empty($Field['MaxLength'])) {
|
||||||
$ValItem.=' || $(\'#'.$FieldKey.'\').raw().value.length>'.$Field['MaxLength'];
|
$ValItem .= ' || $(\'#'.$FieldKey.'\').raw().value.length > '.$Field['MaxLength'];
|
||||||
} else {
|
} else {
|
||||||
$ValItem.=' || $(\'#'.$FieldKey.'\').raw().value.length>255';
|
$ValItem .= ' || $(\'#'.$FieldKey.'\').raw().value.length > 255';
|
||||||
}
|
}
|
||||||
if (!empty($Field['MinLength'])) {
|
if (!empty($Field['MinLength'])) {
|
||||||
$ValItem.=' || $(\'#'.$FieldKey.'\').raw().value.length<'.$Field['MinLength'];
|
$ValItem .= ' || $(\'#'.$FieldKey.'\').raw().value.length < '.$Field['MinLength'];
|
||||||
}
|
}
|
||||||
$ValItem.=') { return showError(\''.$FieldKey.'\',\''.$Field['ErrorMessage'].'\'); }'."\r\n";
|
$ValItem .= ') { return showError(\''.$FieldKey.'\',\''.$Field['ErrorMessage'].'\'); }'."\r\n";
|
||||||
|
|
||||||
} elseif ($Field['Type'] == 'number') {
|
} elseif ($Field['Type'] == 'number') {
|
||||||
$Match='0-9';
|
$Match = '0-9';
|
||||||
if (!empty($Field['AllowPeriod'])) {
|
if (!empty($Field['AllowPeriod'])) {
|
||||||
$Match.='.';
|
$Match .= '.';
|
||||||
}
|
}
|
||||||
if (!empty($Field['AllowComma'])) {
|
if (!empty($Field['AllowComma'])) {
|
||||||
$Match.=',';
|
$Match .= ',';
|
||||||
}
|
}
|
||||||
|
|
||||||
$ValItem=' if ($(\'#'.$FieldKey.'\').raw().value.match(/[^'.$Match.']/) || $(\'#'.$FieldKey.'\').raw().value.length<1';
|
$ValItem = ' if ($(\'#'.$FieldKey.'\').raw().value.match(/[^'.$Match.']/) || $(\'#'.$FieldKey.'\').raw().value.length < 1';
|
||||||
if (!empty($Field['MaxLength'])) {
|
if (!empty($Field['MaxLength'])) {
|
||||||
$ValItem.=' || $(\'#'.$FieldKey.'\').raw().value/1>'.$Field['MaxLength'];
|
$ValItem .= ' || $(\'#'.$FieldKey.'\').raw().value/1 > '.$Field['MaxLength'];
|
||||||
}
|
}
|
||||||
if (!empty($Field['MinLength'])) {
|
if (!empty($Field['MinLength'])) {
|
||||||
$ValItem.=' || $(\'#'.$FieldKey.'\').raw().value/1<'.$Field['MinLength'];
|
$ValItem .= ' || $(\'#'.$FieldKey.'\').raw().value/1 < '.$Field['MinLength'];
|
||||||
}
|
}
|
||||||
$ValItem.=') { return showError(\''.$FieldKey.'\',\''.$Field['ErrorMessage'].'\'); }'."\r\n";
|
$ValItem .= ') { return showError(\''.$FieldKey.'\',\''.$Field['ErrorMessage'].'\'); }'."\r\n";
|
||||||
|
|
||||||
} elseif ($Field['Type'] == 'email') {
|
} elseif ($Field['Type'] == 'email') {
|
||||||
$ValItem=' if (!validEmail($(\'#'.$FieldKey.'\').raw().value)';
|
$ValItem = ' if (!validEmail($(\'#'.$FieldKey.'\').raw().value)';
|
||||||
if (!empty($Field['MaxLength'])) {
|
if (!empty($Field['MaxLength'])) {
|
||||||
$ValItem.=' || $(\'#'.$FieldKey.'\').raw().value.length>'.$Field['MaxLength'];
|
$ValItem .= ' || $(\'#'.$FieldKey.'\').raw().value.length > '.$Field['MaxLength'];
|
||||||
} else {
|
} else {
|
||||||
$ValItem.=' || $(\'#'.$FieldKey.'\').raw().value.length>255';
|
$ValItem .= ' || $(\'#'.$FieldKey.'\').raw().value.length > 255';
|
||||||
}
|
}
|
||||||
if (!empty($Field['MinLength'])) {
|
if (!empty($Field['MinLength'])) {
|
||||||
$ValItem.=' || $(\'#'.$FieldKey.'\').raw().value.length<'.$Field['MinLength'];
|
$ValItem .= ' || $(\'#'.$FieldKey.'\').raw().value.length < '.$Field['MinLength'];
|
||||||
} else {
|
} else {
|
||||||
$ValItem.=' || $(\'#'.$FieldKey.'\').raw().value.length<6';
|
$ValItem .= ' || $(\'#'.$FieldKey.'\').raw().value.length < 6';
|
||||||
}
|
}
|
||||||
$ValItem.=') { return showError(\''.$FieldKey.'\',\''.$Field['ErrorMessage'].'\'); }'."\r\n";
|
$ValItem .= ') { return showError(\''.$FieldKey.'\',\''.$Field['ErrorMessage'].'\'); }'."\r\n";
|
||||||
|
|
||||||
} elseif ($Field['Type'] == 'link') {
|
} elseif ($Field['Type'] == 'link') {
|
||||||
$ValItem=' if (!validLink($(\'#'.$FieldKey.'\').raw().value)';
|
$ValItem = ' if (!validLink($(\'#'.$FieldKey.'\').raw().value)';
|
||||||
if (!empty($Field['MaxLength'])) {
|
if (!empty($Field['MaxLength'])) {
|
||||||
$ValItem.=' || $(\'#'.$FieldKey.'\').raw().value.length>'.$Field['MaxLength'];
|
$ValItem .= ' || $(\'#'.$FieldKey.'\').raw().value.length > '.$Field['MaxLength'];
|
||||||
} else {
|
} else {
|
||||||
$ValItem.=' || $(\'#'.$FieldKey.'\').raw().value.length>255';
|
$ValItem .= ' || $(\'#'.$FieldKey.'\').raw().value.length > 255';
|
||||||
}
|
}
|
||||||
if (!empty($Field['MinLength'])) {
|
if (!empty($Field['MinLength'])) {
|
||||||
$ValItem.=' || $(\'#'.$FieldKey.'\').raw().value.length<'.$Field['MinLength'];
|
$ValItem .= ' || $(\'#'.$FieldKey.'\').raw().value.length < '.$Field['MinLength'];
|
||||||
} else {
|
} else {
|
||||||
$ValItem.=' || $(\'#'.$FieldKey.'\').raw().value.length<10';
|
$ValItem .= ' || $(\'#'.$FieldKey.'\').raw().value.length < 10';
|
||||||
}
|
}
|
||||||
$ValItem.=') { return showError(\''.$FieldKey.'\',\''.$Field['ErrorMessage'].'\'); }'."\r\n";
|
$ValItem .= ') { return showError(\''.$FieldKey.'\',\''.$Field['ErrorMessage'].'\'); }'."\r\n";
|
||||||
|
|
||||||
} elseif ($Field['Type'] == 'username') {
|
} elseif ($Field['Type'] == 'username') {
|
||||||
$ValItem = ' if ($(\'#'.$FieldKey.'\').raw().value.match(/[^a-zA-Z0-9_\-]/)';
|
$ValItem = ' if ($(\'#'.$FieldKey.'\').raw().value.match(/[^a-zA-Z0-9_\-]/)';
|
||||||
if (!empty($Field['MaxLength'])) {
|
if (!empty($Field['MaxLength'])) {
|
||||||
$ValItem.=' || $(\'#'.$FieldKey.'\').raw().value.length>'.$Field['MaxLength'];
|
$ValItem .= ' || $(\'#'.$FieldKey.'\').raw().value.length > '.$Field['MaxLength'];
|
||||||
}
|
}
|
||||||
if (!empty($Field['MinLength'])) {
|
if (!empty($Field['MinLength'])) {
|
||||||
$ValItem.=' || $(\'#'.$FieldKey.'\').raw().value.length<'.$Field['MinLength'];
|
$ValItem .= ' || $(\'#'.$FieldKey.'\').raw().value.length < '.$Field['MinLength'];
|
||||||
}
|
}
|
||||||
$ValItem.=') { return showError(\''.$FieldKey.'\',\''.$Field['ErrorMessage'].'\'); }'."\r\n";
|
$ValItem .= ') { return showError(\''.$FieldKey.'\',\''.$Field['ErrorMessage'].'\'); }'."\r\n";
|
||||||
|
|
||||||
} elseif ($Field['Type'] == 'regex') {
|
} elseif ($Field['Type'] == 'regex') {
|
||||||
$ValItem=' if (!$(\'#'.$FieldKey.'\').raw().value.match('.$Field['Regex'].')) { return showError(\''.$FieldKey.'\',\''.$Field['ErrorMessage'].'\'); }'."\r\n";
|
$ValItem = ' if (!$(\'#'.$FieldKey.'\').raw().value.match('.$Field['Regex'].')) { return showError(\''.$FieldKey.'\',\''.$Field['ErrorMessage'].'\'); }'."\r\n";
|
||||||
|
|
||||||
} elseif ($Field['Type'] == 'date') {
|
} elseif ($Field['Type'] == 'date') {
|
||||||
$DisplayError = $FieldKey.'month';
|
$DisplayError = $FieldKey.'month';
|
||||||
if (isset($Field['MinLength']) && $Field['MinLength'] == 3) {
|
if (isset($Field['MinLength']) && $Field['MinLength'] == 3) {
|
||||||
$Day = '$(\'#'.$FieldKey.'day\').raw().value'; $DisplayError.=",".$FieldKey."day";
|
$Day = '$(\'#'.$FieldKey.'day\').raw().value';
|
||||||
|
$DisplayError .= ",{$FieldKey}day";
|
||||||
} else {
|
} else {
|
||||||
$Day = '1';
|
$Day = '1';
|
||||||
}
|
}
|
||||||
$DisplayError.=",".$FieldKey."year";
|
$DisplayError .= ",{$FieldKey}year";
|
||||||
$ValItemHold=' if (!validDate($(\'#'.$FieldKey.'month\').raw().value+\'/\'+'.$Day.'+\'/\'+$(\'#'.$FieldKey.'year\').raw().value)) { return showError(\''.$DisplayError.'\',\''.$Field['ErrorMessage'].'\'); }'."\r\n";
|
$ValItemHold = ' if (!validDate($(\'#'.$FieldKey.'month\').raw().value+\'/\'+'.$Day.'+\'/\'+$(\'#'.$FieldKey.'year\').raw().value)) { return showError(\''.$DisplayError.'\',\''.$Field['ErrorMessage'].'\'); }'."\r\n";
|
||||||
|
|
||||||
if (empty($Field['Required'])) {
|
if (empty($Field['Required'])) {
|
||||||
$ValItem=' if ($(\'#'.$FieldKey.'month\').raw().value!=""';
|
$ValItem = ' if ($(\'#'.$FieldKey.'month\').raw().value != ""';
|
||||||
if (isset($Field['MinLength']) && $Field['MinLength'] == 3) { $ValItem.=' || $(\'#'.$FieldKey.'day\').raw().value!=""'; }
|
if (isset($Field['MinLength']) && $Field['MinLength'] == 3) {
|
||||||
$ValItem.=' || $(\'#'.$FieldKey.'year\').raw().value!="") {'."\r\n";
|
$ValItem .= ' || $(\'#'.$FieldKey.'day\').raw().value != ""';
|
||||||
$ValItem.=$ValItemHold;
|
}
|
||||||
$ValItem.=" }\r\n";
|
$ValItem .= ' || $(\'#'.$FieldKey.'year\').raw().value != "") {'."\r\n";
|
||||||
|
$ValItem .= $ValItemHold;
|
||||||
|
$ValItem .= " }\r\n";
|
||||||
} else {
|
} else {
|
||||||
$ValItem.=$ValItemHold;
|
$ValItem .= $ValItemHold;
|
||||||
}
|
}
|
||||||
|
|
||||||
} elseif ($Field['Type'] == 'checkbox') {
|
} elseif ($Field['Type'] == 'checkbox') {
|
||||||
$ValItem=' if (!$(\'#'.$FieldKey.'\').checked) { return showError(\''.$FieldKey.'\',\''.$Field['ErrorMessage'].'\'); }'."\r\n";
|
$ValItem = ' if (!$(\'#'.$FieldKey.'\').checked) { return showError(\''.$FieldKey.'\',\''.$Field['ErrorMessage'].'\'); }'."\r\n";
|
||||||
|
|
||||||
} elseif ($Field['Type'] == 'compare') {
|
} elseif ($Field['Type'] == 'compare') {
|
||||||
$ValItem=' if ($(\'#'.$FieldKey.'\').raw().value!=$(\'#'.$Field['CompareField'].'\').raw().value) { return showError(\''.$FieldKey.','.$Field['CompareField'].'\',\''.$Field['ErrorMessage'].'\'); }'."\r\n";
|
$ValItem = ' if ($(\'#'.$FieldKey.'\').raw().value!=$(\'#'.$Field['CompareField'].'\').raw().value) { return showError(\''.$FieldKey.','.$Field['CompareField'].'\',\''.$Field['ErrorMessage'].'\'); }'."\r\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($Field['Required']) && $Field['Type'] != 'date') {
|
if (empty($Field['Required']) && $Field['Type'] != 'date') {
|
||||||
$ReturnJS.=' if ($(\'#'.$FieldKey.'\').raw().value!="") {'."\r\n ";
|
$ReturnJS .= ' if ($(\'#'.$FieldKey.'\').raw().value!="") {'."\r\n ";
|
||||||
$ReturnJS.=$ValItem;
|
$ReturnJS .= $ValItem;
|
||||||
$ReturnJS.=" }\r\n";
|
$ReturnJS .= " }\r\n";
|
||||||
} else {
|
} else {
|
||||||
$ReturnJS.=$ValItem;
|
$ReturnJS .= $ValItem;
|
||||||
}
|
}
|
||||||
$ValItem='';
|
$ValItem = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$ReturnJS.="}\r\n";
|
$ReturnJS .= "}\r\n";
|
||||||
$ReturnJS.="//]]>\r\n";
|
$ReturnJS .= "//]]>\r\n";
|
||||||
$ReturnJS.="</script>\r\n";
|
$ReturnJS .= "</script>\r\n";
|
||||||
return $ReturnJS;
|
return $ReturnJS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
|
|
||||||
<div class="preview_submit">
|
<div class="submit_div preview_submit">
|
||||||
<input type="button" value="Preview" class="hidden button_preview_<?=$ID?>" title="Preview text" />
|
<input type="button" value="Preview" class="hidden button_preview_<?=$ID?>" title="Preview text" />
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
|
|
||||||
<div id="textarea_wrap_<?=$NID?>" class="textarea_wrap">
|
<div id="textarea_wrap_<?=$NID?>" class="field_div textarea_wrap">
|
||||||
<textarea name="<?=$Name?>" id="<?=$ID?>" cols="<?=$Cols?>" rows="<?=$Rows?>" <?=$Attributes?>><?=$Value?></textarea>
|
<textarea name="<?=$Name?>" id="<?=$ID?>" cols="<?=$Cols?>" rows="<?=$Rows?>" <?=$Attributes?>><?=$Value?></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
@ -165,11 +165,20 @@ Use C99-style "// ..." comments for single-line comments.
|
|||||||
|
|
||||||
5. USER INTERFACE
|
5. USER INTERFACE
|
||||||
|
|
||||||
All buttons shall use sentence case.
|
All button labels shall use sentence case.
|
||||||
|
|
||||||
All table headings shall use sentence case.
|
All table headings shall use sentence case.
|
||||||
|
|
||||||
All text-based buttons shall use the "brackets" CSS class
|
All text-based buttons shall use the "brackets" CSS class.
|
||||||
|
|
||||||
|
Use common sense for design-related code. Microsoft's UI design guidelines
|
||||||
|
explain when certain form input controls should be used over others to
|
||||||
|
provide a familiar and intuitive interface. Refer to the following links
|
||||||
|
for the most likely issues to encounter in web design:
|
||||||
|
http://msdn.microsoft.com/en-us/library/windows/desktop/aa511452.aspx
|
||||||
|
http://msdn.microsoft.com/en-us/library/windows/desktop/aa511453.aspx
|
||||||
|
http://msdn.microsoft.com/en-us/library/windows/desktop/aa511488.aspx
|
||||||
|
http://msdn.microsoft.com/en-us/library/windows/desktop/aa511494.aspx
|
||||||
|
|
||||||
|
|
||||||
6. EXAMPLES
|
6. EXAMPLES
|
||||||
|
@ -36,9 +36,9 @@
|
|||||||
$Val->SetFields('email', true, 'email', 'You did not enter a valid email address.');
|
$Val->SetFields('email', true, 'email', 'You did not enter a valid email address.');
|
||||||
$Val->SetFields('password', true, 'regex', 'A strong password is between 8 and 40 characters long, contains at least 1 lowercase and uppercase letter, and contains at least a number or symbol', array('regex'=>'/(?=^.{8,}$)(?=.*[^a-zA-Z])(?=.*[A-Z])(?=.*[a-z]).*$/'));
|
$Val->SetFields('password', true, 'regex', 'A strong password is between 8 and 40 characters long, contains at least 1 lowercase and uppercase letter, and contains at least a number or symbol', array('regex'=>'/(?=^.{8,}$)(?=.*[^a-zA-Z])(?=.*[A-Z])(?=.*[a-z]).*$/'));
|
||||||
$Val->SetFields('confirm_password', true, 'compare', 'Your passwords do not match.', array('comparefield'=>'password'));
|
$Val->SetFields('confirm_password', true, 'compare', 'Your passwords do not match.', array('comparefield'=>'password'));
|
||||||
$Val->SetFields('readrules', true, 'checkbox', 'You did not check the box that says you will read the rules.');
|
$Val->SetFields('readrules', true, 'checkbox', 'You did not select the box that says you will read the rules.');
|
||||||
$Val->SetFields('readwiki', true, 'checkbox', 'You did not check the box that says you will read the wiki.');
|
$Val->SetFields('readwiki', true, 'checkbox', 'You did not select the box that says you will read the wiki.');
|
||||||
$Val->SetFields('agereq', true, 'checkbox', 'You did not check the box that says you are 13 years of age or older.');
|
$Val->SetFields('agereq', true, 'checkbox', 'You did not select the box that says you are 13 years of age or older.');
|
||||||
//$Val->SetFields('captcha', true, 'string', 'You did not enter a captcha code.', array('minlength' => 6, 'maxlength' => 6));
|
//$Val->SetFields('captcha', true, 'string', 'You did not enter a captcha code.', array('minlength' => 6, 'maxlength' => 6));
|
||||||
|
|
||||||
if (!empty($_POST['submit'])) {
|
if (!empty($_POST['submit'])) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
"guidelines" => array(
|
"guidelines" => array(
|
||||||
"This option is for asking the moderators to update your request to the new system.",
|
"This option is for asking the moderators to update your request to the new system.",
|
||||||
"If your request has no other votes, you can just edit it yourself!",
|
"If your request has no other votes, you can just edit it yourself!",
|
||||||
"If possible, please include a <a href=\"http://www.discogs.com\">Discogs</a> or <a href=\"http://musicbrainz.org\">MusicBrainz</a> link in the comments field."
|
"If possible, please include a <a href=\"http://www.discogs.com\">Discogs</a> or <a href=\"https://musicbrainz.org\">MusicBrainz</a> link in the comments field."
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
"request" => array(
|
"request" => array(
|
||||||
@ -33,7 +33,7 @@
|
|||||||
"guidelines" => array(
|
"guidelines" => array(
|
||||||
"The report request option is for reporting a request which breaks any of the rules found <a href=\"rules.php?p=requests\">here</a> and for making minor, generally cosmetic, changes to a request (e.g. adding album art, revising a to-be-announced release title, etc.).",
|
"The report request option is for reporting a request which breaks any of the rules found <a href=\"rules.php?p=requests\">here</a> and for making minor, generally cosmetic, changes to a request (e.g. adding album art, revising a to-be-announced release title, etc.).",
|
||||||
"We encourage all users to use this feature whenever possible. This will get quicker action than PMing a staff member will.",
|
"We encourage all users to use this feature whenever possible. This will get quicker action than PMing a staff member will.",
|
||||||
"In your report description below, please be specific and include as much information as possible that will help our staff resolve the issue. Links to reliable, external sources of information are extremely useful when resolving reports. Examples of such sources include the artist's official web site, <a href=\"http://www.discogs.com\">Discogs</a>, and <a href=\"http://musicbrainz.org\">MusicBrainz</a>.",
|
"In your report description below, please be specific and include as much information as possible that will help our staff resolve the issue. Links to reliable, external sources of information are extremely useful when resolving reports. Examples of such sources include the artist's official web site, <a href=\"http://www.discogs.com\">Discogs</a>, and <a href=\"https://musicbrainz.org\">MusicBrainz</a>.",
|
||||||
"<strong>Do not report requests simply because they are unfillable.</strong> Requests for currently unfillable releases are allowed because the request may become fillable in the future. An example of such a scenario would be a request for a physical media rip of a currently iTunes-only release because a physical media release could occur at some future date. The probability of such a physical release is not relevant.",
|
"<strong>Do not report requests simply because they are unfillable.</strong> Requests for currently unfillable releases are allowed because the request may become fillable in the future. An example of such a scenario would be a request for a physical media rip of a currently iTunes-only release because a physical media release could occur at some future date. The probability of such a physical release is not relevant.",
|
||||||
"<strong>If you are reporting this request to get it updated to the new requests system, please go back and click '[Request update]'</strong>."
|
"<strong>If you are reporting this request to get it updated to the new requests system, please go back and click '[Request update]'</strong>."
|
||||||
)
|
)
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
<?
|
<?
|
||||||
/*
|
/*
|
||||||
* The $Types array is the backbone of the reports system and is stored here so it can
|
* The $Types array is the backbone of the reports system and is stored here so it can
|
||||||
* be included on the pages that need it, but not clog up the pages that don't.
|
* be included on the pages that need it without clogging up the pages that don't.
|
||||||
* Important thing to note about the array:
|
* Important thing to note about the array:
|
||||||
* 1. When coding for a non music site, you need to ensure that the top level of the
|
* 1. When coding for a non music site, you need to ensure that the top level of the
|
||||||
* array lines up with the $Categories array in your config.php.
|
* array lines up with the $Categories array in your config.php.
|
||||||
* 2. The first sub array contains resolves that are present on every report type
|
* 2. The first sub array contains resolves that are present on every report type
|
||||||
* regardless of category.
|
* regardless of category.
|
||||||
* 3. The only part that shouldn't be self explanatory is that for the tracks field in
|
* 3. The only part that shouldn't be self-explanatory is that for the tracks field in
|
||||||
* the report_fields arrays, 0 means not shown, 1 means required, 2 means required but
|
* the report_fields arrays, 0 means not shown, 1 means required, 2 means required but
|
||||||
* you can't tick the 'All' box.
|
* you can't select the 'All' box.
|
||||||
* 4. The current report_fields that are set up are tracks, sitelink, link and image. If
|
* 4. The current report_fields that are set up are tracks, sitelink, link and image. If
|
||||||
* you wanted to add a new one, you'd need to add a field to the reportsv2 table, elements
|
* you wanted to add a new one, you'd need to add a field to the reportsv2 table, elements
|
||||||
* to the relevant report_fields arrays here, add the HTML in ajax_report and add security
|
* to the relevant report_fields arrays here, add the HTML in ajax_report and add security
|
||||||
|
@ -94,9 +94,9 @@
|
|||||||
<a href="requests.php?action=delete&id=<?=$RequestID?>" class="brackets">Delete</a>
|
<a href="requests.php?action=delete&id=<?=$RequestID?>" class="brackets">Delete</a>
|
||||||
<? }
|
<? }
|
||||||
if (Bookmarks::has_bookmarked('request', $RequestID)) { ?>
|
if (Bookmarks::has_bookmarked('request', $RequestID)) { ?>
|
||||||
<a href="#" id="bookmarklink_request_<?=$RequestID?>" onclick="Unbookmark('request', <?=$RequestID?>,'Bookmark');return false;" class="brackets">Remove bookmark</a>
|
<a href="#" id="bookmarklink_request_<?=$RequestID?>" onclick="Unbookmark('request', <?=$RequestID?>, 'Bookmark'); return false;" class="brackets">Remove bookmark</a>
|
||||||
<? } else { ?>
|
<? } else { ?>
|
||||||
<a href="#" id="bookmarklink_request_<?=$RequestID?>" onclick="Bookmark('request', <?=$RequestID?>,'Remove bookmark');return false;" class="brackets">Bookmark</a>
|
<a href="#" id="bookmarklink_request_<?=$RequestID?>" onclick="Bookmark('request', <?=$RequestID?>, 'Remove bookmark'); return false;" class="brackets">Bookmark</a>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
<a href="reports.php?action=report&type=request&id=<?=$RequestID?>" class="brackets">Report request</a>
|
<a href="reports.php?action=report&type=request&id=<?=$RequestID?>" class="brackets">Report request</a>
|
||||||
<? if (!$IsFilled) { ?>
|
<? if (!$IsFilled) { ?>
|
||||||
@ -107,15 +107,15 @@
|
|||||||
<? } ?>
|
<? } ?>
|
||||||
|
|
||||||
<?
|
<?
|
||||||
//create a search URL to WorldCat and google based on title
|
// Create a search URL to WorldCat and Google based on title
|
||||||
$encoded_title = urlencode(preg_replace("/\([^\)]+\)/", '', $Title));
|
$encoded_title = urlencode(preg_replace("/\([^\)]+\)/", '', $Title));
|
||||||
$encoded_artist = substr(str_replace('&', 'and', $ArtistName), 0, -3);
|
$encoded_artist = substr(str_replace('&', 'and', $ArtistName), 0, -3);
|
||||||
$encoded_artist = str_ireplace('Performed By', '', $encoded_artist);
|
$encoded_artist = str_ireplace('Performed By', '', $encoded_artist);
|
||||||
$encoded_artist = preg_replace("/\([^\)]+\)/", '', $encoded_artist);
|
$encoded_artist = preg_replace("/\([^\)]+\)/", '', $encoded_artist);
|
||||||
$encoded_artist = urlencode($encoded_artist);
|
$encoded_artist = urlencode($encoded_artist);
|
||||||
|
|
||||||
$worldcat_url = "http://worldcat.org/search?q=" . "$encoded_artist $encoded_title";
|
$worldcat_url = 'https://www.worldcat.org/search?qt=worldcat_org_all&q=' . "$encoded_artist%20$encoded_title";
|
||||||
$google_url = "https://www.google.com/search?&tbm=shop&q=" . "$encoded_artist $encoded_title";
|
$google_url = 'https://www.google.com/search?tbm=shop&q=' . "$encoded_artist%20$encoded_title";
|
||||||
?>
|
?>
|
||||||
<a href="<? echo $worldcat_url; ?>" class="brackets">Find in library</a>
|
<a href="<? echo $worldcat_url; ?>" class="brackets">Find in library</a>
|
||||||
<a href="<? echo $google_url; ?>" class="brackets">Find in stores</a>
|
<a href="<? echo $google_url; ?>" class="brackets">Find in stores</a>
|
||||||
@ -128,7 +128,7 @@
|
|||||||
<?
|
<?
|
||||||
if (!empty($Image)) {
|
if (!empty($Image)) {
|
||||||
?>
|
?>
|
||||||
<p align="center"><img style="max-width: 220px;" src="<?=ImageTools::process($Image, true)?>" alt="<?=$FullName?>" onclick="lightbox.init('<?=ImageTools::process($Image)?>',220);" /></p>
|
<p align="center"><img style="max-width: 220px;" src="<?=ImageTools::process($Image, true)?>" alt="<?=$FullName?>" onclick="lightbox.init('<?=ImageTools::process($Image)?>', 220);" /></p>
|
||||||
<? } else { ?>
|
<? } else { ?>
|
||||||
<p align="center"><img src="<?=STATIC_SERVER?>common/noartwork/<?=$CategoryIcons[$CategoryID - 1]?>" alt="<?=$CategoryName?>" title="<?=$CategoryName?>" width="220" height="220" border="0" /></p>
|
<p align="center"><img src="<?=STATIC_SERVER?>common/noartwork/<?=$CategoryIcons[$CategoryID - 1]?>" alt="<?=$CategoryName?>" title="<?=$CategoryName?>" width="220" height="220" border="0" /></p>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
@ -333,9 +333,9 @@
|
|||||||
$OCLCs = explode(',', $OCLC);
|
$OCLCs = explode(',', $OCLC);
|
||||||
for ($i = 0; $i < count($OCLCs); $i++) {
|
for ($i = 0; $i < count($OCLCs); $i++) {
|
||||||
if (!empty($Worldcat)) {
|
if (!empty($Worldcat)) {
|
||||||
$Worldcat .= ', <a href="http://www.worldcat.org/oclc/'.$OCLCs[$i].'">'.$OCLCs[$i].'</a>';
|
$Worldcat .= ', <a href="https://www.worldcat.org/oclc/'.$OCLCs[$i].'">'.$OCLCs[$i].'</a>';
|
||||||
} else {
|
} else {
|
||||||
$Worldcat = '<a href="http://www.worldcat.org/oclc/'.$OCLCs[$i].'">'.$OCLCs[$i].'</a>';
|
$Worldcat = '<a href="https://www.worldcat.org/oclc/'.$OCLCs[$i].'">'.$OCLCs[$i].'</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -354,7 +354,7 @@
|
|||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="label">Torrent group</td>
|
<td class="label">Torrent group</td>
|
||||||
<td><a href="torrents.php?id=<?=$GroupID?>">torrents.php?id=<?=$GroupID?></td>
|
<td><a href="torrents.php?id=<?=$GroupID?>">torrents.php?id=<?=$GroupID?></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
<tr>
|
<tr>
|
||||||
@ -381,8 +381,8 @@
|
|||||||
<td>
|
<td>
|
||||||
<input type="text" id="amount_box" size="8" onchange="Calculate();" />
|
<input type="text" id="amount_box" size="8" onchange="Calculate();" />
|
||||||
<select id="unit" name="unit" onchange="Calculate();">
|
<select id="unit" name="unit" onchange="Calculate();">
|
||||||
<option value='mb'>MB</option>
|
<option value="mb">MB</option>
|
||||||
<option value='gb'>GB</option>
|
<option value="gb">GB</option>
|
||||||
</select>
|
</select>
|
||||||
<input type="button" value="Preview" onclick="Calculate();" />
|
<input type="button" value="Preview" onclick="Calculate();" />
|
||||||
<strong><?=($RequestTax * 100)?>% of this is deducted as tax by the system.</strong>
|
<strong><?=($RequestTax * 100)?>% of this is deducted as tax by the system.</strong>
|
||||||
@ -421,7 +421,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="label">Filled</td>
|
<td class="label">Filled</td>
|
||||||
<td>
|
<td>
|
||||||
<strong><a href="torrents.php?<?=(strtotime($TimeFilled)<$TimeCompare?'id=':'torrentid=').$TorrentID?>">Yes</a></strong>,
|
<strong><a href="torrents.php?<?=(strtotime($TimeFilled) < $TimeCompare ? 'id=' : 'torrentid=').$TorrentID?>">Yes</a></strong>,
|
||||||
by user <?=Users::format_username($FillerID, false, false, false)?>
|
by user <?=Users::format_username($FillerID, false, false, false)?>
|
||||||
<? if ($LoggedUser['ID'] == $RequestorID || $LoggedUser['ID'] == $FillerID || check_perms('site_moderate_requests')) { ?>
|
<? if ($LoggedUser['ID'] == $RequestorID || $LoggedUser['ID'] == $FillerID || check_perms('site_moderate_requests')) { ?>
|
||||||
<strong><a href="requests.php?action=unfill&id=<?=$RequestID?>" class="brackets">Unfill</a></strong> Unfilling a request without a valid, nontrivial reason will result in a warning.
|
<strong><a href="requests.php?action=unfill&id=<?=$RequestID?>" class="brackets">Unfill</a></strong> Unfilling a request without a valid, nontrivial reason will result in a warning.
|
||||||
@ -437,7 +437,7 @@
|
|||||||
<input type="hidden" name="action" value="takefill" />
|
<input type="hidden" name="action" value="takefill" />
|
||||||
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||||
<input type="hidden" name="requestid" value="<?=$RequestID?>" />
|
<input type="hidden" name="requestid" value="<?=$RequestID?>" />
|
||||||
<input type="text" size="50" name="link" <?=(!empty($Link) ? "value='$Link' " : '')?>/>
|
<input type="text" size="50" name="link"<?=(!empty($Link) ? " value=\"$Link\"" : '')?> />
|
||||||
<strong>Should be the permalink (PL) to the torrent (e.g. https://<?=SSL_SITE_URL?>/torrents.php?torrentid=xxxx).</strong>
|
<strong>Should be the permalink (PL) to the torrent (e.g. https://<?=SSL_SITE_URL?>/torrents.php?torrentid=xxxx).</strong>
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
@ -464,7 +464,11 @@
|
|||||||
$Results = Requests::get_comment_count($RequestID);
|
$Results = Requests::get_comment_count($RequestID);
|
||||||
|
|
||||||
if (isset($_GET['postid']) && is_number($_GET['postid']) && $Results > TORRENT_COMMENTS_PER_PAGE) {
|
if (isset($_GET['postid']) && is_number($_GET['postid']) && $Results > TORRENT_COMMENTS_PER_PAGE) {
|
||||||
$DB->query("SELECT COUNT(ID) FROM requests_comments WHERE RequestID = $RequestID AND ID <= $_GET[postid]");
|
$DB->query("
|
||||||
|
SELECT COUNT(ID)
|
||||||
|
FROM requests_comments
|
||||||
|
WHERE RequestID = $RequestID
|
||||||
|
AND ID <= $_GET[postid]");
|
||||||
list($PostNum) = $DB->next_record();
|
list($PostNum) = $DB->next_record();
|
||||||
list($Page, $Limit) = Format::page_limit(TORRENT_COMMENTS_PER_PAGE, $PostNum);
|
list($Page, $Limit) = Format::page_limit(TORRENT_COMMENTS_PER_PAGE, $PostNum);
|
||||||
} else {
|
} else {
|
||||||
@ -508,7 +512,7 @@
|
|||||||
by <strong><?=Users::format_username($AuthorID, true, true, true, true)?></strong> <?=time_diff($AddedTime)?>
|
by <strong><?=Users::format_username($AuthorID, true, true, true, true)?></strong> <?=time_diff($AddedTime)?>
|
||||||
- <a href="#quickpost" onclick="Quote('<?=$PostID?>','<?=$Username?>');" class="brackets">Quote</a>
|
- <a href="#quickpost" onclick="Quote('<?=$PostID?>','<?=$Username?>');" class="brackets">Quote</a>
|
||||||
<? if ($AuthorID == $LoggedUser['ID'] || check_perms('site_moderate_forums')) { ?>
|
<? if ($AuthorID == $LoggedUser['ID'] || check_perms('site_moderate_forums')) { ?>
|
||||||
- <a href="#post<?=$PostID?>" onclick="Edit_Form('<?=$PostID?>','<?=$Key?>');" class="brackets">Edit</a>
|
- <a href="#post<?=$PostID?>" onclick="Edit_Form('<?=$PostID?>', '<?=$Key?>');" class="brackets">Edit</a>
|
||||||
<? }
|
<? }
|
||||||
if (check_perms('site_moderate_forums')) { ?>
|
if (check_perms('site_moderate_forums')) { ?>
|
||||||
- <a href="#post<?=$PostID?>" onclick="Delete('<?=$PostID?>');" class="brackets">Delete</a>
|
- <a href="#post<?=$PostID?>" onclick="Delete('<?=$PostID?>');" class="brackets">Delete</a>
|
||||||
|
@ -218,6 +218,7 @@ function compare($X, $Y) {
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<?
|
<?
|
||||||
|
|
||||||
if ($Categories[$GroupCategoryID - 1] == 'Music') {
|
if ($Categories[$GroupCategoryID - 1] == 'Music') {
|
||||||
$ShownWith = false;
|
$ShownWith = false;
|
||||||
?>
|
?>
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
p.Level AS Class
|
p.Level AS Class
|
||||||
FROM users_main AS m
|
FROM users_main AS m
|
||||||
JOIN users_info AS i ON i.UserID = m.ID
|
JOIN users_info AS i ON i.UserID = m.ID
|
||||||
LEFT JOIN permissions AS p ON p.ID=m.PermissionID
|
LEFT JOIN permissions AS p ON p.ID = m.PermissionID
|
||||||
WHERE m.ID = '".db_string($UserID)."'");
|
WHERE m.ID = '".db_string($UserID)."'");
|
||||||
list($Username, $Email, $IRCKey, $Paranoia, $Info, $Avatar, $Country, $StyleID, $StyleURL, $SiteOptions, $UnseededAlerts, $Class) = $DB->next_record(MYSQLI_NUM, array(3, 9));
|
list($Username, $Email, $IRCKey, $Paranoia, $Info, $Avatar, $Country, $StyleID, $StyleURL, $SiteOptions, $UnseededAlerts, $Class) = $DB->next_record(MYSQLI_NUM, array(3, 9));
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ function checked($Checked) {
|
|||||||
$SiteOptions = array();
|
$SiteOptions = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
View::show_header($Username.' > Settings','user,jquery,jquery-ui,release_sort,password_validate,validate,push_settings,cssgallery,preview_paranoia,bbcode');
|
View::show_header($Username.' > Settings','user,jquery,jquery-ui,release_sort,password_validate,validate,push_settings,cssgallery,preview_paranoia,bbcode');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -121,7 +121,7 @@ function checked($Checked) {
|
|||||||
<td class="label"><strong>Profile stats</strong></td>
|
<td class="label"><strong>Profile stats</strong></td>
|
||||||
<td>
|
<td>
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" name="autoload_comm_stats" <?Format::selected('AutoloadCommStats', 1, 'checked', $SiteOptions);?>>
|
<input type="checkbox" name="autoload_comm_stats"<?Format::selected('AutoloadCommStats', 1, 'checked', $SiteOptions);?> />
|
||||||
Automatically fetch the snatch and peer stats on profile pages.
|
Automatically fetch the snatch and peer stats on profile pages.
|
||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
@ -136,33 +136,60 @@ function checked($Checked) {
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="label"><strong>Default search type</strong></td>
|
<td class="label"><strong>Default search type</strong></td>
|
||||||
<td>
|
<td>
|
||||||
<select name="searchtype" id="searchtype">
|
<ul class="options_list nobullet">
|
||||||
<option value="0"<? if ($SiteOptions['SearchType'] == 0) { ?> selected="selected"<? } ?>>Simple</option>
|
<li>
|
||||||
<option value="1"<? if ($SiteOptions['SearchType'] == 1) { ?> selected="selected"<? } ?>>Advanced</option>
|
<input type="radio" name="searchtype" id="search_type_simple" value="0" <? if ($SiteOptions['SearchType'] == 0) { ?>checked="checked" <? } ?>/>
|
||||||
</select>
|
<label for="search_type_simple">Simple</label>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<input type="radio" name="searchtype" id="search_type_advanced" value="1" <? if ($SiteOptions['SearchType'] == 1) { ?>checked="checked" <? } ?>/>
|
||||||
|
<label for="search_type_advanced">Advanced</label>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="label"><strong>Torrent grouping</strong></td>
|
<td class="label"><strong>Torrent grouping</strong></td>
|
||||||
<td>
|
<td>
|
||||||
<select name="disablegrouping" id="disablegrouping">
|
<ul class="options_list nobullet">
|
||||||
<option value="0"<? if ($SiteOptions['DisableGrouping2'] == 0) { ?> selected="selected"<? } ?>>Group torrents by default</option>
|
<li>
|
||||||
<option value="1"<? if ($SiteOptions['DisableGrouping2'] == 1) { ?> selected="selected"<? } ?>>DO NOT group torrents by default</option>
|
<div class="field_div">
|
||||||
</select>
|
<input type="checkbox" name="disablegrouping" id="disablegrouping"<?Format::selected('DisableGrouping2', 0, 'checked', $SiteOptions);?> />
|
||||||
<select name="torrentgrouping" id="torrentgrouping">
|
<label for="disablegrouping">Group torrents by default</label>
|
||||||
<option value="0"<? if ($SiteOptions['TorrentGrouping'] == 0) { ?> selected="selected"<? } ?>>Groups are open by default</option>
|
</div>
|
||||||
<option value="1"<? if ($SiteOptions['TorrentGrouping'] == 1) { ?> selected="selected"<? } ?>>Groups are closed by default</option>
|
</li>
|
||||||
</select>
|
<li>
|
||||||
|
<div class="field_div">
|
||||||
|
<p>By default, torrent groups are:</p>
|
||||||
|
<ul class="options_list nobullet">
|
||||||
|
<li>
|
||||||
|
<input type="radio" name="torrentgrouping" id="torrent_grouping_open" value="0" <? if ($SiteOptions['TorrentGrouping'] == 0) { ?>checked="checked" <? } ?>/>
|
||||||
|
<label for="torrent_grouping_open">Open</label>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<input type="radio" name="torrentgrouping" id="torrent_grouping_closed" value="1" <? if ($SiteOptions['TorrentGrouping'] == 1) { ?>checked="checked" <? } ?>/>
|
||||||
|
<label for="torrent_grouping_closed">Closed</label>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="label"><strong>Discography view</strong></td>
|
<td class="label"><strong>Default discography view</strong></td>
|
||||||
<td>
|
<td>
|
||||||
<select name="discogview" id="discogview">
|
<ul class="options_list nobullet">
|
||||||
<option value="0"<? if ($SiteOptions['DiscogView'] == 0) { ?> selected="selected"<? } ?>>Open by default</option>
|
<li>
|
||||||
<option value="1"<? if ($SiteOptions['DiscogView'] == 1) { ?> selected="selected"<? } ?>>Closed by default</option>
|
<input type="radio" name="discogview" id="discog_view_open" value="0" <? if ($SiteOptions['DiscogView'] == 0) { ?>checked="checked" <? } ?>/>
|
||||||
</select>
|
<label for="discog_view_open">Open</label>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<input type="radio" name="discogview" id="discog_view_closed" value="1" <? if ($SiteOptions['DiscogView'] == 1) { ?>checked="checked" <? } ?>/>
|
||||||
|
<label for="discog_view_closed">Closed</label>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -229,17 +256,28 @@ function checked($Checked) {
|
|||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<!-- <strip> -->
|
||||||
|
<? if(check_perms("users_mod")) { ?>
|
||||||
|
<tr>
|
||||||
|
<td class="label"><strong>TehConnection integration</strong></td>
|
||||||
|
<td>
|
||||||
|
<input type="checkbox" name="films" id="films" <?=!isset($SiteOptions['Films']) || $SiteOptions['Films'] == true ? "checked='checked'" : ""?>/>
|
||||||
|
<label for="films">Show movie posters and link to TehConnection on movie soundtracks</label>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<? } ?>
|
||||||
|
<!-- </strip> -->
|
||||||
<tr>
|
<tr>
|
||||||
<td class="label"><strong>Torrent search</strong></td>
|
<td class="label"><strong>Torrent search</strong></td>
|
||||||
<td>
|
<td>
|
||||||
<ul class="options_list nobullet">
|
<ul class="options_list nobullet">
|
||||||
<li>
|
<li>
|
||||||
<input type="checkbox" name="showtfilter" id="showtfilter"<?=(!isset($SiteOptions['ShowTorFilter']) || $SiteOptions['ShowTorFilter'] ? ' checked="checked"' : '')?>/>
|
<input type="checkbox" name="showtfilter" id="showtfilter"<?=(!isset($SiteOptions['ShowTorFilter']) || $SiteOptions['ShowTorFilter'] ? ' checked="checked"' : '')?>/>
|
||||||
<label for="showtfilter">Show filter</label>
|
<label for="showtfilter">Show filter controls</label>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<input type="checkbox" name="showtags" id="showtags"<?Format::selected("ShowTags", 1, "checked", $SiteOptions);?>/>
|
<input type="checkbox" name="showtags" id="showtags"<?Format::selected('ShowTags', 1, 'checked', $SiteOptions);?>/>
|
||||||
<label for="showtags">Show tag list</label>
|
<label for="showtags">Show filters for official tags</label>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</td>
|
</td>
|
||||||
@ -337,7 +375,7 @@ function checked($Checked) {
|
|||||||
<td class="label"><strong>Quote notifications</strong></td>
|
<td class="label"><strong>Quote notifications</strong></td>
|
||||||
<td>
|
<td>
|
||||||
<input type="checkbox" name="notifyquotes" id="notifyquotes"<? if (!empty($SiteOptions['NotifyOnQuote'])) { ?> checked="checked"<? } ?> />
|
<input type="checkbox" name="notifyquotes" id="notifyquotes"<? if (!empty($SiteOptions['NotifyOnQuote'])) { ?> checked="checked"<? } ?> />
|
||||||
<label for="notifyquotes">Notifications when someone quotes you in the forum</label>
|
<label for="notifyquotes">Receive notifications when someone quotes you in the forum</label>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -368,7 +406,7 @@ function checked($Checked) {
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="label"><strong>Last.fm username</strong></td>
|
<td class="label"><strong>Last.fm username</strong></td>
|
||||||
<td><input type="text" size="50" name="lastfm_username" id="lastfm_username" value="<?=display_str($LastFMUsername)?>" />
|
<td><input type="text" size="50" name="lastfm_username" id="lastfm_username" value="<?=display_str($LastFMUsername)?>" />
|
||||||
<p class="min_padding">Your Last.fm username. Will be used to display Last.fm information on your profile which can be seen by other users.</p>
|
<p class="min_padding">Used to display Last.fm information on your profile which can be seen by other users.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -581,7 +619,7 @@ function checked($Checked) {
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" class="right">
|
<td colspan="2" class="right">
|
||||||
<input type="submit" value="Save Profile" />
|
<input type="submit" value="Save profile" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
@ -15,30 +15,30 @@
|
|||||||
|
|
||||||
$Permissions = Permissions::get_permissions($U['PermissionID']);
|
$Permissions = Permissions::get_permissions($U['PermissionID']);
|
||||||
if ($UserID != $LoggedUser['ID'] && !check_perms('users_edit_profiles', $Permissions['Class'])) {
|
if ($UserID != $LoggedUser['ID'] && !check_perms('users_edit_profiles', $Permissions['Class'])) {
|
||||||
send_irc("PRIVMSG ".ADMIN_CHAN." :User ".$LoggedUser['Username']." (https://".SSL_SITE_URL."/user.php?id=".$LoggedUser['ID'].") just tried to edit the profile of https://".SSL_SITE_URL."/user.php?id=".$_REQUEST['userid']);
|
send_irc('PRIVMSG '.ADMIN_CHAN.' :User '.$LoggedUser['Username'].' (https://'.SSL_SITE_URL.'/user.php?id='.$LoggedUser['ID'].') just tried to edit the profile of https://'.SSL_SITE_URL.'/user.php?id='.$_REQUEST['userid']);
|
||||||
error(403);
|
error(403);
|
||||||
}
|
}
|
||||||
|
|
||||||
$Val->SetFields('stylesheet',1,"number","You forgot to select a stylesheet.");
|
$Val->SetFields('stylesheet', 1, "number", "You forgot to select a stylesheet.");
|
||||||
$Val->SetFields('styleurl',0,"regex","You did not enter a valid stylesheet url.",array('regex'=>'/^https?:\/\/(localhost(:[0-9]{2,5})?|[0-9]{1,3}(\.[0-9]{1,3}){3}|([a-zA-Z0-9\-\_]+\.)+([a-zA-Z]{1,5}[^\.]))(:[0-9]{2,5})?(\/[^<>]+)+\.css$/i'));
|
$Val->SetFields('styleurl', 0, "regex", "You did not enter a valid stylesheet URL.", array('regex' => '/^https?:\/\/(localhost(:[0-9]{2,5})?|[0-9]{1,3}(\.[0-9]{1,3}){3}|([a-zA-Z0-9\-\_]+\.)+([a-zA-Z]{1,5}[^\.]))(:[0-9]{2,5})?(\/[^<>]+)+\.css$/i'));
|
||||||
$Val->SetFields('disablegrouping',1,"number","You forgot to select your torrent grouping option.",array('minlength'=>0,'maxlength'=>1));
|
// The next two are commented out because the drop-down menus were replaced with a check box and radio buttons
|
||||||
$Val->SetFields('torrentgrouping',1,"number","You forgot to select your torrent grouping option.",array('minlength'=>0,'maxlength'=>1));
|
//$Val->SetFields('disablegrouping', 0, "number", "You forgot to select your torrent grouping option.");
|
||||||
$Val->SetFields('discogview',1,"number","You forgot to select your discography view option.",array('minlength'=>0,'maxlength'=>1));
|
//$Val->SetFields('torrentgrouping', 0, "number", "You forgot to select your torrent grouping option.");
|
||||||
$Val->SetFields('postsperpage',1,"number","You forgot to select your posts per page option.",array('inarray'=>array(25,50,100)));
|
$Val->SetFields('discogview', 1, "number", "You forgot to select your discography view option.", array('minlength' => 0, 'maxlength' => 1));
|
||||||
//$Val->SetFields('hidecollage',1,"number","You forgot to select your collage option.",array('minlength'=>0,'maxlength'=>1));
|
$Val->SetFields('postsperpage', 1, "number", "You forgot to select your posts per page option.", array('inarray' => array(25, 50, 100)));
|
||||||
$Val->SetFields('collagecovers',1,"number","You forgot to select your collage option.");
|
//$Val->SetFields('hidecollage', 1, "number", "You forgot to select your collage option.", array('minlength' => 0, 'maxlength' => 1));
|
||||||
$Val->SetFields('avatar',0,"regex","You did not enter a valid avatar url.",array('regex'=>"/^".IMAGE_REGEX."$/i"));
|
$Val->SetFields('collagecovers', 1, "number", "You forgot to select your collage option.");
|
||||||
$Val->SetFields('email',1,"email","You did not enter a valid email address.");
|
$Val->SetFields('avatar', 0, "regex", "You did not enter a valid avatar URL.", array('regex' => "/^".IMAGE_REGEX."$/i"));
|
||||||
$Val->SetFields('irckey',0,"string","You did not enter a valid IRCKey, must be between 6 and 32 characters long.",array('minlength'=>6,'maxlength'=>32));
|
$Val->SetFields('email', 1, "email", "You did not enter a valid email address.");
|
||||||
$Val->SetFields('cur_pass',0,"string","You did not enter a valid password, must be at least 6 characters long.",array('minlength'=>6,'maxlength'=>150));
|
$Val->SetFields('irckey', 0, "string", "You did not enter a valid IRCKey. An IRCKey must be between 6 and 32 characters long.", array('minlength' => 6, 'maxlength' => 32));
|
||||||
$Val->SetFields('new_pass_1',0,"regex","You did not enter a valid password. A strong password is between 8 and 40 characters long contains at least 1 lowercase and uppercase letter, contains at least a number or symbol",array('regex'=>'/(?=^.{8,}$)(?=.*[^a-zA-Z])(?=.*[A-Z])(?=.*[a-z]).*$/'));
|
$Val->SetFields('cur_pass', 0, "string", "You did not enter a valid password. Passwords must be at least 6 characters long.", array('minlength' => 6, 'maxlength' => 150));
|
||||||
$Val->SetFields('new_pass_2',1,"compare","Your passwords do not match.",array('comparefield'=>'new_pass_1'));
|
$Val->SetFields('new_pass_1', 0, "regex", "You did not enter a valid password. A strong password is between 8 and 40 characters long contains at least 1 lowercase and uppercase letter, contains at least a number or symbol", array('regex' => '/(?=^.{8,}$)(?=.*[^a-zA-Z])(?=.*[A-Z])(?=.*[a-z]).*$/'));
|
||||||
|
$Val->SetFields('new_pass_2', 1, "compare", "Your passwords do not match.", array('comparefield' => 'new_pass_1'));
|
||||||
if (check_perms('site_advanced_search')) {
|
if (check_perms('site_advanced_search')) {
|
||||||
$Val->SetFields('searchtype',1,"number","You forgot to select your default search preference.",array('minlength'=>0,'maxlength'=>1));
|
$Val->SetFields('searchtype', 1, "number", "You forgot to select your default search preference.", array('minlength' => 0, 'maxlength' => 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
$Err = $Val->ValidateForm($_POST);
|
$Err = $Val->ValidateForm($_POST);
|
||||||
|
|
||||||
if ($Err) {
|
if ($Err) {
|
||||||
error($Err);
|
error($Err);
|
||||||
header('Location: user.php?action=edit&userid='.$UserID);
|
header('Location: user.php?action=edit&userid='.$UserID);
|
||||||
@ -183,7 +183,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($LoggedUser['DisableAvatar'] && $_POST['avatar'] != $U['Avatar']) {
|
if ($LoggedUser['DisableAvatar'] && $_POST['avatar'] != $U['Avatar']) {
|
||||||
$Err = 'Your avatar rights have been removed.';
|
$Err = 'Your avatar privileges have been revoked.';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($Err) {
|
if ($Err) {
|
||||||
@ -195,7 +195,7 @@
|
|||||||
if (!empty($LoggedUser['DefaultSearch'])) {
|
if (!empty($LoggedUser['DefaultSearch'])) {
|
||||||
$Options['DefaultSearch'] = $LoggedUser['DefaultSearch'];
|
$Options['DefaultSearch'] = $LoggedUser['DefaultSearch'];
|
||||||
}
|
}
|
||||||
$Options['DisableGrouping2'] = (!empty($_POST['disablegrouping']) ? 1 : 0);
|
$Options['DisableGrouping2'] = (!empty($_POST['disablegrouping']) ? 0 : 1);
|
||||||
$Options['TorrentGrouping'] = (!empty($_POST['torrentgrouping']) ? 1 : 0);
|
$Options['TorrentGrouping'] = (!empty($_POST['torrentgrouping']) ? 1 : 0);
|
||||||
$Options['DiscogView'] = (!empty($_POST['discogview']) ? 1 : 0);
|
$Options['DiscogView'] = (!empty($_POST['discogview']) ? 1 : 0);
|
||||||
$Options['PostsPerPage'] = (int) $_POST['postsperpage'];
|
$Options['PostsPerPage'] = (int) $_POST['postsperpage'];
|
||||||
@ -216,6 +216,7 @@
|
|||||||
$Options['ShowSnatched'] = (!empty($_POST['showsnatched']) ? 1 : 0);
|
$Options['ShowSnatched'] = (!empty($_POST['showsnatched']) ? 1 : 0);
|
||||||
$Options['DisableAutoSave'] = (!empty($_POST['disableautosave']) ? 1 : 0);
|
$Options['DisableAutoSave'] = (!empty($_POST['disableautosave']) ? 1 : 0);
|
||||||
$Options['NoVoteLinks'] = (!empty($_POST['novotelinks']) ? 1 : 0);
|
$Options['NoVoteLinks'] = (!empty($_POST['novotelinks']) ? 1 : 0);
|
||||||
|
|
||||||
$Options['CoverArt'] = (int) !empty($_POST['coverart']);
|
$Options['CoverArt'] = (int) !empty($_POST['coverart']);
|
||||||
$Options['ShowExtraCovers'] = (int) !empty($_POST['show_extra_covers']);
|
$Options['ShowExtraCovers'] = (int) !empty($_POST['show_extra_covers']);
|
||||||
|
|
||||||
|
64
static/functions/jquery.validate.js
vendored
64
static/functions/jquery.validate.js
vendored
@ -1,8 +1,8 @@
|
|||||||
/*!
|
/*!
|
||||||
* jQuery Validation Plugin 1.12.0pre
|
* jQuery Validation Plugin 1.12.0pre
|
||||||
*
|
*
|
||||||
* http://bassistance.de/jquery-plugins/jquery-plugin-validation/
|
* http://jqueryvalidation.org/
|
||||||
* http://docs.jquery.com/Plugins/Validation
|
* http://jqueryvalidation.org/documentation/
|
||||||
*
|
*
|
||||||
* Copyright 2013 Jörn Zaefferer
|
* Copyright 2013 Jörn Zaefferer
|
||||||
* Released under the MIT license:
|
* Released under the MIT license:
|
||||||
@ -12,7 +12,7 @@
|
|||||||
(function($) {
|
(function($) {
|
||||||
|
|
||||||
$.extend($.fn, {
|
$.extend($.fn, {
|
||||||
// http://docs.jquery.com/Plugins/Validation/validate
|
// http://jqueryvalidation.org/validate/
|
||||||
validate: function( options ) {
|
validate: function( options ) {
|
||||||
// if nothing is selected, return nothing; can't chain anyway
|
// if nothing is selected, return nothing; can't chain anyway
|
||||||
if ( !this.length ) {
|
if ( !this.length ) {
|
||||||
@ -94,7 +94,7 @@ $.extend($.fn, {
|
|||||||
|
|
||||||
return validator;
|
return validator;
|
||||||
},
|
},
|
||||||
// http://docs.jquery.com/Plugins/Validation/valid
|
// http://jqueryvalidation.org/valid/
|
||||||
valid: function() {
|
valid: function() {
|
||||||
if ( $(this[0]).is("form")) {
|
if ( $(this[0]).is("form")) {
|
||||||
return this.validate().form();
|
return this.validate().form();
|
||||||
@ -117,7 +117,7 @@ $.extend($.fn, {
|
|||||||
});
|
});
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
// http://docs.jquery.com/Plugins/Validation/rules
|
// http://jqueryvalidation.org/rules/
|
||||||
rules: function( command, argument ) {
|
rules: function( command, argument ) {
|
||||||
var element = this[0];
|
var element = this[0];
|
||||||
|
|
||||||
@ -171,11 +171,11 @@ $.extend($.fn, {
|
|||||||
|
|
||||||
// Custom selectors
|
// Custom selectors
|
||||||
$.extend($.expr[":"], {
|
$.extend($.expr[":"], {
|
||||||
// http://docs.jquery.com/Plugins/Validation/blank
|
// http://jqueryvalidation.org/blank-selector/
|
||||||
blank: function( a ) { return !$.trim("" + $(a).val()); },
|
blank: function( a ) { return !$.trim("" + $(a).val()); },
|
||||||
// http://docs.jquery.com/Plugins/Validation/filled
|
// http://jqueryvalidation.org/filled-selector/
|
||||||
filled: function( a ) { return !!$.trim("" + $(a).val()); },
|
filled: function( a ) { return !!$.trim("" + $(a).val()); },
|
||||||
// http://docs.jquery.com/Plugins/Validation/unchecked
|
// http://jqueryvalidation.org/unchecked-selector/
|
||||||
unchecked: function( a ) { return !$(a).prop("checked"); }
|
unchecked: function( a ) { return !$(a).prop("checked"); }
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -272,7 +272,7 @@ $.extend($.validator, {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// http://docs.jquery.com/Plugins/Validation/Validator/setDefaults
|
// http://jqueryvalidation.org/jQuery.validator.setDefaults/
|
||||||
setDefaults: function( settings ) {
|
setDefaults: function( settings ) {
|
||||||
$.extend( $.validator.defaults, settings );
|
$.extend( $.validator.defaults, settings );
|
||||||
},
|
},
|
||||||
@ -346,7 +346,7 @@ $.extend($.validator, {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// http://docs.jquery.com/Plugins/Validation/Validator/form
|
// http://jqueryvalidation.org/Validator.form/
|
||||||
form: function() {
|
form: function() {
|
||||||
this.checkForm();
|
this.checkForm();
|
||||||
$.extend(this.submitted, this.errorMap);
|
$.extend(this.submitted, this.errorMap);
|
||||||
@ -366,7 +366,7 @@ $.extend($.validator, {
|
|||||||
return this.valid();
|
return this.valid();
|
||||||
},
|
},
|
||||||
|
|
||||||
// http://docs.jquery.com/Plugins/Validation/Validator/element
|
// http://jqueryvalidation.org/Validator.element/
|
||||||
element: function( element ) {
|
element: function( element ) {
|
||||||
element = this.validationTargetFor( this.clean( element ) );
|
element = this.validationTargetFor( this.clean( element ) );
|
||||||
this.lastElement = element;
|
this.lastElement = element;
|
||||||
@ -386,7 +386,7 @@ $.extend($.validator, {
|
|||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
|
|
||||||
// http://docs.jquery.com/Plugins/Validation/Validator/showErrors
|
// http://jqueryvalidation.org/Validator.showErrors/
|
||||||
showErrors: function( errors ) {
|
showErrors: function( errors ) {
|
||||||
if ( errors ) {
|
if ( errors ) {
|
||||||
// add items to error list and map
|
// add items to error list and map
|
||||||
@ -410,7 +410,7 @@ $.extend($.validator, {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// http://docs.jquery.com/Plugins/Validation/Validator/resetForm
|
// http://jqueryvalidation.org/Validator.resetForm/
|
||||||
resetForm: function() {
|
resetForm: function() {
|
||||||
if ( $.fn.resetForm ) {
|
if ( $.fn.resetForm ) {
|
||||||
$(this.currentForm).resetForm();
|
$(this.currentForm).resetForm();
|
||||||
@ -980,7 +980,7 @@ $.extend($.validator, {
|
|||||||
return data;
|
return data;
|
||||||
},
|
},
|
||||||
|
|
||||||
// http://docs.jquery.com/Plugins/Validation/Validator/addMethod
|
// http://jqueryvalidation.org/jQuery.validator.addMethod/
|
||||||
addMethod: function( name, method, message ) {
|
addMethod: function( name, method, message ) {
|
||||||
$.validator.methods[name] = method;
|
$.validator.methods[name] = method;
|
||||||
$.validator.messages[name] = message !== undefined ? message : $.validator.messages[name];
|
$.validator.messages[name] = message !== undefined ? message : $.validator.messages[name];
|
||||||
@ -991,7 +991,7 @@ $.extend($.validator, {
|
|||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
// http://docs.jquery.com/Plugins/Validation/Methods/required
|
// http://jqueryvalidation.org/required-method/
|
||||||
required: function( value, element, param ) {
|
required: function( value, element, param ) {
|
||||||
// check if dependency is met
|
// check if dependency is met
|
||||||
if ( !this.depend(param, element) ) {
|
if ( !this.depend(param, element) ) {
|
||||||
@ -1008,40 +1008,40 @@ $.extend($.validator, {
|
|||||||
return $.trim(value).length > 0;
|
return $.trim(value).length > 0;
|
||||||
},
|
},
|
||||||
|
|
||||||
// http://docs.jquery.com/Plugins/Validation/Methods/email
|
// http://jqueryvalidation.org/email-method/
|
||||||
email: function( value, element ) {
|
email: function( value, element ) {
|
||||||
// contributed by Scott Gonzalez: http://projects.scottsplayground.com/email_address_validation/
|
// contributed by Scott Gonzalez: http://projects.scottsplayground.com/email_address_validation/
|
||||||
return this.optional(element) || /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(value);
|
return this.optional(element) || /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(value);
|
||||||
},
|
},
|
||||||
|
|
||||||
// http://docs.jquery.com/Plugins/Validation/Methods/url
|
// http://jqueryvalidation.org/url-method/
|
||||||
url: function( value, element ) {
|
url: function( value, element ) {
|
||||||
// contributed by Scott Gonzalez: http://projects.scottsplayground.com/iri/
|
// contributed by Scott Gonzalez: http://projects.scottsplayground.com/iri/
|
||||||
return this.optional(element) || /^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value);
|
return this.optional(element) || /^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value);
|
||||||
},
|
},
|
||||||
|
|
||||||
// http://docs.jquery.com/Plugins/Validation/Methods/date
|
// http://jqueryvalidation.org/date-method/
|
||||||
date: function( value, element ) {
|
date: function( value, element ) {
|
||||||
return this.optional(element) || !/Invalid|NaN/.test(new Date(value).toString());
|
return this.optional(element) || !/Invalid|NaN/.test(new Date(value).toString());
|
||||||
},
|
},
|
||||||
|
|
||||||
// http://docs.jquery.com/Plugins/Validation/Methods/dateISO
|
// http://jqueryvalidation.org/dateISO-method/
|
||||||
dateISO: function( value, element ) {
|
dateISO: function( value, element ) {
|
||||||
return this.optional(element) || /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(value);
|
return this.optional(element) || /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(value);
|
||||||
},
|
},
|
||||||
|
|
||||||
// http://docs.jquery.com/Plugins/Validation/Methods/number
|
// http://jqueryvalidation.org/number-method/
|
||||||
number: function( value, element ) {
|
number: function( value, element ) {
|
||||||
return this.optional(element) || /^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value);
|
return this.optional(element) || /^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value);
|
||||||
},
|
},
|
||||||
|
|
||||||
// http://docs.jquery.com/Plugins/Validation/Methods/digits
|
// http://jqueryvalidation.org/digits-method/
|
||||||
digits: function( value, element ) {
|
digits: function( value, element ) {
|
||||||
return this.optional(element) || /^\d+$/.test(value);
|
return this.optional(element) || /^\d+$/.test(value);
|
||||||
},
|
},
|
||||||
|
|
||||||
// http://docs.jquery.com/Plugins/Validation/Methods/creditcard
|
// http://jqueryvalidation.org/creditcard-method/
|
||||||
// based on http://en.wikipedia.org/wiki/Luhn
|
// based on https://en.wikipedia.org/wiki/Luhn_algorithm
|
||||||
creditcard: function( value, element ) {
|
creditcard: function( value, element ) {
|
||||||
if ( this.optional(element) ) {
|
if ( this.optional(element) ) {
|
||||||
return "dependency-mismatch";
|
return "dependency-mismatch";
|
||||||
@ -1069,42 +1069,42 @@ $.extend($.validator, {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (nCheck % 10) === 0;
|
return (nCheck % 10) === 0;
|
||||||
},
|
} ,
|
||||||
|
|
||||||
// http://docs.jquery.com/Plugins/Validation/Methods/minlength
|
// http://jqueryvalidation.org/minlength-method/
|
||||||
minlength: function( value, element, param ) {
|
minlength: function( value, element, param ) {
|
||||||
var length = $.isArray( value ) ? value.length : this.getLength($.trim(value), element);
|
var length = $.isArray( value ) ? value.length : this.getLength($.trim(value), element);
|
||||||
return this.optional(element) || length >= param;
|
return this.optional(element) || length >= param;
|
||||||
},
|
},
|
||||||
|
|
||||||
// http://docs.jquery.com/Plugins/Validation/Methods/maxlength
|
// http://jqueryvalidation.org/maxlength-method/
|
||||||
maxlength: function( value, element, param ) {
|
maxlength: function( value, element, param ) {
|
||||||
var length = $.isArray( value ) ? value.length : this.getLength($.trim(value), element);
|
var length = $.isArray( value ) ? value.length : this.getLength($.trim(value), element);
|
||||||
return this.optional(element) || length <= param;
|
return this.optional(element) || length <= param;
|
||||||
},
|
},
|
||||||
|
|
||||||
// http://docs.jquery.com/Plugins/Validation/Methods/rangelength
|
// http://jqueryvalidation.org/rangelength-method/
|
||||||
rangelength: function( value, element, param ) {
|
rangelength: function( value, element, param ) {
|
||||||
var length = $.isArray( value ) ? value.length : this.getLength($.trim(value), element);
|
var length = $.isArray( value ) ? value.length : this.getLength($.trim(value), element);
|
||||||
return this.optional(element) || ( length >= param[0] && length <= param[1] );
|
return this.optional(element) || ( length >= param[0] && length <= param[1] );
|
||||||
},
|
},
|
||||||
|
|
||||||
// http://docs.jquery.com/Plugins/Validation/Methods/min
|
// http://jqueryvalidation.org/min-method/
|
||||||
min: function( value, element, param ) {
|
min: function( value, element, param ) {
|
||||||
return this.optional(element) || value >= param;
|
return this.optional(element) || value >= param;
|
||||||
},
|
},
|
||||||
|
|
||||||
// http://docs.jquery.com/Plugins/Validation/Methods/max
|
// http://jqueryvalidation.org/max-method/
|
||||||
max: function( value, element, param ) {
|
max: function( value, element, param ) {
|
||||||
return this.optional(element) || value <= param;
|
return this.optional(element) || value <= param;
|
||||||
},
|
},
|
||||||
|
|
||||||
// http://docs.jquery.com/Plugins/Validation/Methods/range
|
// http://jqueryvalidation.org/range-method/
|
||||||
range: function( value, element, param ) {
|
range: function( value, element, param ) {
|
||||||
return this.optional(element) || ( value >= param[0] && value <= param[1] );
|
return this.optional(element) || ( value >= param[0] && value <= param[1] );
|
||||||
},
|
},
|
||||||
|
|
||||||
// http://docs.jquery.com/Plugins/Validation/Methods/equalTo
|
// http://jqueryvalidation.org/equalTo-method/
|
||||||
equalTo: function( value, element, param ) {
|
equalTo: function( value, element, param ) {
|
||||||
// bind to the blur event of the target in order to revalidate whenever the target field is updated
|
// bind to the blur event of the target in order to revalidate whenever the target field is updated
|
||||||
// TODO find a way to bind the event just once, avoiding the unbind-rebind overhead
|
// TODO find a way to bind the event just once, avoiding the unbind-rebind overhead
|
||||||
@ -1117,7 +1117,7 @@ $.extend($.validator, {
|
|||||||
return value === target.val();
|
return value === target.val();
|
||||||
},
|
},
|
||||||
|
|
||||||
// http://docs.jquery.com/Plugins/Validation/Methods/remote
|
// http://jqueryvalidation.org/remote-method/
|
||||||
remote: function( value, element, param ) {
|
remote: function( value, element, param ) {
|
||||||
if ( this.optional(element) ) {
|
if ( this.optional(element) ) {
|
||||||
return "dependency-mismatch";
|
return "dependency-mismatch";
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Allows the user to populate upload form using musicbrainz.
|
* Allows the user to populate upload form using MusicBrainz.
|
||||||
* Popup display code based on example found here http://yensdesign.com/2008/09/how-to-create-a-stunning-and-smooth-popup-using-jquery/
|
* Popup display code based on example found here http://yensdesign.com/2008/09/how-to-create-a-stunning-and-smooth-popup-using-jquery/
|
||||||
*
|
*
|
||||||
* @author Gwindow
|
* @author Gwindow
|
||||||
@ -40,12 +40,14 @@ $(document).ready(function() {
|
|||||||
var $album_encoded = encodeURIComponent($album);
|
var $album_encoded = encodeURIComponent($album);
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url : "http://www.musicbrainz.org/ws/2/release-group/?query=artist:%22" + $artist_encoded + "%22%20AND%20releasegroup:%22" + $album_encoded + "%22",
|
url : "https://musicbrainz.org/ws/2/release-group/?query=artist:%22" + $artist_encoded + "%22%20AND%20releasegroup:%22" + $album_encoded + "%22",
|
||||||
dataType: "xml",
|
dataType: "xml",
|
||||||
success: showReleaseGroups
|
success: showReleaseGroups
|
||||||
});
|
});
|
||||||
|
|
||||||
} else { alert("Please fill out artist and/or album fields.");}
|
} else {
|
||||||
|
alert("Please fill out artist and/or album fields.");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#results1").click(function(event) {
|
$("#results1").click(function(event) {
|
||||||
@ -109,7 +111,7 @@ function showReleaseGroups(xml) {
|
|||||||
if ($count == 0 ) {
|
if ($count == 0 ) {
|
||||||
alert("Could not find on MusicBrainz");
|
alert("Could not find on MusicBrainz");
|
||||||
} else {
|
} else {
|
||||||
jQuery('#popup_title').text("Choose Release Group");
|
jQuery('#popup_title').text("Choose release group");
|
||||||
openPopup();
|
openPopup();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,7 +135,7 @@ function showReleases(xml) {
|
|||||||
$year_original = $date_release_group.substring(0,4);
|
$year_original = $date_release_group.substring(0,4);
|
||||||
$release_type = $(xml).find("release-group").attr("type");
|
$release_type = $(xml).find("release-group").attr("type");
|
||||||
$release_group_id = $(xml).find("release-group").attr("id");
|
$release_group_id = $(xml).find("release-group").attr("id");
|
||||||
jQuery('#popup_title').html("Choose Release " + '<a href="https://musicbrainz.org/release-group/'
|
jQuery('#popup_title').html("Choose release " + '<a href="https://musicbrainz.org/release-group/'
|
||||||
+ $release_group_id + '" target="_new" class="brackets">View on MusicBrainz</a>');
|
+ $release_group_id + '" target="_new" class="brackets">View on MusicBrainz</a>');
|
||||||
jQuery('#popup_back').html('<a href="#null" id="back" class="brackets">Go back</a>');
|
jQuery('#popup_back').html('<a href="#null" id="back" class="brackets">Go back</a>');
|
||||||
|
|
||||||
@ -221,7 +223,7 @@ function populateForm(xml) {
|
|||||||
|
|
||||||
var $amazon_link = "";
|
var $amazon_link = "";
|
||||||
if ($asin.length > 0) {
|
if ($asin.length > 0) {
|
||||||
$amazin_link = "[url=http://amazon.com/exec/obidos/ASIN/" + $asin + "]Amazon[/url]" + "\n";
|
$amazon_link = "[url=http://www.amazon.com/exec/obidos/ASIN/" + $asin + "]Amazon[/url]" + "\n";
|
||||||
}
|
}
|
||||||
var $country_text = "";
|
var $country_text = "";
|
||||||
if ($country.length > 0) {
|
if ($country.length > 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user