0 AND pInStock>0
AND (" . $relatedBoolean . " > 3
OR( (pHOverall < " . ($pHOverall + $hTol) . " AND pHOverall > " . ($pHOverall - $hTol) . ")
AND (pHPainting < " . ($pHPainting + $hTol) . " AND pHPainting > " . ($pHPainting - $hTol) . ")
AND (pVOverall < " . ($pVOverall + $vTol) . " AND pVOverall > " . ($pVOverall - $vTol) . ")
AND (pVPainting < " . ($pVPainting + $vTol) . " AND pVPainting > " . ($pVPainting - $vTol) . ")
)) ORDER BY relevance DESC LIMIT 10";
*/
$strongWords = '';
if(stristr($relatedBoolean,'Tiger')) $strongWords .= ' Tiger Tigers';
if(stristr($relatedBoolean,'Warrior')) $strongWords .= ' Warrior Warriors';
if(stristr($relatedBoolean,'Woman')) $strongWords .= ' Woman Women Girl Lady';
if(stristr($relatedBoolean,'Buddh')) $strongWords .= ' Buddhist Buddha';
if(stristr($relatedBoolean,'Modern')) $strongWords .= ' Modern';
if(stristr($relatedBoolean,'Philosoph')) $strongWords .= ' Philosophy Philosopher';
if(stristr($relatedBoolean,'Fish')) $strongWords .= ' Fish';
if(stristr($relatedBoolean,'Dragon')) $strongWords .= ' Dragon Dragons';
if(stristr($relatedBoolean,'Bird')) $strongWords .= ' Bird Birds';
if(stristr($relatedBoolean,'Crane')) $strongWords .= ' Crane Cranes';
if(stristr($relatedBoolean,'Egret')) $strongWords .= ' Egret Egrets';
if(stristr($relatedBoolean,'Horse')) $strongWords .= ' Horse Horses Horseback';
if(stristr($relatedBoolean,'Cat') || stristr($relatedBoolean,'Kitten')) $strongWords .= ' Cat Cats Kitten Kittens';
if(stristr($relatedBoolean,'Flower')) $strongWords .= ' Flower Flowers';
if(stristr($relatedBoolean,'Blossom')) $strongWords .= ' Blossom Blossoms';
if(stristr($relatedBoolean,'Peon')) $strongWords .= ' Peony Peonies';
if(stristr($relatedBoolean,'Lotus')) $strongWords .= ' Lotus';
if(stristr($relatedBoolean,'Bamboo')) $strongWords .= ' Bamboo';
if(stristr($relatedBoolean,'Landscape')) $strongWords .= ' Landscape';
if(stristr($relatedBoolean,'Japanese')) $strongWords .= ' Japanese';
if(stristr($relatedBoolean,'Samurai')) $strongWords .= ' Samurai';
if(stristr($relatedBoolean,'Geisha')) $strongWords .= ' Geisha Geishas';
if(stristr($relatedBoolean,'Woodblock')) $strongWords .= ' Woodblock';
if(stristr($relatedBoolean,'Guanyin')) $strongWords .= ' Guanyin';
$strongWords = trim($strongWords);
$score0 = $addFormat = '';
//if(strstr($relatedBoolean,'scroll')) { $addFormat = " pName LIKE '%Scroll%' AND"; str_replace(' scroll','',$relatedBoolean); }
$xSQL = "SELECT pId,pName,pPrice,pListPrice,pStaticPage,pInStock,pMatt,pDescription,";
if($strongWords != '') { $xSQL .= " 300 * (MATCH pName AGAINST ('" . $strongWords . "')) AS score0,"; $score0 = 'score0+'; }
$xSQL .= " 200 * (MATCH pName AGAINST('" . $relatedBoolean . "')) AS score1,
17 * (MATCH pSearchParams AGAINST('" . $relatedBoolean . "')) AS score2,
20 * (MATCH pLongDescription AGAINST('" . $relatedBoolean . "')) AS score3,
15 * (MATCH pDescription AGAINST('" . $relatedBoolean . "')) AS score4
FROM products WHERE ";
$xSQL .= $addFormat;
$xSQL .= " (MATCH pName,pDescription AGAINST ('" . $relatedBoolean . "' IN BOOLEAN MODE)) AND pId != '" . $pId . "' AND pSection<25 AND pInStock>0 AND pDisplay=1";
$xSQL .= " ORDER BY (" . $score0 . "score1+score2+score3+score4) DESC
LIMIT 18";
if(@$_GET['showsql']) print '$xSQL= ' . $xSQL . '
....
';
if($allprods = mysqli_query($GLOBALS['ectdatabase'],$xSQL) or mysqli_error($GLOBALS['ectdatabase'])) $totrows = mysqli_num_rows($allprods); else $totrows = 0;
if($totrows > 0) {
print '