From a87703788e1c881173b4f09b41cc38dc30ced07f Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Sun, 16 Sep 2001 12:59:00 +0000 Subject: Various changes git-svn-id: file:///svn/phpbb/trunk@1047 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions.php | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) (limited to 'phpBB/includes/functions.php') diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index ecc1727452..155259cddf 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -182,43 +182,44 @@ function make_jumpbox() return($boxstring); } -function make_forum_box($box_name, $default_forum = -1) +// +// Simple version of jumpbox, just lists authed forums +// +function make_forum_select($box_name) { - global $db; + global $db, $userdata; - $limit_forums = ""; + $is_auth_ary = auth(AUTH_READ, AUTH_LIST_ALL, $userdata); $sql = "SELECT forum_id, forum_name - FROM " . FORUMS_TABLE . " + FROM " . FORUMS_TABLE . " ORDER BY cat_id, forum_order"; - if(!$q_forums = $db->sql_query($sql)) + if( !$q_forums = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, "Couldn't obtain forums information.", "", __LINE__, __FILE__, $sql); } - $total_forums = $db->sql_numrows($q_forums); - $forum_rows = $db->sql_fetchrowset($q_forums); - $boxstring = '' . $forum_list . ''; } - return($boxstring); + return($forum_list); } + // // Initialise user settings on page load function init_userprefs($userdata) -- cgit v1.2.1 n> Mageia Installer and base platform for many utilitiesThierry Vignaud [tv]
summaryrefslogtreecommitdiffstats
path: root/perl-install/log.pm
blob: b049f5d4910006ce60ad0d293f545e8e8d6eb835 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package log; # $Id$

use diagnostics;
use strict;
use c;


#-#####################################################################################
#- Globals
#-#####################################################################################
my $logOpen = 0;
my $logDebugMessages = 0;


#-######################################################################################
#- Functions
#-######################################################################################
sub F() { *LOG }

sub l {
    $logOpen or openLog();
    if ($::isStandalone) {
	c::syslog(join "", @_);
    } elsif ($::isInstall) {
	print LOG "* ", @_, "\n";
	print LOG2 "* ", @_, "\n";
    } else {
	print STDERR @_, "\n";
    }
}
sub ld { $logDebugMessages and &l }
sub w { &l }

sub openLog(;$) {
    if ($::isStandalone) {
	c::openlog("DrakX");
    } elsif ($::isInstall) {
	if ($_[0]) { #- useLocal
	    open LOG, "> $_[0]";# or die "no log possible :(";
	} else {
	    open LOG, "> /dev/tty3" or open LOG, ">> /tmp/install.log";# or die "no log possible :(";
	}
	open LOG2, ">> /tmp/ddebug.log";# or die "no log possible :(";
	select((select(LOG),  $| = 1)[0]);
	select((select(LOG2), $| = 1)[0]);
    }
    exists $ENV{DEBUG} and $logDebugMessages = 1;
    $logOpen = 1;
}

sub closeLog() { 
    if ($::isStandalone) {
	c::closelog();
    } else { close LOG; close LOG2; }
}

#-######################################################################################
#- Wonderful perl :(
#-######################################################################################
1;