added support for reading from replicated databases
This commit is contained in:
parent
c39e7dc7b0
commit
7648c6c13f
24 changed files with 87 additions and 48 deletions
|
|
@ -184,7 +184,7 @@ sub getReplies {
|
|||
$query .= "(status='approved'";
|
||||
}
|
||||
$query .= " or userId=$session{user}{userId}) order by forumPostId";
|
||||
my $sth = WebGUI::SQL->read($query);
|
||||
my $sth = WebGUI::SQL->read($query,WebGUI::SQL->getSlave);
|
||||
while (my @data = $sth->array) {
|
||||
push(@replies,WebGUI::Forum::Post->new($data[0]));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ sub getNextThread {
|
|||
my ($self) = @_;
|
||||
unless (exists $self->{_next}) {
|
||||
my ($nextId) = WebGUI::SQL->quickArray("select min(forumThreadId) from forumThread where forumId=".$self->get("forumId")."
|
||||
and forumThreadId>".$self->get("forumThreadId"));
|
||||
and forumThreadId>".$self->get("forumThreadId"),WebGUI::SQL->getSlave);
|
||||
$self->{_next} = WebGUI::Forum::Thread->new($nextId);
|
||||
}
|
||||
return $self->{_next};
|
||||
|
|
@ -214,7 +214,7 @@ sub getPreviousThread {
|
|||
my ($self) = @_;
|
||||
unless (exists $self->{_previous}) {
|
||||
my ($nextId) = WebGUI::SQL->quickArray("select max(forumThreadId) from forumThread where forumId=".$self->get("forumId")."
|
||||
and forumThreadId<".$self->get("forumThreadId"));
|
||||
and forumThreadId<".$self->get("forumThreadId"),WebGUI::SQL->getSlave);
|
||||
$self->{_previous} = WebGUI::Forum::Thread->new($nextId);
|
||||
}
|
||||
return $self->{_previous};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue