SetDefine('FS_CACHE', DIR_ABS . '../cache/');
SetDefine('DIR_CLASSES', DIR_ABS . '../classes/');
// Include Smarty
SetDefine('DIR_SMARTY', DIR_ABS . '../smarty/');
// Include SIMPL
include_once FS_SIMPL . 'simpl.php';
include_once DIR_ABS . '../inc/functions.php';
include_once DIR_SMARTY . 'Smarty.class.php';
include_once DIR_CLASSES . 'utilities.php';
// Connect to database
$db = new Db();
$db->Connect();
// Create the template object
$smarty = new FormTemplates();
// Assign the mode to the templates
$smarty->assign('mode', $mode);
SetDefine('CONSUMER_KEY', '');
SetDefine('CONSUMER_SECRET', '');
SetDefine('OAUTH_CALLBACK', ADDRESS . 'callback');
$myUser = new User();
$myAccountInfo = new AccountInfo();
// If the user has already logged in the past week
if (isset($_COOKIE['session']) && $_COOKIE['session'] != '') {
    // Look the user up and set their session
    $myUser->SetValue('sessionid', $_COOKIE['session']);
    $myUser->GetInfo(NULL, array('sessionid'));
    if ($myUser->GetPrimary() != '') {
        $myAccountInfo->SetValue('user_id', $myUser->GetPrimary());
        $myAccountInfo->GetInfo(NULL, array('user_id'));
    }
}
示例#2
0
function create_table()
{
    /* 定数定義 */
    SetDefine();
    /* テーブル要素の生成 */
    $htmldata = SetTableData($htmldata);
    /* Html生成 */
    echo $htmldata;
}
示例#3
0
<?php

//connect database
ScConnect();
SetDefine();
include 'func/func.sppd.php';
//error handle
if ($_SERVER['REMOTE_ADDR'] !== "::1") {
    set_error_handler("scErrorHandle");
}
function scErrorHandle($errno, $errstr, $errfile, $errline)
{
    $cError = "Error on {$errno} File : {$errfile}({$errline}) -> {$errstr}";
}
function SetDefine()
{
    //set define harus dipanggil setiap saat karena define jika direload akan hilang
    //ex define("sapeltu","isi",true) ;
    //location
    if (!defined("SYS_Url")) {
        define("SYS_Url", scSys::GetConfig("sc_front_url"));
    }
    if (!defined("SYS_UrlCore")) {
        define("SYS_UrlCore", SYS_Url . "sapeltucore/");
    }
    if (!defined("SYS_UrlImages")) {
        define("SYS_UrlImages", SYS_Url . "/uploaded/");
    }
    if (!defined("SYS_Title")) {
        define("SYS_Title", scSys::GetConfig("sc_front_title"));
    }