= 500 ? $_GET['x'] : 600; if ($_GET['sq'] > 0) $wid = 120; if ($_GET['y'] > 0) $ht = "&ht=".$_GET['y']; # for google ad 90pix height $books = file("books.list"); srand(time()*getmypid()); if ($_GET['sk'] && rand(0,10) < 9) { $pat = $_GET['sk']; while (list($key, $value) = each($books)) { if (preg_match("/$pat/", $value)) { $rnd = $key; break; } } } else { $rnd = rand(0, count($books)-1); } $line = preg_replace("/\n/", "", $books[$rnd]); list($title, $url, $cover) = split('\|', $line, 3); $tip = $url; $tiptxt = $title; #if (!$tip) $tip = "books/Home/1"; #XXXblurb#$tiplines = file($tip); // XXX costly extra disk read #$tiptext = " Read an ebook: ". (trim($tiplines[0])); // for alt= $tiptext = " Read an ebook: ". (trim($title)); // for alt= if (preg_match("/['\"]/", $tiptext)) $tiptext = ""; # XXX skip in alt if has quotes $params = "t=$title&c=$cover$ht"; if ($_SERVER['QUERY_STRING'] != "") $params = "$params&".$_SERVER['QUERY_STRING']; #$debug=" t=$tip params=$params "; $nonce=rand(); $pre=$_GET['pre']; $post=$_GET['post']; #"discuss" #print << More ebooks... Read more from this author Spread the word... Discuss this ebook... Click to read $title and other ebooks by Andrew Burt'); #EOJ; print << More ebooks... Read more from this author Spread the word... Discuss this ebook... Click to read $title and other ebooks by Andrew Burt$post'); EOJ; ?>