Fossil SCM
Show the FORUMPOST table content associated with a forum thread on the /forumthreadhashlist page (accessible by admins only).
Commit
042a750aa60d2a643d8e1e22d787b8bbbed23c1f6302c05fbf375247b1bd5d32
Parent
923aa7534586349…
1 file changed
+18
+18
| --- src/forum.c | ||
| +++ src/forum.c | ||
| @@ -573,10 +573,11 @@ | ||
| 573 | 573 | int froot; |
| 574 | 574 | const char *zName = P("name"); |
| 575 | 575 | ForumThread *pThread; |
| 576 | 576 | ForumPost *p; |
| 577 | 577 | char *fuuid; |
| 578 | + Stmt q; | |
| 578 | 579 | |
| 579 | 580 | login_check_credentials(); |
| 580 | 581 | if( !g.perm.Admin ){ |
| 581 | 582 | return; |
| 582 | 583 | } |
| @@ -607,10 +608,27 @@ | ||
| 607 | 608 | for(p=pThread->pFirst; p; p=p->pNext){ |
| 608 | 609 | @ %h(p->zUuid) |
| 609 | 610 | } |
| 610 | 611 | forumthread_delete(pThread); |
| 611 | 612 | @ </pre> |
| 613 | + @ <hr> | |
| 614 | + @ <h2>Related FORUMPOST Table Content</h2> | |
| 615 | + @ <table border="1" cellpadding="4" cellspacing="0"> | |
| 616 | + @ <tr><th>fpid<th>froot<th>fprev<th>firt<th>fmtime | |
| 617 | + db_prepare(&q, "SELECT fpid, froot, fprev, firt, datetime(fmtime)" | |
| 618 | + " FROM forumpost" | |
| 619 | + " WHERE froot=%d" | |
| 620 | + " ORDER BY fmtime", froot); | |
| 621 | + while( db_step(&q)==SQLITE_ROW ){ | |
| 622 | + @ <tr><td>%d(db_column_int(&q,0))\ | |
| 623 | + @ <td>%d(db_column_int(&q,1))\ | |
| 624 | + @ <td>%d(db_column_int(&q,2))\ | |
| 625 | + @ <td>%d(db_column_int(&q,3))\ | |
| 626 | + @ <td>%h(db_column_text(&q,4))</tr> | |
| 627 | + } | |
| 628 | + @ </table> | |
| 629 | + db_finalize(&q); | |
| 612 | 630 | style_finish_page(); |
| 613 | 631 | } |
| 614 | 632 | |
| 615 | 633 | /* |
| 616 | 634 | ** Render a forum post for display |
| 617 | 635 |
| --- src/forum.c | |
| +++ src/forum.c | |
| @@ -573,10 +573,11 @@ | |
| 573 | int froot; |
| 574 | const char *zName = P("name"); |
| 575 | ForumThread *pThread; |
| 576 | ForumPost *p; |
| 577 | char *fuuid; |
| 578 | |
| 579 | login_check_credentials(); |
| 580 | if( !g.perm.Admin ){ |
| 581 | return; |
| 582 | } |
| @@ -607,10 +608,27 @@ | |
| 607 | for(p=pThread->pFirst; p; p=p->pNext){ |
| 608 | @ %h(p->zUuid) |
| 609 | } |
| 610 | forumthread_delete(pThread); |
| 611 | @ </pre> |
| 612 | style_finish_page(); |
| 613 | } |
| 614 | |
| 615 | /* |
| 616 | ** Render a forum post for display |
| 617 |
| --- src/forum.c | |
| +++ src/forum.c | |
| @@ -573,10 +573,11 @@ | |
| 573 | int froot; |
| 574 | const char *zName = P("name"); |
| 575 | ForumThread *pThread; |
| 576 | ForumPost *p; |
| 577 | char *fuuid; |
| 578 | Stmt q; |
| 579 | |
| 580 | login_check_credentials(); |
| 581 | if( !g.perm.Admin ){ |
| 582 | return; |
| 583 | } |
| @@ -607,10 +608,27 @@ | |
| 608 | for(p=pThread->pFirst; p; p=p->pNext){ |
| 609 | @ %h(p->zUuid) |
| 610 | } |
| 611 | forumthread_delete(pThread); |
| 612 | @ </pre> |
| 613 | @ <hr> |
| 614 | @ <h2>Related FORUMPOST Table Content</h2> |
| 615 | @ <table border="1" cellpadding="4" cellspacing="0"> |
| 616 | @ <tr><th>fpid<th>froot<th>fprev<th>firt<th>fmtime |
| 617 | db_prepare(&q, "SELECT fpid, froot, fprev, firt, datetime(fmtime)" |
| 618 | " FROM forumpost" |
| 619 | " WHERE froot=%d" |
| 620 | " ORDER BY fmtime", froot); |
| 621 | while( db_step(&q)==SQLITE_ROW ){ |
| 622 | @ <tr><td>%d(db_column_int(&q,0))\ |
| 623 | @ <td>%d(db_column_int(&q,1))\ |
| 624 | @ <td>%d(db_column_int(&q,2))\ |
| 625 | @ <td>%d(db_column_int(&q,3))\ |
| 626 | @ <td>%h(db_column_text(&q,4))</tr> |
| 627 | } |
| 628 | @ </table> |
| 629 | db_finalize(&q); |
| 630 | style_finish_page(); |
| 631 | } |
| 632 | |
| 633 | /* |
| 634 | ** Render a forum post for display |
| 635 |