2007-10-11 17:06:08 +00:00
|
|
|
require "functions.pl";
|
2007-10-10 21:48:12 +00:00
|
|
|
|
|
|
|
#create or resume session
|
|
|
|
CGI::Session->name($session_name);
|
2007-10-24 10:03:04 +00:00
|
|
|
$query = new CGI;
|
2007-12-17 18:55:33 +00:00
|
|
|
$session = new CGI::Session;
|
2007-10-10 21:48:12 +00:00
|
|
|
|
2007-10-29 15:00:40 +00:00
|
|
|
@userinfo = get_userinfo_from_sid($session->id);
|
2007-10-10 21:48:12 +00:00
|
|
|
|
2007-10-29 15:00:40 +00:00
|
|
|
@page = get_page_array(@userinfo);
|
|
|
|
|
|
|
|
$page->{frontpage} = [''];
|
2007-10-10 21:48:12 +00:00
|
|
|
|
2007-10-24 10:03:04 +00:00
|
|
|
if($query->param('information'))
|
|
|
|
{
|
|
|
|
$page->{'message'}->{'type'} = "information";
|
|
|
|
$page->{'message'}->{'text'} = $query->param('information');
|
2007-12-21 17:39:49 +00:00
|
|
|
$page->{'message'}->{'value'} = $query->param('value');
|
2007-10-24 10:03:04 +00:00
|
|
|
}
|
|
|
|
elsif($query->param('error'))
|
|
|
|
{
|
|
|
|
$page->{'message'}->{'type'} = "error";
|
|
|
|
$page->{'message'}->{'text'} = $query->param('error');
|
2007-12-21 17:39:49 +00:00
|
|
|
$page->{'message'}->{'value'} = $query->param('value');
|
|
|
|
}
|
|
|
|
elsif($query->param('warning'))
|
|
|
|
{
|
|
|
|
$page->{'message'}->{'type'} = "warning";
|
|
|
|
$page->{'message'}->{'text'} = $query->param('warning');
|
|
|
|
$page->{'message'}->{'value'} = $query->param('value');
|
2007-10-24 10:03:04 +00:00
|
|
|
}
|
|
|
|
|
2007-12-01 22:49:58 +00:00
|
|
|
|
|
|
|
#prepare query
|
|
|
|
my $sth = $dbh->prepare(qq{select text, count from tagcloud }) or die $dbh->errstr;
|
|
|
|
|
|
|
|
#execute it
|
|
|
|
$sth->execute() or die $dbh->errstr;
|
|
|
|
|
|
|
|
#get every returned value
|
|
|
|
while (my ($text, $count) = $sth->fetchrow_array())
|
|
|
|
{
|
|
|
|
#push the new value to the $page->tagcloud array
|
|
|
|
push @{ $page->{tagcloud}->{tag} }, { text => [$text =~ / / ? "\"$text\"" : $text], count => [$count] };
|
|
|
|
}
|
|
|
|
|
|
|
|
#finish query
|
|
|
|
$sth->finish() or die $dbh->errstr;
|
|
|
|
|
2007-12-17 18:55:33 +00:00
|
|
|
print output_page();
|