larger smaller normal text version of this page

Revision [2038]

Last edited on 2009-11-03 12:21:52 by LwC [Tried to fix wrapping]
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("

$NoActiveLists



« {$GLOBALS['strBack']}");
printf('

'.$_ROW['name'].'

', basename($_SERVER['PHP_SELF']));
//printf("

%s

%s
Sent: %s

",
printf("%s
Sent: %s

",
// printf("

%s

%s
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("

$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");
$_QUERY3 = sprintf("select * from ".$table_prefix."attachment where id=%s",$_ROW2);
$_ROW3['remotefile'] = "{$_ROW3['remotefile']}";
print("

$InvalidMessage



« {$GLOBALS['strBack']}");
Deletions:
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("

$NoActiveLists



href='javascript:history.back();'>« {$GLOBALS['strBack']}");
printf('

'.$_ROW
['name'].'

', basename($_SERVER['PHP_SELF']));
//printf("

%s

%s
Sent: %s

",
printf("%s
Sent: %s

",
// printf("

%s

%s
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("

$EmptyArchive



href='javascript:history.back();'>« {$GLOBALS['strBack']}");
echo " &pagerows={$pagerows}&pagenum=1'> « $First ";
echo " &pagerows={$pagerows}&pagenum=$previous'> ‹ $Prev ";
echo " &pagerows={$pagerows}&pagenum=$next'> $Next › ";
echo " &pagerows={$pagerows}&pagenum=$last_page'> $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("
listID=".$listID."&layoutID=".$layoutID."&pagerows=".$pagerows."&pagenum=".$pagenum.">&
laquo; " . $ArchiveTitle . "
".
// printf("   ['listID']."&layoutID=1>« Archive".
$_QUERY2 = sprintf("select * from ".$table_prefix."message_attachment
where messageid=%s",$_ROW['id']);
printf("\r\n
\r\n
dir=\"$Direction\">$strAttachmentIntro\r\n
\r\n");
$_QUERY3 = sprintf("select * from ".$table_prefix."attachment where
id=%s",$_ROW2);
$_ROW3['remotefile'] = " {$GLOBALS['pageroot']}/dl.php?id={$_ROW3['id']}\">{$_ROW3['remotefile']}";
print("

$InvalidMessage



href='javascript:history.back();'>« {$GLOBALS['strBack']}");

Revision [2031]

Edited on 2009-10-14 01:26:53 by LwC [Line fix]
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("

$NoActiveLists



href='javascript:history.back();'>« {$GLOBALS['strBack']}");
printf('

'.$_ROW
['name'].'

', basename($_SERVER['PHP_SELF']));
//printf("

%s

%s
Sent: %s

",
printf("%s
Sent: %s

",
// printf("

%s

%s
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("

$EmptyArchive



href='javascript:history.back();'>« {$GLOBALS['strBack']}");
echo " &pagerows={$pagerows}&pagenum=1'> « $First ";
echo " &pagerows={$pagerows}&pagenum=$previous'> ‹ $Prev ";
echo " &pagerows={$pagerows}&pagenum=$next'> $Next › ";
echo " &pagerows={$pagerows}&pagenum=$last_page'> $Last » ";
$_QUERY = sprintf("select * from ".$table_prefix."message where id=%s",intval
($_GET['x']));
} else
unset($_TEMPROW);
if (isset($_TEMPROW) && strpos($_TEMPROW, "[FOOTER]") !== false) {
$_ROW['message'] = str_replace("[FOOTER]", nl2br($_ROW['footer']), $_ROW
['message']);
printf("
listID=".$listID."&layoutID=".$layoutID."&pagerows=".$pagerows."&pagenum=".$pagenum.">&
laquo; " . $ArchiveTitle . "
".
// printf("   ['listID']."&layoutID=1>« Archive".
$_QUERY2 = sprintf("select * from ".$table_prefix."message_attachment
where messageid=%s",$_ROW['id']);
printf("\r\n
\r\n
dir=\"$Direction\">$strAttachmentIntro\r\n
\r\n");
$_QUERY3 = sprintf("select * from ".$table_prefix."attachment where
id=%s",$_ROW2);
$_ROW3['remotefile'] = " {$GLOBALS['pageroot']}/dl.php?id={$_ROW3['id']}\">{$_ROW3['remotefile']}";
print("

$InvalidMessage



href='javascript:history.back();'>« {$GLOBALS['strBack']}");
Deletions:
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("

$NoActiveLists



« {$GLOBALS['strBack']}");
printf('

'.$_ROW['name'].'

', basename($_SERVER['PHP_SELF']));
//printf("

%s

%s
Sent: %s

",
printf("%s
Sent: %s

",
// printf("

%s

%s
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("

$EmptyArchive



« {$GLOBALS['strBack']}");
echo " « $First ";
echo " ‹ $Prev ";
echo " $Next › ";
echo " $Last » ";
$_QUERY = sprintf("select * from ".$table_prefix."message where id=%s",intval($_GET['x']));
if (isset($_TEMPROW["template"]) && strpos($_TEMPROW, "[FOOTER]") !== false) {
$_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");
$_QUERY3 = sprintf("select * from ".$table_prefix."attachment where id=%s",$_ROW2);
$_ROW3['remotefile'] = "{$_ROW3['remotefile']}";
print("

$InvalidMessage



« {$GLOBALS['strBack']}");

Revision [2030]

Edited on 2009-10-14 01:19:47 by LwC [New version]
Additions:
* @version $Id: v1.9, 2009-10-14
* Making sure not to use invalid templates
// v1.9 code - start
if (isset($_TEMPROW["template"])) {
$_TEMPROW = stripslashes($_TEMPROW["template"]);
$_ROW['message'] = str_replace("[CONTENT]", $_ROW['message'], $_TEMPROW);
if (isset($_TEMPROW["template"]) && strpos($_TEMPROW, "[FOOTER]") !== false) {
// v1.9 code - end
Deletions:
$_TEMPROW = stripslashes($_TEMPROW["template"]);
$_ROW['message'] = str_replace("[CONTENT]", $_ROW['message'], $_TEMPROW);
if (strpos($_TEMPROW, "[FOOTER]") !== false) {


Revision [2029]

Edited on 2009-10-13 12:35:06 by LwC [Fixed wrapping problem]
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("

$NoActiveLists



« {$GLOBALS['strBack']}");
printf('

'.$_ROW['name'].'

', basename($_SERVER['PHP_SELF']));
//printf("

%s

%s
Sent: %s

",
printf("%s
Sent: %s

",
// printf("

%s

%s
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("

$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");
$_QUERY3 = sprintf("select * from ".$table_prefix."attachment where id=%s",$_ROW2);
$_ROW3['remotefile'] = "{$_ROW3['remotefile']}";
print("

$InvalidMessage



« {$GLOBALS['strBack']}");
Deletions:
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("

$NoActiveLists



href='javascript:history.back();'>« {$GLOBALS['strBack']}");
printf('

'.$_ROW
['name'].'

', basename($_SERVER['PHP_SELF']));
//printf("

%s

%s
Sent: %s

",
printf("%s
Sent: %s

",
// printf("

%s

%s
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("

$EmptyArchive



href='javascript:history.back();'>« {$GLOBALS['strBack']}");
echo " &pagerows={$pagerows}&pagenum=1'> « $First ";
echo " &pagerows={$pagerows}&pagenum=$previous'> ‹ $Prev ";
echo " &pagerows={$pagerows}&pagenum=$next'> $Next › ";
echo " &pagerows={$pagerows}&pagenum=$last_page'> $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("
listID=".$listID."&layoutID=".$layoutID."&pagerows=".$pagerows."&pagenum=".$pagenum.">&
laquo; " . $ArchiveTitle . "
".
// printf("   ['listID']."&layoutID=1>« Archive".
$_QUERY2 = sprintf("select * from ".$table_prefix."message_attachment
where messageid=%s",$_ROW['id']);
printf("\r\n
\r\n
dir=\"$Direction\">$strAttachmentIntro\r\n
\r\n");
$_QUERY3 = sprintf("select * from ".$table_prefix."attachment where
id=%s",$_ROW2);
$_ROW3['remotefile'] = " {$GLOBALS['pageroot']}/dl.php?id={$_ROW3['id']}\">{$_ROW3['remotefile']}";
print("

$InvalidMessage



href='javascript:history.back();'>« {$GLOBALS['strBack']}");

Revision [2024]

Edited on 2009-10-04 01:52:12 by LwC [New version]
Additions:
* The additions of the following versions were made by http://lior.weissbrod.com
* @version $Id: v1.8, 2009-10-04
* @package Contribution to PHPlist 2.10.10
* Changes:
+ nl2br only used for plaintext messages
+ Individual page titles when viewing specific items
+ Continued multilingual support
* Changes:
+ Attachment support (even more so, the file sizes are displayed in human readable form)!
+ layoutID is actually used!
+ layoutID defaults to "none" and is taken automatically from each message's setting
+ Added Content-Type header (taken from the active language file)
+ List descriptions go through stripslashes
+ Started multilingual support (with optional opt-in values styled $strArchiveX)
require_once dirname(__FILE__)."/texts/dutch.inc"; #HW: change this to the language file you
use
// v1.8 code - start
$multilingual = array(
'Direction' => "ltr",
'ArchiveNoItem' => "No such item",
'ArchiveTitle' => "Archives",
'ArchiveList' => "Please select a list to see its archive",
'First' => "First",
'Last' => "Last",
'Next' => "Next",
'Prev' => "Previous",
'ViewLists' => "List of mailing lists",
'NoActiveLists' => "No active lists found",
'EmptyArchive' => "No entries were found in the archive",
'InvalidMessage' => "Could not retrieve the selected message",
'database_unselected' => "Could not select database",
'database_unconnected' => "Could not connect to database"
);
foreach ($multilingual as $key => $value) {
if (isset($GLOBALS["str$key"]))
$$key = $GLOBALS["str$key"];
else
$$key = $value;
// v1.8 code - end
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");
// v1.8 code - start
print("$ArchiveTitle\r\n$theheader");
print("

$NoActiveLists



href='javascript:history.back();'>« {$GLOBALS['strBack']}");
print("$ArchiveList\r\n$theheader");
// 1.8 code - end
// 1.7 code - start
print("

$ArchiveList

\n");
printf('

'.$_ROW
['name'].'

', basename($_SERVER['PHP_SELF']));
// v1.8 code - start
print("

$database_unselected

");
print("

$database_unconnected

");
// v1.8 code - end
// v1.8 code - start
print("$ArchiveTitle {$row['name']}\r\n$theheader");
printf("

$ArchiveTitle {$row['name']}


");
// v1.8 code - end
//printf("

%s

%s
Sent: %s

",
printf("%s
Sent: %s

",
// printf("

%s

%s
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;
// v1.8 code - start
print("

$EmptyArchive



href='javascript:history.back();'>« {$GLOBALS['strBack']}");
// v1.8 code - end
// v1.8 code - start
echo "

";
echo " &pagerows={$pagerows}&pagenum=1'> « $First ";
echo " &pagerows={$pagerows}&pagenum=$previous'> ‹ $Prev ";
echo " &pagerows={$pagerows}&pagenum=$next'> $Next › ";
echo " &pagerows={$pagerows}&pagenum=$last_page'> $Last » ";
echo "
";
// v1.8 code - end
// v1.8 code - start
echo "\n
\n
$ViewLists
";
// 1.8 code - end
// v1.8 code - start
print("

$database_unselected

");
print("

$database_unconnected

");
// v1.8 code - end
$_QUERY = sprintf("select * from ".$table_prefix."message where id=%s",intval
($_GET['x']));
// v1.8 code - start
print("{$_ROW['subject']}\r\n$theheader");
// v1.8 code - end
// v1.8 code - start
if (!$_ROW['htmlformatted'])
$_ROW['message'] = nl2br($_ROW['message']);
$_ROW['message'] = str_replace("[FOOTER]", nl2br($_ROW['footer']), $_ROW
['message']);
// v1.8 code - end
// v1.8 code - start
printf("
listID=".$listID."&layoutID=".$layoutID."&pagerows=".$pagerows."&pagenum=".$pagenum.">&
laquo; " . $ArchiveTitle . "
".
// v1.8 code - end
// printf("   ['listID']."&layoutID=1>« Archive".
// v1.8 code - start
$_ROW['message'],
// v1.8 code - end
$_QUERY2 = sprintf("select * from ".$table_prefix."message_attachment
where messageid=%s",$_ROW['id']);
printf("\r\n
\r\n
dir=\"$Direction\">$strAttachmentIntro\r\n
\r\n");
$_QUERY3 = sprintf("select * from ".$table_prefix."attachment where
id=%s",$_ROW2);
$_ROW3['remotefile'] = " {$GLOBALS['pageroot']}/dl.php?id={$_ROW3['id']}\">{$_ROW3['remotefile']}";
// v1.8 code - start
print("

$InvalidMessage



href='javascript:history.back();'>« {$GLOBALS['strBack']}");
// v1.8 code - end
// v1.8 code - start
print("

$database_unselected

");
print("

$database_unconnected

");
// v1.8 code - end
Deletions:
* The additions of this version were made by http://lior.weissbrod.com
* Changes in ver. 1.7:
* + Attachment support (even more so, the file sizes are displayed in human readable form)!
* + layoutID is actually used!
* + layoutID defaults to "none" and is taken automatically from each message's setting
* + Added Content-Type header (taken from the active language file)
* + List descriptions go through stripslashes
* + Started multilingual support (with optional opt-in values styled $strArchiveX)
*
* Previous version info:
require_once dirname(__FILE__)."/texts/dutch.inc"; #HW: change this to the language file you use
if (isset($strDir))
$direction = $strDir;
else
$direction = "ltr";
if (isset($GLOBALS['strArchiveNoItem']))
$ArchiveNoItem = $GLOBALS['strArchiveNoItem'];
else
$ArchiveNoItem = "No such item";
if (isset($GLOBALS['strArchiveTitle']))
$ArchiveTitle = $GLOBALS['strArchiveTitle'];
$ArchiveTitle = "Archives";
print("$ArchiveTitle\r\n");
print($theheader);
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("

No active lists found.



« Back");
if (isset($GLOBALS['strArchiveList']))
$archivelist = $GLOBALS['strArchiveList'];
else
$archivelist = "Please select a list to see its archive";
print("

$archivelist

\n");
printf('

'.$_ROW['name'].'

', basename($_SERVER['PHP_SELF']));
print("

Could not select database.

");
print("

Could not connect to database.

");
printf("

".$row['name']."


");
//printf("

%s

%s
Sent: %s

",
printf("%s
Sent: %s

",
// printf("

%s

%s
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("

No entries were found in the archive.



« Back");
echo "

";
echo " « First ";
echo " ‹ Previous ";
echo " Next › ";
echo " Last » ";
echo "\n

View all lists

";
print("

Could not select database.

");
print("

Could not connect to database.

");
$_QUERY = sprintf("select * from ".$table_prefix."message where id=%s",intval($_GET['x']));
$_ROW['message'] = str_replace("[FOOTER]", $_ROW['footer'], $_ROW['message']);
printf("
« Archive".
// printf("  « Archive".
nl2br($_ROW['message']),
$_QUERY2 = sprintf("select * from ".$table_prefix."message_attachment where messageid=%s",$_ROW['id']);
printf("\r\n
\r\n
$strAttachmentIntro\r\n
\r\n");
$_QUERY3 = sprintf("select * from ".$table_prefix."attachment where id=%s",$_ROW2);
$_ROW3['remotefile'] = "{$_ROW3['remotefile']}";
print("

Could not retrieve the selected message.



« Back");
print("

Could not select database.

");
print("

Could not connect to database.

");

Revision [1963]

Edited on 2009-05-05 11:24:11 by LwC [Fixed grammar]
Additions:
If you want to be able to browse newsletters' archives, then you will need this standalone file add-on:
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

%s
Sent: %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

%s
Sent: %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

View all lists

";
}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");
printf("
$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("
\r\n
\r\n");
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 " echo( substr( $pCode, $index, $subStrLen) );
$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 you want to be able to browse newsletters' archives, then will need this standalone file add-on:
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

%s
Sent: %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

%s
Sent: %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

View all lists

";
}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");
printf("
$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("
\r\n
\r\n");
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 " echo( substr( $pCode, $index, $subStrLen) );
$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 );


Revision [1668]

Edited on 2008-10-20 02:30:56 by LwC [Date]
Additions:
* @version $Id: v1.7, 2008-10-20
Deletions:
* @version $Id: v1.7, 2008-10-14


Revision [1667]

Edited on 2008-10-20 02:29:57 by LwC [Small additions]
Additions:
if (isset($strDir))
$direction = $strDir;
else
$direction = "ltr";
$theheader = str_replace('
', '
', $data["header"]);
print($theheader);
printf("\r\n
\r\n
$strAttachmentIntro\r\n\r\n");
printf("
\r\n
\r\n");
Deletions:
print($data["header"]);
printf("\r\n
\r\n$strAttachmentIntro\r\n\r\n");
printf("
\r\n");


Revision [1665]

Edited on 2008-10-14 21:09:39 by LwC [Fixed category]
Additions:
CategoryDevelopment
Deletions:
CategoryHacks


Revision [1664]

Edited on 2008-10-14 21:07:53 by LwC [Fixed categories]
Additions:
[[PhplistHacks phplist Hacks]]
CategoryHacks
Deletions:
[[PhplistDevelopment phplist Development]]
CategoryDevelopment


Revision [1663]

Edited on 2008-10-14 21:05:40 by LwC [Added a word]
Additions:
If you want to be able to browse newsletters' archives, then will need this standalone file add-on:
Deletions:
If you want to be able to browse newsletters' archives, then will need this standalone file:


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