$mass_img = array();
$mass_tegs_1 = array();
$mass_id_sub= array();
$j=0;
$tegtohtml = $tegs_str;
foreach ($mass_tegs as $k=>$v)
{
/*
$res=mysql_query("SELECT DISTINCT id,tegs,category_sub FROM tb_wallpapers WHERE UPPER(tegs) LIKE '%".strtoupper($v)."%' and id<>'$img' and status=1 limit 10");
while($row=mysql_fetch_array($res)){
*/
$res = $mysqli->query("SELECT DISTINCT id,tegs,category_sub FROM tb_wallpapers WHERE UPPER(tegs) LIKE '%".strtoupper($v)."%' and id<>'$img' and status=1 limit 10");
while($row=mysqli_fetch_array($res, MYSQLI_ASSOC)){
$mass_img [$j]=$row["id"];
$mass_tegs_1 [$j]=$row["tegs"];
$mass_id_sub [$j]=$row["category_sub"];
$j++;
}
}
//mysql_query("update tb_wallpapers set views=views+1 where id='$img' limit 1");
$mysqli->query("update tb_wallpapers set views=views+1 where id='$img' limit 1");
$mass_img=array_unique($mass_img); // Убираем повторы
//$mass_tegs=array_unique($mass_tegs);// Убираем повторы
//$mass_id_sub=array_unique($mass_id_sub);// Убираем повторы
$count=count($mass_img);
if($count>12) $count=12;
if($count>1)
{
srand((float) microtime() * 10000000);
$rand_keys = array_rand($mass_img, $count);
$str_img='';
$i=1;
foreach ($rand_keys as $k=>$v)
{
$mass_tegs_2=explode(",", $mass_tegs_1[$v]);
$tegs_str='';
foreach ($mass_tegs_2 as $a=>$s) $tegs_str.=$s.'-';
$tegs_str=encodestring($tegs_str);
$tegs_str=substr_replace($tegs_str ," ",-1);
$tegs_str=str_replace(array(' '), '-', trim($tegs_str));
$tegs_str=str_replace(array('--'), '-', trim($tegs_str));
$str_img.='
!['.$mass_tegs_1[$v].' wallpaper '.$mass_tegs_1[$v].' wallpaper](/wallpapers/min/'.$mass_img[$v].'.jpg)
'.$tegs_sql.'
';
$i++;
}
}elseif($count==0) {
$str_img='

'.$tegs_sql.'
';
}elseif($count==1) {
$mass_tegs_2=explode(",", $mass_tegs_1[0]);
$tegs_str='';
foreach ($mass_tegs_2 as $a=>$s) $tegs_str.=$s.'-';
$tegs_str=encodestring($tegs_str);
$tegs_str=substr_replace($tegs_str ,"",-1);
$str_img='
!['.$mass_tegs_1[0].' wallpaper '.$mass_tegs_1[0].' wallpaper](/wallpapers/min/'.$mass_img[0].'.jpg)
'.$tegs_sql.'
';
}
?>
Wallpaper erotica, model, cathleen a

$tegs_str='';
foreach ($mass_tegs as $a=>$s){
/*
$res=mysql_query("SELECT id FROM tb_wallpapers WHERE UPPER(tegs) LIKE '%".strtoupper($s)."%'");
$tegs_col = mysql_num_rows($res);
*/
$res = $mysqli->query("SELECT id FROM tb_wallpapers WHERE UPPER(tegs) LIKE '%".strtoupper($s)."%'");
$tegs_col = mysqli_num_rows($res);
if($tegs_col>1)
$tegs_str.='
'.$s.'';
else
$tegs_str.='
'.$s.'';
}
$tegs_str=str_replace(array('?+'), '', trim($tegs_str));
$tegs_str=str_replace(array('?'), '', trim($tegs_str));
echo $tegs_str;
?>
Download Wallpaper
Similar Wallpapers
Wallpaper Info
Uploaded on
Original: 4324x2883 - 10992 downloads