
Новые сообщения [новые:0]
Дайджест
Горячие темы
Избранное [новые:0]
Форумы
Пользователи
Статистика
Статистика нагрузки
Мод. лог
Поиск
|
|
25.09.2006, 20:59
|
|||
|---|---|---|---|
|
|||
Ну простейший вопрос |
|||
|
#18+
Возник следующий вопрос: Имеется массив тем из 2-ух форумов, объединенный в один. Однако возникла проблема: нужно сделать так, чтобы темы выводились только за последние ПОЛГОДА. Имеется также новостной массив, там сортировка за последний месяц. Её можно использовать, как образец для сортировки за полгода. Так, все-таки, как сделать эту сортировку? ... (наш массив из 2-ух форумов) $r=mysql_query("SELECT forum_id, topic_views, topic_id, topic_time, topic_poster, topic_title, topic_first_post_id, topic_replies FROM phpbb_topics WHERE forum_id=$forum_ids[1] UNION All SELECT forum_id, topic_views, topic_id, topic_time, topic_poster, topic_title, topic_first_post_id, topic_replies FROM phpbb_topics WHERE forum_id=$forum_ids[2] ORDER BY topic_replies DESC LIMIT 5"); (новости) $arc=intval($_GET['arc']); $r=mysql_query("SELECT t.topic_id AS topic_id, t.topic_title AS topic_title, t.topic_time AS topic_time, t.topic_poster AS topic_poster, t.topic_replies AS topic_replies, t.topic_first_post_id AS topic_first_post_id, p.post_text AS post_text, p.post_id AS post_id, p.bbcode_uid AS bbcode_uid FROM phpbb_topics AS t, phpbb_posts_text AS p WHERE t.forum_id=$FORUM AND p.post_id=t.topic_first_post_id ".($arc>0?"AND YEAR(FROM_UNIXTIME(t.topic_time))=".intval($arc/100)." AND MONTH(FROM_UNIXTIME(t.topic_time))=".intval($arc%100):"")." ORDER BY t.topic_time DESC".($arc>0?"":" LIMIT 10")); ... |
|||
|
:
Нравится:
Не нравится:
|
|||
|
|
|

start [/forum/topic.php?fid=32&mobile=1&tid=1545022]: |
0ms |
get settings: |
8ms |
get forum list: |
15ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
140ms |
get topic data: |
6ms |
get forum data: |
2ms |
get page messages: |
27ms |
get tp. blocked users: |
1ms |
| others: | 200ms |
| total: | 405ms |

| 0 / 0 |
