Translations of this page: en bg cs de fi fr hu it ja pl ru tr zh

This is an old revision of the document!


Syndication

This script extern.php is used to include information about your board from pages outside the forums and to syndicate news about recent discussions via RSS. The script can display a list of recent discussions (sorted by post time or last post time), a list of active users or a collection of general board statistics. The script can be called directly via an URL (for RSS), from a PHP include command or through the use of Server Side Includes (SSI).

The scripts behaviour is controlled via variables supplied in the URL to the script. The different variables are: action (what to output), show (how many topics to display), forum (the ID of the forum to poll for topics) and type (output as HTML or RSS). The only mandatory variable is action.

Possible/default values are:

  • action:
    • active (show most recently active topics) (HTML or RSS)
    • new (show newest topics) (HTML or RSS)
    • online (show users online) (HTML)
    • online_full (as above, but includes a full list) (HTML)
    • stats (show board statistics) (HTML)
  • show: Any integer value between 1 and 50. This variables is ignored for RSS output. The default is 15.
  • fid: One or more forum IDs (comma-separated). If ignored, topics from all guest-readable forums will be polled.
  • type: RSS. Anything else means HTML output.

Here are some examples using PHP include().

  • Show the 15 most recently active topics from all forums:

include('http://host.com/forums/extern.php?action=active');

  • Show the 10 newest topics from forums with ID 5, 6 and 7:

include('http://host.com/forums/extern.php?action=new&show=10&fid=5,6,7');

  • Show users online:

include('http://host.com/forums/extern.php?action=online');

  • Show users online with full listing of users:

include('http://host.com/forums/extern.php?action=online_full');

  • Show board statistics:

include('http://host.com/forums/extern.php?action=stats');

Here are some examples using SSI.

  • Show the 5 newest topics from forums with ID 11 and 22:

<!–#include virtual=“forums/extern.php?action=new&show=5&fid=11,22” –>

  • Show board statistics:

<!–#include virtual=“forums/extern.php?action=stats” –>

And finally some examples using extern.php to output an RSS 0.91 feed.

  • Output the 15 most recently active topics:

http://host.com/extern.php?action=active&type=RSS

  • Output the 15 newest topics from forum with ID=2:

http://host.com/extern.php?action=active&type=RSS&fid=2


Personal Tools