| ︙ | | | ︙ | |
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
|
zEditorName = zPosterName;
}
zDate = db_text(0, "SELECT datetime(%.17g,toLocal())", p->rDate);
if( p->pEditPrev ){
zPosterName = forum_post_display_name(p->pEditHead, 0);
zEditorName = forum_post_display_name(p, pManifest);
zHist = bHist ? "" : zQuery[0]==0 ? "?hist" : "&hist";
@ <h3 class='forumPostHdr'>(%d(p->sid)\
@ .%0*d(fossil_num_digits(p->nEdit))(p->rev)) \
if( fossil_strcmp(zPosterName, zEditorName)==0 ){
@ By %s(zPosterName) on %h(zDate) edited from \
@ %z(href("%R/forumpost/%S?%s%s",p->pEditPrev->zUuid,zQuery,zHist))\
@ %d(p->sid).%0*d(fossil_num_digits(p->nEdit))(p->pEditPrev->rev)</a>
}else{
@ Originally by %s(zPosterName) \
@ with edits by %s(zEditorName) on %h(zDate) from \
@ %z(href("%R/forumpost/%S%s%s",p->pEditPrev->zUuid,zQuery,zHist))\
@ %d(p->sid).%0*d(fossil_num_digits(p->nEdit))(p->pEditPrev->rev)</a>
}
}else{
zPosterName = forum_post_display_name(p, pManifest);
@ <h3 class='forumPostHdr'>(%d(p->sid)) \
@ By %s(zPosterName) on %h(zDate)
}
fossil_free(zDate);
/* If debugging is enabled, link to the artifact page. */
if( g.perm.Debug ){
|
|
|
|
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
|
zEditorName = zPosterName;
}
zDate = db_text(0, "SELECT datetime(%.17g,toLocal())", p->rDate);
if( p->pEditPrev ){
zPosterName = forum_post_display_name(p->pEditHead, 0);
zEditorName = forum_post_display_name(p, pManifest);
zHist = bHist ? "" : zQuery[0]==0 ? "?hist" : "&hist";
@ <h2 class='forumPostHdr'>(%d(p->sid)\
@ .%0*d(fossil_num_digits(p->nEdit))(p->rev)) \
if( fossil_strcmp(zPosterName, zEditorName)==0 ){
@ By %s(zPosterName) on %h(zDate) edited from \
@ %z(href("%R/forumpost/%S?%s%s",p->pEditPrev->zUuid,zQuery,zHist))\
@ %d(p->sid).%0*d(fossil_num_digits(p->nEdit))(p->pEditPrev->rev)</a>
}else{
@ Originally by %s(zPosterName) \
@ with edits by %s(zEditorName) on %h(zDate) from \
@ %z(href("%R/forumpost/%S%s%s",p->pEditPrev->zUuid,zQuery,zHist))\
@ %d(p->sid).%0*d(fossil_num_digits(p->nEdit))(p->pEditPrev->rev)</a>
}
}else{
zPosterName = forum_post_display_name(p, pManifest);
@ <h2 class='forumPostHdr'>(%d(p->sid)) \
@ By %s(zPosterName) on %h(zDate)
}
fossil_free(zDate);
/* If debugging is enabled, link to the artifact page. */
if( g.perm.Debug ){
|
| ︙ | | | ︙ | |
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
|
@ %z(href("%R/forumpost/%!S%s",p->zUuid,zQuery))[link]</a>
}
/* Provide a link to the raw source code. */
if( !bUnf ){
@ %z(href("%R/forumpost/%!S?raw",p->zUuid))[source]</a>
}
@ </h3>
}
/* Check if this post is approved, also if it's by the current user. */
bPrivate = content_is_private(p->fpid);
bSameUser = login_is_individual()
&& fossil_strcmp(pManifest->zUser, g.zLogin)==0;
|
|
|
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
|
@ %z(href("%R/forumpost/%!S%s",p->zUuid,zQuery))[link]</a>
}
/* Provide a link to the raw source code. */
if( !bUnf ){
@ %z(href("%R/forumpost/%!S?raw",p->zUuid))[source]</a>
}
@ </h2>
}
/* Check if this post is approved, also if it's by the current user. */
bPrivate = content_is_private(p->fpid);
bSameUser = login_is_individual()
&& fossil_strcmp(pManifest->zUser, g.zLogin)==0;
|
| ︙ | | | ︙ | |
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
|
**
** Show a single forum posting. The posting is shown in context with
** its entire thread. The selected posting is enclosed within
** <div class='forumSel'>...</div>. Javascript is used to move the
** selected posting into view after the page loads.
**
** Query parameters:
**
** name=X REQUIRED. The hash of the post to display.
** t=a Automatic display mode, i.e. hierarchical for
** desktop and chronological for mobile. This is the
** default if the "t" query parameter is omitted.
** t=c Show posts in the order they were written.
** t=h Show posts using hierarchical indenting.
** t=s Show only the post specified by "name=X".
|
<
|
791
792
793
794
795
796
797
798
799
800
801
802
803
804
|
**
** Show a single forum posting. The posting is shown in context with
** its entire thread. The selected posting is enclosed within
** <div class='forumSel'>...</div>. Javascript is used to move the
** selected posting into view after the page loads.
**
** Query parameters:
** name=X REQUIRED. The hash of the post to display.
** t=a Automatic display mode, i.e. hierarchical for
** desktop and chronological for mobile. This is the
** default if the "t" query parameter is omitted.
** t=c Show posts in the order they were written.
** t=h Show posts using hierarchical indenting.
** t=s Show only the post specified by "name=X".
|
| ︙ | | | ︙ | |
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
|
** WEBPAGE: forumthread
**
** Show all forum messages associated with a particular message thread.
** The result is basically the same as /forumpost except that none of
** the postings in the thread are selected.
**
** Query parameters:
**
** name=X REQUIRED. The hash of any post of the thread.
** t=a Automatic display mode, i.e. hierarchical for
** desktop and chronological for mobile. This is the
** default if the "t" query parameter is omitted.
** t=c Show posts in the order they were written.
** t=h Show posts using hierarchical indenting.
** unf Show the original, unformatted source text.
|
<
|
817
818
819
820
821
822
823
824
825
826
827
828
829
830
|
** WEBPAGE: forumthread
**
** Show all forum messages associated with a particular message thread.
** The result is basically the same as /forumpost except that none of
** the postings in the thread are selected.
**
** Query parameters:
** name=X REQUIRED. The hash of any post of the thread.
** t=a Automatic display mode, i.e. hierarchical for
** desktop and chronological for mobile. This is the
** default if the "t" query parameter is omitted.
** t=c Show posts in the order they were written.
** t=h Show posts using hierarchical indenting.
** unf Show the original, unformatted source text.
|
| ︙ | | | ︙ | |
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
|
*/
static void forum_post_widget(
const char *zTitle,
const char *zMimetype,
const char *zContent
){
if( zTitle ){
@ Title: <input type="input" name="title" value="%h(zTitle)" size="50"
@ maxlength="125"><br>
}
@ %z(href("%R/markup_help"))Markup style</a>:
mimetype_option_menu(zMimetype);
@ <br><textarea aria-label="Content:" name="content" class="wikiedit" \
@ cols="80" rows="25" wrap="virtual">%h(zContent)</textarea><br>
}
/*
** WEBPAGE: forumnew
** WEBPAGE: forumedit
**
** Start a new thread on the forum or reply to an existing thread.
|
|
|
>
|
>
|
|
|
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
|
*/
static void forum_post_widget(
const char *zTitle,
const char *zMimetype,
const char *zContent
){
if( zTitle ){
@ <label>Title: <input type="input" name="title" value="%h(zTitle)" size="50"
@ maxlength="125"></label><br>
}
@ <label>Markup style
@ %z(href("%R/markup_help"))
@ <span class="help-buttonlet processed" title="Help"></span></a>:
mimetype_option_menu(zMimetype);
@ </label><br><textarea aria-label="Content" title="Content" name="content" \
@ class="wikiedit" cols="80" rows="25" wrap="virtual">%h(zContent)</textarea><br>
}
/*
** WEBPAGE: forumnew
** WEBPAGE: forumedit
**
** Start a new thread on the forum or reply to an existing thread.
|
| ︙ | | | ︙ | |
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
|
style_finish_page();
}
/*
** WEBPAGE: forume2
**
** Edit an existing forum message.
** Query parameters:
**
** fpid=X Hash of the post to be edited. REQUIRED
*/
void forumedit_page(void){
int fpid;
int froot;
Manifest *pPost = 0;
Manifest *pRootPost = 0;
|
<
>
|
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
|
style_finish_page();
}
/*
** WEBPAGE: forume2
**
** Edit an existing forum message.
**
** Query parameters:
** fpid=X Hash of the post to be edited. REQUIRED
*/
void forumedit_page(void){
int fpid;
int froot;
Manifest *pPost = 0;
Manifest *pRootPost = 0;
|
| ︙ | | | ︙ | |
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
|
** WEBPAGE: forum
**
** The main page for the forum feature. Show a list of recent forum
** threads. Also show a search box at the top if search is enabled,
** and a button for creating a new thread, if enabled.
**
** Query parameters:
**
** n=N The number of threads to show on each page
** x=X Skip the first X threads
** s=Y Search for term Y.
*/
void forum_main_page(void){
Stmt q;
int iLimit, iOfst, iCnt;
|
<
|
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
|
** WEBPAGE: forum
**
** The main page for the forum feature. Show a list of recent forum
** threads. Also show a search box at the top if search is enabled,
** and a button for creating a new thread, if enabled.
**
** Query parameters:
** n=N The number of threads to show on each page
** x=X Skip the first X threads
** s=Y Search for term Y.
*/
void forum_main_page(void){
Stmt q;
int iLimit, iOfst, iCnt;
|
| ︙ | | | ︙ | |