Specifications
FIGURE 28.7
The display_items() function has been used to lay out a list of the lists that the user is not subscribed to.
This is the Show Other Lists page.
Let’s look at the code for the display_items() function. It is shown in Listing 28.6.
LISTING 28.6 display_items() Function from output_fns.php—This Function Is Used to
Display a List of Items with Associated Actions
function display_items($title, $list, $action1=’’, $action2=’’, $action3=’’)
{
global $table_width;
echo “<table width = $table_width cellspacing = 0 cellpadding = 0
border = 0>”;
// count number of actions
$actions = (($action1!=’’) + ($action2!=’’) + ($action3!=’’));
echo “<tr>
<th colspan = “. (1+$actions) .” bgcolor=’#5B69A6’> $title </th>
</tr>”;
// count number of items
$items = sizeof($list);
Building Practical PHP and MySQL Projects
P
ART V
680
34 7842 CH28 3/6/01 3:46 PM Page 680