HP400
This is really very kind of you. The code works well as it is. I wanted a field called "intro" that would - surprise surprise - offer a preamble to some of the articles. But I've had to do without that because I simply can't find a way to say if it's empty, ignore it.
Similarly with the subheads, for the same reason as 'intro', all the articles have subheads whether they need it or not - not knowing how to offer the choice.
$a = mysql_query("SELECT
intro,
sub,
head,
story,
byline,
DATE_FORMAT(updated, '%d/%m/%y %H%i')
AS ud
FROM connex
WHERE id=$id");
$a = mysql_fetch_array($a);
$b =
(' <div class="intro">'
. $a['intro']
. '</div> <h6 class"bold"> <em>'
if($a['sub'] != "")
{
print $a['sub']
}
. $a['sub']
. '</em></h6><p>'
. '<h1 class="red">'
. $a['head']
. '</h1> <p></p>'
. $a['story']
. '<div class="names2">- '
. $a['byline']
. '</div> <p><div id="date2"> <em> Updated: '
. $a["ud"]
. '</em></p></div>'
);
if (!isset($GET['page']))
{
$page = 0;
}
else
{
$page = $GET['page'];
}
// Split the text into an array of pages
$textarray = spliti('[PAGEBREAK]', $b);
// Select the page we want
$b = $textarray[$page];
$PHP_SELF = $_SERVER['PHP_SELF'];
if ($page != 0) {
$prevpage = $page - 1;
echo "<p></p><p></p><b> <a href=\"$PHP_SELF?id=$id&page=$prevpage\">".
' ... P r e v i o u s p a g e </a></b>';
}
echo "<p><div class=\"boxed\">$b <p></p></div>";
if ($page < count($textarray) - 1)
{
$nextpage = $page + 1;
echo "<b>
<a href=\"$PHP_SELF?id=$id&page=$nextpage\">".
'R e a d m o r e . . . </a></b><p></p>';
}
}
else
... the 'else' goes on to offer just heads and blurbs of the articles, for the student to choose which (if any) he wants to read.
Very impressed with your website. Looks v good, I must say. Cheers, HP400