|
|
|
Ну простейший вопрос
|
|||
|---|---|---|---|
|
#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")); ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 25.09.2006, 20:59 |
|
||
|
|

start [/forum/topic.php?fid=32&gotonew=1&tid=1545022]: |
0ms |
get settings: |
8ms |
get forum list: |
17ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
165ms |
get topic data: |
9ms |
get first new msg: |
5ms |
get forum data: |
3ms |
get page messages: |
37ms |
get tp. blocked users: |
1ms |
| others: | 199ms |
| total: | 452ms |

| 0 / 0 |
