- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 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>
                                 
        
Комментарии (0) RSS
Добавить комментарий