With regards to the Similar Articles issue, this is what I have got now, but it is giving me a big headache :
PHP Code:
$similarlist = explode(" ", $title);
$countsimiliar = sizeof($similarlist);
for($j = 0; $j < $countsimiliar; $j++)
{
$nochars = strlen(''.$similarlist[$j].'');
if($nochars > 4)
{
$similarquery2 .= "title LIKE '%".$similarlist[$j]."%' OR content LIKE '%".$similarlist[$j]."%' ";
if ($j < $countsimiliar-1)
{
$similarquery2 .= " AND ";
}
$markyes =1;
}
}
if($markyes==1)
{
$similarquery = "SELECT * FROM " . TABLE_PREFIX . "articles_article WHERE ";
}
$similarquery = $similarquery.$similarquery2;
It works fine if the last word in the title has more number of characters than the limit, which is set by $nochars>4 in this case.
But if not, an extra AND will be appended to the query.....
so for e.g, a title like "Review of the Nvidia Nforce Chip"
That would fail, since the last word Chip consists of only 4 characters.
how could I go about this ?
So close yet so far...
My head is spinning .....