Exemplo n.º 1
0
<?php

//20151016, V3 modified-FFW (API)
//*Initialization, Configuration, and Definition
require_once $_SERVER['DOCUMENT_ROOT'] . "/../app_config/FutureForumWWW.php";
//Include Modules
require_once 'general.php';
//Input argument processing
$argin = processRequestArguments();
//Now do stuff
//When encounter errors, use stopBecause("", optional ERROR_NUMBER default -1);
if (session_status() === PHP_SESSION_NONE) {
    session_start();
}
if (!isset($_SESSION['user_id'])) {
    stopBecause("登录信息有误!", 1);
}
if (isset($argin['remove'])) {
    queryDB("DELETE FROM `news` WHERE id='{$argin['remove']}'");
}
if (isset($argin['create'])) {
    queryDB("INSERT INTO `news` (`code`, `publishTime`,`title` )\r\n    VALUES ('{$argin['create']}', NOW(), '新建新闻  ')");
}
//*JSON encoding and return
//defaults: 'status'=0, 'data'=array(), 'message'='', 'redirection'='';
produceOutputV3(array());
Exemplo n.º 2
0
<?php

//20151016, V3 modified-FFW (API)
//*Initialization, Configuration, and Definition
require_once $_SERVER['DOCUMENT_ROOT'] . "/../app_config/FutureForumWWW.php";
//Include Modules
require_once 'general.php';
//Input argument processing
$argin = processRequestArguments();
//Now do stuff
//When encounter errors, use stopBecause("", optional ERROR_NUMBER default -1);
if (session_status() === PHP_SESSION_NONE) {
    session_start();
}
if (!isset($_SESSION['user_id'])) {
    stopBecause("登录信息有误!", 1);
}
$people_category = queryDB_array("select * from people_category");
$people = queryDB_array("select * from people order by code asc");
$miscs = queryDB_array("select * from miscs where groupcode='people' order by sequence asc ");
//*JSON encoding and return
//defaults: 'status'=0, 'data'=array(), 'message'='', 'redirection'='';
produceOutputV3(array('data' => array('category' => $people_category, 'people' => $people, 'miscs' => $miscs)));
Exemplo n.º 3
0
function error_handler($errno, $errstr)
{
    if ($errno & E_USER_ERROR) {
        produceOutputV3(array('status' => $errno, 'message' => $errstr));
        exit;
    }
    return false;
}
Exemplo n.º 4
0
<?php

//20151016, V3 modified-FFW (API)
//*Initialization, Configuration, and Definition
require_once $_SERVER['DOCUMENT_ROOT'] . "/../app_config/FutureForumWWW.php";
//Include Modules
require_once 'general.php';
//Input argument processing
$argin = processRequestArguments();
//Now do stuff
//When encounter errors, use stopBecause("", optional ERROR_NUMBER default -1);
if (session_status() === PHP_SESSION_NONE) {
    session_start();
}
if (!isset($_SESSION['user_id'])) {
    stopBecause("登录信息有误!", 1);
}
$events_category = queryDB_array("select * from events_category");
$events = queryDB_array("select \r\n    events.id as id,\r\n    events.code as code,\r\n    category,number,\r\n    `number_zh-cn`,\r\n    number_en,\r\n    `name_zh-cn`,\r\n    `name_en`,\r\n    events.`title_zh-cn` as `title_zh-cn`,\r\n    events.title_en as title_en,\r\n    speaker_name,\r\n    speaker_name_en,\r\n    `meta-title`,\r\n    `meta-keywords`,\r\n    `meta-description`,\r\n    date_string, date_string_en, address, address_en, `text_zh-cn`, `text_en`, youkuID, sequence,\r\n    events_category.`title_zh-cn` as category_title\r\n    from events inner join events_category on events_category.value=events.category\r\n    order by sequence asc");
$miscs = queryDB_array("select * from miscs where groupcode='footprint' order by sequence asc ");
//*JSON encoding and return
//defaults: 'status'=0, 'data'=array(), 'message'='', 'redirection'='';
produceOutputV3(array('data' => array('category' => $events_category, 'events' => $events, 'miscs' => $miscs)));
Exemplo n.º 5
0
<?php

//20151016, V3 modified-FFW (API)
//*Initialization, Configuration, and Definition
require_once $_SERVER['DOCUMENT_ROOT'] . "/../app_config/FutureForumWWW.php";
//Include Modules
require_once 'general.php';
//Input argument processing
$argin = processRequestArguments();
//Now do stuff
//When encounter errors, use stopBecause("", optional ERROR_NUMBER default -1);
if (!isset($argin['offset'])) {
    $argin['offset'] = 0;
}
if (!isset($argin['limit'])) {
    $argin['limit'] = 15;
}
$newsRecent = queryDB_array("\r\n    select code,author,abstract,title, DATE_FORMAT(publishTime,'%Y-%c-%e %k:%i') as publishTime from news\r\n    where status <> 0\r\n    order by status desc, publishTime desc\r\n    limit {$argin['offset']} , {$argin['limit']};\r\n");
$newsCount = queryDB_row("select count(*) as total from news where status <> 0");
//*JSON encoding and return
//defaults: 'status'=0, 'data'=array(), 'message'='', 'redirection'='';
produceOutputV3(array('data' => array('newsRecent' => $newsRecent, 'newsCount' => $newsCount)));
Exemplo n.º 6
0
<?php

//20151016, V3 modified-FFW (API)
//*Initialization, Configuration, and Definition
require_once $_SERVER['DOCUMENT_ROOT'] . "/../app_config/FutureForumWWW.php";
//Include Modules
require_once 'general.php';
//Input argument processing
$argin = processRequestArguments();
//Now do stuff
//When encounter errors, use stopBecause("", optional ERROR_NUMBER default -1);
if (session_status() === PHP_SESSION_NONE) {
    session_start();
}
if (!isset($_SESSION['user_id'])) {
    stopBecause("登录信息有误!", 1);
}
$miscs = queryDB_array("select * from miscs where groupcode='global' order by sequence asc ");
//*JSON encoding and return
//defaults: 'status'=0, 'data'=array(), 'message'='', 'redirection'='';
produceOutputV3(array('data' => array('miscs' => $miscs)));
Exemplo n.º 7
0
<?php

//20151016, V3 modified-FFW (API)
//*Initialization, Configuration, and Definition
require_once $_SERVER['DOCUMENT_ROOT'] . "/../app_config/FutureForumWWW.php";
//Include Modules
require_once 'general.php';
//Input argument processing
$argin = processRequestArguments();
//Now do stuff
//When encounter errors, use stopBecause("", optional ERROR_NUMBER default -1);
if (session_status() === PHP_SESSION_NONE) {
    session_start();
}
if (!isset($_SESSION['user_id'])) {
    stopBecause("登录信息有误!", 1);
}
$links = queryDB_array("select * from links order by type asc");
//*JSON encoding and return
//defaults: 'status'=0, 'data'=array(), 'message'='', 'redirection'='';
produceOutputV3(array('data' => array('links' => $links)));
Exemplo n.º 8
0
<?php

//20151016, V3 modified-FFW (API)
//*Initialization, Configuration, and Definition
require_once $_SERVER['DOCUMENT_ROOT'] . "/../app_config/FutureForumWWW.php";
//Include Modules
require_once 'general.php';
//Input argument processing
$argin = processRequestArguments();
//Now do stuff
//When encounter errors, use stopBecause("", optional ERROR_NUMBER default -1);
if (session_status() === PHP_SESSION_NONE) {
    session_start();
}
if (!isset($_SESSION['user_id'])) {
    stopBecause("登录信息有误!", 1);
}
if (!isset($argin['offset'])) {
    $argin['offset'] = 0;
}
if (!isset($argin['limit'])) {
    $argin['limit'] = 5;
}
$news = queryDB_array("select * from news order by publishTime desc limit {$argin['offset']} , {$argin['limit']};");
$miscs = queryDB_array("select * from miscs where groupcode='news' order by sequence asc ");
//*JSON encoding and return
//defaults: 'status'=0, 'data'=array(), 'message'='', 'redirection'='';
produceOutputV3(array('data' => array('news' => $news, 'miscs' => $miscs)));
Exemplo n.º 9
0
<?php

//20151016, V3 modified-FFW (API)
//*Initialization, Configuration, and Definition
require_once $_SERVER['DOCUMENT_ROOT'] . "/../app_config/FutureForumWWW.php";
//Include Modules
require_once 'general.php';
//Input argument processing
$argin = processRequestArguments();
//Now do stuff
//When encounter errors, use stopBecause("", optional ERROR_NUMBER default -1);
if (session_status() === PHP_SESSION_NONE) {
    session_start();
}
if (!isset($_SESSION['user_id'])) {
    stopBecause("登录信息有误!", 1);
}
//*JSON encoding and return
//defaults: 'status'=0, 'data'=array(), 'message'='', 'redirection'='';
produceOutputV3(array('data' => array('about' => queryDB_row("select * from aboutus where id = {$argin['id']}"))));
Exemplo n.º 10
0
<?php

//20151016, V3 modified-FFW (API)
//*Initialization, Configuration, and Definition
require_once $_SERVER['DOCUMENT_ROOT'] . "/../app_config/FutureForumWWW.php";
//Include Modules
require_once 'general.php';
//Input argument processing
$argin = processRequestArguments();
//Now do stuff
//When encounter errors, use stopBecause("", optional ERROR_NUMBER default -1);
if (session_status() === PHP_SESSION_NONE) {
    session_start();
}
if (!isset($_SESSION['user_id'])) {
    stopBecause("登录信息有误!", 1);
}
//*JSON encoding and return
//defaults: 'status'=0, 'data'=array(), 'message'='', 'redirection'='';
produceOutputV3(array('data' => array('prize' => queryDB_row("select * from prize where language = {$argin['language']}"))));
Exemplo n.º 11
0
<?php

//20151016, V3 modified-FFW (API)
//*Initialization, Configuration, and Definition
require_once $_SERVER['DOCUMENT_ROOT'] . "/../app_config/FutureForumWWW.php";
//Include Modules
require_once 'general.php';
//Input argument processing
$argin = processRequestArguments();
//Now do stuff
//When encounter errors, use stopBecause("", optional ERROR_NUMBER default -1);
if (session_status() === PHP_SESSION_NONE) {
    session_start();
}
if (!isset($_SESSION['user_id'])) {
    stopBecause("登录信息有误!", 1);
}
$slides = queryDB_array("select * from homepage_slides order by sequence asc");
$miscs = queryDB_array("select * from miscs where groupcode='homepage' order by sequence asc ");
//*JSON encoding and return
//defaults: 'status'=0, 'data'=array(), 'message'='', 'redirection'='';
produceOutputV3(array('data' => array('slides' => $slides, 'miscs' => $miscs)));
Exemplo n.º 12
0
<?php

//20151016, V3 modified-FFW (API)
//*Initialization, Configuration, and Definition
require_once $_SERVER['DOCUMENT_ROOT'] . "/../app_config/FutureForumWWW.php";
//Include Modules
require_once 'general.php';
//Input argument processing
$argin = processRequestArguments();
//Now do stuff
//When encounter errors, use stopBecause("", optional ERROR_NUMBER default -1);
if (session_status() === PHP_SESSION_NONE) {
    session_start();
}
if (!isset($_SESSION['user_id'])) {
    stopBecause("登录信息有误!", 1);
}
//*JSON encoding and return
//defaults: 'status'=0, 'data'=array(), 'message'='', 'redirection'='';
produceOutputV3(array('data' => array('actions' => queryDB_array("select * from actions"))));