1. PHP / Говнокод #1513

    +157

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    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
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    function ru_title() {
    
            global $locale, $lang, $settings;
    
            define("DIVIDER", $locale['title-00']);
    
            $title = "";
    
            if (stristr($_SERVER['REQUEST_URI'],"news")){
                    $title = $locale['title-16'];
                    if (isset($_GET['readmore'])){
                            $result = dbquery("SELECT * FROM ".DB_PREFIX."news WHERE news_id='".$_GET['readmore']."'");
                            if (dbrows($result) != 0) {
                                    $data = dbarray($result);
                                    $title = $data["news_subject"].DIVIDER.$title;
                            }
                    }
            }
            elseif (stristr($_SERVER['REQUEST_URI'],"contact")){
                    $title = $locale['title-01'];
            }
            elseif (stristr($_SERVER['REQUEST_URI'],"edit_profile")){
                    $title = $locale['title-02'];
            }
            elseif (stristr($_SERVER['REQUEST_URI'],"lostpassword")){
                    $title = $locale['title-03'];
            }
            elseif (stristr($_SERVER['REQUEST_URI'],"messages")){
                    $title = $locale['title-04'];
            }
            elseif (stristr($_SERVER['REQUEST_URI'],"photogallery")){
                    $title = $locale['title-05'];
            }
            elseif (stristr($_SERVER['REQUEST_URI'],"profile")){
                    $title = $locale['title-06'];
            }
            elseif (stristr($_SERVER['REQUEST_URI'],"register")){
                    $title = $locale['title-07'];
            }
            elseif (stristr($_SERVER['REQUEST_URI'],"search")){
                    $title = $locale['title-08'];
            }
            elseif (stristr($_SERVER['REQUEST_URI'],"submit")){
                    $title = $locale['title-09'];
            }
    
            elseif (stristr($_SERVER['REQUEST_URI'],"downloads")){
    
                if ($_SERVER['PHP_SELF'] !== "/infusions/mod_downloads/downloads.php"){ // Sky edition
                    $title = $lang['downloads_000'];
                    if (isset($_GET['cat_id'])){
                            $result = dbquery("SELECT * FROM ".DB_PREFIX."download_cats WHERE download_cat_id='".$_GET['cat_id']."'");
                            if (dbrows($result) != 0) {
                                    $data = dbarray($result);
                                    $title = $data["download_cat_name"].DIVIDER.$title;
                            }
                    }
    			}
    		}
            return $title.(($title == "") ? ("") : (DIVIDER));
    }

    Споcоб реализации динамических заголовков для одной популярной CMS

    Запостил: eXanDr, 11 Августа 2009

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

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