Bibliography

“;
$countfound = 0;
for ($i=0; $i<3; $i++) { if ($images[$i] != "") { //echo $images[$i]; echo "“;
}
}
echo “

“;
}
//we keep track of which section breaks we’ve added
// puts a ———A——- if not there already
function writetitlebreak($title, $titles)
{

$firstletter =strtoupper($title[0]);
//if (strpos($titles, $firstletter) === false)
if (in_array($firstletter, $titles) == false)
{
array_push($titles, $firstletter);
// echo $titles;
echo “

–“.$firstletter.”–

“;
}
//echo count($titles);
return $titles;
}

// shows a list of links
function drawlinks($row)
{
$id = $row[‘id’];
// now iterate through all rows
$result = mysql_query(‘SELECT * from storylinks’)
or die(mysql_error());
$availablesaid = 0;
while($linkrow = mysql_fetch_array($result)){

if ($linkrow[‘idlink’] == $id)
{
if (0== $availablesaid)
{
// show message only once
echo “
Read: |”;
$availablesaid = 1;
}

// echo $linkrow[‘type’];
echo ““.linktypetostring($linkrow[‘type’]).”|”;
}
}

}
// shows a single row from the database
function showrow($row, $isreprint)
{

// Reprints are representd by an ID Link to to the original entry (i.e., to link to Ragman in your reprint column you would have a 1

if (“0” == $isreprint)
{
if ($row[‘reprint’] != 0 && “0” == $isreprint)
{
// echo “exit”;
return 0;
}

$more = “”;
if (“” != $row[‘pagelink’])
{
$more = ““.$row[‘title’].”“;
}
else
{
$more = $row[‘title’];
}

echo “\””.$more.”\” “;
}
// if we are a reprint field we exit because we will be displayed with our parent

echo “– “.$row[‘where’].”, “.$row[‘year’];

if (“no” != $row[‘forthcoming’])
{
echo ” (Forthcoming – “.$row[‘forthcoming’].”)”;
}

if (“” != $row[‘extranote’])
{
echo ” (“.$row[‘extranote’].”)”;
}

// now lookup the links from the links table associated with this ID
drawlinks($row);

///////////////////////////////////////
// now printreviews
$reviewresult = mysql_query(‘SELECT * from reviews order by id’) or die(mysql_error());

while ($reviewrow = mysql_fetch_array($reviewresult)){
// just grab first review
if ($row[‘id’] == $reviewrow[‘idlink’])
{
// echo “test”;
echo ““.$reviewrow[‘blurb’].”(” .$reviewrow[‘sitename’].”)“;
break;
}
}
//end:review
///////////////////////////////////////
// now print reprints
$result = mysql_query(‘SELECT * from stories order by title’);
while($reprintrow = mysql_fetch_array($result)){
if ($reprintrow[‘reprint’] == $row[‘id’])
{
// this worked but not second part of string echo highlight_string(“\n\t Reprinted in “);
echo “

Reprinted in “;
showrow($reprintrow, “1”);
echo “

“;
}

}
///////////////////////////////////////

if (“0” == $isreprint)
{
echo “

“;
}
}

$dbhost = ‘sql7.bravehost.com’;
$dbuser = ‘biolistname’;
$dbpass = ‘wr7wr8Guches4uFr’;

$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die (‘Error connecting to mysql’);

$dbname = ‘biolist_187812’;
$db = mysql_select_db($dbname);

$result = mysql_query(“SELECT * from stories order by title”)
or die(mysql_error());

// store the record of the “example” table into $row

// Print out the contents of the entry

$titles = array(‘+’);
$imagearray = array();

while($row = mysql_fetch_array($result)){
if ($row[‘image’] != “”)
{
array_push($imagearray , $row[‘image’]);
}

}
echo “This is a list of stories that Brent Knowles has had published. You can also find reprints of his stories for Kindles, iPods, iBooks and such or see this list grouped by genre.”;

showimagetoolbar($imagearray);

$storytypefilter = ‘story’;

if ($_POST[‘gofull’] )
{
$storytypefilter = ‘all’;

}

if ($storytypefilter == ‘story’)
{

$result = mysql_query(“SELECT * from stories where storynovelarticle='”.$storytypefilter.”‘ order by title “)
or die(mysql_error());
}
else
{
$result = mysql_query(“SELECT * from stories order by title “)
or die(mysql_error());

}
while($row = mysql_fetch_array($result)){

if ($row[‘hide’] != 1)
{ $titles = writetitlebreak($row[‘title’], $titles);

showrow($row, “0”);
}

}

mysql_close($conn);
echo “


“;

?>






There is also a separate list of stories available on the Kindle and iPad

Comments are disabled for this post