3 CXGN::People::Forum - classes to handle the SOL forum on the SGN website.
7 The Forum comprises three main classes:
17 CXGN::People::Forum::Topic
21 CXGN::People::Forum::Post
25 These are described in more detail below.
29 Lukas Mueller (lam87@cornell.edu)
34 require CXGN
::Contact
;
35 use CXGN
::People
::Forum
::Topic
;
36 use CXGN
::People
::Forum
::Post
;
38 =head1 PACKAGE CXGN::People::Forum
40 Parent class of CXGN::People::* classes that essentially handles database access and provides utility functions used by all subclasses.
44 package CXGN
::People
::Forum
;
46 #use base qw( CXGN::Class::DBI );
47 use base qw
| CXGN
::DB
::Object
|;
54 Returns: a CXGN::People::Forum object
55 Side effects: establishes a connection to the database
56 Description: should not be called explicitly, but rather
57 by subclasses of this class.
65 my $self = $class->SUPER::new
($dbh);
70 =head2 function format_post_text()
76 Description: formats a post or topic text for display.
77 Note that it converts certain embedded tags to
78 html links. This function does not assure security
79 - use the get_encoded_arguments in the CXGN::Page
80 object for that purpose.
84 sub format_post_text
{
86 my $post_text = shift;
88 # support vB script url tag
89 while ($post_text =~ /\[url\](.*?)\[\/url\
]/g
) {
91 my $replace_link = $link;
92 if ($link !~ /^http/i) {
93 $replace_link = "http:\/\/$link";
95 $post_text =~ s/\[url\]$link\[\/url\]/\
<a href
=\"$replace_link\"\
>$replace_link\
<\
/a\>/g;
97 # convert newlines to <br /> tags
99 $post_text =~ s/\n/\<br \/\
>/g
;