require Sesse::pr0n::Config_local;
};
- $VERSION = "v2.05";
+ $VERSION = "v2.10";
@ISA = qw(Exporter);
@EXPORT = qw(&error &dberror);
%EXPORT_TAGS = qw();
return ($width, $height);
}
-sub print_link {
- my ($r, $title, $baseurl, $param, $defparam) = @_;
- my $str = "<a href=\"$baseurl";
+sub get_query_string {
+ my ($param, $defparam) = @_;
my $first = 1;
+ my $str = "";
while (my ($key, $value) = each %$param) {
next unless defined($value);
$str .= "$key=$value";
$first = 0;
}
-
- $str .= "\">$title</a>";
+ return $str;
+}
+
+sub print_link {
+ my ($r, $title, $baseurl, $param, $defparam) = @_;
+ my $str = "<a href=\"$baseurl" . get_query_string($param, $defparam) . "\">$title</a>";
$r->print($str);
}
# Try to reconnect
Apache2::ServerUtil->server->log_error("Lost contact with PostgreSQL server, trying to reconnect...");
unless ($dbh = DBI->connect("dbi:Pg:dbname=pr0n;host=" . $Sesse::pr0n::Config::db_host,
- $Sesse::pr0n::Config::db_user, $Sesse::pr0n::Config::db_password)) {
+ $Sesse::pr0n::Config::db_username, $Sesse::pr0n::Config::db_password)) {
$dbh = undef;
die "Couldn't connect to PostgreSQL database";
}