Additions:
require_once dirname(__FILE__)."/texts/dutch.inc"; #HW: change this to the language file you use
define("__QUERY__","select * from ".$table_prefix."message,".$table_prefix."list,".$table_prefix."listmessage where ".$table_prefix."list.id=".$listID." and ".$table_prefix."list.id=".$table_prefix."listmessage.listid and ".$table_prefix."message.id=".$table_prefix."listmessage.messageid and ".$table_prefix."list.active=1");
print("
« {$GLOBALS['strBack']}");
printf('
//printf("
Sent: %s
",
printf("%s
Sent: %s
",
// printf("
Sent: %s
",
//stripslashes($_ROW['name']),$_SERVER['PHP_SELF'],$_ROW['messageid'],$_ROW['subject'],$_ROW['sent']);
$_SERVER['PHP_SELF'],$_ROW['messageid'],$_ROW['subject'],$_ROW['sent']);
$fromURL="http://".$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']."?x=".$_ROW['messageid']."&listID=".$listID."&layoutID=".$layoutID."&pagerows=".$pagerows."&pagenum=".$pagenum;
print("
« {$GLOBALS['strBack']}");
echo " « $First ";
echo " ‹ $Prev ";
echo " $Next › ";
echo " $Last » ";
$_QUERY = sprintf("select * from ".$table_prefix."message where id=%s",intval($_GET['x']));
$_ROW['message'] = str_replace("[FOOTER]", nl2br($_ROW['footer']), $_ROW['message']);
printf("
« " . $ArchiveTitle . "".
// printf(" « Archive".
$_QUERY2 = sprintf("select * from ".$table_prefix."message_attachment where messageid=%s",$_ROW['id']);
printf("\r\n
\r\n
define("__QUERY__","select * from ".$table_prefix."message,".$table_prefix."list,".$table_prefix."listmessage where ".$table_prefix."list.id=".$listID." and ".$table_prefix."list.id=".$table_prefix."listmessage.listid and ".$table_prefix."message.id=".$table_prefix."listmessage.messageid and ".$table_prefix."list.active=1");
print("
$NoActiveLists
« {$GLOBALS['strBack']}");
printf('
'.$_ROW['name'].'
', basename($_SERVER['PHP_SELF']));//printf("
%s
%sSent: %s
",
printf("%s
Sent: %s
",
// printf("
%s
%sSent: %s
",
//stripslashes($_ROW['name']),$_SERVER['PHP_SELF'],$_ROW['messageid'],$_ROW['subject'],$_ROW['sent']);
$_SERVER['PHP_SELF'],$_ROW['messageid'],$_ROW['subject'],$_ROW['sent']);
$fromURL="http://".$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']."?x=".$_ROW['messageid']."&listID=".$listID."&layoutID=".$layoutID."&pagerows=".$pagerows."&pagenum=".$pagenum;
print("
$EmptyArchive
« {$GLOBALS['strBack']}");
echo " « $First ";
echo " ‹ $Prev ";
echo " $Next › ";
echo " $Last » ";
$_QUERY = sprintf("select * from ".$table_prefix."message where id=%s",intval($_GET['x']));
$_ROW['message'] = str_replace("[FOOTER]", nl2br($_ROW['footer']), $_ROW['message']);
printf("
« " . $ArchiveTitle . "".
// printf(" « Archive".
$_QUERY2 = sprintf("select * from ".$table_prefix."message_attachment where messageid=%s",$_ROW['id']);
printf("\r\n
\r\n
$strAttachmentIntro\r\n\r\n");
| $i\r\n"); $_QUERY3 = sprintf("select * from ".$table_prefix."attachment where id=%s",$_ROW2); if($RS3 = mysql_query($_QUERY3, $DB)) { $_ROW3 = mysql_fetch_assoc($RS3); $_ROW3['remotefile'] = "{$_ROW3['remotefile']}"; unset($_ROW3['id'], $_ROW3['filename']); $_ROW3['size'] = size_hum_read($_ROW3['size']); foreach ($_ROW3 as $value) printf(" | $value\r\n"); } } if ($i > 0) printf(" |
if(mysql_num_rows($RS)<=0){
print("
Could not retrieve the selected message.
« Back");
}
mysql_free_result($RS);
mysql_close($DB);
}else{
mysql_free_result($RS);
mysql_close($DB);
print($ArchiveNoItem);
exit(0);
}
}else{
mysql_close($DB);
print("
Could not select database.
");}
}else{
print("
Could not connect to database.
");}
// This is a very naive implementation, it doesn't properly
// parse the "img" tag, but only looks for the string
// '
$colonStr = strpos( $pCode, ":", $srcPos );
$subStrLen = $srcPos + 10 - $index; // 10 = size of "
$index += $subStrLen;
if( ($colonStr < 12) || ($colonStr > 16) || ($colonStr === false) )
// somewhat arbitrary
{
// modify the string by adding the $baseUrl
echo( $baseUrl );
}
$subStrLen = strlen( $code ) - $index;
echo( substr( $pCode, $index, $subStrLen) );
$index = strlen( $code );
return strpos(strtolower($str),strtolower($needle),$offset);
$fr = '';
while ( !feof($fd) ) {
$fr .= fread( $fd, 8192 );
}
// for PHP <5, you have to change these to strpos(), and it becomes case-sensitive.
//$start = stripos( $fr, $startString ) + strlen($startString);
$start = stripos( $fr, $startString ) ;
$finish = stripos( $fr, $endString ); // - strlen($endString);
{
$start += strlen($startString);
$length = $finish - $start;
$code = Substr( $fr, $start, $length );
addBase( $baseUrl, $code );
}
else
report( "", $report );
report( "", $report );
Deletions:
if(mysql_select_db($database_name)){
$_QUERY = "select * from ".$table_prefix."list where active=1";
if($RS = mysql_query($_QUERY, $DB)) {
if(mysql_num_rows($RS)<=0) {
print("
No active lists found.
« Back");
} else {
if (isset($GLOBALS['strArchiveList']))
else
print("
$archivelist
\n");while($_ROW = mysql_fetch_assoc($RS)){
printf('
'.$_ROW['name'].'
', basename($_SERVER['PHP_SELF']));printf("
".stripslashes($_ROW['description'])."
\n\n");}
}
mysql_free_result($RS);
mysql_close($DB);
}else{
mysql_free_result($RS);
mysql_close($DB);
print($ArchiveNoItem);
exit(0);
}
}else{
mysql_close($DB);
print("
Could not select database.
");}
print("
Could not connect to database.
");if($DB = mysql_connect($database_host, $database_user, $database_password)){
if(mysql_select_db($database_name)){
if($tmp_res = mysql_query(__QUERY__, $DB)){
// find the number of rows returned
$rows = mysql_num_rows($tmp_res);
// and tell us the pagenumber of the last page
$last_page = ceil($rows/$pagerows);
// let the pagenumber not be larger than the last page
if ($pagenum > $last_page) {
$pagenum = $last_page;
}
// add a limit statement for the sql
$query = __QUERY__ ;
$query .= ' order by sent DESC limit ' .($pagenum - 1) * $pagerows .',' .$pagerows;
// print the name of the list here, so it doesn't get printed
// multiple times for each message
// we only need to fetch one row to know the name
$row = mysql_fetch_assoc($tmp_res);
printf("
".$row['name']."
");
mysql_free_result($tmp_res);
}
if($RS = mysql_query($query, $DB)){
while($_ROW = mysql_fetch_assoc($RS)){
// Print the selected newsletter...
// Note: the original line of code will take the layoutID from
// the command line.
// I prefer using the alternative code line where the layoutID
// is predefined, because I need the page displaying the
// listing of newsletters to be in a different layout than
// the newsletters. In my case I use layoutID=3 for displaying
// the newsletter itself. I still use the command line layoutID
// to display the listing of newsletters, which in my case is
// layoutID=1
// Original code to print the selected newsletter:
//printf("
%s
%sSent: %s
",
if (!isset($_GET['layoutID']) || $_GET['layoutID']<1)
printf("%s
Sent: %s
",
// Alternative code to print the selected newsletter
// with a predefined layoutID:
// printf("
%s
%sSent: %s
",
//stripslashes($_ROW['name']),$_SERVER['PHP_SELF'],$_ROW['messageid'],$_ROW['subject'],$_ROW['sent']);
$_SERVER['PHP_SELF'],$_ROW['messageid'],$_ROW['subject'],$_ROW['sent']);
// mickey: print a snippet of the newsletter
printf("
");
$fromURL="http://".$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']."?x=".$_ROW['messageid']."&listID=".$listID."&layoutID=".$layoutID."&pagerows=".$pagerows."&pagenum=".$pagenum;
$baseURL="http://".$_Server['SERVER_NAME'] ;
includeFrom( $fromURL,
$baseURL,
"", ",
"
TRUE );
printf("
");
}
if(mysql_num_rows($RS)<=0){
print("
No entries were found in the archive.
« Back");
}
mysql_free_result($RS);
mysql_close($DB);
// the first/previous and next/last links
echo "
";
if ($pagenum != 1) {
echo " « First ";
echo " ";
$previous = $pagenum-1;
echo " ‹ Previous ";
}
if ($pagenum != $last_page) {
$next = $pagenum+1;
echo " Next › ";
echo " ";
echo " Last » ";
}
// Back to archives list of lists
echo "\n";
}else{
mysql_free_result($RS);
mysql_close($DB);
print($ArchiveNoItem);
exit(0);
}
}else{
mysql_close($DB);
print("
Could not select database.
");}
}else{
print("
Could not connect to database.
");}
if($DB = mysql_connect($database_host, $database_user, $database_password)){
if(mysql_select_db($database_name)){
$_QUERY = sprintf("select * from ".$table_prefix."message where id=%s",intval($_GET['x']));
if($RS = mysql_query($_QUERY, $DB)){
$_ROW = mysql_fetch_assoc($RS);
// Re-print the list of selected newsletters after clicking on
// the archive link in the header of a displayed newsletter
// Note: the original line of code will take the layoutID from
// the command line.
// I prefer using the alternative code line where the layoutID
// is predefined, because I need the page displaying the
// listing of newsletters to be in a different layout than
// the newsletters.
$_TEMPROW = mysql_fetch_assoc($_TEMPRS);
$_TEMPROW = stripslashes($_TEMPROW["template"]);
$_ROW['message'] = str_replace("[CONTENT]", $_ROW['message'], $_TEMPROW);
if (strpos($_TEMPROW, "[FOOTER]") !== false) {
$_ROW['message'] = str_replace("[FOOTER]", $_ROW['footer'], $_ROW['message']);
$_ROW['footer'] = "";
}
if (!empty($_ROW['footer']))
$_ROW['footer'] = "\r\n
" . $_ROW['footer'];
// Original code to re-print the list of selected newsletters:
printf("
« Archive".
// Alternative code to re-print the list of selected newsletters
// with a predefined layoutID:
// printf(" « Archive".
"
%s
".// "
Sent: %s
".
"
%s%s",
basename($_SERVER['PHP_SELF']),
$_ROW['subject'],
// $_ROW['sent'],
nl2br($_ROW['message']),
nl2br($_ROW['footer']));
$i = 0;
$_QUERY2 = sprintf("select * from ".$table_prefix."message_attachment where messageid=%s",$_ROW['id']);
$RS2 = mysql_query($_QUERY2, $DB);
while ($_ROW2 = mysql_fetch_assoc($RS2)) {
if ($i == 1)
printf("\r\n
\r\n
$strAttachmentIntro\r\n\r\n");
\r\n
\r\n");| $i\r\n"); $_QUERY3 = sprintf("select * from ".$table_prefix."attachment where id=%s",$_ROW2); if($RS3 = mysql_query($_QUERY3, $DB)) { $_ROW3 = mysql_fetch_assoc($RS3); $_ROW3['remotefile'] = "{$_ROW3['remotefile']}"; unset($_ROW3['id'], $_ROW3['filename']); $_ROW3['size'] = size_hum_read($_ROW3['size']); foreach ($_ROW3 as $value) printf(" | $value\r\n"); } } if ($i > 0) printf(" |
if(mysql_num_rows($RS)<=0){
print("
Could not retrieve the selected message.
« Back");
}
mysql_free_result($RS);
mysql_close($DB);
}else{
mysql_free_result($RS);
mysql_close($DB);
print($ArchiveNoItem);
exit(0);
}
}else{
mysql_close($DB);
print("
Could not select database.
");}
}else{
print("
Could not connect to database.
");}
// This is a very naive implementation, it doesn't properly
// parse the "img" tag, but only looks for the string
// '
$colonStr = strpos( $pCode, ":", $srcPos );
$subStrLen = $srcPos + 10 - $index; // 10 = size of "
$index += $subStrLen;
if( ($colonStr < 12) || ($colonStr > 16) || ($colonStr === false) )
// somewhat arbitrary
{
// modify the string by adding the $baseUrl
echo( $baseUrl );
}
$subStrLen = strlen( $code ) - $index;
echo( substr( $pCode, $index, $subStrLen) );
$index = strlen( $code );
return strpos(strtolower($str),strtolower($needle),$offset);
$fr = '';
while ( !feof($fd) ) {
$fr .= fread( $fd, 8192 );
}
// for PHP <5, you have to change these to strpos(), and it becomes case-sensitive.
//$start = stripos( $fr, $startString ) + strlen($startString);
$start = stripos( $fr, $startString ) ;
$finish = stripos( $fr, $endString ); // - strlen($endString);
{
$start += strlen($startString);
$length = $finish - $start;
$code = Substr( $fr, $start, $length );
addBase( $baseUrl, $code );
}
else
report( "", $report );
report( "", $report );
Additions:
* @version $Id: v1.7, 2008-10-20
Deletions:
Additions:
if (isset($strDir))
$direction = $strDir;
else
$direction = "ltr";
$theheader = str_replace('
$direction = $strDir;
else
$direction = "ltr";
$theheader = str_replace('
', 'print($data["header"]);
printf("\r\n
\r\n$strAttachmentIntro\r\n\r\n");
\r\n");
CategoryHacks
[[PhplistDevelopment phplist Development]]
CategoryDevelopment
If you want to be able to browse newsletters' archives, then will need this standalone file:
', $data["header"]);
print($theheader);
printf("\r\n
\r\n
print($theheader);
printf("\r\n
\r\n
$strAttachmentIntro\r\n\r\n");
\r\n
\r\n");Deletions:
printf("\r\n
\r\n$strAttachmentIntro\r\n
Additions:
CategoryDevelopment
Deletions:
Additions:
[[PhplistHacks phplist Hacks]]
CategoryHacks
CategoryHacks
Deletions:
CategoryDevelopment
Additions:
If you want to be able to browse newsletters' archives, then will need this standalone file add-on:
Deletions:
Revision [1662]
The oldest known version of this page was created on 2008-10-14 21:02:13 by LwC
Page was generated in 0.1943 seconds



