What's new? | Help | Directory | Sign in
Google
             
Search
for
Updated Jan 26, 2008 by tslocum
DirectoryBoards  
Script to auto-generate $boards for your Directory entry

directoryboards.php

1.0.4 and greater

<?php
require 'config.php';

echo '$boards = \'';

$results = $tc_db->GetAll("SELECT HIGH_PRIORITY `name`, `desc` FROM `" . KU_DBPREFIX . "boards` ORDER BY `name` ASC");
if (count($results) > 0) {
	$boards_list = '';
	
	foreach ($results as $line) {
		$boards_list .= $line['name'] . '|' . $line['desc'] . ',';
	}
	
	$boards_list = substr($boards_list, 0, -1);
	
	echo $boards_list;
}

echo '\';';
?>

Pre-1.0.4

<?php
require 'config.php';

echo '$boards = \'';

$results = $tc_db->GetAll("SELECT HIGH_PRIORITY `name`, `desc` FROM `" . KU_DBPREFIX . "boards` ORDER BY `name` ASC");
if (count($results) > 0) {
	$boards_list = '';
	
	foreach ($results as $line) {
		$boards_list .= $line['name'] . '|' . $line['desc'] . ',';
	}
	
	$boards_list = substr($boards_list, 0, -1);
	
	$boards_list = str_replace(' ', '+', $boards_list);
	
	echo $boards_list;
}

echo '\';';
?>

Sign in to add a comment