uni-web
Banned
Проблема ми е там че при селекта когато има два банера с еднакви ключови думи не ми зачита позицията!
PHP:
$html = @file_get_contents($ref);
if(preg_match('/<title>(.*)<\/title>/smU', $html, $matches)) {
$title = $matches[1];
$title = str_replace($big , $smal, $title);
$mas=explode(" ",$title);
for ($i=0; $i<count($mas);$i++){
$str1 .= "%" . $mas[$i] . "%";
if(strlen($mas[$i]) > 2){
$srta .= "or `keywords` LIKE '%" .$mas[$i]. "%' ";
}
}
$searcha = $srta;
$search = $str1;
if(mysql_num_rows(@mysql_query("select * from baners_reclam where position = '4' and bstatus = 'active' and type != 'google' and `keywords` LIKE '$search' $searcha ORDER BY RAND() limit 1")) == ""){
$queri = @mysql_fetch_array(@mysql_query("select * from baners_reclam where position = '4' and bstatus = 'active' and type != 'google' ORDER BY RAND() limit 1"));
}else{
$queri = @mysql_fetch_array(@mysql_query("select * from baners_reclam where position = '4' and bstatus = 'active' and type != 'google' and `keywords` LIKE '$search' $searcha ORDER BY RAND() limit 1"));
}
}