PDA

View Full Version : Is it possible to alphabetize my forums?


uReside.com
04-08-2005, 04:47 PM
I have 814 forums, in about 30 parent folders. I was wondering if i could setup the parent to alphabetize the childs of each parent, and the parent of those 30, to alphabetize those.

Andreas
06-03-2005, 03:48 AM
!!! Warning !!!

This code is UNTESTED. Use it at your own risk.
I strongly recommend NOT to use it in a production environment.


<?php
require_once('./global.php');
require_once('./includes/adminfunctions.php');
$displayorder=1;
$forums = $DB_site->query("SELECT forumid FROM " . TABLE_PREFIX . "forum WHERE displayorder!=0 ORDER by title ASC");
while ($forum = $DB_site->fetch_array($forums))
{
$DB_site->query("UPDATE " . TABLE_PREFIX . "forum SET displayorder = $displayorder WHERE forumid=$forum[forumid]");
$displayorder++;
}
unset($forumarraycache, $forumcache);
build_forum_permissions();
echo('Forums reordered');
?>