| | @@ -47,11 +47,11 @@ |
| 47 | 47 | ForumPost *pNext; /* Next in chronological order */ |
| 48 | 48 | ForumPost *pPrev; /* Previous in chronological order */ |
| 49 | 49 | ForumPost *pDisplay; /* Next in display order */ |
| 50 | 50 | int nEdit; /* Number of edits to this post */ |
| 51 | 51 | int nIndent; /* Number of levels of indentation for this post */ |
| 52 | | - int fClosed; /* See forum_rid_is_closed() */ |
| 52 | + int iClosed; /* See forum_rid_is_closed() */ |
| 53 | 53 | }; |
| 54 | 54 | |
| 55 | 55 | /* |
| 56 | 56 | ** A single instance of the following tracks all entries for a thread. |
| 57 | 57 | */ |
| | @@ -93,11 +93,11 @@ |
| 93 | 93 | ** (recursively) for closure, else only p is checked. |
| 94 | 94 | */ |
| 95 | 95 | int forum_post_is_closed(ForumPost *p, int bCheckParents){ |
| 96 | 96 | if( !p ) return 0; |
| 97 | 97 | if( p->pEditTail ) p = p->pEditTail; |
| 98 | | - if( p->fClosed || !bCheckParents ) return p->fClosed; |
| 98 | + if( p->iClosed || !bCheckParents ) return p->iClosed; |
| 99 | 99 | else if( p->pIrt ){ |
| 100 | 100 | return forum_post_is_closed(p->pIrt->pEditTail |
| 101 | 101 | ? p->pIrt->pEditTail : p->pIrt, |
| 102 | 102 | bCheckParents); |
| 103 | 103 | } |
| | @@ -144,19 +144,19 @@ |
| 144 | 144 | } |
| 145 | 145 | return rc>0 ? -rc : rc; |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | /* |
| 149 | | -** If fClosed is true and the current user has admin privileges, this |
| 150 | | -** renders either a checkbox to unlock forum post fpid (if fClosed>0) |
| 149 | +** If iClosed is true and the current user has admin privileges, this |
| 150 | +** renders either a checkbox to unlock forum post fpid (if iClosed>0) |
| 151 | 151 | ** or a SPAN.warning element that the given post inherits the CLOSED |
| 152 | | -** status from a parent post (if fClosed<0). If neither of the initial |
| 152 | +** status from a parent post (if iClosed<0). If neither of the initial |
| 153 | 153 | ** conditions is true, this is a no-op. |
| 154 | 154 | */ |
| 155 | | -static void forumpost_emit_unlock_checkbox(int fClosed, int fpid){ |
| 156 | | - if( fClosed && g.perm.Admin ){ |
| 157 | | - if( fClosed>0 ){ |
| 155 | +static void forumpost_emit_unlock_checkbox(int iClosed, int fpid){ |
| 156 | + if( iClosed && g.perm.Admin ){ |
| 157 | + if( iClosed>0 ){ |
| 158 | 158 | /* Only show the "unlock" checkbox on a post which is actually |
| 159 | 159 | ** closed, not on a post which inherits that state. */ |
| 160 | 160 | @ <label class='warning'><input type="checkbox" name="reopen" value="1"> |
| 161 | 161 | @ Re-open this CLOSED post? (NOT YET IMPLEMENTED)</label> |
| 162 | 162 | }else{ |
| | @@ -308,11 +308,11 @@ |
| 308 | 308 | for(; p; p=p->pEditPrev ){ |
| 309 | 309 | p->nEdit = pPost->nEdit; |
| 310 | 310 | p->pEditTail = pPost; |
| 311 | 311 | } |
| 312 | 312 | } |
| 313 | | - pPost->fClosed = forum_rid_is_closed(pPost->fpid, 1); |
| 313 | + pPost->iClosed = forum_rid_is_closed(pPost->fpid, 1); |
| 314 | 314 | } |
| 315 | 315 | db_finalize(&q); |
| 316 | 316 | |
| 317 | 317 | if( computeHierarchy ){ |
| 318 | 318 | /* Compute the hierarchical display order */ |
| | @@ -398,11 +398,11 @@ |
| 398 | 398 | /* 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123 */ |
| 399 | 399 | " sid rev closed fpid pIrt pEditPrev pEditTail hash\n"); |
| 400 | 400 | for(p=pThread->pFirst; p; p=p->pNext){ |
| 401 | 401 | fossil_print("%4d %4d %7d %9d %9d %9d %9d %8.8s\n", |
| 402 | 402 | p->sid, p->rev, |
| 403 | | - p->fClosed, |
| 403 | + p->iClosed, |
| 404 | 404 | p->fpid, p->pIrt ? p->pIrt->fpid : 0, |
| 405 | 405 | p->pEditPrev ? p->pEditPrev->fpid : 0, |
| 406 | 406 | p->pEditTail ? p->pEditTail->fpid : 0, p->zUuid); |
| 407 | 407 | } |
| 408 | 408 | fossil_print("\nDisplay\n"); |
| | @@ -554,25 +554,25 @@ |
| 554 | 554 | char *zHist; /* History query string */ |
| 555 | 555 | Manifest *pManifest; /* Manifest comprising the current post */ |
| 556 | 556 | int bPrivate; /* True for posts awaiting moderation */ |
| 557 | 557 | int bSameUser; /* True if author is also the reader */ |
| 558 | 558 | int iIndent; /* Indent level */ |
| 559 | | - int fClosed; /* True if (sub)thread is closed */ |
| 559 | + int iClosed; /* True if (sub)thread is closed */ |
| 560 | 560 | const char *zMimetype;/* Formatting MIME type */ |
| 561 | 561 | |
| 562 | 562 | /* Get the manifest for the post. Abort if not found (e.g. shunned). */ |
| 563 | 563 | pManifest = manifest_get(p->fpid, CFTYPE_FORUM, 0); |
| 564 | 564 | if( !pManifest ) return; |
| 565 | | - fClosed = forum_post_is_closed(p, 1); |
| 565 | + iClosed = forum_post_is_closed(p, 1); |
| 566 | 566 | /* When not in raw mode, create the border around the post. */ |
| 567 | 567 | if( !bRaw ){ |
| 568 | 568 | /* Open the <div> enclosing the post. Set the class string to mark the post |
| 569 | 569 | ** as selected and/or obsolete. */ |
| 570 | 570 | iIndent = (p->pEditHead ? p->pEditHead->nIndent : p->nIndent)-1; |
| 571 | 571 | @ <div id='forum%d(p->fpid)' class='forumTime\ |
| 572 | 572 | @ %s(bSelect ? " forumSel" : "")\ |
| 573 | | - @ %s(fClosed ? " forumClosed" : "")\ |
| 573 | + @ %s(iClosed ? " forumClosed" : "")\ |
| 574 | 574 | @ %s(p->pEditTail ? " forumObs" : "")' \ |
| 575 | 575 | if( iIndent && iIndentScale ){ |
| 576 | 576 | @ style='margin-left:%d(iIndent*iIndentScale)ex;'> |
| 577 | 577 | }else{ |
| 578 | 578 | @ > |
| | @@ -683,13 +683,13 @@ |
| 683 | 683 | if( !bPrivate ){ |
| 684 | 684 | /* Reply and Edit are only available if the post has been |
| 685 | 685 | ** approved. Closed threads can only be edited or replied to |
| 686 | 686 | ** by an admin but a user may delete their own posts even if |
| 687 | 687 | ** they are closed. */ |
| 688 | | - if( g.perm.Admin || !fClosed ){ |
| 688 | + if( g.perm.Admin || !iClosed ){ |
| 689 | 689 | @ <input type="submit" name="reply" value="Reply"> |
| 690 | | - if( g.perm.Admin || (bSameUser && !fClosed) ){ |
| 690 | + if( g.perm.Admin || (bSameUser && !iClosed) ){ |
| 691 | 691 | @ <input type="submit" name="edit" value="Edit"> |
| 692 | 692 | } |
| 693 | 693 | if( g.perm.Admin || bSameUser ){ |
| 694 | 694 | @ <input type="submit" name="nullout" value="Delete"> |
| 695 | 695 | } |
| | @@ -1317,11 +1317,11 @@ |
| 1317 | 1317 | const char *zTitle = 0; |
| 1318 | 1318 | char *zDate = 0; |
| 1319 | 1319 | const char *zFpid = PD("fpid",""); |
| 1320 | 1320 | int isCsrfSafe; |
| 1321 | 1321 | int isDelete = 0; |
| 1322 | | - int fClosed = 0; |
| 1322 | + int iClosed = 0; |
| 1323 | 1323 | int bSameUser; /* True if author is also the reader */ |
| 1324 | 1324 | int bPreview; /* True in preview mode. */ |
| 1325 | 1325 | int bPrivate; /* True if post is private (not yet moderated) */ |
| 1326 | 1326 | |
| 1327 | 1327 | login_check_credentials(); |
| | @@ -1340,11 +1340,11 @@ |
| 1340 | 1340 | if( P("cancel") ){ |
| 1341 | 1341 | cgi_redirectf("%R/forumpost/%S",P("fpid")); |
| 1342 | 1342 | return; |
| 1343 | 1343 | } |
| 1344 | 1344 | bPreview = P("preview")!=0; |
| 1345 | | - fClosed = forum_rid_is_closed(fpid, froot!=fpid); |
| 1345 | + iClosed = forum_rid_is_closed(fpid, froot!=fpid); |
| 1346 | 1346 | isCsrfSafe = cgi_csrf_safe(1); |
| 1347 | 1347 | bPrivate = content_is_private(fpid); |
| 1348 | 1348 | bSameUser = login_is_individual() |
| 1349 | 1349 | && fossil_strcmp(pPost->zUser, g.zLogin)==0; |
| 1350 | 1350 | if( isCsrfSafe && (g.perm.ModForum || (bPrivate && bSameUser)) ){ |
| | @@ -1436,11 +1436,11 @@ |
| 1436 | 1436 | } |
| 1437 | 1437 | @ <h2>Revised Message:</h2> |
| 1438 | 1438 | @ <form action="%R/forume2" method="POST"> |
| 1439 | 1439 | @ <input type="hidden" name="fpid" value="%h(P("fpid"))"> |
| 1440 | 1440 | @ <input type="hidden" name="edit" value="1"> |
| 1441 | | - if( fClosed ) forumpost_error_closed(); |
| 1441 | + if( iClosed ) forumpost_error_closed(); |
| 1442 | 1442 | forum_from_line(); |
| 1443 | 1443 | forum_post_widget(zTitle, zMimetype, zContent); |
| 1444 | 1444 | }else{ |
| 1445 | 1445 | /* Reply */ |
| 1446 | 1446 | char *zDisplayName; |
| | @@ -1466,24 +1466,24 @@ |
| 1466 | 1466 | } |
| 1467 | 1467 | @ <h2>Enter Reply:</h2> |
| 1468 | 1468 | @ <form action="%R/forume2" method="POST"> |
| 1469 | 1469 | @ <input type="hidden" name="fpid" value="%h(P("fpid"))"> |
| 1470 | 1470 | @ <input type="hidden" name="reply" value="1"> |
| 1471 | | - if( fClosed ) forumpost_error_closed(); |
| 1471 | + if( iClosed ) forumpost_error_closed(); |
| 1472 | 1472 | forum_from_line(); |
| 1473 | 1473 | forum_post_widget(0, zMimetype, zContent); |
| 1474 | 1474 | } |
| 1475 | 1475 | if( !isDelete ){ |
| 1476 | 1476 | @ <input type="submit" name="preview" value="Preview"> |
| 1477 | 1477 | } |
| 1478 | 1478 | @ <input type="submit" name="cancel" value="Cancel"> |
| 1479 | 1479 | if( (bPreview && !whitespace_only(zContent)) || isDelete ){ |
| 1480 | | - if( !fClosed || g.perm.Admin ) { |
| 1480 | + if( !iClosed || g.perm.Admin ) { |
| 1481 | 1481 | @ <input type="submit" name="submit" value="Submit"> |
| 1482 | 1482 | } |
| 1483 | | - forumpost_emit_unlock_checkbox(fClosed, fpid); |
| 1484 | | - }else if( !bPreview && fClosed ){ |
| 1483 | + forumpost_emit_unlock_checkbox(iClosed, fpid); |
| 1484 | + }else if( !bPreview && iClosed ){ |
| 1485 | 1485 | @ <span class='warning'>This post is CLOSED</span> |
| 1486 | 1486 | } |
| 1487 | 1487 | if( g.perm.Debug ){ |
| 1488 | 1488 | /* For the test-forumnew page add these extra debugging controls */ |
| 1489 | 1489 | @ <div class="debug"> |
| 1490 | 1490 | |