"PHP" / Говнокод #5318 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
  36. 36
  37. 37
  38. 38
// START MY FOR MENU
$list_pages = preg_replace('/<li([^>]*)>/is', ' ', $output);
$list_pages = str_replace('</li>', '', $list_pages);
$list_pages = preg_replace('/<a/is', '</td><td class="menu"> <a$1', $list_pages);

if (isset($_GET['page_id']) AND !is_numeric($_GET['page_id'])) { exit("ERROR!"); }
$pd = mysql_real_escape_string($_GET['page_id']);
if(strstr($_SERVER['REQUEST_URI'], 'page_id='.$pd) == TRUE) {
$list_pages = preg_replace('/<\/td><td class=\"menu\"\> <a href=\"(http:\/\/'.$_SERVER["HTTP_HOST"].'\/\?page_id='.$pd.')/is', '</td><td class="menu_click"><a href="$1', $list_pages);
}

for($i=0; $i<sizeof($pages); $i++) {
$link = $pages[$i]->guid;
$lol = '';
if(strstr($_SERVER['REQUEST_URI'], '?') == TRUE) {
if ($link == 'http://'.$_SERVER['HTTP_HOST'].'/?'.$_SERVER['QUERY_STRING']) {
$list_pages = preg_replace('/<\/td><td class=\"menu\"\> <a href=\"(http:\/\/'.$_SERVER["HTTP_HOST"].'\/\?'.$_SERVER["QUERY_STRING"].')/is', '</td><td class="menu_click2"><a href="$1', $list_pages);
}
 } else {
if ($link == 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']) {
$list_pages = preg_replace('/<\/td><td class=\"menu\"\> <a href=\"(http:\/\/'.$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"].')/is', '</td><td class="menu_click2"><a href="$1', $list_pages);   
}
   }
}


     $output = $list_pages;
     $str = preg_split("/<\/a\>/i", $output);
     $moar = '';
   for ($i=0; $i<sizeof($pages); $i++)
   {
     $moar .= preg_replace('/<\/td><td class=\"menu\"\> <a href=\"(.*)\" title=\"(.*)\">/is', 
     '</td><td class="menu" onclick="linkgo(\'$1\');" id="moar'.$i.'" onmouseover="menu1(\'moar'.$i.'\');" onmouseout="menu2(\'moar'.$i.'\');"> <a href="$1" title="$2">', $str[$i]);
     $moar .= "</a>";
     }
    $output = $moar;
    
// END MY FOR MENU

None ;)

Запостил: Furry Furry, (Updated )

Комментарии (68) RSS

Добавить комментарий

Переведи на "PHP", guest!

    А не использовать ли нам bbcode?


    8