Maxxus PRO SPK-23 Especificaciones Pagina 711

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 893
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 710
LISTING 28.8 Continued
$info = load_list_info($listid);
if($info)
{
echo “<h2>”.pretty($info[listname]).”</h2>”;
echo ‘<p>’.pretty($info[blurb]);
echo ‘<p>Number of subscribers:’ . $info[subscribers];
echo ‘<p>Number of messages in archive:’ . $info[archive];
}
}
The display_information() function uses two other functions to help it achieve its Web task:
the load_list_info() function and the pretty() function. The load_list_info() function
actually retrieves the data from the database. The pretty() function simply formats the data
from the database by stripping out slashes, turning newlines into HTML line breaks, and so on.
Lets look briefly at the load_list_info() function. This function is in the mlm_fns.php
function library. The code for it is shown in Listing 28.9.
LISTING 28.9 load_list_info() Function from mlm_fns.phpThis Function Builds an Array
of List Information
function load_list_info($listid)
{
if(!$listid)
return false;
if(!db_connect())
return false;
$query = “select listname, blurb from lists where listid = $listid”;
$result = mysql_query($query);
if(!$result)
{
echo “Cannot retrieve this list”;
return false;
}
$info = mysql_fetch_array($result);
$query = “select count(*) from sub_lists where listid = $listid”;
$result = mysql_query($query);
if($result)
{
$info[‘subscribers’] = mysql_result($result, 0, 0);
}
Building a Mailing List Manager
C
HAPTER 28
28
BUILDING A
MAILING LIST
MANAGER
685
34 7842 CH28 3/6/01 3:46 PM Page 685
Vista de pagina 710
1 2 ... 706 707 708 709 710 711 712 713 714 715 716 ... 892 893

Comentarios a estos manuales

Sin comentarios