20 | $sql = 'SELECT w.word_text, COUNT(*) AS word_count | 20 | if ($config['forum_tags_type']) |
21 | FROM ' . SEARCH_WORD_TABLE . ' AS w, ' . SEARCH_MATCH_TABLE . ' AS m, ' . POSTS_TABLE . ' AS p, ' . TOPICS_TABLE . ' AS t | 21 | { |
22 | WHERE m.word_id = w.word_id | 22 | $sql = 'SELECT w.word_text, COUNT(*) AS word_count |
23 | AND m.post_id = p.post_id | 23 | FROM ' . SEARCH_WORD_TABLE . ' AS w, ' . SEARCH_MATCH_TABLE . ' AS m, ' . POSTS_TABLE . ' AS p, ' . TOPICS_TABLE . ' AS t |
24 | AND p.topic_id = t.topic_id | 24 | WHERE m.word_id = w.word_id |
25 | AND t.forum_id = ' . $forum_id . ' | 25 | AND m.post_id = p.post_id |
26 | GROUP BY m.word_id | 26 | AND p.topic_id = t.topic_id |
27 | ORDER BY word_count DESC LIMIT ' . intval($config['word_graph_max_words']); | 27 | AND t.forum_id = ' . $forum_id . ' |
28 | $result = $db->sql_query($sql, 0, 'forums_wg_', FORUMS_CACHE_FOLDER); | 28 | GROUP BY m.word_id |
| | 29 | ORDER BY word_count DESC |
| | 30 | LIMIT ' . intval($config['word_graph_max_words']); |
| | 31 | $result = $db->sql_query($sql, 86400, 'forums_wg_' . str_pad($forum_id, 8, '0') . '_', FORUMS_CACHE_FOLDER); |
| | 32 | } |
| | 33 | else |
| | 34 | { |
| | 35 | $sql = "SELECT l.tag_text as word_text, l.tag_count as word_count |
| | 36 | FROM " . TOPICS_TAGS_LIST_TABLE . " l, " . TOPICS_TAGS_MATCH_TABLE . " m |
| | 37 | WHERE m.forum_id = " . $forum_id . " |
| | 38 | AND l.tag_id = m.tag_id |
| | 39 | GROUP BY m.tag_id |
| | 40 | ORDER BY l.tag_count DESC |
| | 41 | LIMIT " . intval($config['word_graph_max_words']); |
| | 42 | $result = $db->sql_query($sql, 86400, 'forums_tags_' . str_pad($forum_id, 8, '0') . '_', FORUMS_CACHE_FOLDER); |
| | 43 | } |