Fump Additives

Table of contents:

  1. default_footer – automatic footer added to mailings
  2. register_utf8.cgi – registering to list in Fump via UTF-8 coded form
  3. do You need another function? – ideas, orders
 
to content table

default_footer

Fump has (in my opinion) one restriction hampering comfortable use and creating mailings. I mean footer in mail, which should contain at least information like "You can sign out of the mailing. Just click…", because of anti-spam culture. Furthermore, a good manner is that one mailing list has always the same signature (e.g. Greetings, Rafal Wysocki).

Of course there is a possibility to define many footers, but it has two primary disadvantages:

  • You have to remember about adding them at the and of every e-mail
  • When You have many lists, You've got to remember which footer is from which list.

Now imagine, that you create an e-mail

and don't write anything at the end. You don't sign and don't write a link to sign out of the list. However Fump automatically knows, which footer to add, and adds it to every mail from those list.
There is already your signature, sign out link and every information you want to set at the end.
The footer is of course added only to mailing, not to the mails about signing in or out (the first table with messages in Fump).

The default_footer additive is just for that. It requires little interference in code. Otherwise I think that with this description it'll take you only a few minutes.

I almost forgot to write this. These are only a few lines added. It looks inconspicuously, but it works both for text messages and HTML. It of course distinguishes which footer content to choose.

How to do this:

  1. In main Fump's folder find file func.cgi
  2. Make it's backup copy named func_org.cgi, just in case
  3. Open file func.cgi, and find procedure GetMessText (like in code below – around line number 1124) and add these lines. Original code alternates with added code:
     
    sub GetMessText{
    	my ($user,$conf,$mess,$account);
    	$user=shift;
    	$conf=shift;
    	$mess=shift;
    	my $is_download=shift;
    	$account=$user->{fk_account};
    	if($mess->{type}=~/mixed/i){
    		if(length($mess->{mess}) and length($mess->{messhtml})){
    			#nothing to do
    		}elsif(length($mess->{messhtml})){
    			$mess->{type}='html'
    		}else{
    			$mess->{type}='text'
    		}
    	}
    	#Message format
    	if($mess->{type}=~/mixed/i){
    		if($user->{messageformat}==1){
    			#user TEXT
    			$mess->{type}='text';
    		}elsif($user->{messageformat}==2){
    			#user HTML
    			$mess->{type}='html';
    		}else{
    			#user DEFAULT
    			if($mess->{defmesstype}==2){
    				#DEFAULT message TYPE is "HTML"
    				$mess->{type}='html';
    			}else{
    				$mess->{type}='text';
    			}
    		}
    	}
    	my $messtext,$messsubject;
    
    	## RWINSERT
    	## =================================================================
    	## default_footer Fump modification
    	## by Rafal Wysocki
    	## http://registertofump.com
    	## =================================================================
    	my $typesend=$mess->{typesend};
    	my $dopisuj = (($typesend ne 'subscribe')&&($typesend ne 'unsubscribe')&&($typesend ne 'doi'));
    	my $signame='default_'.$mess->{fk_account};
    	my $msgtype=0;
    	my $sigtext='';
    	## /RWINSERT
    
    	if($mess->{type}=~/text/){
    		$messtext=$mess->{mess};
    		$messtext=~s/\[SIGNATURE_([a-zA-Z_0-9]+?)\]/&LoadSignature($1,0)/gse;
    	}else{
    		$messtext=$mess->{messhtml};
    		$messtext=~s/\[SIGNATURE_([a-zA-Z_0-9]+?)\]/&LoadSignature($1,1)/gse;
    
    		## RWINSERT
    		$msgtype=1;
    		## /RWINSERT
    
    	}
    
    	## RWINSERT
    	if ($dopisuj)
    	{
    		#default_nr - stopka do wszystkich wiadomosci
    		$sigtext=&LoadSignature($signame,$msgtype);
    		if ($sigtext ne '')
    		{
    			$messtext = $messtext."\r\n".$sigtext;
    		}
    	}
    	# /RWINSERT
    
    	return($messtext);
    }
    
     
     
  4. Now just define a footer named "default_XX", where XX is mailing list's number, and it'll be automatically added to every mail sent from this list.
    E.g. You've got list no. 1, create footer "default_9" and it's content will be always added to this list's mailings.
     
    Isn't it simple :) ?
 
to content table 

register_utf8.cgi

Allows to register to Fump from any form with UTF-8 sign coding. It encodes it instantly to ISO-8859-2. It's completely independent and doesn't require installing any libraries. At the moment it works only for polish signs. If you need other sign setlet me know

This addition works absolutely "transparently". It changes only coding and passes data to Fump's register.cgi, so user will see exactly the same page which after registration using original script.

Additive usage:

  1. Download additive's file register_utf8.cgi (click right mouse button and choose "save as"). Save it on your disk.
  2. Upload this file from your disk to server – to Fump's folder, that it appears near original register.cgi. Probably you have to use a FTP client. It of course has to have the right to execute (+x). You can grant it the same rights as register.cgi has.
  3. In mailing list registration form find record <form name="subscribeform" method="post"  action="http://****/register.cgi">
  4. In this place type _utf8 before .cgi. It should now be <form name="subscribeform" method="post"  action="http://****/register_utf8.cgi">
  5. Finished. From now You can set the changed form on UTF-8 coded pages, and in Fump it will record in ISO-8859-2
 
to content table 

Do You need another function?

Let me know.