]> git.p6c8.net - selfforum.git/blobdiff - selfforum-cgi/shared/Template/Posting.pm
added version checks
[selfforum.git] / selfforum-cgi / shared / Template / Posting.pm
index 348a7dbb07797d7c2f16e1d153dc1b1fbc4f453b..4cae38d2c8754da3ec53e0da2837d9c4cb80f8bc 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->{cachepath});
+        $cache -> add_view (
+          { thread  => $param -> {thread},
+            posting => $param -> {posting}
+          }
+        );
+      }
     }
   }
 
     }
   }
 

patrick-canterino.de