Araenus Web Publiserings Verktøy

         Nyheter
Linker
Kjøp & Selg Skolebøker
Kontakt Oss
Verdens Ur
Utdanning / Skoler
Send gratis SMS
"; if (($fbilde eq 2) && ($ad[15] ne '')) { print "\n";} elsif (($fbilde eq 2) && ($ad[15] eq '')) { print "\n"; } if ($lital eq 'Ja') { $itstart = ""; $itslutt = ""; } else { $itstart = ""; $itslutt= ""; } if ($lbold eq 'Ja') { $bostart = ""; $boslutt = ""; } else { $bostart = ""; $boslutt = ""; } if ($ad[4] ne 'Ja') { if (($ftype eq 3) && ($fargeteller eq 0)) { print "\n"; $fargeteller = 1; } elsif ($ftype eq 3) { print "\n"; $fargeteller = 0; } else { print "\n"; } } if (($fbilde eq 1) && ($ad[15] ne '')) { print "\n";} elsif (($fbilde eq 1) && ($ad[15] eq '')) { print "\n"; } } } if (($ftype eq 4) || ($ftype eq 5)) { if ((($ad[1] eq 'Ja') && ($ad[2] eq '')) || (($ad[1] eq 'Ja') && ($ad[2] eq 'Ja') && ($nowtime > $synfra) && ($nowtime < $syntil))) { print ""; if (($fbilde eq 2) && ($ad[15] ne '')) { print "\n";} elsif (($fbilde eq 2) && ($ad[15] eq '')) { print "\n"; } if ($oital eq 'Ja') { $itstart = ""; $itslutt = ""; } else { $itstart = ""; $itslutt= ""; } if ($obold eq 'Ja') { $bostart = ""; $boslutt = ""; } else { $bostart = ""; $boslutt = ""; } if ($ad[4] ne 'Ja') { if (($ftype eq 5) && ($fargeteller eq 0)) { print "\n"; $fargeteller = 1; } elsif ($ftype eq 5) { print "\n"; $fargeteller = 0; } else { print "\n"; } } if (($fbilde eq 1) && ($ad[15] ne '')) { print "\n";} elsif (($fbilde eq 1) && ($ad[15] eq '')) { print "\n"; } if (($user[9]>=4) || ($user[2] eq $ad[7])) { if ($ad[18] ne 'Ja') { $adstring = "\[ $tx[122] \] \[ $tx[43] \]"; } else { $adstring = "\[ $tx[85] \]\[ $tx[43] \]"; } print "\n"; } } } if ($ftype eq 1) { print "\n"; } } ############################################## # Sub: Get Form Data # This gets data from a post. sub get_form_data { $buffer = ""; read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs=split(/&/,$buffer); foreach $pair (@pairs) { @a = split(/=/,$pair); $name=$a[0]; $value=$a[1]; $value =~ s/\+/ /g; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ s/~!/ ~!/g; $value =~ s/[\n\r]/ /sg; #remove \n $value =~ s/\[\]//g; #remove [] push (@data,$name); push (@data, $value); } %form=@data; %form; }"; if (($fbilde eq 2) && ($ad[15] ne '')) { print "\n";} elsif (($fbilde eq 2) && ($ad[15] eq '')) { print "\n"; } if ($lital eq 'Ja') { $itstart = ""; $itslutt = ""; } else { $itstart = ""; $itslutt= ""; } if ($lbold eq 'Ja') { $bostart = ""; $boslutt = ""; } else { $bostart = ""; $boslutt = ""; } if ($ad[4] ne 'Ja') { if (($ftype eq 3) && ($fargeteller eq 0)) { print "\n"; $fargeteller = 1; } elsif ($ftype eq 3) { print "\n"; $fargeteller = 0; } else { print "\n"; } } if (($fbilde eq 1) && ($ad[15] ne '')) { print "\n";} elsif (($fbilde eq 1) && ($ad[15] eq '')) { print "\n"; } } } if (($ftype eq 4) || ($ftype eq 5)) { if ((($ad[1] eq 'Ja') && ($ad[2] eq '')) || (($ad[1] eq 'Ja') && ($ad[2] eq 'Ja') && ($nowtime > $synfra) && ($nowtime < $syntil))) { print ""; if (($fbilde eq 2) && ($ad[15] ne '')) { print "\n";} elsif (($fbilde eq 2) && ($ad[15] eq '')) { print "\n"; } if ($oital eq 'Ja') { $itstart = ""; $itslutt = ""; } else { $itstart = ""; $itslutt= ""; } if ($obold eq 'Ja') { $bostart = ""; $boslutt = ""; } else { $bostart = ""; $boslutt = ""; } if ($ad[4] ne 'Ja') { if (($ftype eq 5) && ($fargeteller eq 0)) { print "\n"; $fargeteller = 1; } elsif ($ftype eq 5) { print "\n"; $fargeteller = 0; } else { print "\n"; } } if (($fbilde eq 1) && ($ad[15] ne '')) { print "\n";} elsif (($fbilde eq 1) && ($ad[15] eq '')) { print "\n"; } if (($user[9]>=4) || ($user[2] eq $ad[7])) { if ($ad[18] ne 'Ja') { $adstring = "\[ $tx[122] \] \[ $tx[43] \]"; } else { $adstring = "\[ $tx[85] \]\[ $tx[43] \]"; } print "\n"; } } } if ($ftype eq 1) { print "\n"; } } ############################################## # Sub: Get Form Data # This gets data from a post. sub get_form_data { $buffer = ""; read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs=split(/&/,$buffer); foreach $pair (@pairs) { @a = split(/=/,$pair); $name=$a[0]; $value=$a[1]; $value =~ s/\+/ /g; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ s/~!/ ~!/g; $value =~ s/[\n\r]/ /sg; #remove \n $value =~ s/\[\]//g; #remove [] push (@data,$name); push (@data, $value); } %form=@data; %form; }"; if (($fbilde eq 2) && ($ad[15] ne '')) { print "\n";} elsif (($fbilde eq 2) && ($ad[15] eq '')) { print "\n"; } if ($lital eq 'Ja') { $itstart = ""; $itslutt = ""; } else { $itstart = ""; $itslutt= ""; } if ($lbold eq 'Ja') { $bostart = ""; $boslutt = ""; } else { $bostart = ""; $boslutt = ""; } if ($ad[4] ne 'Ja') { if (($ftype eq 3) && ($fargeteller eq 0)) { print "\n"; $fargeteller = 1; } elsif ($ftype eq 3) { print "\n"; $fargeteller = 0; } else { print "\n"; } } if (($fbilde eq 1) && ($ad[15] ne '')) { print "\n";} elsif (($fbilde eq 1) && ($ad[15] eq '')) { print "\n"; } } } if (($ftype eq 4) || ($ftype eq 5)) { if ((($ad[1] eq 'Ja') && ($ad[2] eq '')) || (($ad[1] eq 'Ja') && ($ad[2] eq 'Ja') && ($nowtime > $synfra) && ($nowtime < $syntil))) { print ""; if (($fbilde eq 2) && ($ad[15] ne '')) { print "\n";} elsif (($fbilde eq 2) && ($ad[15] eq '')) { print "\n"; } if ($oital eq 'Ja') { $itstart = ""; $itslutt = ""; } else { $itstart = ""; $itslutt= ""; } if ($obold eq 'Ja') { $bostart = ""; $boslutt = ""; } else { $bostart = ""; $boslutt = ""; } if ($ad[4] ne 'Ja') { if (($ftype eq 5) && ($fargeteller eq 0)) { print "\n"; $fargeteller = 1; } elsif ($ftype eq 5) { print "\n"; $fargeteller = 0; } else { print "\n"; } } if (($fbilde eq 1) && ($ad[15] ne '')) { print "\n";} elsif (($fbilde eq 1) && ($ad[15] eq '')) { print "\n"; } if (($user[9]>=4) || ($user[2] eq $ad[7])) { if ($ad[18] ne 'Ja') { $adstring = "\[ $tx[122] \] \[ $tx[43] \]"; } else { $adstring = "\[ $tx[85] \]\[ $tx[43] \]"; } print "\n"; } } } if ($ftype eq 1) { print "\n"; } } ############################################## # Sub: Get Form Data # This gets data from a post. sub get_form_data { $buffer = ""; read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs=split(/&/,$buffer); foreach $pair (@pairs) { @a = split(/=/,$pair); $name=$a[0]; $value=$a[1]; $value =~ s/\+/ /g; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ s/~!/ ~!/g; $value =~ s/[\n\r]/ /sg; #remove \n $value =~ s/\[\]//g; #remove [] push (@data,$name); push (@data, $value); } %form=@data; %form; }
#!/usr/bin/perl use Time::Local; use DBI; use CGI; ########################################## # Araenus Web Admin Control System # AWACS # # PULLOUT # # Kodet av Odd Benestad d.y # (c) 2000 Araenus AS # ########################################## chomp($wholepath = `pwd`); open THEFILE, "$wholepath\/awacs.path" || die(); (@env_details) = ; close THEFILE; chomp (@env_details); foreach $temp_details (@env_details) { @env_variable = split(/\=/, $temp_details); chomp(@env_variable); $env_variable[0] =~ s/^\s+//; $env_variable[0] =~ s/\s+$//; $env_variable[1] =~ s/^\s+//; $env_variable[1] =~ s/\s+$//; if ($env_variable[0] eq "path") { $wholepath = $env_variable[1]; } } open THEFILE, "$wholepath\/awacs.common" || die(); @env_details = ; close THEFILE; chomp (@env_details); foreach $temp_details (@env_details) { @env_variable = split(/\=/, $temp_details); chomp(@env_variable); $env_variable[0] =~ s/^\s+//; $env_variable[0] =~ s/\s+$//; $env_variable[1] =~ s/^\s+//; $env_variable[1] =~ s/\s+$//; if ($env_variable[0] eq "dsn") { $dsn = $env_variable[1]; } if ($env_variable[0] eq "user_name") { $user_name = $env_variable[1]; } if ($env_variable[0] eq "password") { $password = $env_variable[1]; } } my ($dbh, $sth); my (@ary, @tx); $awacslogo = ""; $awacs = ""; $logo = ""; print "Content-type: text/html\n\n"; print "\n\n"; print "\n"; $dbh = DBI->connect($dsn, $user_name, $password, { RaiseError => 1}); $sth = $dbh->prepare (qq{ SELECT * FROM awacs_system }); $sth->execute(); @system_field = $sth->fetchrow_array(); $language = $system_field[3]; $bildeurl = "$system_field[7]"; &get_form_data; # parse arguments from post @ARGV = split(/\\*\&/, $ENV{'QUERY_STRING'}); $ARGV[0] =~ s/\W//g; $ARGV[1] =~ s/\W//g; if ($ARGV[0] ne '') { $idkat = $ARGV[0]; } else { undef($idkat); } if ($ARGV[1] ne '') { $idnyhet = $ARGV[1]; } else { undef($idnyhet); } &viskategori; $sth->finish(); $dbh->disconnect(); ############################################## # Sub: Vis elementer i kategorier # sub viskategori { $nr = $ARGV[0]; $cat_id_choice = $nr; &hent_awacs_kategori; &prepare_awacs_kategori; $unfold = 1; $where_query = "WHERE awacs_data.cat_id = $nr AND awacs_data.published = \"Ja\" "; if ($ARGV[1] ne '') { $where_query .= "AND awacs_data.news_id = \"$ARGV[1]\" "; $unfold = 2; } $sth = $dbh->prepare (qq{ SELECT * FROM awacs_data $where_query ORDER BY $order_by LIMIT $fmax }); $sth->execute(); if ($type ne 1) { print "\n"; } while (@ad = $sth->fetchrow_array()) { &screenoutput; } if ($type ne 1) { print "
\n"; } } sub prepare_awacs_kategori { if ($fbover eq '') { $bover = ""; } else { $bover = "BGCOLOR=$bover"; } if ($fbingr eq '') { $bingr = ""; } else { $bingr = "BGCOLOR=$fbingr"; } if ($fbinnh eq '') { $binnh = ""; } else { $binnh = "BGCOLOR=$fbinnh"; } if ($fbalter eq '') { $balter = ""; } else { $balter = "BGCOLOR=$fbalter"; } $sth = $dbh->prepare (qq{ SELECT * FROM language_sort WHERE language_sort.lang_id = $language AND language_sort.lang_sort_id = $forder }); $sth->execute(); @field = $sth->fetchrow_array(); $order_by = $field[2]; undef($fargeteller); undef($elementcount); $fargeteller = 0; $elementcount = 1; } ############################################## # Sub: hent_awacs_kategori # Henter kategori data sub hent_awacs_kategori { $sth = $dbh->prepare (qq{ SELECT * FROM awacs_category WHERE awacs_category.cat_id = $cat_id_choice }); $sth->execute(); @field = $sth->fetchrow_array(); $fnavn = $field[1]; $fmax = $field[2]; $ftype = $field[3]; $ofont = $field[4]; $osize = $field[5]; $ocolo = $field[6]; $oital = $field[7]; $obold = $field[8]; $ingfont = $field[9]; $ingsize = $field[10]; $ingcolo = $field[11]; $ingital = $field[12]; $ingbold = $field[13]; $ifont = $field[14]; $isize = $field[15]; $icolo = $field[16]; $iital = $field[17]; $ibold = $field[18]; $lfont = $field[19]; $lsize = $field[20]; $lcolo = $field[21]; $lital = $field[22]; $lbold = $field[23]; $fbilde = $field[24]; $flinkplas = $field[25]; $fsynautho = $field[26]; $fsyndate = $field[27]; $flinknyhet = $field[28]; $fruler = $field[29]; $forder = $field[30]; $fmalfil = $field[31]; $fbover = $field[32]; $fbingr = $field[33]; $fbinnh = $field[34]; $fbalter = $field[35]; $fcellbord = $field[36]; $fcellspac = $field[37]; $fcellpadd = $field[38]; $fr_shadow = $field[39]; $fr_size = $field[40]; $fr_colo = $field[41]; } sub screenoutput { ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); $nowtime = "$year$mon$day$hour$min"; $syntyear = substr($ad[11],0,4); $syntmon = substr($ad[11],5,2); $syntday = substr($ad[11],8,2); $synthour = substr($ad[11],11,2); $syntmin = substr($ad[11],14,2); $syntil = "$syntyear$syntmon$syntday$synthour$syntmin"; $synfyear = substr($ad[10],0,4); $synfmon = substr($ad[10],5,2); $synfday = substr($ad[10],8,2); $synfhour = substr($ad[10],11,2); $synfmin = substr($ad[10],14,2); $synfra = "$synfyear$synfmon$synfday$synfhour$synfmin"; undef($howlink); if ($ad[14] eq 2) { $howlink = "target=_top"; } else { $howlink = "target=_blank"; } if ($ad[19] ne "") { $howlink = "target=$ad[19]"; } if ($ocolo eq '') { $ocolo = $colortext; } if ($ingcolo eq '') { $ingcolo = $colortext; } if ($icolo eq '') { $icolo = $colortext; } if ($lcolo eq '') { $lcolo = $colortext; } undef($fargeteller); undef($elementcount); $fargeteller = 0; if ($ftype eq 1) { if ((($ad[1] eq 'Ja') && ($ad[2] ne 'Ja')) || (($ad[1] eq 'Ja') && ($ad[2] eq 'Ja') && ($nowtime > $synfra) && ($nowtime < $syntil))) { if ($oital eq 'Ja') { $itstart = ""; $itslutt = ""; } else { $itstart = ""; $itslutt= ""; } if ($obold eq 'Ja') { $bostart = ""; $boslutt = ""; } else { $bostart = ""; $boslutt = ""; } print "
\n"; if ($ad[4] ne 'Ja') { print "\n"; } if ($ingital eq 'Ja') { $itstart = ""; $itslutt = ""; } else { $itstart = ""; $itslutt= ""; } if ($ingbold eq 'Ja') { $bostart = ""; $boslutt = ""; } else { $bostart = ""; $boslutt = ""; } if (($fsynautho eq 2) || ($fsyndate eq 2)) { print "\n"; } print "
$bostart$itstart$ad[3]$itslutt$boslutt
\n";} if ($fsyndate eq 2) { print "$ad[9] \n"; } if (($fsynautho eq 2) && ($ad[8] ne '')) { print "$tx[49]: $ad[7]\n"; } elsif (($fsynautho eq 2) && ($ad[8] eq '')) { print "$tx[49]: $ad[7]\n"; } if (($fsynautho eq 2) || ($fsyndate eq 2)) { print "
\n"; print "\n"; print ""; if (($fbilde eq 2) && ($ad[15] ne '') && ($ad[12] ne '')) { print "\n";} elsif (($fbilde eq 2) && ($ad[15] ne '') && ($ad[12] eq '')) { print "\n";} print "\n"; if (($fbilde eq 1) && ($ad[15] ne '') && ($ad[12] ne '')) { print "\n";} elsif (($fbilde eq 1) && ($ad[15] ne '') && ($ad[12] eq '')) { print "\n";} print "
$bostart$itstart$ad[5]$itslutt$boslutt
\n"; print "\n"; if ($lital eq 'Ja') { $itstart = ""; $itslutt = ""; } else { $itstart = ""; $itslutt= ""; } if ($lbold eq 'Ja') { $bostart = ""; $boslutt = ""; } else { $bostart = ""; $boslutt = ""; } if (($ad[12] ne '') && ($ad[13] ne '') && ($flinkplas eq 2)) { print "\n";} if ($iital eq 'Ja') { $itstart = ""; $itslutt = ""; } else { $itstart = ""; $itslutt= ""; } if ($ibold eq 'Ja') { $bostart = ""; $boslutt = ""; } else { $bostart = ""; $boslutt = ""; } if (($flinknyhet eq 2) && ( $unfold eq 1)) { print "\n"; } elsif (($flinknyhet eq 2) && ($unfold ne 1)) { print "\n"; print "\n";} else { print "\n";} if (($ad[12] ne '') && ($ad[13] ne '') && ($flinkplas eq 1) && ($unfold ne 2)) { print "\n";} print "
$bostart$itstart$ad[13]$itslutt$boslutt
$bostart$itstart$system_field[5]$itslutt$boslutt
$bostart$itstart$ad[6]$itslutt$boslutt
$bostart$itstart$system_field[10]$itslutt$boslutt
$bostart$itstart$ad[6]$itslutt$boslutt
$bostart$itstart$ad[13]$itslutt$boslutt
\n"; if ($fruler eq 2) { if ($fr_shadow eq 2) { $rshadow = " "; } else { $rshadow = " NOSHADE"; } if ($fr_colo eq '') { $rcolo = "COLOR=000000"; } else { $rcolo = "COLOR=$fr_colo"; } print "\n"; } } } if (($ftype eq 2) || ($ftype eq 3)) { if ((($ad[1] eq 'Ja') && ($ad[2] ne 'Ja')) || (($ad[1] eq 'Ja') && ($ad[2] eq 'Ja') && ($nowtime > $synfra) && ($nowtime < $syntil))) { print "
$bostart$itstart$ad[13]$itslutt$boslutt$bostart$itstart$ad[13]$itslutt$boslutt$bostart$itstart$ad[13]$itslutt$boslutt
$bostart$itstart$ad[3]$itslutt$boslutt$bostart$itstart$ad[3]$itslutt$boslutt$bostart$itstart$ad[3]$itslutt$boslutt$adstring

#!/usr/bin/perl use Time::Local; use DBI; use CGI; ########################################## # Araenus Web Admin Control System # AWACS # # PULLOUT # # Kodet av Odd Benestad d.y # (c) 2000 Araenus AS # ########################################## chomp($wholepath = `pwd`); open THEFILE, "$wholepath\/awacs.path" || die(); (@env_details) = ; close THEFILE; chomp (@env_details); foreach $temp_details (@env_details) { @env_variable = split(/\=/, $temp_details); chomp(@env_variable); $env_variable[0] =~ s/^\s+//; $env_variable[0] =~ s/\s+$//; $env_variable[1] =~ s/^\s+//; $env_variable[1] =~ s/\s+$//; if ($env_variable[0] eq "path") { $wholepath = $env_variable[1]; } } open THEFILE, "$wholepath\/awacs.common" || die(); @env_details = ; close THEFILE; chomp (@env_details); foreach $temp_details (@env_details) { @env_variable = split(/\=/, $temp_details); chomp(@env_variable); $env_variable[0] =~ s/^\s+//; $env_variable[0] =~ s/\s+$//; $env_variable[1] =~ s/^\s+//; $env_variable[1] =~ s/\s+$//; if ($env_variable[0] eq "dsn") { $dsn = $env_variable[1]; } if ($env_variable[0] eq "user_name") { $user_name = $env_variable[1]; } if ($env_variable[0] eq "password") { $password = $env_variable[1]; } } my ($dbh, $sth); my (@ary, @tx); $awacslogo = ""; $awacs = ""; $logo = ""; print "Content-type: text/html\n\n"; print "\n\n"; print "\n"; $dbh = DBI->connect($dsn, $user_name, $password, { RaiseError => 1}); $sth = $dbh->prepare (qq{ SELECT * FROM awacs_system }); $sth->execute(); @system_field = $sth->fetchrow_array(); $language = $system_field[3]; $bildeurl = "$system_field[7]"; &get_form_data; # parse arguments from post @ARGV = split(/\\*\&/, $ENV{'QUERY_STRING'}); $ARGV[0] =~ s/\W//g; $ARGV[1] =~ s/\W//g; if ($ARGV[0] ne '') { $idkat = $ARGV[0]; } else { undef($idkat); } if ($ARGV[1] ne '') { $idnyhet = $ARGV[1]; } else { undef($idnyhet); } &viskategori; $sth->finish(); $dbh->disconnect(); ############################################## # Sub: Vis elementer i kategorier # sub viskategori { $nr = $ARGV[0]; $cat_id_choice = $nr; &hent_awacs_kategori; &prepare_awacs_kategori; $unfold = 1; $where_query = "WHERE awacs_data.cat_id = $nr AND awacs_data.published = \"Ja\" "; if ($ARGV[1] ne '') { $where_query .= "AND awacs_data.news_id = \"$ARGV[1]\" "; $unfold = 2; } $sth = $dbh->prepare (qq{ SELECT * FROM awacs_data $where_query ORDER BY $order_by LIMIT $fmax }); $sth->execute(); if ($type ne 1) { print "\n"; } while (@ad = $sth->fetchrow_array()) { &screenoutput; } if ($type ne 1) { print "
\n"; } } sub prepare_awacs_kategori { if ($fbover eq '') { $bover = ""; } else { $bover = "BGCOLOR=$bover"; } if ($fbingr eq '') { $bingr = ""; } else { $bingr = "BGCOLOR=$fbingr"; } if ($fbinnh eq '') { $binnh = ""; } else { $binnh = "BGCOLOR=$fbinnh"; } if ($fbalter eq '') { $balter = ""; } else { $balter = "BGCOLOR=$fbalter"; } $sth = $dbh->prepare (qq{ SELECT * FROM language_sort WHERE language_sort.lang_id = $language AND language_sort.lang_sort_id = $forder }); $sth->execute(); @field = $sth->fetchrow_array(); $order_by = $field[2]; undef($fargeteller); undef($elementcount); $fargeteller = 0; $elementcount = 1; } ############################################## # Sub: hent_awacs_kategori # Henter kategori data sub hent_awacs_kategori { $sth = $dbh->prepare (qq{ SELECT * FROM awacs_category WHERE awacs_category.cat_id = $cat_id_choice }); $sth->execute(); @field = $sth->fetchrow_array(); $fnavn = $field[1]; $fmax = $field[2]; $ftype = $field[3]; $ofont = $field[4]; $osize = $field[5]; $ocolo = $field[6]; $oital = $field[7]; $obold = $field[8]; $ingfont = $field[9]; $ingsize = $field[10]; $ingcolo = $field[11]; $ingital = $field[12]; $ingbold = $field[13]; $ifont = $field[14]; $isize = $field[15]; $icolo = $field[16]; $iital = $field[17]; $ibold = $field[18]; $lfont = $field[19]; $lsize = $field[20]; $lcolo = $field[21]; $lital = $field[22]; $lbold = $field[23]; $fbilde = $field[24]; $flinkplas = $field[25]; $fsynautho = $field[26]; $fsyndate = $field[27]; $flinknyhet = $field[28]; $fruler = $field[29]; $forder = $field[30]; $fmalfil = $field[31]; $fbover = $field[32]; $fbingr = $field[33]; $fbinnh = $field[34]; $fbalter = $field[35]; $fcellbord = $field[36]; $fcellspac = $field[37]; $fcellpadd = $field[38]; $fr_shadow = $field[39]; $fr_size = $field[40]; $fr_colo = $field[41]; } sub screenoutput { ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); $nowtime = "$year$mon$day$hour$min"; $syntyear = substr($ad[11],0,4); $syntmon = substr($ad[11],5,2); $syntday = substr($ad[11],8,2); $synthour = substr($ad[11],11,2); $syntmin = substr($ad[11],14,2); $syntil = "$syntyear$syntmon$syntday$synthour$syntmin"; $synfyear = substr($ad[10],0,4); $synfmon = substr($ad[10],5,2); $synfday = substr($ad[10],8,2); $synfhour = substr($ad[10],11,2); $synfmin = substr($ad[10],14,2); $synfra = "$synfyear$synfmon$synfday$synfhour$synfmin"; undef($howlink); if ($ad[14] eq 2) { $howlink = "target=_top"; } else { $howlink = "target=_blank"; } if ($ad[19] ne "") { $howlink = "target=$ad[19]"; } if ($ocolo eq '') { $ocolo = $colortext; } if ($ingcolo eq '') { $ingcolo = $colortext; } if ($icolo eq '') { $icolo = $colortext; } if ($lcolo eq '') { $lcolo = $colortext; } undef($fargeteller); undef($elementcount); $fargeteller = 0; if ($ftype eq 1) { if ((($ad[1] eq 'Ja') && ($ad[2] ne 'Ja')) || (($ad[1] eq 'Ja') && ($ad[2] eq 'Ja') && ($nowtime > $synfra) && ($nowtime < $syntil))) { if ($oital eq 'Ja') { $itstart = ""; $itslutt = ""; } else { $itstart = ""; $itslutt= ""; } if ($obold eq 'Ja') { $bostart = ""; $boslutt = ""; } else { $bostart = ""; $boslutt = ""; } print "
\n"; if ($ad[4] ne 'Ja') { print "\n"; } if ($ingital eq 'Ja') { $itstart = ""; $itslutt = ""; } else { $itstart = ""; $itslutt= ""; } if ($ingbold eq 'Ja') { $bostart = ""; $boslutt = ""; } else { $bostart = ""; $boslutt = ""; } if (($fsynautho eq 2) || ($fsyndate eq 2)) { print "\n"; } print "
$bostart$itstart$ad[3]$itslutt$boslutt
\n";} if ($fsyndate eq 2) { print "$ad[9] \n"; } if (($fsynautho eq 2) && ($ad[8] ne '')) { print "$tx[49]: $ad[7]\n"; } elsif (($fsynautho eq 2) && ($ad[8] eq '')) { print "$tx[49]: $ad[7]\n"; } if (($fsynautho eq 2) || ($fsyndate eq 2)) { print "
\n"; print "\n"; print ""; if (($fbilde eq 2) && ($ad[15] ne '') && ($ad[12] ne '')) { print "\n";} elsif (($fbilde eq 2) && ($ad[15] ne '') && ($ad[12] eq '')) { print "\n";} print "\n"; if (($fbilde eq 1) && ($ad[15] ne '') && ($ad[12] ne '')) { print "\n";} elsif (($fbilde eq 1) && ($ad[15] ne '') && ($ad[12] eq '')) { print "\n";} print "
$bostart$itstart$ad[5]$itslutt$boslutt
\n"; print "\n"; if ($lital eq 'Ja') { $itstart = ""; $itslutt = ""; } else { $itstart = ""; $itslutt= ""; } if ($lbold eq 'Ja') { $bostart = ""; $boslutt = ""; } else { $bostart = ""; $boslutt = ""; } if (($ad[12] ne '') && ($ad[13] ne '') && ($flinkplas eq 2)) { print "\n";} if ($iital eq 'Ja') { $itstart = ""; $itslutt = ""; } else { $itstart = ""; $itslutt= ""; } if ($ibold eq 'Ja') { $bostart = ""; $boslutt = ""; } else { $bostart = ""; $boslutt = ""; } if (($flinknyhet eq 2) && ( $unfold eq 1)) { print "\n"; } elsif (($flinknyhet eq 2) && ($unfold ne 1)) { print "\n"; print "\n";} else { print "\n";} if (($ad[12] ne '') && ($ad[13] ne '') && ($flinkplas eq 1) && ($unfold ne 2)) { print "\n";} print "
$bostart$itstart$ad[13]$itslutt$boslutt
$bostart$itstart$system_field[5]$itslutt$boslutt
$bostart$itstart$ad[6]$itslutt$boslutt
$bostart$itstart$system_field[10]$itslutt$boslutt
$bostart$itstart$ad[6]$itslutt$boslutt
$bostart$itstart$ad[13]$itslutt$boslutt
\n"; if ($fruler eq 2) { if ($fr_shadow eq 2) { $rshadow = " "; } else { $rshadow = " NOSHADE"; } if ($fr_colo eq '') { $rcolo = "COLOR=000000"; } else { $rcolo = "COLOR=$fr_colo"; } print "\n"; } } } if (($ftype eq 2) || ($ftype eq 3)) { if ((($ad[1] eq 'Ja') && ($ad[2] ne 'Ja')) || (($ad[1] eq 'Ja') && ($ad[2] eq 'Ja') && ($nowtime > $synfra) && ($nowtime < $syntil))) { print "
$bostart$itstart$ad[13]$itslutt$boslutt$bostart$itstart$ad[13]$itslutt$boslutt$bostart$itstart$ad[13]$itslutt$boslutt
$bostart$itstart$ad[3]$itslutt$boslutt$bostart$itstart$ad[3]$itslutt$boslutt$bostart$itstart$ad[3]$itslutt$boslutt$adstring
#!/usr/bin/perl use Time::Local; use DBI; use CGI; ########################################## # Araenus Web Admin Control System # AWACS # # PULLOUT # # Kodet av Odd Benestad d.y # (c) 2000 Araenus AS # ########################################## chomp($wholepath = `pwd`); open THEFILE, "$wholepath\/awacs.path" || die(); (@env_details) = ; close THEFILE; chomp (@env_details); foreach $temp_details (@env_details) { @env_variable = split(/\=/, $temp_details); chomp(@env_variable); $env_variable[0] =~ s/^\s+//; $env_variable[0] =~ s/\s+$//; $env_variable[1] =~ s/^\s+//; $env_variable[1] =~ s/\s+$//; if ($env_variable[0] eq "path") { $wholepath = $env_variable[1]; } } open THEFILE, "$wholepath\/awacs.common" || die(); @env_details = ; close THEFILE; chomp (@env_details); foreach $temp_details (@env_details) { @env_variable = split(/\=/, $temp_details); chomp(@env_variable); $env_variable[0] =~ s/^\s+//; $env_variable[0] =~ s/\s+$//; $env_variable[1] =~ s/^\s+//; $env_variable[1] =~ s/\s+$//; if ($env_variable[0] eq "dsn") { $dsn = $env_variable[1]; } if ($env_variable[0] eq "user_name") { $user_name = $env_variable[1]; } if ($env_variable[0] eq "password") { $password = $env_variable[1]; } } my ($dbh, $sth); my (@ary, @tx); $awacslogo = ""; $awacs = ""; $logo = ""; print "Content-type: text/html\n\n"; print "\n\n"; print "\n"; $dbh = DBI->connect($dsn, $user_name, $password, { RaiseError => 1}); $sth = $dbh->prepare (qq{ SELECT * FROM awacs_system }); $sth->execute(); @system_field = $sth->fetchrow_array(); $language = $system_field[3]; $bildeurl = "$system_field[7]"; &get_form_data; # parse arguments from post @ARGV = split(/\\*\&/, $ENV{'QUERY_STRING'}); $ARGV[0] =~ s/\W//g; $ARGV[1] =~ s/\W//g; if ($ARGV[0] ne '') { $idkat = $ARGV[0]; } else { undef($idkat); } if ($ARGV[1] ne '') { $idnyhet = $ARGV[1]; } else { undef($idnyhet); } &viskategori; $sth->finish(); $dbh->disconnect(); ############################################## # Sub: Vis elementer i kategorier # sub viskategori { $nr = $ARGV[0]; $cat_id_choice = $nr; &hent_awacs_kategori; &prepare_awacs_kategori; $unfold = 1; $where_query = "WHERE awacs_data.cat_id = $nr AND awacs_data.published = \"Ja\" "; if ($ARGV[1] ne '') { $where_query .= "AND awacs_data.news_id = \"$ARGV[1]\" "; $unfold = 2; } $sth = $dbh->prepare (qq{ SELECT * FROM awacs_data $where_query ORDER BY $order_by LIMIT $fmax }); $sth->execute(); if ($type ne 1) { print "\n"; } while (@ad = $sth->fetchrow_array()) { &screenoutput; } if ($type ne 1) { print "
\n"; } } sub prepare_awacs_kategori { if ($fbover eq '') { $bover = ""; } else { $bover = "BGCOLOR=$bover"; } if ($fbingr eq '') { $bingr = ""; } else { $bingr = "BGCOLOR=$fbingr"; } if ($fbinnh eq '') { $binnh = ""; } else { $binnh = "BGCOLOR=$fbinnh"; } if ($fbalter eq '') { $balter = ""; } else { $balter = "BGCOLOR=$fbalter"; } $sth = $dbh->prepare (qq{ SELECT * FROM language_sort WHERE language_sort.lang_id = $language AND language_sort.lang_sort_id = $forder }); $sth->execute(); @field = $sth->fetchrow_array(); $order_by = $field[2]; undef($fargeteller); undef($elementcount); $fargeteller = 0; $elementcount = 1; } ############################################## # Sub: hent_awacs_kategori # Henter kategori data sub hent_awacs_kategori { $sth = $dbh->prepare (qq{ SELECT * FROM awacs_category WHERE awacs_category.cat_id = $cat_id_choice }); $sth->execute(); @field = $sth->fetchrow_array(); $fnavn = $field[1]; $fmax = $field[2]; $ftype = $field[3]; $ofont = $field[4]; $osize = $field[5]; $ocolo = $field[6]; $oital = $field[7]; $obold = $field[8]; $ingfont = $field[9]; $ingsize = $field[10]; $ingcolo = $field[11]; $ingital = $field[12]; $ingbold = $field[13]; $ifont = $field[14]; $isize = $field[15]; $icolo = $field[16]; $iital = $field[17]; $ibold = $field[18]; $lfont = $field[19]; $lsize = $field[20]; $lcolo = $field[21]; $lital = $field[22]; $lbold = $field[23]; $fbilde = $field[24]; $flinkplas = $field[25]; $fsynautho = $field[26]; $fsyndate = $field[27]; $flinknyhet = $field[28]; $fruler = $field[29]; $forder = $field[30]; $fmalfil = $field[31]; $fbover = $field[32]; $fbingr = $field[33]; $fbinnh = $field[34]; $fbalter = $field[35]; $fcellbord = $field[36]; $fcellspac = $field[37]; $fcellpadd = $field[38]; $fr_shadow = $field[39]; $fr_size = $field[40]; $fr_colo = $field[41]; } sub screenoutput { ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); $nowtime = "$year$mon$day$hour$min"; $syntyear = substr($ad[11],0,4); $syntmon = substr($ad[11],5,2); $syntday = substr($ad[11],8,2); $synthour = substr($ad[11],11,2); $syntmin = substr($ad[11],14,2); $syntil = "$syntyear$syntmon$syntday$synthour$syntmin"; $synfyear = substr($ad[10],0,4); $synfmon = substr($ad[10],5,2); $synfday = substr($ad[10],8,2); $synfhour = substr($ad[10],11,2); $synfmin = substr($ad[10],14,2); $synfra = "$synfyear$synfmon$synfday$synfhour$synfmin"; undef($howlink); if ($ad[14] eq 2) { $howlink = "target=_top"; } else { $howlink = "target=_blank"; } if ($ad[19] ne "") { $howlink = "target=$ad[19]"; } if ($ocolo eq '') { $ocolo = $colortext; } if ($ingcolo eq '') { $ingcolo = $colortext; } if ($icolo eq '') { $icolo = $colortext; } if ($lcolo eq '') { $lcolo = $colortext; } undef($fargeteller); undef($elementcount); $fargeteller = 0; if ($ftype eq 1) { if ((($ad[1] eq 'Ja') && ($ad[2] ne 'Ja')) || (($ad[1] eq 'Ja') && ($ad[2] eq 'Ja') && ($nowtime > $synfra) && ($nowtime < $syntil))) { if ($oital eq 'Ja') { $itstart = ""; $itslutt = ""; } else { $itstart = ""; $itslutt= ""; } if ($obold eq 'Ja') { $bostart = ""; $boslutt = ""; } else { $bostart = ""; $boslutt = ""; } print "
\n"; if ($ad[4] ne 'Ja') { print "\n"; } if ($ingital eq 'Ja') { $itstart = ""; $itslutt = ""; } else { $itstart = ""; $itslutt= ""; } if ($ingbold eq 'Ja') { $bostart = ""; $boslutt = ""; } else { $bostart = ""; $boslutt = ""; } if (($fsynautho eq 2) || ($fsyndate eq 2)) { print "\n"; } print "
$bostart$itstart$ad[3]$itslutt$boslutt
\n";} if ($fsyndate eq 2) { print "$ad[9] \n"; } if (($fsynautho eq 2) && ($ad[8] ne '')) { print "$tx[49]: $ad[7]\n"; } elsif (($fsynautho eq 2) && ($ad[8] eq '')) { print "$tx[49]: $ad[7]\n"; } if (($fsynautho eq 2) || ($fsyndate eq 2)) { print "
\n"; print "\n"; print ""; if (($fbilde eq 2) && ($ad[15] ne '') && ($ad[12] ne '')) { print "\n";} elsif (($fbilde eq 2) && ($ad[15] ne '') && ($ad[12] eq '')) { print "\n";} print "\n"; if (($fbilde eq 1) && ($ad[15] ne '') && ($ad[12] ne '')) { print "\n";} elsif (($fbilde eq 1) && ($ad[15] ne '') && ($ad[12] eq '')) { print "\n";} print "
$bostart$itstart$ad[5]$itslutt$boslutt
\n"; print "\n"; if ($lital eq 'Ja') { $itstart = ""; $itslutt = ""; } else { $itstart = ""; $itslutt= ""; } if ($lbold eq 'Ja') { $bostart = ""; $boslutt = ""; } else { $bostart = ""; $boslutt = ""; } if (($ad[12] ne '') && ($ad[13] ne '') && ($flinkplas eq 2)) { print "\n";} if ($iital eq 'Ja') { $itstart = ""; $itslutt = ""; } else { $itstart = ""; $itslutt= ""; } if ($ibold eq 'Ja') { $bostart = ""; $boslutt = ""; } else { $bostart = ""; $boslutt = ""; } if (($flinknyhet eq 2) && ( $unfold eq 1)) { print "\n"; } elsif (($flinknyhet eq 2) && ($unfold ne 1)) { print "\n"; print "\n";} else { print "\n";} if (($ad[12] ne '') && ($ad[13] ne '') && ($flinkplas eq 1) && ($unfold ne 2)) { print "\n";} print "
$bostart$itstart$ad[13]$itslutt$boslutt
$bostart$itstart$system_field[5]$itslutt$boslutt
$bostart$itstart$ad[6]$itslutt$boslutt
$bostart$itstart$system_field[10]$itslutt$boslutt
$bostart$itstart$ad[6]$itslutt$boslutt
$bostart$itstart$ad[13]$itslutt$boslutt
\n"; if ($fruler eq 2) { if ($fr_shadow eq 2) { $rshadow = " "; } else { $rshadow = " NOSHADE"; } if ($fr_colo eq '') { $rcolo = "COLOR=000000"; } else { $rcolo = "COLOR=$fr_colo"; } print "\n"; } } } if (($ftype eq 2) || ($ftype eq 3)) { if ((($ad[1] eq 'Ja') && ($ad[2] ne 'Ja')) || (($ad[1] eq 'Ja') && ($ad[2] eq 'Ja') && ($nowtime > $synfra) && ($nowtime < $syntil))) { print "
$bostart$itstart$ad[13]$itslutt$boslutt$bostart$itstart$ad[13]$itslutt$boslutt$bostart$itstart$ad[13]$itslutt$boslutt
$bostart$itstart$ad[3]$itslutt$boslutt$bostart$itstart$ad[3]$itslutt$boslutt$bostart$itstart$ad[3]$itslutt$boslutt$adstring
Nyheter med Araenus Newsgrabber ver. 1.0
Klikk for ytterligere ferske nyheter