aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions.php
diff options
context:
space:
mode:
authorLudovic Arnaud <ludovic_arnaud@users.sourceforge.net>2002-10-03 02:43:41 +0000
committerLudovic Arnaud <ludovic_arnaud@users.sourceforge.net>2002-10-03 02:43:41 +0000
commit268d936f4673974e46d16d8ddd7edba1422aba9a (patch)
tree0e3ef51b37a4f4ebe10dd75af26cd2ba099e8790 /phpBB/includes/functions.php
parent1666e7d3e733bf81b460497ac334232258c343fa (diff)
downloadforums-268d936f4673974e46d16d8ddd7edba1422aba9a.tar
forums-268d936f4673974e46d16d8ddd7edba1422aba9a.tar.gz
forums-268d936f4673974e46d16d8ddd7edba1422aba9a.tar.bz2
forums-268d936f4673974e46d16d8ddd7edba1422aba9a.tar.xz
forums-268d936f4673974e46d16d8ddd7edba1422aba9a.zip
Subforums handling part 2, it almost works. Also added: the "Explain" link at the bottom page, can be removed easily before official release if necessary.
git-svn-id: file:///svn/phpbb/trunk@2913 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r--phpBB/includes/functions.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index aa7feba656..9b3d079e31 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -583,6 +583,29 @@ function on_page($num_items, $per_page, $start)
return sprintf($lang['Page_of'], floor( $start / $per_page ) + 1, max(ceil( $num_items / $per_page ), 1) );
}
+function format_subforums_list($subforums)
+{
+ if (empty($subforums))
+ {
+ return '';
+ }
+
+ global $phpEx, $SID;
+ foreach ($subforums as $row)
+ {
+ $alist[$row['forum_id']] = $row['forum_name'];
+ }
+ asort($alist);
+
+ $links = array();
+ foreach ($alist as $forum_id => $forum_name)
+ {
+ $links[] = '<a href="viewforum.' . $phpEx . $SID . '&f=' . $forum_id . '">' . htmlspecialchars($forum_name) . '</a>';
+ }
+
+ return implode(', ', $links);
+}
+
//
// Obtain list of naughty words and build preg style replacement arrays for use by the
// calling script, note that the vars are passed as references this just makes it easier