|
|
|
Ну простейший вопрос
|
|||
|---|---|---|---|
|
#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&fpage=132&tid=1545022]: |
0ms |
get settings: |
7ms |
get forum list: |
16ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
45ms |
get topic data: |
8ms |
get forum data: |
2ms |
get page messages: |
31ms |
get tp. blocked users: |
1ms |
| others: | 209ms |
| total: | 325ms |

| 0 / 0 |
