コード例 #1
0
function CompleteTransaction($errorMessage)
{
    global $output;
    if ($errorMessage) {
        mysql_query("ROLLBACK");
        Output("Success", 0);
        Output("Error", "'" . $errorMessage . "'");
    } else {
        mysql_query("COMMIT");
        Output("Success", 1);
    }
    $started = false;
    foreach ($output as $key => $value) {
        if (!$started) {
            print "{$key}={$value}";
            $started = true;
        } else {
            print "&{$key}={$value}";
        }
    }
}
コード例 #2
0
ファイル: quests.php プロジェクト: nyxojaele/Possibilities
                        $questString .= ",{$stepQuestRow['0']}";
                    }
                    break;
            }
            $questRow = mysql_fetch_assoc($questsResults);
        }
    }
    Output("Result", $questString);
} else {
    if ($action == 'available') {
        $newID = ActivateQuest($userID, $requestID);
        if ($newID == -1) {
            CompleteTransaction("Can not activate quest");
            return;
        }
        Output("NewID", $newID);
    } else {
        if ($action == 'reset') {
            //We separate this from everything else because the rows may or may not exist already at this point
            $id = $_POST['id'];
            if (CheckQuestOwnership($userID, $id)) {
                if (!ResetQuest($userID, $id)) {
                    CompleteTransaction("Can not reset quest");
                    return;
                }
            }
        } else {
            $id = $_POST['id'];
            if (!CheckQuestOwnership($userID, $id)) {
                CompleteTransaction("Quest doesn't belong to this user");
                return;
コード例 #3
0
ファイル: index.php プロジェクト: BackupTheBerlios/thwc
        }
        // if
    }
    // while
    if ($_SESSION['openclose'] == 0) {
        $_SESSION['openclose'] = 1;
    }
    // openclose Variablen als gesetzt makieren
}
// else
$data['boards'] = $boards;
$data['user'] = U_NAME;
$data['PMreport'] = '';
if (U_ID > 0) {
    if (U_PM_NEW == 0) {
        $data['PMreport'] = 'Du hast keine neuen Nachrichten.';
    }
    if (U_PM_NEW == 1 && U_PM_COUNT == 1) {
        $data['PMreport'] = 'Du hast eine neue Nachricht.';
    }
    if (U_PM_NEW == 1 && U_PM_COUNT > 1) {
        $data['PMreport'] = 'Du hast ' . U_PM_COUNT . ' neue Nachrichten.';
    }
}
$data['nav_path'] .= ' >> Forenübersicht';
$data['time'] = 'Serverzeit: ' . date("d.M.Y\\, H:i \\U\\h\\r", $board_time);
$data['onlinebox'] = Template($onlinebox);
$data['statbox'] = Template($statbox);
$data['boardtable'] = Template($TIndex);
echo Output(Template($TBoard));
コード例 #4
0
function Dump($output)
{
    Output($output);
}
コード例 #5
0
ファイル: action.php プロジェクト: thezawad/Sicily
function Submit(&$arg)
{
    $pid = safefetch($arg, 'pid');
    $cid = safefetch($arg, 'cid');
    $lang = safefetch($arg, 'language');
    $source = isset($arg['source']) ? $arg['source'] : '';
    $ret = submit_source($pid, $cid, $lang, $source);
    if (is_numeric($ret)) {
        Output("status", "success");
        Output("sid", $ret);
    } else {
        Fail($ret);
    }
}
コード例 #6
0
mysql_query("SET NAMES utf8");
//搜索表
$query_content = "SELECT * FROM user WHERE ID = '" . $request_id . "'";
$result = mysql_query($query_content, $link);
//记录请求id的记录数
$cnt = mysql_num_rows($result);
//判断请求
if ($request_request == 'REGISTER') {
    if ($cnt == 1) {
        echo "Already have !";
    } else {
        //修正编码
        mysql_query("SET NAMES utf8");
        //插入新注册的id password
        $query_content = "INSERT INTO user VALUES('" . $request_id . "','" . $request_password . "','" . $request_sex . "')";
        $result = mysql_query($query_content, $link) or die("Cant't insert a new user!") . mysql_errno() . mysql_error();
        echo "Successfully Registered!";
    }
    Output($link);
} elseif ($request_request == 'CONFIRM') {
    if ($cnt == 1) {
        echo "Already have !";
    } else {
        echo "Haven't record!";
    }
    Output($link);
} else {
    die("Wrong Request!!");
}
//输出现有的记录
mysql_close($link);
コード例 #7
0
ファイル: index.php プロジェクト: BackupTheBerlios/thwc
<?php

/* $Id: index.php,v 1.1 2003/06/12 13:59:19 master_mario Exp $ */
include 'modhead.inc.php';
echo Output(Template(Get_Template('mod.html')));
tb_footer();
コード例 #8
0
ファイル: event.php プロジェクト: BackupTheBerlios/thwc
         (c) 2003 by
          Mario Pischel         <*****@*****.**>

         download the latest version:
         https://developer.berlios.de/projects/thwc/

         This  program is  free  software;  you can
         redistribute it and/or modify it under the
         terms of the GNU General Public License as
         published by the Free Software Foundation;
         either  version 2 of  the License,  or (at
         your option) any later version.

       ==============================================
*/
include 'inc/header.inc.php';
include 'inc/bcode.inc.php';
// global Template
$TEvent = Get_Template('templates/' . $style['styletemplate'] . '/event.html');
$r_event = db_query("SELECT\n     caltime,\n\t caltopic,\n\t calautor,\n\t caltext\n FROM " . $pref . "calendar WHERE calid='{$event}'");
if (db_rows($r_event) == 1) {
    $event = db_result($r_event);
    $data['datum'] = date("d.m.Y (H:i\\U\\h\\r)", $event['caltime']);
    $data['event'] = parse_code($event['caltopic'], 1, 0, 0, $config['eventcode']);
    $data['text'] = parse_code($event['caltext'], 1, 0, $config['eventcode'], $config['eventcode']);
    $data['autor'] = '<a href="s_profile.php?username='******'calautor'] . '" target="_blank">' . $event['calautor'] . '</a>';
} else {
    echo 'Fehler! Kein Event mit dieser ID gefunden.';
}
echo Output(Template($TEvent));
コード例 #9
0
    mysql_query($query_content, $link) or die("Can't insert to customer!") . mysql_errno() . mysql_error();
    //把BA插入 customer 中
    $query_content = "INSERT INTO customer(Sender,Reciever,First_Pointer,Last_Pointer) \n\t\t\t\t\t  VALUES('" . $Reciever . "','" . $Sender . "',{$Pointer},{$Pointer})";
    mysql_query('SET NAMES UTF8');
    mysql_query($query_content, $link) or die("Can't insert to customer!") . mysql_errno() . mysql_error();
} else {
    $row = mysql_fetch_array($result, MYSQL_BOTH);
    $One_Customer_Id = $row["Customer_Id"];
    $row = mysql_fetch_array($result, MYSQL_BOTH);
    $Other_Customer_Id = $row["Customer_Id"];
    $Con_Id = $row["Last_Pointer"];
    //插入 conversation 中
    $query_content = "INSERT INTO conversation(Sender,Reciever,Message) \n\t\t\t\t\t  VALUES('" . $Sender . "','" . $Reciever . "','" . $Message . "')";
    mysql_query('SET NAMES UTF8');
    mysql_query($query_content, $link) or die("Can't insert to conversation!") . mysql_errno() . mysql_error();
    //记录这次插入的ID
    $Pointer = mysql_insert_id();
    //更新上一次记录的Con_Id
    $query_content = "UPDATE conversation SET  Next_Pointer = {$Pointer} WHERE Con_Id = {$Con_Id}";
    mysql_query('SET NAMES UTF8');
    mysql_query($query_content, $link) or die("Can't UPDATE conversation!") . mysql_errno() . mysql_error();
    //更新AB BA的Last_Pointer
    $query_content = "UPDATE customer SET  Last_Pointer = {$Pointer} WHERE\n\t\t\t\t\t  Customer_Id = {$One_Customer_Id} OR Customer_Id = {$Other_Customer_Id} ";
    mysql_query('SET NAMES UTF8');
    mysql_query($query_content, $link) or die("Can't UPDATE customer!") . mysql_errno() . mysql_error();
}
$Table = 'customer';
Output($link, $Table);
$Table = 'conversation';
Output($link, $Table);
コード例 #10
0
 public function __toString()
 {
     // Create error array
     $array['error'] = array('code' => $this->code, 'message' => $this->message, 'field' => $this->field);
     return Output($array);
 }
コード例 #11
0
function message_redirect($msg, $url)
{
    global $style;
    $TRedirect = Get_Template('templates/' . $style['styletemplate'] . '/redirect.html');
    $TRedirect = str_replace('[url]', $url, $TRedirect);
    $TRedirect = str_replace('[msg]', $msg, $TRedirect);
    echo Output($TRedirect);
    exit;
}