Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Dion

    (@diondesigns)

    While straightforward, the code modifications would be difficult to accomplish for end users. However, if you ask your question on the BridgeDD support board:

    https://diondesigns.org/bridgedd/support/index.php

    I would be happy to post a custom version of the latest topics widget that only checks a single user-defined forum.

    Thread Starter manutoo

    (@manutoo)

    Thanks for the offer, but I managed to do the changes by myself.

    If others are interested, it happens in : wp-content/plugins/bridgedd/bridgedd_widgets.min.addon .
    You’ll need to beautify this file (for example with https://universalindent.sourceforge.net/ , it also contains a PHP beautifier).

    Then the main stuff is to change the SQL call from :

    $sql = 'SELECT t.topic_id, t.topic_last_post_id, t.topic_last_poster_id, t.topic_last_post_time, t.topic_title, u.username, u.user_colour FROM '
    			. TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u WHERE '
    			. sql_in_set('t.forum_id', ((!empty($wflag)) ? $guest_forums : $user_forums))
    			. ' AND u.user_id = t.topic_last_poster_id ORDER BY t.topic_last_post_time DESC LIMIT 0,' . $limit;

    to :

    $sql = 'SELECT t.topic_id, t.topic_last_post_id, t.topic_last_poster_id, t.topic_last_post_time, t.topic_title, u.username, u.user_colour FROM '
    			. TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u WHERE '
    . $db -> sql_in_set('t.forum_id', $Forums !== false ? $Forums : (!empty($wflag) ? $guest_forums : $user_forums))
    			. ' AND u.user_id = t.topic_last_poster_id ORDER BY t.topic_last_post_time DESC LIMIT 0,' . $limit;

    With “$Forums” containing the comma separated list of Forums you want to display ; example : “41”, or “41, 13”, etc…

    Thread Starter manutoo

    (@manutoo)

    EDIT:
    the forum list must be space separated and the changed line becomes :
    . $db -> sql_in_set('t.forum_id', $Forums !== false ? array_map('intval', explode(" ", $Forums)) : (!empty($wflag) ? $guest_forums : $user_forums))

    Plugin Author Dion

    (@diondesigns)

    I am happy that you were able to solve this yourself. Please note, however, that one must be very careful when specifying a list of forums. Since such a list bypasses the phpBB permission system, it is possible to display recent topics from admin-only forums.

    I just read your review…thank you! FYI, I have already written a custom login/logout widget which logs the user into phpBB instead of WordPress. It is been available in the BridgeDD Subscribers forum on the BridgeDD support board, but I have also provided it to anyone who asks for it.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Latest posts from a specific forum ?’ is closed to new replies.