'"', // « (U+00AB) in UTF-8 "\xC2\xBB" => '"', // » (U+00BB) in UTF-8 "\xE2\x80\x98" => "'", // ‘ (U+2018) in UTF-8 "\xE2\x80\x99" => "'", // ’ (U+2019) in UTF-8 "\xE2\x80\x9A" => "'", // ‚ (U+201A) in UTF-8 "\xE2\x80\x9B" => "'", // ‛ (U+201B) in UTF-8 "\xE2\x80\x9C" => '"', // “ (U+201C) in UTF-8 "\xE2\x80\x9D" => '"', // ” (U+201D) in UTF-8 "\xE2\x80\x9E" => '"', // „ (U+201E) in UTF-8 "\xE2\x80\x9F" => '"', // ‟ (U+201F) in UTF-8 "\xE2\x80\xB9" => "'", // ‹ (U+2039) in UTF-8 "\xE2\x80\xBA" => "'", // › (U+203A) in UTF-8 "\xE2\x80\xA6" => "...", // ... (U+2026) in UTF-8 "\xE2\x80\x82" => " ", // Enspace (U+2002) in UTF-8 "\xE2\x80\x83" => " ", // Emspace (U+2003) in UTF-8 "\xC2\xA0" => " " // Nonbreak space in UTF-8 ); $string = strtr($string, $quotes); // Version 2 $search = array( chr(145), chr(146), chr(147), chr(148), chr(150), chr(151), chr(133), chr(32), chr(160) ); $replace = array("'","'",'"','"','-','-','...',' ',' '); $string = str_replace($search, $replace, $string); // Version 3 $string = str_replace( array('‘','’','“','”','–','”','‐','‑','‒','…',' ',' ',' '), array("'", "'", '"', '"','-',' - ','-',' - ',' - ','...',' ',' ',' '), $string ); // Version 4 $search = array( '‘', '’', '“', '”', '—', '–', '‐', '…', ' ', '&emspace;', ' ' ); $replace = array("'","'",'"','"',' - ','-','-','...',' ',' ',' '); $string = str_replace($search, $replace, $string); return $string; } $user= "a1adult_a1adult"; $pass = "condom"; $db = "a1adult_a1ebooks"; $host = "localhost"; // hook up connection to MySQL $linkxc = mysqli_connect($host, $user, $pass, $db); if (!$linkxc) { echo "Error: Unable to connect to MySQL." . PHP_EOL; echo "Debugging errno: " . mysqli_connect_errno() . PHP_EOL; echo "Debugging error: " . mysqli_connect_error() . PHP_EOL; exit; } $lastpage=$_SESSION['lastpage']; $pr=$_REQUEST['expr']; if (!isset($pr) or $pr=="" or $pr<0 or $pr>999999) { $pr=$_SESSION['prexc']; } $extokay="N"; $result=mysqli_query($linkxc, "SELECT * FROM 00products where pr_code='$pr' "); while($row = mysqli_fetch_row($result)) { $title=$row[2]; $pubno=$row[3]; $autno=$row[4]; $ldjpg=$row[21]; $ldgif=$row[22]; $ldpng=$row[23]; $srclibs=$row[76]; $extract=$row[46]; // get the author's name $resultau=mysqli_query($linkxc, "SELECT * FROM 00authors where aut_number='$autno'"); while($rowau = mysqli_fetch_row($resultau)) {if ($rowau[1]==$autno) { $autname=$rowau[5]; $autbio=$rowau[6]; $autweb=$rowau[44]; $autlinkno=$rowau[30]; } else {$autbio=""; $autname="Author Unknown";} } $title=html_entity_decode($title,ENT_QUOTES); $extract=html_entity_decode($extract,ENT_QUOTES); $autname=html_entity_decode($autname,ENT_QUOTES); $extract=convert_smart_quotes($extract); $extract=nl2br($extract); // check if an extract html file exists - and if it does then use it instead of the loaded extract $extname="a1extracts/".$pr."ext.htm"; $incext="N"; if (file_exists("$extname")){$incext="Y";} $tagtitle=$title." eBook: ".$autname.": Fiction4All - Excerpt" ; $tagdesc=$tagtitle; $tagkeys="ebook,".$autname.",".$title.",Fiction4All"; if ($row[52]!="" and $row[52]!=" ") {$tagkeys=$tagkeys.",".$row[52];} if ($row[53]!="" and $row[53]!=" ") {$tagkeys=$tagkeys.",".$row[53];} if ($row[54]!="" and $row[54]!=" ") {$tagkeys=$tagkeys.",".$row[54];} if ($row[75]!="" and $row[75]!=" ") {$tagkeys=$tagkeys.",".$row[75];} } ?> <?php print "Book Excerpt for $title"; ?> "; print " "; print " "; if ($srclibs=="A") { if ($ldpng=="Y") {$pic="https://a1adultebooks.com/bookimages/".$pr."fs.png";} elseif ($ldgif=="Y") {$pic="https://a1adultebooks.com/bookimages/".$pr."fs.gif";} elseif ($ldjpg=="Y") {$pic="https://a1adultebooks.com/bookimages/".$pr."fs.jpg";} else {$pic="";} } if ($srclibs=="F") { if ($ldpng=="Y") {$pic="https://fiction4all.com/bookimages/".$pr."fs.png";} elseif ($ldgif=="Y") {$pic="https://fiction4all.com/bookimages/".$pr."fs.gif";} elseif ($ldjpg=="Y") {$pic="https://fiction4all.com/bookimages/".$pr."fs.jpg";} else {$pic="";} } if ($pic!="") { print "

$title by $autname

";} $vb=""; $jin=""; $pub=""; print "

Add To Cart

"; print ""; print ""; print "

EXTRACT FOR
$title

($autname)

"; print "

"; print "
"; if ($incext=="Y") { print ""; print " "; print "
"; if (file_exists("$extname")) { echo $extract=convert_smart_quotes(file_get_contents("$extname")); } } else { if ($extract=="") { print "

No Excerpt Is Available

"; } else { print "
";
				print "

$extract

"; print "
"; } } print "
"; print "

"; print ""; ?>