You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// allow edits of forums posts up till one hour after posting.
65
+
// allow edits of forums posts up to one hour after posting.
66
+
}
67
+
68
+
if (!defined('NEED_CREDIT_TO_POST_EXCEPT_HELP')) {
69
+
define('NEED_CREDIT_TO_POST_EXCEPT_HELP', true);
66
70
}
67
71
68
72
define('MAX_FORUM_LOGGING_TIME', 2419200); //3600*24*28 - 28 days
@@ -1275,20 +1279,24 @@ function is_admin($user) {
1275
1279
returnfalse;
1276
1280
}
1277
1281
1278
-
// return
1279
-
// 'yes' if logged in and can post (show New thread button)
1280
-
// 'login' if could post if logged in (show login to post msg)
1281
-
// 'no' if can't post (don't show anythin)
1282
+
// should we show a 'new thread' button in a forum page?
1283
+
// Note: we show the button even if in some cases
1284
+
// an attempt to post will fail (see below)
1282
1285
//
1283
-
functionuser_can_create_thread($user, $forum) {
1286
+
functionshow_post_button($user, $forum) {
1284
1287
if ($forum->is_dev_blog) {
1285
-
returnis_admin($user)?'yes':'no';
1288
+
returnis_admin($user);
1286
1289
}
1287
-
return$user ?'yes':'login';
1290
+
returntrue;
1288
1291
}
1289
1292
1293
+
// If the user is not allowed to post to the forum, show an error page.
1294
+
//
1290
1295
functioncheck_post_access($user, $forum) {
1291
1296
if (is_admin($user)) return;
1297
+
if ($forum->is_dev_blog) {
1298
+
error_page("Can't post to News");
1299
+
}
1292
1300
1293
1301
switch ($forum->parent_type) {
1294
1302
case0:
@@ -1306,34 +1314,49 @@ function check_post_access($user, $forum) {
1306
1314
break;
1307
1315
}
1308
1316
1309
-
// If user haven't got enough credit (according to forum regulations)
1310
-
// We do not tell the (ab)user how much this is -
1317
+
// check if user has enough credit according to forum settings.
1318
+
// We don't tell the user how much this is -
1311
1319
// no need to make it easy for them to break the system.
1312
1320
//
1313
-
if ($user->total_credit<$forum->post_min_total_credit || $user->expavg_credit<$forum->post_min_expavg_credit) {
1314
-
error_page(tra("To create a new thread in %1 you must have a certain level of average credit. This is to protect against abuse of the system.", $forum->title));
1321
+
if ($user->total_credit<$forum->post_min_total_credit
0 commit comments