]> git.p6c8.net - selfforum.git/blobdiff - selfforum-cgi/shared/Template/Posting.pm
typo fixed
[selfforum.git] / selfforum-cgi / shared / Template / Posting.pm
index 348a7dbb07797d7c2f16e1d153dc1b1fbc4f453b..0ffb6c20550cf5204d97955608ec9a155ff4d0ab 100644 (file)
@@ -24,6 +24,7 @@ use Posting::_lib qw(
   parse_xml_file
   hr_time
 );
   parse_xml_file
   hr_time
 );
+use Posting::Cache;
 use Template;
 use Template::_conf;
 use Template::_query;
 use Template;
 use Template::_conf;
 use Template::_query;
@@ -169,11 +170,26 @@ sub print_posting_as_HTML ($$$) {
           $formdata->{uniqueID}  ->{assign}->{value} => plain(unique_id),
           $formdata->{followUp}  ->{assign}->{value} => plain($param -> {thread}.';'.$param -> {posting}),
           $formdata->{quoteChar} ->{assign}->{value} => "ÿ".plain(defined $view -> {quoteChars} ? $view -> {quoteChars} : ''),
           $formdata->{uniqueID}  ->{assign}->{value} => plain(unique_id),
           $formdata->{followUp}  ->{assign}->{value} => plain($param -> {thread}.';'.$param -> {posting}),
           $formdata->{quoteChar} ->{assign}->{value} => "ÿ".plain(defined $view -> {quoteChars} ? $view -> {quoteChars} : ''),
-          $formdata->{userID}    ->{assign}->{value} => ''
+          $formdata->{userID}    ->{assign}->{value} => '',
+          $assign->{firsttime}                       => $param->{firsttime} ? $param->{firsttime} : '',
+          $assign->{voted}                           => $param->{voted} ? $param->{voted} : ''
         },
         $pars,
         $parent_pars
       )};
         },
         $pars,
         $parent_pars
       )};
+
+      # all output done
+      #
+      close STDOUT;
+
+      if ($param->{firsttime}) {
+        my $cache = new Posting::Cache ($param->{cachefile});
+        $cache -> add_view (
+          { thread  => $param -> {thread},
+            posting => $param -> {posting}
+          }
+        );
+      }
     }
   }
 
     }
   }
 

patrick-canterino.de