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

    −11

    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
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    76. 76
    77. 77
    78. 78
    79. 79
    80. 80
    81. 81
    82. 82
    83. 83
    84. 84
    85. 85
    86. 86
    87. 87
    88. 88
    89. 89
    90. 90
    91. 91
    92. 92
    93. 93
    94. 94
    95. 95
    96. 96
    97. 97
    98. 98
    function getAd($ad)
    	{
    		$query = $this->db->query("SELECT A.title as header, A.href as board_id, A.id as b_id, A.user_id,
    			B.name as category, C.name as root_category, B.href as category_href,
    			B.href as cat_href, C.href as root_href, D.name as city_name,
    			A.*, B.*, C.*, D.* FROM
    			board as A,
    			categories as B,
    			categories as C,
    			region as D
    			WHERE
    			B.id = A.id_category and C.id = B.root_id and D.href = A.city
    			and A.href = '".functions::q($ad)."' LIMIT 1");
    		while($b = mysql_fetch_assoc($query))
    		{
    			self::check_hit($b['b_id']);
    			$this->INFO['title'] = $b['header']." - ".$b['category']." на %SITE%";
    			$this->INFO['description'] = $b['header'].($b['price'] != 0 ? " - ". $b['price'] . ' ' . (($b['price_t'] == 'uah') ? 'грн' : '$' ) ."." : "").", ".$b['category']." на %SITE%";
    			$this->search->R = $b['city'];
    			$this->search->CAT_HREF = $b['cat_href'];
    			$this->search->COUNT_ADS = 5;
    			$this->search->setInf();
    			$this->getInfo();
    			$board = $this;
    			echo "<div id='content' align='left' class='mtop0'>";
    			$q = $this->db->query("SELECT * FROM photo WHERE folder = '".functions::q($b['photos_id'])."' ORDER BY time ASC");
    			$i = 0;
    			$photo = Array();
    			while($p = mysql_fetch_assoc($q)) {
    				$url = HOME.'photo/'.$p['folder'].'/'.$p['name'];
    				$url_local = DIR.'/photo/'.$p['folder'].'/'.$p['name'];
    				$size = functions::getFullSize($url_local, 553, 373);
    				$size_min = functions::getFullSize($url_local, 90, 70);
    				$photo[$i] = Array($url, $size['width'], $size['height'], $size_min['width'], $size_min['height']);
    				$i++;
    			}
    			echo "<div class='board-content'>";
    			echo "<div class='bread p10px bbottom-eee'>";
    			echo "<a href='".HOME."search/'>Все объявления</a>";
    			$this->search->getBreadLink(HOME.$b['city']."/", trim($b['city_name']));
    			$this->search->getBreadLink(HOME.$b['city'].'/'.$b['root_href']."/", trim($b['root_category']));
    			$this->search->getBreadLink(HOME.$b['city'].'/'.$b['cat_href']."/", trim($b['category']));
    			echo "</div>
    			</div>";
    			echo "<div class='mtop11 board-content'>";
    			// left
    			echo "<div class='w600px left'>";
    			$rel="";
    			echo "<div class='photos-mini right'>";
    			for($i = 0; $i < count($photo); $i++)
    			{
    				preg_match('/\.([^\.]+)$/',$photo[0][0],$a);
    				echo "<div class='m5".($i == 0 ? " mtop0" : ($i == count($photo) - 1 ? " mbottom0" : ""))."'>";
    				if ($i > 0) $rel=" rel='gallery'";
    				echo "<a class='fullp' href='".str_replace($a[1],'full.'.$a[1],$photo[$i][0])."' ".$rel." class='photo-gallery' style='display:none;' title='" . ($i + 1) . "'>
    					<img src='".$photo[$i][0]."' width='".$photo[$i][3]."' height='".$photo[$i][4]."'
    						data-width='".$photo[$i][1]."'  data-height='".$photo[$i][2]."' ".($i == 0 ? " class='op1'" : "")."/>
    					</a>";
    				echo "<a href='".$photo[$i][0]."' class='photo-gallery' title='" . ($i + 1) . "'>
    				<img src='".$photo[$i][0]."' width='".$photo[$i][3]."' height='".$photo[$i][4]."'
    				data-width='".$photo[$i][1]."'  data-height='".$photo[$i][2]."' ".($i == 0 ? " class='op1'" : "")."/>
    				</a>";
    				echo "</div>";
    			}
    			echo "<div class='cboth'></div>";
    			echo "</div>";
    			echo "<div class='photo left' align='left'>";
    			if (isset($a))
    			echo "<a class='fullp' rel='gallery' title='1' id='fullp' href='".str_replace($a[1],'full.'.$a[1],$photo[0][0])."'><img src='".$photo[0][0]."' id='main-photo'/></a>";
    			/*for($i = 0; $i <= count($photo); $i++)
    			{
    				echo "<img src='".$photo[]."' width='' height=''/>";
    			}*/
    			echo "</div>";
    			echo "<div class='cboth'></div>";
    			echo "</div><!-- /.left -->";
    			// right
    			echo "<div class='w500px right'>";
    			echo "<h1 class='board-h1'>".$b['header']."</h1>";
    			// SillexLab edit
                if ($this->getUserId() == $b['user_id'] || $this->getAdmin())
                {
    				echo '<div class="service-buttons-wrap">';
    				echo '<div class="service-buttons"><a class="button service" href="service/top/'.$b['b_id'].'"><img src="img/button-top.png" class="img-button"></a>';
    				echo '<a class="button service" href="/service/color/'.$b['b_id'].'" style=""><img src="img/button-color.png" class="img-button"></a><a class="button service" href="/service/important/'.$b['b_id'].'" style=""><img src="img/button-time.png" class="img-button"></a></div>';
    				echo '</div>';
    			}
    			/*if ($this->getAdmin()) echo "<div class='service-buttons'>
    			<a class='button service' href='service/top/".$b['b_id']."'>В топ!</a>
    			<a class='button service' href='/service/color/".$b['b_id']."'>Выделить цветом</a>
    			<a class='button service' href='/service/important/".$b['b_id']."'>Сделать срочным</a></div>";
    			*/
    			$price = empty($b['price']) ? "---" : $b['price']." ".(($b['price_t'] == 'uah') ? 'грн' : '$' ).".";
    			echo "<div class='board-price'>
    				<span class='price-num'>$price</span></div>";
    			echo "<div class='board-content w410px mtop11'>";
    			echo "<table cellpadding='0' cellspacing='0' class='board-info'>
    				<tr><td class='td1'>Автор:</td><td><strong>".$b['autor']."</strong> <a href='".HOME."search/?hash=".md5($b['email'])."' style='font-size: 11px;'>(Все объявления владельца)</a></td></tr>

    Божественный метод

    Запостил: HiNeX, 21 Сентября 2015

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

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

    Ошибка компиляции комментария:
    1. Гости могут высказаться только во вторник, пятницу или субботу
    ava Семь раз отмерь — один отрежь, guest!
    А не использовать ли нам bbcode?
    • [b]жирный[/b] — жирный
    • [i]курсив[/i] — курсив
    • [u]подчеркнутый[/u] — подчеркнутый
    • [s]перечеркнутый[/s] — перечеркнутый
    • [blink]мигающий[/blink] — мигающий
    • [color=red]цвет[/color] — цвет (подробнее)
    • [size=20]размер[/size] — размер (подробнее)
    • [code=<language>]some code[/code] (подробнее)
    Проверочный код