drugaische
Писатель
- Регистрация
- 18 Май 2014
- Сообщения
- 6
- Реакции
- 1
Подскажите как на главной под категориями вывести новые объявления? спс
Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
Присоединяюсь, но только не цену а свои регионы вставить?Подскажите куда копать чтобы вместо региона в .новых объявлениях. была указана цена .
Видимо нужно файл index.php ковырять, да? Ау спецы, вы че все притухли, дайте советПрисоединяюсь, но только не цену а свои регионы вставить?
Подскажите куда копать чтобы вместо региона в .новых объявлениях. была указана цена .
<?=$lang[163]?>
<?=$lang[1008]?>
$last_add=mysql_query("SELECT jb_board.id AS board_id, jb_board.id_category, jb_board.title, jb_board.city, DATE_FORMAT(jb_board.date_add,'%d.%m.%Y') AS dateAdd, jb_board.checkbox_top, jb_board.checkbox_select, jb_board_cat.id, jb_board_cat.".$name_cat.", jb_photo.photo_name, jb_city.city_name, jb_city.en_city_name FROM jb_board RIGHT JOIN jb_board_cat ON jb_board.id_category = jb_board_cat.id LEFT JOIN jb_city ON jb_board.city_id = jb_city.id LEFT JOIN jb_photo ON jb_board.id = jb_photo.id_message WHERE old_mess = 'old' ".$subQuery." GROUP by board_id ORDER BY board_id DESC LIMIT ".$start.", ".$c['count_adv_on_index']); cq();
jb_board.price,
<div class="o5"><? if(defined('JBLANG')&& constant('JBLANG')=='en') echo $last['en_city_name']; else echo $last['city_name']; ?></div>
<div class="o5"><? if($last['price']!=0) echo "<span >".$last['price']." <?=$lang[1010]?></span>"; ?></div>
Не понятно вопрос.Что вы именно хотите?Присоединяюсь, но только не цену а свои регионы вставить?
<?
if (defined('JBCITY')) $subQuery=' AND jb_board.city_id = '.JBCITY; else $subQuery='';
$name_cat=(defined('JBLANG')&& constant('JBLANG')=='en')?'en_name_cat':'name_cat';
$result = mysql_query ("SELECT id FROM jb_board WHERE old_mess = 'old' ".$subQuery);cq();
$last_add=mysql_query("SELECT jb_board.id AS board_id, jb_board.id_category, jb_board.title, jb_board.city, jb_board.text, jb_board.type, jb_board.price, DATE_FORMAT(jb_board.date_add,'%d.%m.%Y') AS dateAdd, jb_board.checkbox_top, jb_board.checkbox_select, jb_board_cat.id, jb_board_cat.".$name_cat.", jb_photo.photo_name, jb_city.city_name, jb_city.en_city_name FROM jb_board RIGHT JOIN jb_board_cat ON jb_board.id_category = jb_board_cat.id LEFT JOIN jb_city ON jb_board.city_id = jb_city.id LEFT JOIN jb_photo ON jb_board.id = jb_photo.id_message WHERE old_mess = 'old' ".$subQuery." GROUP by board_id ORDER BY board_id DESC LIMIT 10"); cq();
if(mysql_num_rows($last_add)){
?>
<div id="content_block"><div class="bt_l"><div class="bt_r">
<div class="bt_title" style="position:relative"><img class="absmid" src="<?=$im?>jb_t1/newlist.png" /> <?=$lang[600]?><font style="color:#56c5f6;"> | </font><span style="font-size:12px"><?
$today_query=mysql_result(mysql_query("SELECT count(*) FROM jb_board WHERE DATE(date_add)=CURDATE()"),0);cq();
if(@$today_query)echo "".$lang[607]."- <strong>".$today_query."</strong>, ";
$yestd_query=mysql_result(mysql_query("SELECT count(*) FROM jb_board WHERE DATE(date_add)=CURDATE()-INTERVAL 1 DAY"),0);cq();
if (@$yestd_query) echo "".$lang[609]."- <strong>".$yestd_query."</strong>";
?></span><div style="position:absolute; right:0; top:0"><a title="Rss - <?=$lang[502]?>" href="<?=$h?>rss.html"><img width="33px" height="62px" class="absmid" src="<?=$im?>jb_t1/bt2rss_r.png" /></a></div>
</div>
<div class="bc">
<div style="width:100%;">
<table width="100%" border="0" cellspacing="1" cellpadding="0" class="td" background="#ffffff">
<tr class="thead">
<td width="9%" align="center"><?=$lang[122]?></td>
<td align="center" style="border-left:1px solid #e2f2fb;"><?=$lang[529]?></td>
<td width="50%" style="border-left:1px solid #e2f2fb;"><div style="padding-left:10px"><?=$lang[123]?></div></td>
<td align="center" style="border-left:1px solid #e2f2fb;"><?=$lang[163]?></td>
<td align="center" style="border-left:1px solid #e2f2fb;"><?=$lang[127]?></td>
</tr>
<? $count = 1;?>
<?
while ($last=mysql_fetch_assoc($last_add)){
if(utf8_strlen($last['text'])>100)$last['text']=utf8_substr($last['text'],0,97)."...";
$TrColor = ($count % 2 == 0) ? "background:#f8f8f8" : "";
?>
<tr class="<?=smsclass($last['checkbox_top'],$last['checkbox_select'])?> ads" style=" <? echo "".$TrColor."";?>" >
<td width="9%" align="center">
<? echo "<a href=\"".$h."c".$last['id_category'].".html\">".$last[$name_cat]."</a>"; ?>
</td>
<td align="center" width="130px">
<?
if($last['type']=="s")$type_tit=$lang[414];elseif($last['type']=="p")$type_tit=$lang[413];
elseif($last['type']=="u")$type_tit=$lang[800];else $type_tit=$lang[801];?>
<?=$type_tit ?>
</td>
<td width="50%"><div style="padding-left:10px; font-size:12px">
<a title="<?=$last['title']?>" href="<?="c".$last['id_category']."-".$last['board_id']?>.html"><?=$last['title']?></a>
<div style="color:#888; font-size:11px">
<?=$last['text'] ?></div>
<div align="right">
<a style="font:normal 11px Tahoma, Geneva, sans-serif;" title="<?=$last['title']?>" href="<?="c".$last['id_category']."-".$last['board_id']?>.html#comments"><? $query_comments=mysql_query("SELECT DATE_FORMAT(date,'%d.%m.%Y') as dat FROM jb_comments WHERE id_board='".$last['board_id']."' AND old_mess='old' ORDER by id DESC");cq();
if($query_comments)$count_comments=mysql_num_rows($query_comments);
$count_c=($count_comments)?"(".$count_comments.")":"";
if(@$count_comments){ echo "".$lang[423]." ".$count_c."";} ?></a>
</div>
</div>
</td>
<td align="center">
<?=$last['city'] ?>
</td>
<td align="center">
<? echo($last['dateAdd']==date("d.m.Y"))?$lang[531]:$last['dateAdd'];?>
</td>
</tr>
<?
$count ++;
}
echo "</table></div></div></div></div></div>";
}
?>
Попробуйте так.У меня видимо код другой, совет выше не помог вот код мой, может сами подправите если можно . Нужно чтобы вместо насел.пункта выводилась цена спс.
<?
if (defined('JBCITY')) $subQuery=' AND jb_board.city_id = '.JBCITY; else $subQuery='';
$name_cat=(defined('JBLANG')&& constant('JBLANG')=='en')?'en_name_cat':'name_cat';
$result = mysql_query ("SELECT id FROM jb_board WHERE old_mess = 'old' ".$subQuery);cq();
$last_add=mysql_query("SELECT jb_board.id AS board_id, jb_board.id_category,jb_board.price, jb_board.title, jb_board.city, jb_board.text, jb_board.type, jb_board.price, DATE_FORMAT(jb_board.date_add,'%d.%m.%Y') AS dateAdd, jb_board.checkbox_top, jb_board.checkbox_select, jb_board_cat.id, jb_board_cat.".$name_cat.", jb_photo.photo_name, jb_city.city_name, jb_city.en_city_name FROM jb_board RIGHT JOIN jb_board_cat ON jb_board.id_category = jb_board_cat.id LEFT JOIN jb_city ON jb_board.city_id = jb_city.id LEFT JOIN jb_photo ON jb_board.id = jb_photo.id_message WHERE old_mess = 'old' ".$subQuery." GROUP by board_id ORDER BY board_id DESC LIMIT 10"); cq();
if(mysql_num_rows($last_add)){
?>
<div id="content_block"><div class="bt_l"><div class="bt_r">
<div class="bt_title" style="position:relative"><img class="absmid" src="<?=$im?>jb_t1/newlist.png" /> <?=$lang[600]?><font style="color:#56c5f6;"> | </font><span style="font-size:12px"><?
$today_query=mysql_result(mysql_query("SELECT count(*) FROM jb_board WHERE DATE(date_add)=CURDATE()"),0);cq();
if(@$today_query)echo "".$lang[607]."- <strong>".$today_query."</strong>, ";
$yestd_query=mysql_result(mysql_query("SELECT count(*) FROM jb_board WHERE DATE(date_add)=CURDATE()-INTERVAL 1 DAY"),0);cq();
if (@$yestd_query) echo "".$lang[609]."- <strong>".$yestd_query."</strong>";
?></span><div style="position:absolute; right:0; top:0"><a title="Rss - <?=$lang[502]?>" href="<?=$h?>rss.html"><img width="33px" height="62px" class="absmid" src="<?=$im?>jb_t1/bt2rss_r.png" /></a></div>
</div>
<div class="bc">
<div style="width:100%;">
<table width="100%" border="0" cellspacing="1" cellpadding="0" class="td" background="#ffffff">
<tr class="thead">
<td width="9%" align="center"><?=$lang[122]?></td>
<td align="center" style="border-left:1px solid #e2f2fb;"><?=$lang[529]?></td>
<td width="50%" style="border-left:1px solid #e2f2fb;"><div style="padding-left:10px"><?=$lang[123]?></div></td>
<td align="center" style="border-left:1px solid #e2f2fb;"><?=$lang[1008]?></td>
<td align="center" style="border-left:1px solid #e2f2fb;"><?=$lang[127]?></td>
</tr>
<? $count = 1;?>
<?
while ($last=mysql_fetch_assoc($last_add)){
if(utf8_strlen($last['text'])>100)$last['text']=utf8_substr($last['text'],0,97)."...";
$TrColor = ($count % 2 == 0) ? "background:#f8f8f8" : "";
?>
<tr class="<?=smsclass($last['checkbox_top'],$last['checkbox_select'])?> ads" style=" <? echo "".$TrColor."";?>" >
<td width="9%" align="center">
<? echo "<a href=\"".$h."c".$last['id_category'].".html\">".$last[$name_cat]."</a>"; ?>
</td>
<td align="center" width="130px">
<?
if($last['type']=="s")$type_tit=$lang[414];elseif($last['type']=="p")$type_tit=$lang[413];
elseif($last['type']=="u")$type_tit=$lang[800];else $type_tit=$lang[801];?>
<?=$type_tit ?>
</td>
<td width="50%"><div style="padding-left:10px; font-size:12px">
<a title="<?=$last['title']?>" href="<?="c".$last['id_category']."-".$last['board_id']?>.html"><?=$last['title']?></a>
<div style="color:#888; font-size:11px">
<?=$last['text'] ?></div>
<div align="right">
<a style="font:normal 11px Tahoma, Geneva, sans-serif;" title="<?=$last['title']?>" href="<?="c".$last['id_category']."-".$last['board_id']?>.html#comments"><? $query_comments=mysql_query("SELECT DATE_FORMAT(date,'%d.%m.%Y') as dat FROM jb_comments WHERE id_board='".$last['board_id']."' AND old_mess='old' ORDER by id DESC");cq();
if($query_comments)$count_comments=mysql_num_rows($query_comments);
$count_c=($count_comments)?"(".$count_comments.")":"";
if(@$count_comments){ echo "".$lang[423]." ".$count_c."";} ?></a>
</div>
</div>
</td>
<td align="center">
<? if($last['price']!=0) echo "<span >".$last['price']." <?=$lang[1010]?></span>"; ?>
</td>
<td align="center">
<? echo($last['dateAdd']==date("d.m.Y"))?$lang[531]:$last['dateAdd'];?>
</td>
</tr>
<?
$count ++;
}
echo "</table></div></div></div></div></div>";
}
?>
перед ".$last['price']."Огромное спасибо, все получилось, примного Вам блогадарен, вот бы еще узнать чтобы выделять цену куда нужно вставить тэг <FONT color="red">?