Beispiel #1
0
<?php

require "func.php";
$conf = loadconfig('irclogger.config.php');
header('Content-Type: text/html; charset=utf-8');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head>
    <title>IRC channel log</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" media="all" type="text/css" href="style.css" />
</head>
<body>
<?php 
$dbh = getdbhandle($conf);
if ($_REQUEST['s']) {
    $sql = "SELECT id, DATE(dt) as d, TIME(dt) as t, user, type, msg\n              FROM messages\n             WHERE MATCH (msg)\n           AGAINST ('" . addslashes($_REQUEST['s']) . "')\n          ORDER BY dt DESC, id DESC";
} elseif ($_REQUEST['u']) {
    $sql = "SELECT dt\n              FROM messages\n             WHERE user = '******'u']) . "'\n          ORDER BY dt DESC, id DESC\n             LIMIT 1";
    $res = mysql_query($sql, $dbh);
    $row = mysql_fetch_array($res, MYSQL_ASSOC);
    if ($row['dt']) {
        $sql = "SELECT id, DATE(dt) as d, TIME(dt) as t, user, type, msg\n              FROM messages\n             WHERE dt >= '" . addslashes($row['dt']) . "'\n          ORDER BY dt, id";
    } else {
        echo 'Could not find any logs for user ' . htmlspecialchars($_REQUEST['u']);
        $sql = '';
    }
} else {
    if ($_REQUEST['d']) {
Beispiel #2
0
<?php

header("Content-Type: application/xml; charset=ISO-8859-1");
require 'func.php';
$RSS_title = "Hive13 RSS Feed";
$RSS_description = "RSS Feed for Hive13 events";
$RSS_items = "";
// Will be populated once we determine feed type.
$conf = loadconfig('doorlogger.config.php');
$dbh = getdbhandle($conf);
if (isset($_REQUEST['temp'])) {
    $reportIndex = $_REQUEST['temp'];
    $RSS_title = "Hive13 Temperature Report";
    if ($reportIndex == '0') {
        $RSS_description = "Feed of the Hive13 temperature for the last 24 hours.";
        $sql = "SELECT dtEventDate, dcTemp FROM tempEvents WHERE dtEventDate > DATE_SUB(NOW(), INTERVAL 24 HOUR) ORDER BY dtEventDate DESC";
    } else {
        if ($reportIndex == '1') {
            $RSS_description = "Feed of hourly average temperatures for the last 24 hours.";
            $sql = "SELECT AVG(dcTemp) dcTemp, HOUR(dtEventDate) HourOfDay, dtEventDate, count(*) count \n              FROM tempEvents \n              WHERE DATE_SUB( dtEventDate, INTERVAL 1 HOUR ) and dtEventDate > DATE_SUB(NOW(), INTERVAL 24 HOUR) \n              GROUP BY HOUR(dtEventDate), DATE(dtEventDate) \n              ORDER BY dtEventDate DESC";
        }
    }
    $res = mysql_query($sql, $dbh);
    while ($row = mysql_fetch_array($res, MYSQL_ASSOC)) {
        $RSS_items .= '<item>';
        $RSS_items .= '  <title>' . $row['dcTemp'] . '</title>';
        $RSS_items .= '  <link>http://www.hive13.org</link>';
        $RSS_items .= '  <description></description>';
        $RSS_items .= '  <pubDate>' . date(DATE_RSS, strtotime($row['dtEventDate'])) . '</pubDate>';
        $RSS_items .= '</item>';
    }
Beispiel #3
0
<?php

$config = loadconfig();
$db_source = new db_mysql($config['source']);
$db_source->connect();
$db_target = new db_mysql($config['target']);
$db_target->connect();
$db_uc = new db_mysql($config['ucenter']);
if ($setting['config']['ucenter']) {
    $db_uc->connect();
}
$process = load_process('main');
if (empty($process)) {
    showmessage("请首先选择转换程序", "index.php?action=select&source={$source}");
}
$prg = getgpc('prg');
$prg_dir['tables'] = DISCUZ_ROOT . './source/' . $source . '/table/';
$prg_dir['start'] = DISCUZ_ROOT . './source/' . $source . '/';
$prg_dir['steps'] = DISCUZ_ROOT . './source/' . $source . '/';
$prg_done = 0;
$prg_next = '';
$prg_total = $prg_total = count($process['tables']) + count($process['start']) + count($process['steps']);
foreach (array('start', 'tables', 'steps') as $program) {
    if (!empty($process[$program]) && !$process[$program . '_is_end']) {
        foreach ($process[$program] as $k => $v) {
            if ($v) {
                $prg_done++;
            } elseif ($prg_next == '') {
                $prg_next = $k;
            }
        }
        foreach ($checkarray as $key) {
            if (!empty($newconfig[$key]['dbhost'])) {
                $check = mysql_connect_test($newconfig[$key], $key);
                if ($check < 0) {
                    $error[$key] = lang('mysql_connect_error_' . abs($check));
                }
            } else {
                $error[$key] = lang('mysql_config_error');
            }
        }
        save_config_file($configfile, $newconfig, $config_default);
        if (empty($error)) {
            $db_target = new db_mysql($newconfig['target']);
            $db_target->connect();
            delete_process('all');
            showmessage('config_success', 'index.php?a=select&source=' . $source);
        }
    }
}
showtips('如果无法显示设置项目,请删除文件 data/config.inc.php');
$config = loadconfig('config.inc.php');
if (empty($config)) {
    $config = $config_default;
}
show_form_header();
show_config_input('source', $config['source'], $error['source']);
show_config_input('target', $config['target'], $error['target']);
if ($setting['config']['ucenter']) {
    show_config_input('ucenter', $config['ucenter'], $error['ucenter']);
}
show_form_footer('submit', 'config_save');