]> git.p6c8.net - selfforum.git/blobdiff - selfforum-cgi/user/fo_posting.pl
Conf.pm: turned $Bin into $Config (we're now interested in config path not longer...
[selfforum.git] / selfforum-cgi / user / fo_posting.pl
index dad9b8f2ff525ae09a31428099812959da5a688e..0bb18deb8b50ff1461f1e9db1493414a4f27e477 100644 (file)
 ################################################################################
 
 use strict;
-use vars qw($Bin $Shared $Script);
+use vars qw($Bin $Shared $Script $Config);
 
 # locate the script
 #
 BEGIN {
   my $null = $0; $null =~ s/\\/\//g; # for win :-(
-  ($Bin)    = ($null =~ /^(.*)\/.*$/)? $1 : '.';
-  $Shared   = "$Bin/../shared";
-  ($Script) = ($null =~ /^.*\/(.*)$/)? $1 : $null;
+  $Bin     = ($null =~ /^(.*)\/.*$/)? $1 : '.';
+  $Shared  = "$Bin/../shared";
+  $Config  = "$Bin/config";
+  $Script  = ($null =~ /^.*\/(.*)$/)? $1 : $null;
 }
-
 use lib "$Shared";
 use CGI::Carp qw(fatalsToBrowser);
 
@@ -30,7 +30,7 @@ use Conf::Admin;
 
 # load script configuration and admin default conf.
 #
-my $conf         = read_script_conf ($Bin, $Shared, $Script);
+my $conf         = read_script_conf ($Config, $Shared, $Script);
 my $adminDefault = read_admin_conf ($conf -> {files} -> {adminDefault});
 
 # Initialize the request
@@ -375,7 +375,8 @@ sub save {
           lastMessage   => $f -> {last_message},
           parsedThreads => $f -> {threads},
           dtd           => $f -> {dtd},
-          messages      => $self -> {template} -> {messages} || {},
+          messages      => $self -> {conf} -> {template} -> {messages} || {},
+          base_uri      => $self -> {conf} -> {original} -> {files} -> {forum_base}
         };
 
         # set the variables if defined..
@@ -423,8 +424,8 @@ sub save {
           #
           $self -> {response} -> {doc}  = $self -> {conf} -> {assign} -> {docThx};
           $self -> {response} -> {pars} = {
-            $thx -> {time}     => plain (hr_time($time)),
-            $thx -> {body}     => message_as_HTML (
+            $thx -> {time} => plain (hr_time($time)),
+            $thx -> {body} => message_as_HTML (
               $xml,
               $self -> {template},
               { posting    => $mid,
@@ -500,7 +501,7 @@ sub load_main_file {
   my $lock_stat;
 
   unless ($lock_stat = write_lock_file ($self -> {conf} -> {forum_file_name})) {
-    if (defined $lock_stat and $lock_stat == 0) {
+    if (defined $lock_stat) {
       # occupied or no w-bit set for the directory..., hmmm
       #
       violent_unlock_file ($self -> {conf} -> {forum_file_name});

patrick-canterino.de