From 83ec73f18fc09cdb9b99294af7caab5435c66c4b Mon Sep 17 00:00:00 2001 From: Git Date: Sat, 2 Mar 2013 08:00:34 +0000 Subject: [PATCH] Empty commit --- classes/class_torrent_form.php | 1 + design/privateheader.php | 8 +- CHANGES.txt => docs/CHANGES.txt | 0 COPYING.txt => docs/COPYING.txt | 0 docs/CodingStandards.txt | 250 +++++++++++++++++++++++ INSTALL.txt => docs/INSTALL.txt | 0 sections/collages/all_comments.php | 4 +- sections/collages/browse.php | 19 +- sections/collages/collage.php | 18 +- sections/forums/forum.php | 2 +- sections/forums/newthread.php | 14 +- sections/forums/thread.php | 6 +- sections/index/private.php | 6 +- sections/reportsv2/search.php | 5 +- sections/tools/tools.php | 40 ++-- sections/torrents/edit.php | 74 ++++++- sections/torrents/index.php | 5 + sections/torrents/takechangecategory.php | 102 +++++++++ sections/torrents/user.php | 4 +- 19 files changed, 490 insertions(+), 68 deletions(-) rename CHANGES.txt => docs/CHANGES.txt (100%) rename COPYING.txt => docs/COPYING.txt (100%) create mode 100644 docs/CodingStandards.txt rename INSTALL.txt => docs/INSTALL.txt (100%) create mode 100644 sections/torrents/takechangecategory.php diff --git a/classes/class_torrent_form.php b/classes/class_torrent_form.php index 8c0c80de..7c215bd0 100644 --- a/classes/class_torrent_form.php +++ b/classes/class_torrent_form.php @@ -206,6 +206,7 @@ function music_form($GenreTags) { + DisabledFlag) { ?> diff --git a/design/privateheader.php b/design/privateheader.php index 23924c54..44404469 100644 --- a/design/privateheader.php +++ b/design/privateheader.php @@ -223,7 +223,7 @@ $Cache->cache_value('news_latest_id', $CurrentNews, 0); } if ($MyNews < $CurrentNews) { - $Alerts[] = ''.'New Announcement!'.''; + $Alerts[] = ''.'New announcement!'.''; } // Blog @@ -239,7 +239,7 @@ $Cache->cache_value('blog_latest_id', $CurrentBlog, 0); } if ($MyBlog < $CurrentBlog) { - $Alerts[] = ''.'New Blog Post!'.''; + $Alerts[] = ''.'New blog post!'.''; } // Staff blog @@ -264,7 +264,7 @@ $Cache->cache_value('staff_blog_latest_time', $LatestSBlogTime, 1209600); } if ($SBlogReadTime < $LatestSBlogTime) { - $Alerts[] = ''.'New Staff Blog Post!'.''; + $Alerts[] = ''.'New staff blog post!'.''; } } @@ -370,7 +370,7 @@ } if ($NumOtherReports > 0) { - $ModBar[] = ''.$NumOtherReports.(($NumTorrentReports == 1) ? ' Other Report' : ' Other Reports').''; + $ModBar[] = ''.$NumOtherReports.(($NumTorrentReports == 1) ? ' Other report' : ' Other reports').''; } } else if(check_perms('project_team')) { $NumUpdateReports = $Cache->get_value('num_update_reports'); diff --git a/CHANGES.txt b/docs/CHANGES.txt similarity index 100% rename from CHANGES.txt rename to docs/CHANGES.txt diff --git a/COPYING.txt b/docs/COPYING.txt similarity index 100% rename from COPYING.txt rename to docs/COPYING.txt diff --git a/docs/CodingStandards.txt b/docs/CodingStandards.txt new file mode 100644 index 00000000..f403a13a --- /dev/null +++ b/docs/CodingStandards.txt @@ -0,0 +1,250 @@ +This document contains the coding standards for Gazelle. +This document is a work-in-progress and is subject to change. + +NOTE: The standards defined in this document will likely differ from +what is actually seen in the Gazelle code. This document is the first +step in properly enforcing coding standards throughout the project. + + +== TABLE OF CONTENTS == + +1. FILE FORMATTING +2. CODE STYLING +2.1 Code styling for PHP and JavaScript +2.2 Code styling for CSS +2.3 Code styling for SQL +3. NAMING CONVENTIONS +3.1 Function names +3.2 Variable names +3.3 Class names +3.4 SQL names +3.5 Miscellaneous names +4. COMMENTS +5. USER INTERFACE +6. EXAMPLES +6.1 PHP examples +6.2 CSS examples +6.3 SQL examples + + + 1. FILE FORMATTING + +Tabs shall always be used for indentation. Do not use spaces to make code +blocks align in a pretty fashion. + +Files shall be encoded in ASCII. + +Files shall always use Unix-style line endings (LF). The program dos2unix +will take care of this for you if you have files that use Windows-style +line endings (CR+LF) or old Mac-style line endings (CR). + +File names for PHP, CSS, and JavaScript files shall be all lowercase and +use underscores instead of spaces. + + + 2. CODE STYLING + + 2.1 Code styling for PHP and JavaScript + +All statement blocks, including functions, shall have the opening brace +at the end of the same line with a space before the brace. The astute +reader will note that this is K&R style with the exception of functions. + +There shall be a space between a control structure statement (e.g. if, +elseif, for) and the following parenthesis. + +There shall be a space around conditional operators. + +When using ternary operators, spaces shall be used around the operators. + +For conditional blocks, "elseif" is to be used instead of "else if". + +In loops and conditional blocks, there shall be braces even if there is +only one statement. + +In loops and conditional blocks, the statement(s) shall be placed on the +following lines. + +When opening a PHP statement, "= 0) { + $SomeString = "this is a string $DiffString with more text"; +} elseif ($Foo == 0) { + // other things happen +} else { + // more magic +} + +function works_magic($Foo, $Bar) { + return $Foo; +} + +echo ($Foo == true ? 'foo is true' : 'foo is false'); + +if ($Foo == true) { + // magic happens +} + +/* + * This is a good, multi-line comment. + * + * Please comment your code! + */ + +// This is a good, single-line comment. + + + 6.2 CSS examples + +link text + +.spellcheck { + margin: 10px 0; + font-size: 1.25em; + font-weight: bold; +} + +.linkbox .brackets:before, +.linkbox .brackets:after, +.top10_quantity_links .brackets:before, +.top10_quantity_links .brackets:after { + color: #757575; +} + + + 6.3 SQL examples + +SELECT + r.ID, e.EditionID, r.Title, r.Year, r.CatalogueNumber, + l.Name AS Label, r.LabelID, r.Image, r.MusicBrainzID +FROM releases AS r + JOIN editions AS e ON e.ReleaseID = r.ID + LEFT JOIN labels AS l ON l.ID = r.LabelID +WHERE r.ID IN ($ReleaseIDsSQL) +ORDER BY e.EditionID, r.Year ASC + + +SELECT SQL_CALC_FOUND_ROWS c.ID, c.Subject, cu.Unread, cu.Sticky, + cu.ForwardedTo, cu2.UserID, cu.ReceivedDate AS Date +FROM pm_conversations AS c + LEFT JOIN pm_conversations_users AS cu ON cu.ConvID=c.ID + AND cu.UserID='1' + LEFT JOIN pm_conversations_users AS cu2 ON cu2.ConvID=c.ID + AND cu2.UserID!='1' + AND cu2.ForwardedTo=0 + LEFT JOIN users_main AS um ON um.ID=cu2.UserID +WHERE um.Username LIKE 'test' + AND cu.InInbox='1' +GROUP BY c.ID +ORDER BY cu.Sticky, Date DESC +LIMIT 25 + + +SELECT RequestID AS ID, UserID FROM bookmarks_requests + + +EOF diff --git a/INSTALL.txt b/docs/INSTALL.txt similarity index 100% rename from INSTALL.txt rename to docs/INSTALL.txt diff --git a/sections/collages/all_comments.php b/sections/collages/all_comments.php index ddcd0746..ed9f1cf7 100644 --- a/sections/collages/all_comments.php +++ b/sections/collages/all_comments.php @@ -81,8 +81,8 @@ - # - by Report Comment + # + by Report comment - Quote - Edit - Delete diff --git a/sections/collages/browse.php b/sections/collages/browse.php index 7995d6ee..e07942d3 100644 --- a/sections/collages/browse.php +++ b/sections/collages/browse.php @@ -173,15 +173,15 @@ Tags (comma-separated):   - />   - /> + />   + /> Categories: $Cat) { ?> - > + />    @@ -197,15 +197,14 @@ Order by: @@ -293,7 +292,7 @@ //Print results ?> - + @@ -306,7 +305,7 @@
format('collages.php?action=search&tags=')?>
- + diff --git a/sections/collages/collage.php b/sections/collages/collage.php index d607eb76..ac8e58f3 100644 --- a/sections/collages/collage.php +++ b/sections/collages/collage.php @@ -158,7 +158,7 @@ function compare($X, $Y){
- +
@@ -312,7 +312,7 @@ function compare($X, $Y){ ?> <?=$DisplayName?> - + @@ -409,7 +409,7 @@ function compare($X, $Y){
  • - + X
    @@ -453,11 +453,11 @@ function compare($X, $Y){
    Stats
      -
    • Torrents:
    • +
    • Torrents:
    • -
    • Artists:
    • +
    • Artists:
    • -
    • Built by user1) ? 's' : ''?>
    • +
    • Built by user 1 ? 's' : '')?>
    @@ -482,7 +482,7 @@ function compare($X, $Y){ $i++; if($i>10) { break; } ?> -
  • ()
  • +
  • ()
  • @@ -501,7 +501,7 @@ function compare($X, $Y){ $i++; if($i>5) { break; } ?> -
  • ()
  • +
  • ()
  • @@ -555,7 +555,7 @@ function compare($X, $Y){ list($CommentID, $Body, $UserID, $Username, $CommentTime) = $Comment; ?>
    - +
    full_format($Body)?>
    New thread - Search this forum + Search this forum