Completed
Push — master ( 22fbb6...562c06 )
by Kevin
11:14
created
html/inc/forum.inc 1 patch
Doc Comments   +15 added lines patch added patch discarded remove patch
@@ -220,6 +220,9 @@  discard block
 block discarded – undo
220 220
 // (to accommodate long [pre] lines)
221 221
 // and the left column (author info) has fixed size
222 222
 //
223
+/**
224
+ * @param string[] $headings
225
+ */
223 226
 function start_forum_table($headings) {
224 227
     $a = array();
225 228
     foreach ($headings as $h) {
@@ -500,6 +503,9 @@  discard block
 block discarded – undo
500 503
 // Display an individual post.
501 504
 // Generates a table row with two cells: author and message
502 505
 //
506
+/**
507
+ * @param integer $controls
508
+ */
503 509
 function show_post(
504 510
     $post, $thread, $forum, $logged_in_user, $start=0,
505 511
     $latest_viewed=0, $controls=FORUM_CONTROLS, $filter=true
@@ -875,6 +881,9 @@  discard block
 block discarded – undo
875 881
 // These take care of counts and timestamps.
876 882
 // Don't do these things directly - use these functions
877 883
 //
884
+/**
885
+ * @param integer $parent_id
886
+ */
878 887
 function create_post($content, $parent_id, $user, $forum, $thread, $signature) {
879 888
     if (POST_MAX_LINKS
880 889
         && link_count($content) > POST_MAX_LINKS
@@ -1119,6 +1128,9 @@  discard block
 block discarded – undo
1119 1128
 // $sort_style - string (checked by switch statement)
1120 1129
 // $show_hidden - bool (not directly passed to SQL)
1121 1130
 //
1131
+/**
1132
+ * @param boolean $show_hidden
1133
+ */
1122 1134
 function get_thread_posts($threadid, $sort_style, $show_hidden) {
1123 1135
     $sql = "thread=$threadid";
1124 1136
     if (!$show_hidden) {
@@ -1144,6 +1156,9 @@  discard block
 block discarded – undo
1144 1156
 // Show links for post moderation actions;
1145 1157
 // logged in user has moderation rights.
1146 1158
 //
1159
+/**
1160
+ * @param string $config
1161
+ */
1147 1162
 function show_post_moderation_links(
1148 1163
     $config, $logged_in_user, $post, $forum, $tokens
1149 1164
 ){
Please login to merge, or discard this patch.
html/user/forum_edit.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 
45 45
 $post_owner = BoincUser::lookup_id($post->user);
46 46
 if (($logged_in_user->id != $post_owner->id) || (can_reply($thread, $forum, $logged_in_user) == false)) {
47
-    error_page (tra("You are not authorized to edit this post."));
47
+    error_page(tra("You are not authorized to edit this post."));
48 48
 }
49 49
 
50 50
 $thread_owner = BoincUser::lookup_id($thread->owner);
@@ -53,13 +53,13 @@  discard block
 block discarded – undo
53 53
 // (ie. not a response to another post)
54 54
 // allow the user to modify the thread title
55 55
 //
56
-$can_edit_title = ($post->parent_post==0 && $thread_owner->id==$logged_in_user->id && !is_banished($logged_in_user));
56
+$can_edit_title = ($post->parent_post == 0 && $thread_owner->id == $logged_in_user->id && !is_banished($logged_in_user));
57 57
 
58 58
 $content = post_str("content", true);
59 59
 $title = post_str("title", true);
60 60
 $preview = post_str("preview", true);
61 61
 
62
-if (post_str('submit',true) && (!$preview)) {
62
+if (post_str('submit', true) && (!$preview)) {
63 63
     if (POST_MAX_LINKS
64 64
         && link_count($content) > POST_MAX_LINKS
65 65
         && !is_moderator($logged_in_user, $forum)
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     }
69 69
     check_tokens($logged_in_user->authenticator);
70 70
     
71
-    $add_signature = (post_str('add_signature', true) == "1")?1:0;
71
+    $add_signature = (post_str('add_signature', true) == "1") ? 1 : 0;
72 72
     $content = substr($content, 0, 64000);
73 73
     $content = trim($content);
74 74
     if (strlen($content)) {
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
         $now = time();
77 77
         $post->update("signature=$add_signature, content='$content', modified=$now");
78 78
     
79
-        if ($can_edit_title){
79
+        if ($can_edit_title) {
80 80
             $title = trim($title);
81 81
             $title = sanitize_tags($title);
82 82
             $title = BoincDb::escape_string($title);
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
     }
90 90
 }
91 91
 
92
-page_head(tra("Edit post"),'','','', $bbcode_js);
92
+page_head(tra("Edit post"), '', '', '', $bbcode_js);
93 93
 
94 94
 show_forum_header($logged_in_user);
95 95
 switch ($forum->parent_type) {
@@ -144,9 +144,9 @@  discard block
 block discarded – undo
144 144
 }
145 145
 
146 146
 if ($post->signature) {
147
-    $enable_signature="checked=\"true\"";
147
+    $enable_signature = "checked=\"true\"";
148 148
 } else {
149
-    $enable_signature="";
149
+    $enable_signature = "";
150 150
 }
151 151
 row2("", "<input id=\"add_signature\" name=\"add_signature\" value=\"1\" ".$enable_signature." type=\"checkbox\">
152 152
     <label for=\"add_signature\">".tra("Add my signature to this post")."</label>");
@@ -159,5 +159,5 @@  discard block
 block discarded – undo
159 159
 
160 160
 page_tail();
161 161
 
162
-$cvs_version_tracker[]="\$Id$";  //Generated automatically - do not edit
162
+$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit
163 163
 ?>
Please login to merge, or discard this patch.
html/user/forum_post.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -53,10 +53,10 @@  discard block
 block discarded – undo
53 53
 $preview = post_str("preview", true);
54 54
 $warning = null;
55 55
 
56
-if ($content && $title && (!$preview)){
57
-    if (post_str('add_signature', true) == "add_it"){
58
-        $add_signature = true;    // set a flag and concatenate later
59
-    }  else {
56
+if ($content && $title && (!$preview)) {
57
+    if (post_str('add_signature', true) == "add_it") {
58
+        $add_signature = true; // set a flag and concatenate later
59
+    } else {
60 60
         $add_signature = false;
61 61
     }
62 62
     check_tokens($logged_in_user->authenticator);
@@ -68,14 +68,14 @@  discard block
 block discarded – undo
68 68
             $title, $content, $logged_in_user, $forum, $add_signature, $export
69 69
         );
70 70
         if ($thread) {
71
-            header('Location: forum_thread.php?id=' . $thread->id);
71
+            header('Location: forum_thread.php?id='.$thread->id);
72 72
         } else {
73 73
             error_page("Can't create thread");
74 74
         }
75 75
     }
76 76
 }
77 77
 
78
-page_head(tra("Create new thread"),'','','', $bbcode_js);
78
+page_head(tra("Create new thread"), '', '', '', $bbcode_js);
79 79
 show_forum_header($logged_in_user);
80 80
 
81 81
 if ($warning) {
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
     $submit_help = "<br /><font color=\"red\">".tra("Remember to add a title")."</font>";
116 116
 }
117 117
 
118
-if ($force_title && $title){
118
+if ($force_title && $title) {
119 119
     row2(tra("Title"), htmlspecialchars($title)."<input type=\"hidden\" name=\"title\" value=\"".htmlspecialchars($title)."\">");
120 120
 } else {
121 121
     row2(tra("Title").$submit_help,
@@ -131,9 +131,9 @@  discard block
 block discarded – undo
131 131
 echo "</td></tr>";
132 132
 
133 133
 if (!$logged_in_user->prefs->no_signature_by_default) {
134
-    $enable_signature="checked=\"true\"";
134
+    $enable_signature = "checked=\"true\"";
135 135
 } else {
136
-    $enable_signature="";
136
+    $enable_signature = "";
137 137
 }
138 138
 
139 139
 if (is_news_forum($forum)) {
@@ -149,5 +149,5 @@  discard block
 block discarded – undo
149 149
 
150 150
 page_tail();
151 151
 
152
-$cvs_version_tracker[]="\$Id$";
152
+$cvs_version_tracker[] = "\$Id$";
153 153
 ?>
Please login to merge, or discard this patch.