.\" Automatically generated by Pod::Man version 1.15 .\" Wed May 5 11:41:23 2004 .\" .\" Standard preamble: .\" ====================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used .\" to do unbreakable dashes and therefore won't be available. \*(C` and .\" \*(C' expand to `' in nroff, nothing in troff, for use with C<> .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" If the F register is turned on, we'll generate index entries on stderr .\" for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and .\" index entries marked with X<> in POD. Of course, you'll have to process .\" the output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .\" .\" For nroff, turn off justification. Always turn off hyphenation; it .\" makes way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. .bd B 3 . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ====================================================================== .\" .IX Title "ic_howto_forum 8" .TH ic_howto_forum 8 "Interchange 5.2.0" "2004-05-05" "Interchange" .UC .SH "NAME" ic_howto_forum \- Interchange + Forum/Blog \s-1HOWTO\s0 .SH "DESCRIPTION" .IX Header "DESCRIPTION" .SH "Introduction" .IX Header "Introduction" .Sh "Preamble" .IX Subsection "Preamble" Copyright 2002\-2004 Mike Heins and Michael Wilk . Freely redistributable under terms of the \s-1GNU\s0 General Public License. .Sh "Purpose" .IX Subsection "Purpose" The purpose of this document is to expose how to use Interchange 5.0's forum and blog capability, enabled with the [forum ...] tag and a few ancilliary files. .Sh "Audience" .IX Subsection "Audience" Anyone who is using an Interchange catalog. This is not rocket science. .Sh "Contact the authors" .IX Subsection "Contact the authors" If you find any spelling errors, technical slip-ups, mistakes, subliminal messages, or if you wish to send feedback, critique, remarks, comments, or if you wish to contribute examples, instructions for alternative platforms, chapters, or other material, please do so. .PP The preferred method of submitting changes is in the form of a context diff against the \s-1SDF\s0 source file (ic_howto_forum.sdf). Please address your correspondence to: .PP Michael Wilk \fImwilk@steppenwolf.com\fR .PP Mike Heins \fImike.heins@perusion.net\fR .Sh "What it does" .IX Subsection "What it does" Interchange forums allow your customers to comment on your products, or allow you to sponsor discussion threads on an interchange catalog. They maintain their content in a single database table named forum. .SH "Component files of the forums" .IX Header "Component files of the forums" There are two directories to add to your foundation catalog \-\- include/forum and pages/forum. You must add a database table definition, as well as a database source file. You should add Variable support to the variable.txt database, and supporting metadata with help. Finally, you need to add the forum.tag file which contains the forum code. .PP If you build a foundation catalog from the latest Interchange source, all of these will be done already. .PP The files that are needed in the catalog directory: .PP .Vb 9 \& dbconf/default_db/forum.dbm \& dbconf/mysql/forum.mysql \& dbconf/pgsql/forum.pgsql \& include/forum/reply_form \& include/forum/submit_form \& pages/forum/reply.html \& pages/forum/display.html \& pages/forum/submit.html \& products/forum.txt .Ve The files that are needed in the Interchange software directory: .PP .Vb 1 \& code/UserTag/forum.tag .Ve Add the following lines to products/variable.txt (change | to \s-1TAB\s0): .PP .Vb 3 \& FORUM_ANON_NAME|Anonymous Coward|Forums \&FORUM_PRODUCTS|1|Forums \&FORUM_EMAIL_NOTIFY|sales@yourcompany.com|Forums .Ve Add the following records to products/mv_metadata.asc (shown in key: value format, edit file to match with \*(L"te\*(R" or some other tool): .PP .Vb 77 \& # \&# This is a temporary file, automatically generated from the \&# database file: \&# \&# /tmp/what.txt \&# \&# If you change anything in it, it will be converted back into the \&# original format and will replace the original file. \&# \&code:variable::Variable::FORUM_EMAIL_NOTIFY \&type:text \&width:50 \&height: \&field: \&db: \&name: \&outboard: \&options: \&attribute: \&label:Forum notify email \&help:An email address to send copies of user comments on products. \&lookup: \&filter: \&help_url: \&pre_filter: \&lookup_exclude: \&prepend: \&append: \&display_filter: \&default: \&extended: \&# \&code:variable::Variable::FORUM_ANON_NAME \&type:text \&width:20 \&height: \&field: \&db: \&name: \&outboard: \&options: \&attribute: \&label:Forum Anonymous Name \&help:Name to use when a user posts anonymously to a forum \&lookup: \&filter: \&help_url: \&pre_filter: \&lookup_exclude: \&prepend: \&append: \&display_filter: \&default: \&extended: \&# \&code:variable::Variable::FORUM_PRODUCTS \&type:yesno \&width: \&height: \&field: \&db: \&name: \&outboard: \&options: \&attribute: \&label:Enable Product Forums \&help:This enables user comments on products in the flypage. \&lookup: \&filter: \&help_url: \&pre_filter: \&lookup_exclude: \&prepend: \&append: \&display_filter: \&default: \&extended: .Ve Add the following block to pages/flypage.html: .PP .Vb 15 \& [if variable FORUM_PRODUCTS] \& \& \& [forum top="[item-code]" display_page="forum/display" /] \&

\& [page href="forum/reply" \& form=" \& product=1 \& mv_arg=[item-code] \& " \& ]Comment on this product. \&

\& \& \& [/if] .Ve This would normally go at the end of the table displaying the product, but you can place and edit to suit. .PP Again, all of this is provided if you have installed from the latest Interchange 4.9.4 or higher. .SH "The [forum] ITL Tag" .IX Header "The [forum] ITL Tag" The [forum] tag is what provides the capability. It uses the forum table and follows tree-like threads in that table. .PP It has one required parameter, top. That gives the id of the message that is the top of the thread to display. .PP This is a complete forum display for a product: .PP .Vb 1 \& [forum top="[item-code]" /] .Ve You will see something like that in the snip from pages/flypage.html above. .PP You can pass many more parameters to the [forum] tag. Some of them are: .Ip "display-page" 4 .IX Item "display-page" .PP By default, the [forum ...] tag uses the current page to link to to re-display the forum at another level. Normally this works fine, but on a product flypage it will not work. You must pass in a different page. .PP .Vb 1 \& [forum top="[item-code]" display-page="forum/display" /] .Ve .Ip "show-level" 4 .IX Item "show-level" .PP By default, [forum] only displays the text of top-level replies to the current thread. If you want to display more levels, set the show-level parameter to 1 or higher: .PP .Vb 1 \& [forum top="[data session arg]" show-level=3 /] .Ve The above will show the first four levels of replies, with links to any further down the tree. .Ip "scrub-score" 4 .IX Item "scrub-score" .PP If you want to moderate certain comments so that their text won't be shown, you can set the scrub-score parameter to \-1 and then set the score field in the message's database record to \-1. By default, it is linked to with a message: .PP .Vb 1 \& One message beneath your threshold .Ve If you want to totally disable the appearance of the link and message, set the scrub-template to something: .PP .Vb 4 \& [forum top=THREAD \& scrub-score="-1" \& scrub-template="" \& /] .Ve .Ip "show-score" 4 .IX Item "show-score" .PP By default, if a message has a score of two or higher, it's text will be shown no matter what level of display it is on. You can set that threshold with this paramter. .Ip "template" 4 .IX Item "template" .PP You can set the template that displays replies with this parameter. You can also pass this as the container text for the [forum] tag, i.e.: .PP .Vb 21 \& [forum top="[data session arg]"] \& \& \& \& \& \& \& \& \&
\& {SUBJECT} \& by {USERINFO} \& on {DATE} \& \& [ \& Reply \& ] \&
\& {COMMENT} \&
\& [/forum] .Ve See pages/forum/display.html for an example. .Ip "header-template" 4 .IX Item "header-template" .PP You can set the header template that displays the top-level message with this parameter. See pages/forum/display.html for an example. .Ip "link-template" 4 .IX Item "link-template" .PP You can set the template that displays the links to messages that are not shown with this parameter. See pages/forum/display.html for an example. .Ip "scrub-template" 4 .IX Item "scrub-template" .PP The template for a message that has a score lower than scrub-score. See pages/forum/display.html for an example. .Ip "threshold-message" 4 .IX Item "threshold-message" .PP The message displayed in the default scrub-template when a message is scrubbed. If you set the scrub-template yourself, it is ignored. .Ip "display-page" 4 .IX Item "display-page" .PP The page linked to with {\s-1DISPLAY_URL\s0}. Default is the current page. See \fBTemplating\fR below. .Ip "reply-page" 4 .IX Item "reply-page" .PP The page linked to with {\s-1REPLY_URL\s0}. Default is forum/reply.html. See \fBTemplating\fR below. .Ip "submit-page" 4 .IX Item "submit-page" .PP The page linked to with {\s-1SUBMIT_URL\s0}. Default is forum/submit.html. See \fBTemplating\fR below. .Ip "date-format" 4 .IX Item "date-format" .PP The format for the date provided with {\s-1DATE\s0}. Default is \f(CW%B\fR \f(CW%e\fR, \f(CW%Y\fR @%H:%M, which provides a date like October 5, 2002 \f(CW@21:19\fR. .SH "Templating" .IX Header "Templating" All of the [forum] display mechanisms are templated. You can pass four templates \*(-- template, header-template, link-template, and scrub-template. .PP They use the substitution style found in Interchange's attr-list \&\s-1ITL\s0 tag. .PP The following values are available for templating: .PP .Vb 16 \& ADDITIONAL Additional text normally only used at the top level \& COMMENT Text of the message \& CREATED Created date in ISO format \& DATE Date the comment was made \& DISPLAY_URL URL to display the forum with a new starting point \& FORUM_APPEND End indent tags for item (automatic, don't use) \& FORUM_PREPEND Begin indent