listdir = ""; $this->listname = ""; $this->listdomain = ""; $this->tempdir = ""; $this->sendheaders = TRUE; $this->sendbody = TRUE; $this->sendfooters = TRUE; $this->includebefore = ""; $this->includeafter = ""; $this->href = ""; $this->prefertype = "text/html"; $this->showheaders = array( "to", "from", "subject", "date" ); $this->header_en_francais = array ('to' => 'A', 'from' => 'De', 'subject' => 'Sujet', 'date' => 'Date') ; $this->msgtemplate = "
"; // if blank it will use the internal one $this->tablecolours = array( // delete the next line if you don't want alternating colours "#eeeeee", "#ffffff" ); $this->thread_subjlen = 55; // --- STOP EDITING HERE --- // some sanity checking if ((!is_dir($this->listdir . "/archive")) or (!is_dir($this->listdir . "/archive/authors")) or (!is_dir($this->listdir . "/archive/threads")) or (!is_dir($this->listdir . "/archive/subjects"))) { return false ; /*$this->error(EZMLM_INVALID_DIR,TRUE);*/ } } function set_action($action) { if (is_array($action)) { $this->error(EZMLM_INVALID_SYNTAX,TRUE); } $this->action = $action; } function set_actionargs($actionargs) { if ($this->action == '') { $this->error(EZMLM_INVALID_SYNTAX,TRUE); } $this->actionargs = $actionargs; } function run() { if ($this->action == '') { $this->error(EZMLM_INVALID_SYNTAX,TRUE); } if ($this->sendheaders) { $this->sendheaders(); } if ($this->sendbody) { $this->sendbody(); } if ($this->includebefore != '') { @include_once($this->includebefore); } switch ($this->action) { case "list_info": $info = new ezmlm_listinfo(); $info->display(); break; case "show_msg": if (count($this->actionargs) < 2) { $this->error(EZMLM_INVALID_SYNTAX,TRUE); } $show_msg = new ezmlm_msgdisplay(); $show_msg->display($this->actionargs[0] . "/" . $this->actionargs[1]); break; case "show_threads": $threads = new ezmlm_threads(); $threads->load($this->actionargs[0]); break; case "show_author_msgs": $author = new ezmlm_author(); $author->display($this->actionargs[0]); break; } if ($this->includeafter != '') { @include_once($this->includeafter); } if ($this->sendfooters) { $this->sendfooters(); } } function sendheaders() { print "\n"; print "\n"; print "\n"; } function sendbody() { print "\n"; } function sendfooters() { print "\n"; print "\n"; } // begin common functions // makehash - generates an author hash using the included makehash program function makehash($str) { $str = preg_replace ('/>/', '', $str) ; $handle = popen ('/usr/local/lib/safe_mode/makehash \''.$str.'\'', 'r') ; $hash = fread ($handle, 256) ; pclose ($handle) ; return $hash; } // makelink - writes the tag function makelink($params,$text) { if ($this->forcehref != "") { $basehref = $this->forcehref; } else { $basehref = preg_replace('/^(.*)\?.*/', '\\1', $_SERVER['REQUEST_URI']); } $link = '' . $text . ''; return $link; } // md5_of_file - provides wrapper function that emulates md5_file for PHP < 4.2.0 function md5_of_file($file) { if (function_exists("md5_file")) { // php >= 4.2.0 return md5_file($file); } else { if (is_file($file)) { $fd = fopen($file, "rb"); $filecontents = fread($fd, filesize($file)); fclose ($fd); return md5($filecontents); } else { return FALSE; } } } // protect_email - protects email address turns user@domain.com into user@d... function protect_email($str,$short = FALSE) { if (preg_match("/[a-zA-Z0-9\-\.]\@[a-zA-Z0-9\-\.]*\./", $str)) { $outstr = preg_replace("/([a-zA-Z0-9\-\.]*\@)([a-zA-Z0-9\-\.])[a-zA-Z0-9\-\.]*\.[a-zA-Z0-9\-\.]*/","\\1\\2...",$str); $outstr = preg_replace("/\", '<', $outstr); $outstr = preg_replace("/\>/", '>', $outstr); } else { $outstr = $str; } if ($short) { $outstr = preg_replace("/<.*>/", '', $outstr); $outstr = preg_replace("/[\"']/", '', $outstr); } return trim($outstr); } // cleanup_body: sortta like protect_email, just for message bodies function cleanup_body($str) { $outstr = preg_replace("/([a-zA-Z0-9\-\.]*\@)([a-zA-Z0-9\-\.])[a-zA-Z0-9\-\.]*\.[a-zA-Z0-9\-\.]*/","\\1\\2...",$str); return $outstr; } function error($def, $critical = FALSE) { global $ezmlm_error; print "\n\n"; print "
EZMLM-PHP Error: " . $ezmlm_error[$def]['title'] . " |
" . $ezmlm_error[$def]['body'] . " |