The original thread was lost, but I managed to salvage both mods from 'big brother' Google's cache.
-------------------
BUGabundo on 4 july 2006 wrote:I have done a webpage so the mails sent in the PHPlist can be seen on the web.
I'm still working on the login procedures, so u can put this to work without autentication:
- Code: Select all
// AUTOR BUGabundo
// email: phplist@BUGabundo.net
// web: http://BrinKadeiraS.BUGabundo.net
// Date: 3/07/2006
<?php
$hostname_phplist = "localhost";
$database_phplist = "BD_phplist";
$username_phplist = "USER_phplist";
$password_phplist = "PASS_phplist";
$phplist = mysql_pconnect($hostname_phplist, $username_phplist, $password_phplist) or trigger_error(mysql_error(),E_USER_ERROR);
?>
<?php require_once('Connections/phplist.php'); ?>
<?php
$currentPage = $_SERVER["PHP_SELF"];
$maxRows_Recordset1 = 3;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
mysql_select_db($database_phplist, $phplist);
$query_Recordset1 = "SELECT p.entered, li.name, p.subject, p.message FROM phplist_message p, phplist_listmessage l, phplist_list li WHERE p.id=l.messageid AND l.listid=li.id ORDER BY p.entered DESC, li.name ASC";
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $phplist) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if (isset($_GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
$queryString_Recordset1 = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_Recordset1") == false &&
stristr($param, "totalRows_Recordset1") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_Recordset1 = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Mailinglist</title>
</head>
<body>
<div align="center">Records <?php echo ($startRow_Recordset1 + 1) ?> to <?php echo min($startRow_Recordset1 + $maxRows_Recordset1, $totalRows_Recordset1) ?> of <?php echo $totalRows_Recordset1 ?>
</div>
<table border="0" width="50%" align="center">
<tr>
<td width="23%" align="center"><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, 0, $queryString_Recordset1); ?>"><img src="First.gif" border=0></a>
<?php } // Show if not first page ?>
</td>
<td width="31%" align="center"><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, max(0, $pageNum_Recordset1 - 1), $queryString_Recordset1); ?>"><img src="Previous.gif" border=0></a>
<?php } // Show if not first page ?>
</td>
<td width="23%" align="center"><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, min($totalPages_Recordset1, $pageNum_Recordset1 + 1), $queryString_Recordset1); ?>"><img src="Next.gif" border=0></a>
<?php } // Show if not last page ?>
</td>
<td width="23%" align="center"><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, $totalPages_Recordset1, $queryString_Recordset1); ?>"><img src="Last.gif" border=0></a>
<?php } // Show if not last page ?>
</td>
</tr>
</table>
<table border="1" align="center" id="tabela">
<tr align="center">
<th width="85"><div align="center">Data</div></th>
<th width="150"><div align="center">Lista</div></th>
<th width="200"><div align="center">Assunto</div></th>
<th><div align="center">Mensagem</div></th>
</tr>
<?php do { ?>
<tr valign="top">
<td width="85" align="center"><div align="center"><?php echo $row_Recordset1['entered']; ?></div></td>
<td width="150" align="center"><div align="center"><?php echo $row_Recordset1['name']; ?></div></td>
<td width="200" align="center"><div align="center"><?php echo $row_Recordset1['subject']; ?></div></td>
<td><blockquote>
<p><?php echo $row_Recordset1['message']; ?></p>
</blockquote></td>
</tr>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</table>
<table border="0" width="50%" align="center">
<tr>
<td width="23%" align="center"><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, 0, $queryString_Recordset1); ?>"><img src="First.gif" border=0></a>
<?php } // Show if not first page ?>
</td>
<td width="31%" align="center"><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, max(0, $pageNum_Recordset1 - 1), $queryString_Recordset1); ?>"><img src="Previous.gif" border=0></a>
<?php } // Show if not first page ?>
</td>
<td width="23%" align="center"><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, min($totalPages_Recordset1, $pageNum_Recordset1 + 1), $queryString_Recordset1); ?>"><img src="Next.gif" border=0></a>
<?php } // Show if not last page ?>
</td>
<td width="23%" align="center"><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, $totalPages_Recordset1, $queryString_Recordset1); ?>"><img src="Last.gif" border=0></a>
<?php } // Show if not last page ?>
</td>
</tr>
</table>
<div align="center">Records <?php echo ($startRow_Recordset1 + 1) ?> to <?php echo min($startRow_Recordset1 + $maxRows_Recordset1, $totalRows_Recordset1) ?> of <?php echo $totalRows_Recordset1 ?>
</div>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>
_________________
--
BUGabundo Surprised)
(``-_-´´)
http://BrinKadeiraS.BUGabundo.net
BUGabundo wrote:If anybody is in anyway familiried with phplist config, they will install this just as quick.
here is all u need:
creat a PHP file on your host (any where u like) and copy this code.
change this for your configuration:
Code:
$hostname_phplist = "localhost";
$database_phplist = "BD_phplist";
$username_phplist = "USER_phplist";
$password_phplist = "PASS_phplist";
and open it on a web browser: http://YOURDOMAIN/emails.php
advanced: if u like u can change $maxRows_Recordset1 = 3 to any other value.
I only use 3 cause it would take longer to process more, and since many of may mails tend to be quite big, they would fill a big webpage.
_________________
--
BUGabundo Surprised)
(``-_-´´)
http://BrinKadeiraS.BUGabundo.net