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("<br /><h2>$NoActiveLists</h2><br /><br /><a href='javascript:history.back();'>« {$GLOBALS['strBack']}</a>");
printf('<br /><h2><a href="./%s?listID='.$_ROW['id'].'">'.$_ROW['name'].'</a></h2>', basename($_SERVER['PHP_SELF']));
//printf("<br /><h2>%s</h2><a href='%s?x=%s&listID=".$listID."&layoutID=".$layoutID."&pagerows=".$pagerows."&pagenum=".$pagenum."'>%s</a><br /><em>Sent: %s</em><br /><br />",
printf("<a dir=\"$Direction\" href='%s?x=%s&listID=".$listID."&layoutID=".$layoutID."&pagerows=".$pagerows."&pagenum=".$pagenum."'>%s</a><br /><em>Sent: %s</em><br /><br />",
// printf("<br /><h2>%s</h2><a href='%s?x=%s&listID=".$_GET['listID']."&layoutID=3' target=_blank>%s</a><br /><em>Sent: %s</em><br /><br />",
//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("<br /><h2>$EmptyArchive</h2><br /><br /><a href='javascript:history.back();'>« {$GLOBALS['strBack']}</a>");
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}&pagerows={$pagerows}&pagenum=1'> « $First</a> ";
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}&pagerows={$pagerows}&pagenum=$previous'> ‹ $Prev</a> ";
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}&pagerows={$pagerows}&pagenum=$next'> $Next ›</a> ";
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}&pagerows={$pagerows}&pagenum=$last_page'> $Last »</a> ";
$_QUERY = sprintf("select * from ".$table_prefix."message where id=%s",intval($_GET['x']));
$_ROW['message'] = str_replace("[FOOTER]", nl2br($_ROW['footer']), $_ROW['message']);
printf("<br /><a href=./%s?listID=".$listID."&layoutID=".$layoutID."&pagerows=".$pagerows."&pagenum=".$pagenum.">« " . $ArchiveTitle . "</a>".
// printf("  <a href=./%s?listID=".$_GET['listID']."&layoutID=1>« <b>Archive</b></a>".
$_QUERY2 = sprintf("select * from ".$table_prefix."message_attachment where messageid=%s",$_ROW['id']);
printf("\r\n<hr>\r\n<div dir=\"$Direction\">$strAttachmentIntro\r\n<table border=1>\r\n");
$_QUERY3 = sprintf("select * from ".$table_prefix."attachment where id=%s",$_ROW2);
$_ROW3['remotefile'] = "<a href=\"http://{$GLOBALS['website']}/{$GLOBALS['pageroot']}/dl.php?id={$_ROW3['id']}\">{$_ROW3['remotefile']}</a>";
print("<br /><h2>$InvalidMessage</h2><br /><br /><a href='javascript:history.back();'>« {$GLOBALS['strBack']}</a>");
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("<br /><h2>$NoActiveLists</h2><br /><br /><a
href='javascript:history.back();'>« {$GLOBALS['strBack']}</a>");
printf('<br /><h2><a href="./%s?listID='.$_ROW['id'].'">'.$_ROW
['name'].'</a></h2>', basename($_SERVER['PHP_SELF']));
//printf("<br /><h2>%s</h2><a href='%s?x=%
s&listID=".$listID."&layoutID=".$layoutID."&pagerows=".$pagerows."&pagenum=".$pagenum."
'>%s</a><br /><em>Sent: %s</em><br /><br />",
printf("<a dir=\"$Direction\" href='%s?x=%
s&listID=".$listID."&layoutID=".$layoutID."&pagerows=".$pagerows."&pagenum=".$pagenum."
'>%s</a><br /><em>Sent: %s</em><br /><br />",
// printf("<br /><h2>%s</h2><a href='%s?x=%s&listID=".$_GET
['listID']."&layoutID=3' target=_blank>%s</a><br /><em>Sent: %s</em><br /><br />",
//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("<br /><h2>$EmptyArchive</h2><br /><br /><a
href='javascript:history.back();'>« {$GLOBALS['strBack']}</a>");
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}
&pagerows={$pagerows}&pagenum=1'> « $First</a> ";
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}
&pagerows={$pagerows}&pagenum=$previous'> ‹ $Prev</a> ";
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}
&pagerows={$pagerows}&pagenum=$next'> $Next ›</a> ";
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}
&pagerows={$pagerows}&pagenum=$last_page'> $Last »</a> ";
$_QUERY = sprintf("select * from ".$table_prefix."message where id=%s",intval
($_GET['x']));
$_ROW['message'] = str_replace("[FOOTER]", nl2br($_ROW['footer']), $_ROW
['message']);
printf("<br /><a href=./%s?
listID=".$listID."&layoutID=".$layoutID."&pagerows=".$pagerows."&pagenum=".$pagenum.">&
laquo; " . $ArchiveTitle . "</a>".
// printf("  <a href=./%s?listID=".$_GET
['listID']."&layoutID=1>« <b>Archive</b></a>".
$_QUERY2 = sprintf("select * from ".$table_prefix."message_attachment
where messageid=%s",$_ROW['id']);
printf("\r\n<hr>\r\n<div
dir=\"$Direction\">$strAttachmentIntro\r\n<table border=1>\r\n");
$_QUERY3 = sprintf("select * from ".$table_prefix."attachment where
id=%s",$_ROW2);
$_ROW3['remotefile'] = "<a href=\"http://{$GLOBALS['website']}/
{$GLOBALS['pageroot']}/dl.php?id={$_ROW3['id']}\">{$_ROW3['remotefile']}</a>";
print("<br /><h2>$InvalidMessage</h2><br /><br /><a
href='javascript:history.back();'>« {$GLOBALS['strBack']}</a>");


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("<br /><h2>$NoActiveLists</h2><br /><br /><a
href='javascript:history.back();'>« {$GLOBALS['strBack']}</a>");
printf('<br /><h2><a href="./%s?listID='.$_ROW['id'].'">'.$_ROW
['name'].'</a></h2>', basename($_SERVER['PHP_SELF']));
//printf("<br /><h2>%s</h2><a href='%s?x=%
s&listID=".$listID."&layoutID=".$layoutID."&pagerows=".$pagerows."&pagenum=".$pagenum."
'>%s</a><br /><em>Sent: %s</em><br /><br />",
printf("<a dir=\"$Direction\" href='%s?x=%
s&listID=".$listID."&layoutID=".$layoutID."&pagerows=".$pagerows."&pagenum=".$pagenum."
'>%s</a><br /><em>Sent: %s</em><br /><br />",
// printf("<br /><h2>%s</h2><a href='%s?x=%s&listID=".$_GET
['listID']."&layoutID=3' target=_blank>%s</a><br /><em>Sent: %s</em><br /><br />",
//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("<br /><h2>$EmptyArchive</h2><br /><br /><a
href='javascript:history.back();'>« {$GLOBALS['strBack']}</a>");
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}
&pagerows={$pagerows}&pagenum=1'> « $First</a> ";
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}
&pagerows={$pagerows}&pagenum=$previous'> ‹ $Prev</a> ";
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}
&pagerows={$pagerows}&pagenum=$next'> $Next ›</a> ";
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}
&pagerows={$pagerows}&pagenum=$last_page'> $Last »</a> ";
$_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("<br /><a href=./%s?
listID=".$listID."&layoutID=".$layoutID."&pagerows=".$pagerows."&pagenum=".$pagenum.">&
laquo; " . $ArchiveTitle . "</a>".
// printf("  <a href=./%s?listID=".$_GET
['listID']."&layoutID=1>« <b>Archive</b></a>".
$_QUERY2 = sprintf("select * from ".$table_prefix."message_attachment
where messageid=%s",$_ROW['id']);
printf("\r\n<hr>\r\n<div
dir=\"$Direction\">$strAttachmentIntro\r\n<table border=1>\r\n");
$_QUERY3 = sprintf("select * from ".$table_prefix."attachment where
id=%s",$_ROW2);
$_ROW3['remotefile'] = "<a href=\"http://{$GLOBALS['website']}/
{$GLOBALS['pageroot']}/dl.php?id={$_ROW3['id']}\">{$_ROW3['remotefile']}</a>";
print("<br /><h2>$InvalidMessage</h2><br /><br /><a
href='javascript:history.back();'>« {$GLOBALS['strBack']}</a>");
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("<br /><h2>$NoActiveLists</h2><br /><br /><a href='javascript:history.back();'>« {$GLOBALS['strBack']}</a>");
printf('<br /><h2><a href="./%s?listID='.$_ROW['id'].'">'.$_ROW['name'].'</a></h2>', basename($_SERVER['PHP_SELF']));
//printf("<br /><h2>%s</h2><a href='%s?x=%s&listID=".$listID."&layoutID=".$layoutID."&pagerows=".$pagerows."&pagenum=".$pagenum."'>%s</a><br /><em>Sent: %s</em><br /><br />",
printf("<a dir=\"$Direction\" href='%s?x=%s&listID=".$listID."&layoutID=".$layoutID."&pagerows=".$pagerows."&pagenum=".$pagenum."'>%s</a><br /><em>Sent: %s</em><br /><br />",
// printf("<br /><h2>%s</h2><a href='%s?x=%s&listID=".$_GET['listID']."&layoutID=3' target=_blank>%s</a><br /><em>Sent: %s</em><br /><br />",
//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("<br /><h2>$EmptyArchive</h2><br /><br /><a href='javascript:history.back();'>« {$GLOBALS['strBack']}</a>");
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}&pagerows={$pagerows}&pagenum=1'> « $First</a> ";
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}&pagerows={$pagerows}&pagenum=$previous'> ‹ $Prev</a> ";
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}&pagerows={$pagerows}&pagenum=$next'> $Next ›</a> ";
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}&pagerows={$pagerows}&pagenum=$last_page'> $Last »</a> ";
$_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("<br /><a href=./%s?listID=".$listID."&layoutID=".$layoutID."&pagerows=".$pagerows."&pagenum=".$pagenum.">« " . $ArchiveTitle . "</a>".
// printf("  <a href=./%s?listID=".$_GET['listID']."&layoutID=1>« <b>Archive</b></a>".
$_QUERY2 = sprintf("select * from ".$table_prefix."message_attachment where messageid=%s",$_ROW['id']);
printf("\r\n<hr>\r\n<div dir=\"$Direction\">$strAttachmentIntro\r\n<table border=1>\r\n");
$_QUERY3 = sprintf("select * from ".$table_prefix."attachment where id=%s",$_ROW2);
$_ROW3['remotefile'] = "<a href=\"http://{$GLOBALS['website']}/{$GLOBALS['pageroot']}/dl.php?id={$_ROW3['id']}\">{$_ROW3['remotefile']}</a>";
print("<br /><h2>$InvalidMessage</h2><br /><br /><a href='javascript:history.back();'>« {$GLOBALS['strBack']}</a>");


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("<br /><h2>$NoActiveLists</h2><br /><br /><a href='javascript:history.back();'>« {$GLOBALS['strBack']}</a>");
printf('<br /><h2><a href="./%s?listID='.$_ROW['id'].'">'.$_ROW['name'].'</a></h2>', basename($_SERVER['PHP_SELF']));
//printf("<br /><h2>%s</h2><a href='%s?x=%s&listID=".$listID."&layoutID=".$layoutID."&pagerows=".$pagerows."&pagenum=".$pagenum."'>%s</a><br /><em>Sent: %s</em><br /><br />",
printf("<a dir=\"$Direction\" href='%s?x=%s&listID=".$listID."&layoutID=".$layoutID."&pagerows=".$pagerows."&pagenum=".$pagenum."'>%s</a><br /><em>Sent: %s</em><br /><br />",
// printf("<br /><h2>%s</h2><a href='%s?x=%s&listID=".$_GET['listID']."&layoutID=3' target=_blank>%s</a><br /><em>Sent: %s</em><br /><br />",
//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("<br /><h2>$EmptyArchive</h2><br /><br /><a href='javascript:history.back();'>« {$GLOBALS['strBack']}</a>");
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}&pagerows={$pagerows}&pagenum=1'> « $First</a> ";
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}&pagerows={$pagerows}&pagenum=$previous'> ‹ $Prev</a> ";
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}&pagerows={$pagerows}&pagenum=$next'> $Next ›</a> ";
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}&pagerows={$pagerows}&pagenum=$last_page'> $Last »</a> ";
$_QUERY = sprintf("select * from ".$table_prefix."message where id=%s",intval($_GET['x']));
$_ROW['message'] = str_replace("[FOOTER]", nl2br($_ROW['footer']), $_ROW['message']);
printf("<br /><a href=./%s?listID=".$listID."&layoutID=".$layoutID."&pagerows=".$pagerows."&pagenum=".$pagenum.">« " . $ArchiveTitle . "</a>".
// printf("  <a href=./%s?listID=".$_GET['listID']."&layoutID=1>« <b>Archive</b></a>".
$_QUERY2 = sprintf("select * from ".$table_prefix."message_attachment where messageid=%s",$_ROW['id']);
printf("\r\n<hr>\r\n<div dir=\"$Direction\">$strAttachmentIntro\r\n<table border=1>\r\n");
$_QUERY3 = sprintf("select * from ".$table_prefix."attachment where id=%s",$_ROW2);
$_ROW3['remotefile'] = "<a href=\"http://{$GLOBALS['website']}/{$GLOBALS['pageroot']}/dl.php?id={$_ROW3['id']}\">{$_ROW3['remotefile']}</a>";
print("<br /><h2>$InvalidMessage</h2><br /><br /><a href='javascript:history.back();'>« {$GLOBALS['strBack']}</a>");
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("<br /><h2>$NoActiveLists</h2><br /><br /><a
href='javascript:history.back();'>« {$GLOBALS['strBack']}</a>");
printf('<br /><h2><a href="./%s?listID='.$_ROW['id'].'">'.$_ROW
['name'].'</a></h2>', basename($_SERVER['PHP_SELF']));
//printf("<br /><h2>%s</h2><a href='%s?x=%
s&listID=".$listID."&layoutID=".$layoutID."&pagerows=".$pagerows."&pagenum=".$pagenum."
'>%s</a><br /><em>Sent: %s</em><br /><br />",
printf("<a dir=\"$Direction\" href='%s?x=%
s&listID=".$listID."&layoutID=".$layoutID."&pagerows=".$pagerows."&pagenum=".$pagenum."
'>%s</a><br /><em>Sent: %s</em><br /><br />",
// printf("<br /><h2>%s</h2><a href='%s?x=%s&listID=".$_GET
['listID']."&layoutID=3' target=_blank>%s</a><br /><em>Sent: %s</em><br /><br />",
//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("<br /><h2>$EmptyArchive</h2><br /><br /><a
href='javascript:history.back();'>« {$GLOBALS['strBack']}</a>");
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}
&pagerows={$pagerows}&pagenum=1'> « $First</a> ";
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}
&pagerows={$pagerows}&pagenum=$previous'> ‹ $Prev</a> ";
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}
&pagerows={$pagerows}&pagenum=$next'> $Next ›</a> ";
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}
&pagerows={$pagerows}&pagenum=$last_page'> $Last »</a> ";
$_QUERY = sprintf("select * from ".$table_prefix."message where id=%s",intval
($_GET['x']));
$_ROW['message'] = str_replace("[FOOTER]", nl2br($_ROW['footer']), $_ROW
['message']);
printf("<br /><a href=./%s?
listID=".$listID."&layoutID=".$layoutID."&pagerows=".$pagerows."&pagenum=".$pagenum.">&
laquo; " . $ArchiveTitle . "</a>".
// printf("  <a href=./%s?listID=".$_GET
['listID']."&layoutID=1>« <b>Archive</b></a>".
$_QUERY2 = sprintf("select * from ".$table_prefix."message_attachment
where messageid=%s",$_ROW['id']);
printf("\r\n<hr>\r\n<div
dir=\"$Direction\">$strAttachmentIntro\r\n<table border=1>\r\n");
$_QUERY3 = sprintf("select * from ".$table_prefix."attachment where
id=%s",$_ROW2);
$_ROW3['remotefile'] = "<a href=\"http://{$GLOBALS['website']}/
{$GLOBALS['pageroot']}/dl.php?id={$_ROW3['id']}\">{$_ROW3['remotefile']}</a>";
print("<br /><h2>$InvalidMessage</h2><br /><br /><a
href='javascript:history.back();'>« {$GLOBALS['strBack']}</a>");


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("<title>$ArchiveTitle</title>\r\n$theheader");
print("<br /><h2>$NoActiveLists</h2><br /><br /><a
href='javascript:history.back();'>« {$GLOBALS['strBack']}</a>");
print("<title>$ArchiveList</title>\r\n$theheader");
// 1.8 code - end
// 1.7 code - start
print("<br /><h1>$ArchiveList</h1>\n");
printf('<br /><h2><a href="./%s?listID='.$_ROW['id'].'">'.$_ROW
['name'].'</a></h2>', basename($_SERVER['PHP_SELF']));
// v1.8 code - start
print("<h2>$database_unselected</h2>");
print("<h2>$database_unconnected</h2>");
// v1.8 code - end
// v1.8 code - start
print("<title>$ArchiveTitle {$row['name']}</title>\r\n$theheader");
printf("<br /><h2>$ArchiveTitle {$row['name']}</h2><br />");
// v1.8 code - end
//printf("<br /><h2>%s</h2><a href='%s?x=%
s&listID=".$listID."&layoutID=".$layoutID."&pagerows=".$pagerows."&pagenum=".$pagenum."
'>%s</a><br /><em>Sent: %s</em><br /><br />",
printf("<a dir=\"$Direction\" href='%s?x=%
s&listID=".$listID."&layoutID=".$layoutID."&pagerows=".$pagerows."&pagenum=".$pagenum."
'>%s</a><br /><em>Sent: %s</em><br /><br />",
// printf("<br /><h2>%s</h2><a href='%s?x=%s&listID=".$_GET
['listID']."&layoutID=3' target=_blank>%s</a><br /><em>Sent: %s</em><br /><br />",
//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("<br /><h2>$EmptyArchive</h2><br /><br /><a
href='javascript:history.back();'>« {$GLOBALS['strBack']}</a>");
// v1.8 code - end
// v1.8 code - start
echo "<br /><br /><center dir=\"$Direction\">";
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}
&pagerows={$pagerows}&pagenum=1'> « $First</a> ";
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}
&pagerows={$pagerows}&pagenum=$previous'> ‹ $Prev</a> ";
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}
&pagerows={$pagerows}&pagenum=$next'> $Next ›</a> ";
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}
&pagerows={$pagerows}&pagenum=$last_page'> $Last »</a> ";
echo "</center>";
// v1.8 code - end
// v1.8 code - start
echo "\n<hr>\n<center><a href='{$_SERVER['PHP_SELF']}'>$ViewLists</a></center>";
// 1.8 code - end
// v1.8 code - start
print("<h2>$database_unselected</h2>");
print("<h2>$database_unconnected</h2>");
// v1.8 code - end
$_QUERY = sprintf("select * from ".$table_prefix."message where id=%s",intval
($_GET['x']));
// v1.8 code - start
print("<title>{$_ROW['subject']}</title>\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("<br /><a href=./%s?
listID=".$listID."&layoutID=".$layoutID."&pagerows=".$pagerows."&pagenum=".$pagenum.">&
laquo; " . $ArchiveTitle . "</a>".
// v1.8 code - end
// printf("  <a href=./%s?listID=".$_GET
['listID']."&layoutID=1>« <b>Archive</b></a>".
// 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<hr>\r\n<div
dir=\"$Direction\">$strAttachmentIntro\r\n<table border=1>\r\n");
$_QUERY3 = sprintf("select * from ".$table_prefix."attachment where
id=%s",$_ROW2);
$_ROW3['remotefile'] = "<a href=\"http://{$GLOBALS['website']}/
{$GLOBALS['pageroot']}/dl.php?id={$_ROW3['id']}\">{$_ROW3['remotefile']}</a>";
// v1.8 code - start
print("<br /><h2>$InvalidMessage</h2><br /><br /><a
href='javascript:history.back();'>« {$GLOBALS['strBack']}</a>");
// v1.8 code - end
// v1.8 code - start
print("<h2>$database_unselected</h2>");
print("<h2>$database_unconnected</h2>");
// 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("<title>$ArchiveTitle</title>\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("<br /><h2>No active lists found.</h2><br /><br /><a href='javascript:history.back();'>« Back</a>");
if (isset($GLOBALS['strArchiveList']))
$archivelist = $GLOBALS['strArchiveList'];
else
$archivelist = "Please select a list to see its archive";
print("<br /><h1>$archivelist</h1>\n");
printf('<br /><h2><a href="./%s?listID='.$_ROW['id'].'">'.$_ROW['name'].'</a></h2>', basename($_SERVER['PHP_SELF']));
print("<h2>Could not select database.</h2>");
print("<h2>Could not connect to database.</h2>");
printf("<br /><h2>".$row['name']."</h2><br />");
//printf("<br /><h2>%s</h2><a href='%s?x=%s&listID=".$listID."&layoutID=".$layoutID."&pagerows=".$pagerows."&pagenum=".$pagenum."'>%s</a><br /><em>Sent: %s</em><br /><br />",
printf("<a href='%s?x=%s&listID=".$listID."&layoutID=".$layoutID."&pagerows=".$pagerows."&pagenum=".$pagenum."'>%s</a><br /><em>Sent: %s</em><br /><br />",
// printf("<br /><h2>%s</h2><a href='%s?x=%s&listID=".$_GET['listID']."&layoutID=3' target=_blank>%s</a><br /><em>Sent: %s</em><br /><br />",
//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("<br /><h2>No entries were found in the archive.</h2><br /><br /><a href='javascript:history.back();'>« Back</a>");
echo "<br /><br />";
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}&pagerows={$pagerows}&pagenum=1'> « First</a> ";
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}&pagerows={$pagerows}&pagenum=$previous'> ‹ Previous</a> ";
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}&pagerows={$pagerows}&pagenum=$next'> Next ›</a> ";
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}&pagerows={$pagerows}&pagenum=$last_page'> Last »</a> ";
echo "\n<p align=center><a href='{$_SERVER['PHP_SELF']}'>View all lists</a></p>";
print("<h2>Could not select database.</h2>");
print("<h2>Could not connect to database.</h2>");
$_QUERY = sprintf("select * from ".$table_prefix."message where id=%s",intval($_GET['x']));
$_ROW['message'] = str_replace("[FOOTER]", $_ROW['footer'], $_ROW['message']);
printf("<br /><a href=./%s?listID=".$listID."&layoutID=".$layoutID."&pagerows=".$pagerows."&pagenum=".$pagenum.">« Archive</a>".
// printf("  <a href=./%s?listID=".$_GET['listID']."&layoutID=1>« <b>Archive</b></a>".
nl2br($_ROW['message']),
$_QUERY2 = sprintf("select * from ".$table_prefix."message_attachment where messageid=%s",$_ROW['id']);
printf("\r\n<hr>\r\n<div dir=\"$direction\">$strAttachmentIntro\r\n<table border=1>\r\n");
$_QUERY3 = sprintf("select * from ".$table_prefix."attachment where id=%s",$_ROW2);
$_ROW3['remotefile'] = "<a href=\"http://{$GLOBALS['website']}/{$GLOBALS['pageroot']}/dl.php?id={$_ROW3['id']}\">{$_ROW3['remotefile']}</a>";
print("<br /><h2>Could not retrieve the selected message.</h2><br /><br /><a href='javascript:history.back();'>« Back</a>");
print("<h2>Could not select database.</h2>");
print("<h2>Could not connect to database.</h2>");


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("<br /><h2>No active lists found.</h2><br /><br /><a href='javascript:history.back();'>« Back</a>");
} else {
if (isset($GLOBALS['strArchiveList']))
else
print("<br /><h1>$archivelist</h1>\n");
while($_ROW = mysql_fetch_assoc($RS)){
printf('<br /><h2><a href="./%s?listID='.$_ROW['id'].'">'.$_ROW['name'].'</a></h2>', basename($_SERVER['PHP_SELF']));
printf("<p>".stripslashes($_ROW['description'])."</p>\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("<h2>Could not select database.</h2>");
}
print("<h2>Could not connect to database.</h2>");
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("<br /><h2>".$row['name']."</h2><br />");
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("<br /><h2>%s</h2><a href='%s?x=%s&listID=".$listID."&layoutID=".$layoutID."&pagerows=".$pagerows."&pagenum=".$pagenum."'>%s</a><br /><em>Sent: %s</em><br /><br />",
if (!isset($_GET['layoutID']) || $_GET['layoutID']<1)
printf("<a href='%s?x=%s&listID=".$listID."&layoutID=".$layoutID."&pagerows=".$pagerows."&pagenum=".$pagenum."'>%s</a><br /><em>Sent: %s</em><br /><br />",
// Alternative code to print the selected newsletter
// with a predefined layoutID:
// printf("<br /><h2>%s</h2><a href='%s?x=%s&listID=".$_GET['listID']."&layoutID=3' target=_blank>%s</a><br /><em>Sent: %s</em><br /><br />",
//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("<pre>");
$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,
"<Summary>",
"</Summary>",
TRUE );
printf("</pre><br />");
}
if(mysql_num_rows($RS)<=0){
print("<br /><h2>No entries were found in the archive.</h2><br /><br /><a href='javascript:history.back();'>« Back</a>");
}
mysql_free_result($RS);
mysql_close($DB);
// the first/previous and next/last links
echo "<br /><br />";
if ($pagenum != 1) {
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}&pagerows={$pagerows}&pagenum=1'> « First</a> ";
echo " ";
$previous = $pagenum-1;
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}&pagerows={$pagerows}&pagenum=$previous'> ‹ Previous</a> ";
}
if ($pagenum != $last_page) {
$next = $pagenum+1;
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}&pagerows={$pagerows}&pagenum=$next'> Next ›</a> ";
echo " ";
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}&pagerows={$pagerows}&pagenum=$last_page'> Last »</a> ";
}
// Back to archives list of lists
echo "\n<p align=center><a href='{$_SERVER['PHP_SELF']}'>View all lists</a></p>";
}else{
mysql_free_result($RS);
mysql_close($DB);
print($ArchiveNoItem);
exit(0);
}
}else{
mysql_close($DB);
print("<h2>Could not select database.</h2>");
}
}else{
print("<h2>Could not connect to database.</h2>");
}
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<br /><br />" . $_ROW['footer'];
// Original code to re-print the list of selected newsletters:
printf("<br /><a href=./%s?listID=".$listID."&layoutID=".$layoutID."&pagerows=".$pagerows."&pagenum=".$pagenum.">« Archive</a>".
// Alternative code to re-print the list of selected newsletters
// with a predefined layoutID:
// printf("  <a href=./%s?listID=".$_GET['listID']."&layoutID=1>« <b>Archive</b></a>".
"<h1 align='center'>%s</h1>".
// "<br>Sent: %s</em><hr /><br />".
"<br />%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<hr>\r\n<div dir=\"$direction\">$strAttachmentIntro\r\n<table border=1>\r\n");
printf("<tr><td>$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'] = "<a href=\"http://{$GLOBALS['website']}/{$GLOBALS['pageroot']}/dl.php?id={$_ROW3['id']}\">{$_ROW3['remotefile']}</a>";
unset($_ROW3['id'], $_ROW3['filename']);
$_ROW3['size'] = size_hum_read($_ROW3['size']);
foreach ($_ROW3 as $value)
printf("<td>$value\r\n");
}
}
if ($i > 0)
printf("</table>\r\n</div>\r\n");
if(mysql_num_rows($RS)<=0){
print("<br /><h2>Could not retrieve the selected message.</h2><br /><br /><a href='javascript:history.back();'>« Back</a>");
}
mysql_free_result($RS);
mysql_close($DB);
}else{
mysql_free_result($RS);
mysql_close($DB);
print($ArchiveNoItem);
exit(0);
}
}else{
mysql_close($DB);
print("<h2>Could not select database.</h2>");
}
}else{
print("<h2>Could not connect to database.</h2>");
}
// This is a very naive implementation, it doesn't properly
// parse the "img" tag, but only looks for the string
// '<img src="' - if the 'src' element comes somewhere else
// within the tag, or if the filename it points to isn't
// in double-quotes, this routine won't catch it.
// Also this routine is chock full of magic numbers. Whooop.
// check for a ":" in the first 7 characters after 'src=', in which
// case it's already a URL
$colonStr = strpos( $pCode, ":", $srcPos );
$subStrLen = $srcPos + 10 - $index; // 10 = size of "<img src="" string.
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( "<! delimiter not found in $fromUrl >", $report );
report( "<! could not read data from $fromUrl >", $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("<br /><h2>No active lists found.</h2><br /><br /><a href='javascript:history.back();'>« Back</a>");
} else {
if (isset($GLOBALS['strArchiveList']))
else
print("<br /><h1>$archivelist</h1>\n");
while($_ROW = mysql_fetch_assoc($RS)){
printf('<br /><h2><a href="./%s?listID='.$_ROW['id'].'">'.$_ROW['name'].'</a></h2>', basename($_SERVER['PHP_SELF']));
printf("<p>".stripslashes($_ROW['description'])."</p>\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("<h2>Could not select database.</h2>");
}
print("<h2>Could not connect to database.</h2>");
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("<br /><h2>".$row['name']."</h2><br />");
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("<br /><h2>%s</h2><a href='%s?x=%s&listID=".$listID."&layoutID=".$layoutID."&pagerows=".$pagerows."&pagenum=".$pagenum."'>%s</a><br /><em>Sent: %s</em><br /><br />",
if (!isset($_GET['layoutID']) || $_GET['layoutID']<1)
printf("<a href='%s?x=%s&listID=".$listID."&layoutID=".$layoutID."&pagerows=".$pagerows."&pagenum=".$pagenum."'>%s</a><br /><em>Sent: %s</em><br /><br />",
// Alternative code to print the selected newsletter
// with a predefined layoutID:
// printf("<br /><h2>%s</h2><a href='%s?x=%s&listID=".$_GET['listID']."&layoutID=3' target=_blank>%s</a><br /><em>Sent: %s</em><br /><br />",
//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("<pre>");
$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,
"<Summary>",
"</Summary>",
TRUE );
printf("</pre><br />");
}
if(mysql_num_rows($RS)<=0){
print("<br /><h2>No entries were found in the archive.</h2><br /><br /><a href='javascript:history.back();'>« Back</a>");
}
mysql_free_result($RS);
mysql_close($DB);
// the first/previous and next/last links
echo "<br /><br />";
if ($pagenum != 1) {
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}&pagerows={$pagerows}&pagenum=1'> « First</a> ";
echo " ";
$previous = $pagenum-1;
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}&pagerows={$pagerows}&pagenum=$previous'> ‹ Previous</a> ";
}
if ($pagenum != $last_page) {
$next = $pagenum+1;
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}&pagerows={$pagerows}&pagenum=$next'> Next ›</a> ";
echo " ";
echo " <a href='{$_SERVER['PHP_SELF']}?&listID={$listID}&layoutID={$layoutID}&pagerows={$pagerows}&pagenum=$last_page'> Last »</a> ";
}
// Back to archives list of lists
echo "\n<p align=center><a href='{$_SERVER['PHP_SELF']}'>View all lists</a></p>";
}else{
mysql_free_result($RS);
mysql_close($DB);
print($ArchiveNoItem);
exit(0);
}
}else{
mysql_close($DB);
print("<h2>Could not select database.</h2>");
}
}else{
print("<h2>Could not connect to database.</h2>");
}
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<br /><br />" . $_ROW['footer'];
// Original code to re-print the list of selected newsletters:
printf("<br /><a href=./%s?listID=".$listID."&layoutID=".$layoutID."&pagerows=".$pagerows."&pagenum=".$pagenum.">« Archive</a>".
// Alternative code to re-print the list of selected newsletters
// with a predefined layoutID:
// printf("  <a href=./%s?listID=".$_GET['listID']."&layoutID=1>« <b>Archive</b></a>".
"<h1 align='center'>%s</h1>".
// "<br>Sent: %s</em><hr /><br />".
"<br />%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<hr>\r\n<div dir=\"$direction\">$strAttachmentIntro\r\n<table border=1>\r\n");
printf("<tr><td>$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'] = "<a href=\"http://{$GLOBALS['website']}/{$GLOBALS['pageroot']}/dl.php?id={$_ROW3['id']}\">{$_ROW3['remotefile']}</a>";
unset($_ROW3['id'], $_ROW3['filename']);
$_ROW3['size'] = size_hum_read($_ROW3['size']);
foreach ($_ROW3 as $value)
printf("<td>$value\r\n");
}
}
if ($i > 0)
printf("</table>\r\n</div>\r\n");
if(mysql_num_rows($RS)<=0){
print("<br /><h2>Could not retrieve the selected message.</h2><br /><br /><a href='javascript:history.back();'>« Back</a>");
}
mysql_free_result($RS);
mysql_close($DB);
}else{
mysql_free_result($RS);
mysql_close($DB);
print($ArchiveNoItem);
exit(0);
}
}else{
mysql_close($DB);
print("<h2>Could not select database.</h2>");
}
}else{
print("<h2>Could not connect to database.</h2>");
}
// This is a very naive implementation, it doesn't properly
// parse the "img" tag, but only looks for the string
// '<img src="' - if the 'src' element comes somewhere else
// within the tag, or if the filename it points to isn't
// in double-quotes, this routine won't catch it.
// Also this routine is chock full of magic numbers. Whooop.
// check for a ":" in the first 7 characters after 'src=', in which
// case it's already a URL
$colonStr = strpos( $pCode, ":", $srcPos );
$subStrLen = $srcPos + 10 - $index; // 10 = size of "<img src="" string.
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( "<! delimiter not found in $fromUrl >", $report );
report( "<! could not read data from $fromUrl >", $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('<td><div align=left>', '<td><div>', $data["header"]);
print($theheader);
printf("\r\n<hr>\r\n<div dir=\"$direction\">$strAttachmentIntro\r\n<table border=1>\r\n");
printf("</table>\r\n</div>\r\n");
Deletions:
print($data["header"]);
printf("\r\n<hr>\r\n$strAttachmentIntro\r\n<table border=1>\r\n");
printf("</table>\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 [Added a word]
Page was generated in 0.4206 seconds