Просмотр файла sys/fnc/rekl.php

Размер файла: 1.12Kb
  1. <?
  2. function rekl($sel)
  3. {
  4. global $set;
  5. if ($sel==3 && $_SERVER['PHP_SELF']!='/index.php')$sel=4; // для страниц, кроме главной, у нас другая позиция
  6.  
  7.  
  8.  
  9. $q=mysql_query("SELECT * FROM `rekl` WHERE `sel` = '$sel' AND `time_last` > '".time()."' ORDER BY id ASC");
  10. while ($post = mysql_fetch_assoc($q))
  11. {
  12.  
  13. if ($sel==2)echo icons('rekl.png','code');
  14.  
  15.  
  16. if ($post['dop_str']==1)
  17. echo "<a".($set['web']?" target='_blank'":null)." href='http://$_SERVER[SERVER_NAME]/go.php?go=$post[id]'>";
  18. else
  19. echo "<a".($set['web']?" target='_blank'":null)." href='$post[link]'>";
  20.  
  21. if ($post['img']==NULL)echo "$post[name]";
  22. else echo "<img src='$post[img]' alt='$post[name]' />";
  23. echo "</a><br />\n";
  24. }
  25.  
  26. if(($sel==3 || $sel==4) && is_file(H.'sys/dat/raiting.dat'))
  27. {
  28. $iss=file_get_contents(H.'sys/dat/raiting.dat');
  29. $iss=explode('{:}',$iss);
  30. $id=intval($iss[0]);
  31. if($id>0)
  32. {
  33. if($_SERVER['PHP_SELF']=='/index.php')
  34. {
  35. $small='';
  36. }else{
  37. $small='-small';
  38. }
  39. echo '<a href="http://o5top.ru/in.php?'.$id.'"><img src="http://o5top.ru/img.php?'.$id.$small.'" alt="o5top.ru" /></a><br />';
  40. }
  41. }
  42.  
  43. }
  44.  
  45. ?>