Jump to content

How do I get the Forum Name?


Square Wheels

Recommended Posts

Just now, Kevin Carwile said:

Its stored in the language system. Are you doing direct database queries are are you using IPS4 api methods?

Direct

<cfquery datasource="#DSN5#" name="NewPosts" maxrows="10">
SELECT
    tid,
    title AS ThreadTitle,
    last_poster_name,
    last_post,
    title_seo,
    pp_main_photo,
    starter_name,
    last_poster_name,
    forums_topics.posts AS PostCount
FROM
    forums_topics
INNER JOIN
core_members
ON
forums_topics.last_poster_id=member_id

WHERE
    forum_id <> '29' AND
    forum_id <> '31' AND
    forum_id <> '27' AND
    forum_id <> '30'
ORDER BY
    last_post DESC
</cfquery>

Link to comment
Share on other sites

SELECT
    tid,
    title AS ThreadTitle,
    last_poster_name,
    last_post,
    title_seo,
    pp_main_photo,
    starter_name,
    last_poster_name,
    forums_topics.posts AS PostCount,
    CASE WHEN core_sys_lang_words.word_custom IS NULL THEN core_sys_lang_words.word_default ELSE core_sys_lang_words.word_custom END AS ForumTitle
FROM
    forums_topics
INNER JOIN
core_members
ON
forums_topics.last_poster_id=core_members.member_id
INNER JOIN
core_sys_lang_words
ON
core_members.language=core_sys_lang_words.lang_id AND core_sys_lang_words.word_key=CONCAT('forums_forum_', forums_topics.forum_id)
WHERE
    forum_id NOT IN(29, 31, 27, 30)
ORDER BY
    last_post DESC

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...