"; if (($action <> 'show' && $action <> 'showp') || ($action_parent_id == 0)) { // Action 'show' displays initial page, 'showp' displays following pages $text .= NLLAN_68; // Invalid parameter defined } else { if(!isset($_POST['limit_start'])) { $limit_start = 0; } else { $limit_start = intval($_POST['limit_start']); } $nl_count = $sql->count('newsletter', '(*)', "WHERE newsletter_parent='".$action_parent_id."' AND newsletter_flag='1'"); if ($nl_count > 0) { // Retrieve parent info $sql->select('newsletter', "*", "newsletter_id='".$action_parent_id."'"); if ($row = $sql->fetch()) { $parent_newsletter_title = $tp->toHTML($row['newsletter_title'],true); $parent_newsletter_text = $tp->toHTML($row['newsletter_text'],true); $parent_newsletter_header = $tp->toHTML($row['newsletter_header'],true); $parent_newsletter_footer = $tp->toHTML($row['newsletter_footer'],true); } if ($action_nl_id == '' || $action_nl_id == 0) //Show list of sent newsletters { // Display parent name $text .= "{$parent_newsletter_title}
{$parent_newsletter_text}


"; // Display list of sent newsletters titles if ($action == 'showp') { // This should only be done when action is 'showp' $limit_start = $limit_start + $page_size; } $sql->select('newsletter', '*', "newsletter_parent='".$action_parent_id."' AND newsletter_flag='1' ORDER BY newsletter_datestamp DESC LIMIT ".$limit_start.",".$page_size); while ($row = $sql->fetch()) { $ga = new convert(); $newsletter_datestamp = $ga->convert_date($row['newsletter_datestamp'], 'long'); $text .= ""; } $text .= "
".$row['newsletter_issue']." ".$tp->toHTML($row['newsletter_title'],true)." ".$newsletter_datestamp."
"; if($limit_start + $page_size < $nl_count) { $text .= "

"; } } else // Show requested newsletter { $sql->select('newsletter', '*', "newsletter_parent='".$action_parent_id."' AND newsletter_id='".$action_nl_id."' AND newsletter_flag='1'"); if ($row = $sql->fetch()) { // Display parent header $text .= "$parent_newsletter_title
$parent_newsletter_text


$parent_newsletter_header

"; // Display newsletter text $ga = new convert(); $newsletter_datestamp = $ga->convert_date($row['newsletter_datestamp'], "long"); $text .= $newsletter_datestamp."
". $tp->toHTML($row['newsletter_title'],true)."
".$tp->toHTML($row['newsletter_text'],true)."


"; // Display parent footer $text .= "$parent_newsletter_footer
"; // Display back to newsletter overview button $text .= "
"; } else { $text .= NLLAN_70; //Selected newsletter does not exist } } } else { $text .= NLLAN_69; // No send newsletters available for selected parent } } $text .= ""; $ns -> tablerender(NLLAN_67, $text); require_once(FOOTERF);