[vhffs-dev] [svn] commit: r142 - in /trunk: vhffs-api/src/Vhffs/Listengine/ vhffs-listengine/src/archives/ vhffs-listengine/src/archives/templates/

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Author: soda
Date: Thu Jan 26 18:23:43 2006
New Revision: 142

Log:
Fix listengine bug


Modified:
    trunk/vhffs-api/src/Vhffs/Listengine/Intl.pm
    trunk/vhffs-api/src/Vhffs/Listengine/Listengine.pm
    trunk/vhffs-listengine/src/archives/archives.pl
    trunk/vhffs-listengine/src/archives/show_msg.pl
    trunk/vhffs-listengine/src/archives/templates/byday.tmpl
    trunk/vhffs-listengine/src/archives/templates/byday_sub.tmpl
    trunk/vhffs-listengine/src/archives/templates/bymonth.tmpl
    trunk/vhffs-listengine/src/archives/templates/bymonth_sub.tmpl
    trunk/vhffs-listengine/src/archives/templates/byyear.tmpl
    trunk/vhffs-listengine/src/archives/templates/byyear_sub.tmpl
    trunk/vhffs-listengine/src/archives/templates/list.tmpl
    trunk/vhffs-listengine/src/archives/templates/list_sub.tmpl

Modified: trunk/vhffs-api/src/Vhffs/Listengine/Intl.pm
==============================================================================
--- trunk/vhffs-api/src/Vhffs/Listengine/Intl.pm (original)
+++ trunk/vhffs-api/src/Vhffs/Listengine/Intl.pm Thu Jan 26 18:23:43 2006
@@ -267,7 +267,7 @@
 
 sub refuse_error
 {
-    my $list = shit;
+    my $list = shift;
     my $hash = shift;
 
 

Modified: trunk/vhffs-api/src/Vhffs/Listengine/Listengine.pm
==============================================================================
--- trunk/vhffs-api/src/Vhffs/Listengine/Listengine.pm (original)
+++ trunk/vhffs-api/src/Vhffs/Listengine/Listengine.pm Thu Jan 26 18:23:43 2006
@@ -38,10 +38,15 @@
 
     my $dir = get_archives_dir( $list );
 
-    my $file = search_file( $dir , $messageid );
-
-
-    return undef if( ! -f $file );
+    if( ! -d $dir )
+    {
+    	return undef;
+    }
+
+    my $file = search_file_message( $dir , $messageid );
+
+
+    return "tata . $messageid" if( ! -f $file );
 
     
     open( FILE , $file );
@@ -59,7 +64,7 @@
 }
 
 
-sub search_file
+sub search_file_message
 {
     my $dir = shift;
     my $filename = shift;
@@ -77,19 +82,21 @@
 
 	if( -f $complete )
 	{
-
-	    if( Digest::MD5::md5_hex( $temp ) == $filename )
+	    if( Digest::MD5::md5_hex( $temp ) eq $filename )
 	    {
 		return $complete;
 	    }
 	}
 	elsif( -d $complete )
 	{
-	    return search_file( $complete , $filename );
+	    if( defined( $temp = search_file_message( $complete , $filename )))
+	    {
+	    	return( $temp );
+	    }
 	}
 	
     }
-    
+	return undef;
     closedir( DIR );
 }
 

Modified: trunk/vhffs-listengine/src/archives/archives.pl
==============================================================================
--- trunk/vhffs-listengine/src/archives/archives.pl (original)
+++ trunk/vhffs-listengine/src/archives/archives.pl Thu Jan 26 18:23:43 2006
@@ -9,6 +9,7 @@
 use CGI;
 use CGI::Session;
 use Vhffs::Main;
+use Vhffs::Panel::Main;
 use Vhffs::Functions;
 use Vhffs::Services::Mailing;
 use Vhffs::Listengine::Listengine;
@@ -21,9 +22,7 @@
 my $archives;
 my $subtemplate;
 
-setlocale(LC_ALL, CGI->cookie("language") );
-bindtextdomain("vhffs", $vhffs->get_config->get_intldir);
-textdomain("vhffs");
+my $cookie = Vhffs::Panel::Main::cook_lang( $vhffs );
 
 my $cgi = new CGI;
 my $listname = $cgi->param("list");
@@ -37,6 +36,7 @@
 my( $lpart , $domain ) = split/\@/,$listname,2;
 my $list = new Vhffs::Services::Mailing( $vhffs , $lpart , $domain );
 my $templatedir = $vhffs->get_config->get_listengine_templatesdir;
+
 
 
 $template = new HTML::Template( filename => $templatedir."/error.tmpl");
@@ -53,19 +53,7 @@
 }
 
 
-#change theme and language
-if( ( defined $changetheme ) && ( $changetheme eq 'yes' ) )
-{
-    CGI->cookie( theme => $cgi->param("theme") );
- #   $cgi->cookie( -name => 'theme',
-	#	  -value => $cgi->param("theme")
-		#  );
-}
-
 my $theme = Vhffs::Listengine::Panel::check_theme( $cgi->cookie("theme") );
-
-
-
 
 if( Vhffs::Functions::valid_mail( $listname ) != 1 )
 {

Modified: trunk/vhffs-listengine/src/archives/show_msg.pl
==============================================================================
--- trunk/vhffs-listengine/src/archives/show_msg.pl (original)
+++ trunk/vhffs-listengine/src/archives/show_msg.pl Thu Jan 26 18:23:43 2006
@@ -13,6 +13,7 @@
 use Vhffs::Services::Mailing;
 use Vhffs::Listengine::Listengine;
 use Vhffs::Listengine::Panel;
+use utf8;
 
 my $template;
 my $mail;
@@ -64,7 +65,7 @@
 elsif( ! defined ( $mail = Vhffs::Listengine::Listengine::search_message( $list , $mid ) ) )
 {
     $template = new HTML::Template( filename => $templatedir."/error.tmpl");
-    $template->param( ERROR => gettext("unknown message-id") );
+    $template->param( ERROR => gettext("unknown message-id t:$mail") );
 }
 else
 {
@@ -77,8 +78,9 @@
     $header .= gettext("Subject: " ) . $mail->get('Subject');
     
     foreach ( @{$mail->body} )
-    {
-	$body .= $_."<br>";
+	{
+	utf8::encode( $_ );
+	$body .=  $_  ."<br>";
     }
     $template = new HTML::Template( filename => $templatedir."/showmsg.tmpl");
     $template->param( TITLE => sprintf( gettext( "Message from list %s" ) , $list->get_listname ) );

Modified: trunk/vhffs-listengine/src/archives/templates/byday.tmpl
==============================================================================
--- trunk/vhffs-listengine/src/archives/templates/byday.tmpl (original)
+++ trunk/vhffs-listengine/src/archives/templates/byday.tmpl Thu Jan 26 18:23:43 2006
@@ -16,15 +16,21 @@
 	</div>
 
 	<div class="prefs">
-			<form action="archives.pl?action=byyear&list=<TMPL_VAR NAME="VALUE_LISTNAME">&changetheme=yes" method="post">
-
+			<form action="archives.pl" method="post">
+                        <INPUT TYPE="HIDDEN" NAME="list" VALUE="<TMPL_VAR NAME="VALUE_LISTNAME">"/>
+                        <INPUT TYPE="HIDDEN" NAME="changetheme" VALUE="yes"/>
 			<TMPL_VAR NAME="PREFS_THEME">
+			<br/>
 			<INPUT TYPE="SUBMIT" VALUE="<TMPL_VAR NAME="TEXT_SUBMIT_THEME">"/>
 			</form>
 		<br/>
-			<form action="archives.pl?action=byyear&list=<TMPL_VAR NAME="VALUE_LISTNAME">&changelang=yes" method="post">
+			<form action="archives.pl" method="post">
+                        <INPUT TYPE="HIDDEN" NAME="list" VALUE="<TMPL_VAR NAME="VALUE_LISTNAME">"/>
+                        <INPUT TYPE="HIDDEN" NAME="changelang" VALUE="yes"/>
+
 
 			<TMPL_VAR NAME="PREFS_LANG">
+			<br/>
 			<INPUT TYPE="SUBMIT" VALUE="<TMPL_VAR NAME="TEXT_SUBMIT_LANG">"/>
 			</form>
 	</div>
@@ -37,7 +43,9 @@
 	</div>
 
 	<div class="list">
+		<ul>
 		<TMPL_VAR NAME="MAIN">
+		</ul>
 	</div>
 	</body>
 </html>

Modified: trunk/vhffs-listengine/src/archives/templates/byday_sub.tmpl
==============================================================================
--- trunk/vhffs-listengine/src/archives/templates/byday_sub.tmpl (original)
+++ trunk/vhffs-listengine/src/archives/templates/byday_sub.tmpl Thu Jan 26 18:23:43 2006
@@ -1,3 +1,5 @@
+<li>
 <a href="archives.pl?list=<TMPL_VAR NAME="LISTNAME">&method=list&year=<TMPL_VAR NAME="YEAR">&month=<TMPL_VAR NAME="MONTH">&day=<TMPL_VAR NAME="DAY">">
 <TMPL_VAR NAME="VALUE_YEAR">/<TMPL_VAR NAME="VALUE_MONTH">/<TMPL_VAR NAME="DAY">
 </a>
+</li>

Modified: trunk/vhffs-listengine/src/archives/templates/bymonth.tmpl
==============================================================================
--- trunk/vhffs-listengine/src/archives/templates/bymonth.tmpl (original)
+++ trunk/vhffs-listengine/src/archives/templates/bymonth.tmpl Thu Jan 26 18:23:43 2006
@@ -20,25 +20,29 @@
 	</div>
 
 	<div class="prefs">
-			<form action="archives.pl?action=byyear&list=<TMPL_VAR NAME="VALUE_LISTNAME">&changetheme=yes" method="post">
-<INPUT TYPE="HIDDEN" NAME="listname" VALUE="<TMPL_VAR NAME="VALUE_LISTNAME">"/>
+			<form action="archives.pl" method="post">
+			<INPUT TYPE="HIDDEN" NAME="list" VALUE="<TMPL_VAR NAME="VALUE_LISTNAME">"/>
 			<INPUT TYPE="HIDDEN" NAME="changetheme" VALUE="yes"/>
-			<INPUT TYPE="HIDDEN" NAME="action" VALUE="bymonth""/>
-
+			<INPUT TYPE="HIDDEN" NAME="method" VALUE="byyear""/>
 			<TMPL_VAR NAME="PREFS_THEME">
+			<br/>
 			<INPUT TYPE="SUBMIT" VALUE="<TMPL_VAR NAME="TEXT_SUBMIT_THEME">"/>
 			</form>
 		<br/>
-			<form action="archives.pl?action=byyear&list=<TMPL_VAR NAME="VALUE_LISTNAME">&changelang=yes" method="post">
-
+			<form action="archives.pl" method="post">
 			<TMPL_VAR NAME="PREFS_LANG">
+			<INPUT TYPE="HIDDEN" NAME="method" VALUE="byyear"/>
+			<INPUT TYPE="HIDDEN" NAME="changelang" VALUE="yes"/>
+			<INPUT TYPE="HIDDEN" NAME="list" VALUE="<TMPL_VAR NAME="VALUE_LISTNAME">"/>
+			<br/>
 			<INPUT TYPE="SUBMIT" VALUE="<TMPL_VAR NAME="TEXT_SUBMIT_LANG">"/>
 			</form>
 	</div>
 
-
 	<div class="list">
-<TMPL_VAR NAME="MAIN">
+		<ul>
+			<TMPL_VAR NAME="MAIN">
+		</ul>
 	</div>
 	</body>
 </html>

Modified: trunk/vhffs-listengine/src/archives/templates/bymonth_sub.tmpl
==============================================================================
--- trunk/vhffs-listengine/src/archives/templates/bymonth_sub.tmpl (original)
+++ trunk/vhffs-listengine/src/archives/templates/bymonth_sub.tmpl Thu Jan 26 18:23:43 2006
@@ -1,3 +1,5 @@
+<li>
 <a href="archives.pl?list=<TMPL_VAR NAME="LISTNAME">&method=byday&year=<TMPL_VAR NAME="YEAR">&month=<TMPL_VAR NAME="MONTH">">
 		<TMPL_VAR NAME="TEXT_ARCHIVES_MONTH"> <TMPL_VAR NAME="TEXT_MONTH"> <TMPL_VAR NAME="YEAR">
 </a>
+</li>

Modified: trunk/vhffs-listengine/src/archives/templates/byyear.tmpl
==============================================================================
--- trunk/vhffs-listengine/src/archives/templates/byyear.tmpl (original)
+++ trunk/vhffs-listengine/src/archives/templates/byyear.tmpl Thu Jan 26 18:23:43 2006
@@ -15,26 +15,32 @@
 	</div>
 
 	<div class="prefs">
-			<form method="post" action="archives.pl">
+			<form method="post" action="archives.pl?list=<TMPL_VAR NAME="VALUE_LISTNAME">&changetheme=yes">
 
 			<TMPL_VAR NAME="PREFS_THEME">
 
 			<INPUT TYPE="HIDDEN" NAME="list" VALUE="<TMPL_VAR NAME="VALUE_LISTNAME">"/>
 			<INPUT TYPE="HIDDEN" NAME="changetheme" VALUE="yes"/>
-			<INPUT TYPE="HIDDEN" NAME="action" VALUE="byyear""/>
+			<INPUT TYPE="HIDDEN" NAME="method" VALUE="byyear""/>
+			<br/>
 			<INPUT TYPE="SUBMIT" VALUE="<TMPL_VAR NAME="TEXT_SUBMIT_THEME">"/>
 			</form>
 		<br/>
-			<form action="archives.pl?action=byyear&list=<TMPL_VAR NAME="VALUE_LISTNAME">&changelang=yes" method="post">
+			<form method="post" action="archives.pl?list=<TMPL_VAR NAME="VALUE_LISTNAME">&changelang=yes">
+			<INPUT TYPE="HIDDEN" NAME="list" VALUE="<TMPL_VAR NAME="VALUE_LISTNAME">"/>
+			<INPUT TYPE="HIDDEN" NAME="changelang" VALUE="yes"/>
 
 			<TMPL_VAR NAME="PREFS_LANG">
+			<br/>
 			<INPUT TYPE="SUBMIT" VALUE="<TMPL_VAR NAME="TEXT_SUBMIT_LANG">"/>
 			</form>
 	</div>
 
 
 	<div class="list">
+		<ul>
 		<TMPL_VAR NAME="MAIN">
+		</ul>
 	</div>
 	</body>
 </html>

Modified: trunk/vhffs-listengine/src/archives/templates/byyear_sub.tmpl
==============================================================================
--- trunk/vhffs-listengine/src/archives/templates/byyear_sub.tmpl (original)
+++ trunk/vhffs-listengine/src/archives/templates/byyear_sub.tmpl Thu Jan 26 18:23:43 2006
@@ -1,3 +1,5 @@
+<li>
 <a href="archives.pl?list=<TMPL_VAR NAME="LISTNAME">&method=bymonth&year=<TMPL_VAR NAME="YEAR">">
 	<TMPL_VAR NAME="TEXT_ARCHIVES_YEAR"> <TMPL_VAR NAME="YEAR">
 </a>
+</li>

Modified: trunk/vhffs-listengine/src/archives/templates/list.tmpl
==============================================================================
--- trunk/vhffs-listengine/src/archives/templates/list.tmpl (original)
+++ trunk/vhffs-listengine/src/archives/templates/list.tmpl Thu Jan 26 18:23:43 2006
@@ -17,15 +17,19 @@
 
 	<div class="prefs">
 			<form action="archives.pl?action=byyear&list=<TMPL_VAR NAME="VALUE_LISTNAME">&changetheme=yes" method="post">
-
-			<TMPL_VAR NAME="PREFS_THEME">
-			<INPUT TYPE="SUBMIT" VALUE="<TMPL_VAR NAME="TEXT_SUBMIT_THEME">"/>
+                        	<INPUT TYPE="HIDDEN" NAME="list" VALUE="<TMPL_VAR NAME="VALUE_LISTNAME">"/>
+                	        <INPUT TYPE="HIDDEN" NAME="changelang" VALUE="yes"/>
+				<TMPL_VAR NAME="PREFS_THEME">
+				<br/>
+				<INPUT TYPE="SUBMIT" VALUE="<TMPL_VAR NAME="TEXT_SUBMIT_THEME">"/>
 			</form>
 		<br/>
 			<form action="archives.pl?action=byyear&list=<TMPL_VAR NAME="VALUE_LISTNAME">&changelang=yes" method="post">
-
-			<TMPL_VAR NAME="PREFS_LANG">
-			<INPUT TYPE="SUBMIT" VALUE="<TMPL_VAR NAME="TEXT_SUBMIT_LANG">"/>
+                        	<INPUT TYPE="HIDDEN" NAME="list" VALUE="<TMPL_VAR NAME="VALUE_LISTNAME">"/>
+                	        <INPUT TYPE="HIDDEN" NAME="changelang" VALUE="yes"/>
+				<TMPL_VAR NAME="PREFS_LANG">
+				<br/>
+				<INPUT TYPE="SUBMIT" VALUE="<TMPL_VAR NAME="TEXT_SUBMIT_LANG">"/>
 			</form>
 	</div>
 
@@ -38,7 +42,9 @@
 	
 	
 	<div class="list">
+		<ul>
 		<TMPL_VAR NAME="MAIN">
+		</ul>
 	</div>
 	</body>
 </html>

Modified: trunk/vhffs-listengine/src/archives/templates/list_sub.tmpl
==============================================================================
--- trunk/vhffs-listengine/src/archives/templates/list_sub.tmpl (original)
+++ trunk/vhffs-listengine/src/archives/templates/list_sub.tmpl Thu Jan 26 18:23:43 2006
@@ -1,5 +1,6 @@
-<TMPL_VAR NAME="MSG_SUBJECT"> <TMPL_VAR NAME="MSG_FROM"> <TMPL_VAR NAME="MSG_DATE">
-<a href="show_msg.pl?list=<TMPL_VAR NAME="LISTNAME">&mid=<TMPL_VAR NAME="MSG_ID">">
-	<TMPL_VAR NAME="TEXT_VIEW">
-</a>
-<br/>
+<li>
+	<TMPL_VAR NAME="MSG_SUBJECT">( <TMPL_VAR NAME="MSG_FROM"> )<TMPL_VAR NAME="MSG_DATE">
+	<a href="show_msg.pl?list=<TMPL_VAR NAME="LISTNAME">&mid=<TMPL_VAR NAME="MSG_ID">">
+		<TMPL_VAR NAME="TEXT_VIEW">
+	</a>
+</li>




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/