Trunk updated to 0.9 git-svn-id: http://kusabax.cultnet.net/svn/repo/stable@176 73d99b7e-4f53-4972-b7b7-2ecd3c4d89ee
29 lines
831 B
PHP
29 lines
831 B
PHP
<?php
|
|
/**
|
|
* Generate the list of pages, linking to each
|
|
*
|
|
* @param integer $boardpage Current board page
|
|
* @param integer $pages Number of pages
|
|
* @param string $board Board directory
|
|
* @return string Generated page list
|
|
*/
|
|
|
|
/* <3 coda for this wonderful snippet
|
|
print $contents to $filename by using a temporary file and renaming it */
|
|
function print_page($filename, $contents, $board) {
|
|
global $tc_db;
|
|
|
|
$tempfile = tempnam(KU_BOARDSDIR . $board . '/res', 'tmp'); /* Create the temporary file */
|
|
$fp = fopen($tempfile, 'w');
|
|
fwrite($fp, $contents);
|
|
fclose($fp);
|
|
/* If we aren't able to use the rename function, try the alternate method */
|
|
if (!@rename($tempfile, $filename)) {
|
|
copy($tempfile, $filename);
|
|
unlink($tempfile);
|
|
}
|
|
|
|
chmod($filename, 0664); /* it was created 0600 */
|
|
}
|
|
|
|
?>
|