Newsletter?

2peu

No avatar

2006-03-08 11:23

How about implementing a simple newsletter to Qc?
I am no php expert, but maybe someone can take a free php newsletter script and implement it to Qc..i think many of us will apreciate it..? so...anybody..?

2peu

No avatar

2006-03-09 05:00

please..take a number...don't rush... :)

wallace

No avatar

2006-03-09 10:21

a quicky is just download a fine Opensource Newsletter system and insert it on a page with an iframe...

~gumon

No avatar

2006-08-03 21:55

whats wrong?

<?
function checkmail ($newsmail)

    global 
$listfile;
    
$fd fopen ($listfile"r");
    
$contents fread ($fdfilesize ($listfile));
    
fclose ($fd);
    
    if (@
stristr($contents,$newsmail))
        
$valid "invalid";
    if (
ereg("^.+@.+\\..+$)"$newsmail) && !isset($valid))
        
$valid "valid";
    else
        
$valid "invalid";
    
    return 
$valid;
}

if (
$action == "subscribe" && isset($newsmail))
{
    
$valid checkmail($newsmail);
    if (
$valid == "valid")
    {
    
        
$fp fopen('$listfile''a+');
            
flock($fp,2); 
            
fwrite($fp,"".strtolower($newsmail).","); 
        
fclose($fp);
        
header ("Location: ".$welcome."");
        exit;                 

    }
    else {
        
header ("Location: ".$error."");
        exit;                 
    }
}    
elseif (
$action == "unsubscribe" && isset($newsmail))
{
    
$fd fopen ('$listfile'"r");
    
$contents fread ($fdfilesize ($listfile));
    
fclose ($fd);
    
$allpeople "";
    
$entries explode(",",$contents);
    for(
$i=0;$i<count($entries);$i++)
    {
        if (
strtolower($newsmail) == strtolower($entries[$i]))
            
$found "yes";
        elseif (
$entries[$i] != "")
            
$allpeople .= "".$entries[$i].",";
    }
    if (
$found == "yes")
    {
        
$fp fopen('$listfile''w'); 
            
fwrite($fp,$allpeople); 
        
fclose($fp);
    }
    
header ("Location: ".$goodbye."");
    exit;                 
    
}
else
    
header ("Location: ".$error."");
    exit; 

?>

michelle

No avatar

2006-11-12 20:10

<?
function checkmail ($newsmail)
{
global $listfile;
$fd = fopen ($listfile, "r");
$contents = fread ($fd, filesize ($listfile));
fclose ($fd);

if (@stristr($contents,$newsmail))
$valid = "invalid";
if (ereg("^.+@.+\\..+$)", $newsmail) && !isset($valid))
$valid = "valid";
else
$valid = "invalid";

return $valid;
}

if ($action == "subscribe" && isset($newsmail))
{
$valid = checkmail($newsmail);
if ($valid == "valid")
{

$fp = fopen('$listfile', 'a+');
flock($fp,2);
fwrite($fp,"".strtolower($newsmail).",");
fclose($fp);
header ("Location: ".$welcome."");
exit;

}
else {
header ("Location: ".$error."");
exit;
}
}
elseif ($action == "unsubscribe" && isset($newsmail))
{
$fd = fopen ('$listfile', "r");
$contents = fread ($fd, filesize ($listfile));
fclose ($fd);
$allpeople = "";
$entries = explode(",",$contents);
for($i=0;$i<count($entries);$i++)
{
if (strtolower($newsmail) == strtolower($entries[$i]))
$found = "yes";
elseif ($entries[$i] != "")
$allpeople .= "".$entries[$i].",";
}
if ($found == "yes")
{
$fp = fopen('$listfile', 'w');
fwrite($fp,$allpeople);
fclose($fp);
}
header ("Location: ".$goodbye."");
exit;

}
else
header ("Location: ".$error."");
exit;

?>

KiralyVlad

No avatar

2006-11-12 20:27

And what is this, by the way ? A plugin ?

Back to top
about us | contact