本文整理汇总了PHP中tmplInitializeInstance函数的典型用法代码示例。如果您正苦于以下问题:PHP tmplInitializeInstance函数的具体用法?PHP tmplInitializeInstance怎么用?PHP tmplInitializeInstance使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tmplInitializeInstance函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tmplInitializeInstance
To read the license please visit http://www.gnu.org/copyleft/gpl.html
*******************************************************************************/
// prevent direct invocation
if (!isset($cfg['user']) || isset($_REQUEST['cfg'])) {
@ob_end_clean();
@header("location: ../../../index.php");
exit;
}
/******************************************************************************/
// Image class
require_once 'inc/classes/Image.php';
// readrss functions
require_once 'inc/functions/functions.readrss.php';
// init template-instance
tmplInitializeInstance($cfg["theme"], "page.admin.default.tmpl");
// set vars
$tmpl->setvar('enable_xfer', $cfg["enable_xfer"]);
tmplSetTitleBar($cfg['_ADMINISTRATION']);
tmplSetAdminMenu();
// L: tfb-stats
// transfers
$arTransfers = getTransferArray();
$countTransfers = count($arTransfers);
$tmpl->setvar('server_transfers_total', $countTransfers);
// users
$countUsers = count($cfg['users']);
$tmpl->setvar('server_users_total', $countUsers);
// hits
$hits = $db->GetOne("SELECT SUM(hits) AS hits FROM tf_users");
$tmpl->setvar('server_hits_total', $hits);
示例2: tmplInitializeInstance
To read the license please visit http://www.gnu.org/copyleft/gpl.html
*******************************************************************************/
// prevent direct invocation
if (!isset($cfg['user']) || isset($_REQUEST['cfg'])) {
@ob_end_clean();
@header("location: ../../index.php");
exit;
}
/******************************************************************************/
// common functions
require_once 'inc/functions/functions.common.php';
// transfer functions
require_once 'inc/functions/functions.transfer.php';
// init template-instance
tmplInitializeInstance($cfg["theme"], "page.transferDetails.tmpl");
// init transfer
transfer_init();
// init ch-instance
$ch = ClientHandler::getInstance(getTransferClient($transfer));
// load settings, default if settings could not be loaded (fresh transfer)
if ($ch->settingsLoad($transfer) !== true) {
$ch->settingsDefault();
}
// set details vars
transfer_setDetailsVars();
// title + foot
tmplSetFoot(false);
tmplSetTitleBar($transferLabel . " - Details", false);
// iid
tmplSetIidVars();
示例3: define
GNU General Public License for more details.
To read the license please visit http://www.gnu.org/copyleft/gpl.html
*******************************************************************************/
// prevent direct invocation
if (!isset($cfg['user']) || isset($_REQUEST['cfg'])) {
@ob_end_clean();
@header("location: ../../index.php");
exit;
}
/******************************************************************************/
// default-type
define('_DEFAULT_TYPE', 'all');
// init template-instance
tmplInitializeInstance($cfg["theme"], "page.serverStats.tmpl");
// request-vars
$type = isset($_REQUEST['type']) ? tfb_getRequestVar('type') : _DEFAULT_TYPE;
// types
$type_list = array();
array_push($type_list, array('name' => "all", 'selected' => $type == "all" ? 1 : 0));
array_push($type_list, array('name' => "drivespace", 'selected' => $type == "drivespace" ? 1 : 0));
array_push($type_list, array('name' => "who", 'selected' => $type == "who" ? 1 : 0));
if ($cfg['isAdmin'] == 1) {
array_push($type_list, array('name' => "ps", 'selected' => $type == "ps" ? 1 : 0));
}
if ($cfg['isAdmin'] == 1) {
array_push($type_list, array('name' => "netstat", 'selected' => $type == "netstat" ? 1 : 0));
}
if ($cfg['enable_xfer'] == 1 && ($cfg['enable_public_xfer'] == 1 || $cfg['isAdmin'])) {
array_push($type_list, array('name' => "xfer", 'selected' => $type == "xfer" ? 1 : 0));
示例4: tmplInitializeInstance
GNU General Public License for more details.
To read the license please visit http://www.gnu.org/copyleft/gpl.html
*******************************************************************************/
// prevent direct invocation
if (!isset($cfg['user']) || isset($_REQUEST['cfg'])) {
@ob_end_clean();
@header("location: ../../index.php");
exit;
}
/******************************************************************************/
// transfer functions
require_once 'inc/functions/functions.transfer.php';
// init template-instance
tmplInitializeInstance($cfg["theme"], "page.transferHosts.tmpl");
// init transfer
transfer_init();
$isTransmissionTransfer = false;
if ($cfg["transmission_rpc_enable"] > 0) {
if (isHash($transfer)) {
$hash = $transfer;
} else {
$hash = getTransferHash($transfer);
}
require_once 'inc/functions/functions.rpc.transmission.php';
$isTransmissionTransfer = isTransmissionTransfer($hash);
if (!$isTransmissionTransfer && $cfg["transmission_rpc_enable"] == 1) {
$isTransmissionTransfer = getTransferClient($transfer) == 'transmissionrpc';
}
}
示例5: tmplInitializeInstance
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
To read the license please visit http://www.gnu.org/copyleft/gpl.html
*******************************************************************************/
// prevent direct invocation
if (!isset($cfg['user']) || isset($_REQUEST['cfg'])) {
@ob_end_clean();
@header("location: ../../../index.php");
exit;
}
/******************************************************************************/
// init template-instance
tmplInitializeInstance($cfg["theme"], "page.admin.CreateUser.tmpl");
// set vars
$tmpl->setvar('enable_xfer', $cfg["enable_xfer"]);
//
$tmpl->setvar('_NEWUSER', $cfg['_NEWUSER']);
$tmpl->setvar('_USER', $cfg['_USER']);
$tmpl->setvar('_PASSWORD', $cfg['_PASSWORD']);
$tmpl->setvar('_CONFIRMPASSWORD', $cfg['_CONFIRMPASSWORD']);
$tmpl->setvar('_USERTYPE', $cfg['_USERTYPE']);
$tmpl->setvar('_NORMALUSER', $cfg['_NORMALUSER']);
$tmpl->setvar('_ADMINISTRATOR', $cfg['_ADMINISTRATOR']);
$tmpl->setvar('_CREATE', $cfg['_CREATE']);
$tmpl->setvar('_USERIDREQUIRED', $cfg['_USERIDREQUIRED']);
$tmpl->setvar('_PASSWORDLENGTH', $cfg['_PASSWORDLENGTH']);
$tmpl->setvar('_PASSWORDNOTMATCH', $cfg['_PASSWORDNOTMATCH']);
$tmpl->setvar('_PLEASECHECKFOLLOWING', $cfg['_PLEASECHECKFOLLOWING']);
示例6: AuditAction
@ob_end_clean();
@header("location: ../../index.php");
exit;
}
/******************************************************************************/
// is enabled ?
if ($cfg["enable_search"] != 1) {
AuditAction($cfg["constants"]["error"], "ILLEGAL ACCESS: " . $cfg["user"] . " tried to use search");
@error("search is disabled", "index.php?iid=index", "");
}
// common functions
require_once 'inc/functions/functions.common.php';
// require
require_once "inc/searchEngines/SearchEngineBase.php";
// init template-instance
tmplInitializeInstance($cfg["theme"], "page.torrentSearch.tmpl");
// Go get the if this is a search request. go get the data and produce output.
$hideSeedless = tfb_getRequestVar('hideSeedless');
if (!empty($hideSeedless)) {
$_SESSION['hideSeedless'] = $hideSeedless;
}
if (!isset($_SESSION['hideSeedless'])) {
$_SESSION['hideSeedless'] = 'no';
}
$hideSeedless = $_SESSION['hideSeedless'];
$pg = tfb_getRequestVar('pg');
$searchEngine = tfb_getRequestVar('searchEngine');
if (empty($searchEngine)) {
$searchEngine = $cfg["searchEngine"];
}
if (!preg_match('/^[a-zA-Z0-9]+$/D', $searchEngine)) {
示例7: tfb_getRequestVar
exit;
}
/******************************************************************************/
// common functions
require_once 'inc/functions/functions.common.php';
// delete
if (isset($_REQUEST['delete'])) {
$delete = tfb_getRequestVar('delete');
if (!empty($delete)) {
DeleteMessage($delete);
}
@header("location: index.php?iid=readmsg");
exit;
}
// init template-instance
tmplInitializeInstance($cfg["theme"], "page.readmsg.tmpl");
if (isset($_REQUEST['mid'])) {
$mid = tfb_getRequestVar('mid');
list($from_user, $message, $ip, $time, $isnew, $force_read) = GetMessage($mid);
if (!empty($from_user) && $isnew == 1) {
// We have a Message that is being seen
// Mark it as NOT new.
MarkMessageRead($mid);
}
$message = check_html($message, "a");
$message = html_entity_decode($message);
$message = str_replace("\n", "<br>", $message);
if (IsUser($from_user)) {
$tmpl->setvar('IsUser', 1);
}
$tmpl->setvar('from_user', $from_user);
示例8: AuditAction
require_once 'inc/functions/functions.dir.php';
// is enabled ?
if ($cfg["enable_view_nfo"] != 1) {
AuditAction($cfg["constants"]["error"], "ILLEGAL ACCESS: " . $cfg["user"] . " tried to use nfo-viewer");
@error("nfo-viewer is disabled. Action has been logged.", "", "");
}
// target
$file = UrlHTMLSlashesDecode(tfb_getRequestVar("path"));
$path = $cfg["path"] . $file;
// only valid dirs + entries with permission
if (!((tfb_isValidPath($path, ".nfo") || tfb_isValidPath($path, ".txt") || tfb_isValidPath($path, ".log")) && isValidEntry($file) && hasPermission($file, $cfg["user"], 'r'))) {
AuditAction($cfg["constants"]["error"], "ILLEGAL NFO-ACCESS: " . $cfg["user"] . " tried to view " . $file);
@error("Illegal access. Action has been logged.", "", "");
}
// init template-instance
tmplInitializeInstance($cfg["theme"], "page.viewnfo.tmpl");
// set vars
$tmpl->setvar('file', $file);
$folder = htmlspecialchars(substr($file, 0, strrpos($file, "/")));
$tmpl->setvar('folder', $folder);
if ($fileHandle = @fopen($path, 'r')) {
$output = "";
while (!@feof($fileHandle)) {
$output .= @fgets($fileHandle, 4096);
}
@fclose($fileHandle);
} else {
$output = "Error opening NFO File: " . $file;
}
if (empty($_REQUEST["dos"]) && empty($_REQUEST["win"]) || !empty($_REQUEST["dos"])) {
$output = htmlentities($output, ENT_COMPAT, "cp866");
示例9: AuditAction
*******************************************************************************/
// prevent direct invocation
if (!isset($cfg['user']) || isset($_REQUEST['cfg'])) {
@ob_end_clean();
@header("location: ../../index.php");
exit;
}
/******************************************************************************/
// is enabled ?
if ($cfg["enable_multiupload"] != 1) {
AuditAction($cfg["constants"]["error"], "ILLEGAL ACCESS: " . $cfg["user"] . " tried to use multiupload");
@error("multiupload is disabled", "index.php?iid=index", "");
}
// init template-instance
tmplInitializeInstance($cfg["theme"], "page.multiup.tmpl");
// form
$row_list = array();
for ($j = 0; $j < $cfg["hack_multiupload_rows"]; ++$j) {
array_push($row_list, array());
}
$tmpl->setloop('row_list', $row_list);
// queue
$tmpl->setvar('queueActive', FluxdQmgr::isRunning() ? 1 : 0);
//
$tmpl->setvar('file_types_label', $cfg['file_types_label']);
//
$tmpl->setvar('_UPLOAD', $cfg['_UPLOAD']);
$tmpl->setvar('_SELECTFILE', $cfg['_SELECTFILE']);
$tmpl->setvar('_ID_IMAGES', $cfg['_ID_IMAGES']);
$tmpl->setvar('_MULTIPLE_UPLOAD', $cfg['_MULTIPLE_UPLOAD']);
示例10: tmplInitializeInstance
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
To read the license please visit http://www.gnu.org/copyleft/gpl.html
*******************************************************************************/
// prevent direct invocation
if (!isset($cfg['user']) || isset($_REQUEST['cfg'])) {
@ob_end_clean();
@header("location: ../../index.php");
exit;
}
/******************************************************************************/
// init template-instance
tmplInitializeInstance($cfg["theme"], "page.history.tmpl");
// prepare vars
$offset = 50;
$inx = 0;
$min = 0;
if (isset($_REQUEST['min'])) {
$min = tfb_getRequestVar('min');
}
$max = $min + $offset;
if ($cfg['enable_restrictivetview'] == 0) {
$sql = "SELECT user_id, file, time FROM tf_log WHERE action=" . $db->qstr($cfg["constants"]["url_upload"]) . " OR action=" . $db->qstr($cfg["constants"]["file_upload"]) . " ORDER BY time desc";
} else {
$sql = $cfg['isAdmin'] ? "SELECT user_id, file, time FROM tf_log WHERE action=" . $db->qstr($cfg["constants"]["url_upload"]) . " OR action=" . $db->qstr($cfg["constants"]["file_upload"]) . " ORDER BY time desc" : "SELECT user_id, file, time FROM tf_log WHERE user_id=" . $db->qstr($cfg["user"]) . " AND ( action=" . $db->qstr($cfg["constants"]["url_upload"]) . " OR action=" . $db->qstr($cfg["constants"]["file_upload"]) . " ) ORDER BY time desc";
}
$result = $db->SelectLimit($sql, $offset, $min);
$file_result = array();
示例11: tmplInitializeInstance
GNU General Public License for more details.
To read the license please visit http://www.gnu.org/copyleft/gpl.html
*******************************************************************************/
// prevent direct invocation
if (!isset($cfg['user']) || isset($_REQUEST['cfg'])) {
@ob_end_clean();
@header("location: ../../index.php");
exit;
}
/******************************************************************************/
// common functions
require_once 'inc/functions/functions.common.php';
// init template-instance
tmplInitializeInstance($cfg["theme"], "page.profile.tmpl");
// op-switch
$op = tfb_getRequestVar('op');
switch ($op) {
//******************************************************************************
// addProfile -- adding a Profile Information
//******************************************************************************
case "addProfile":
$newProfile["name"] = tfb_getRequestVar('name');
$newProfile["minport"] = tfb_getRequestVar('minport');
$newProfile["maxport"] = tfb_getRequestVar('maxport');
$newProfile["maxcons"] = tfb_getRequestVar('maxcons');
$newProfile["rerequest"] = tfb_getRequestVar('rerequest');
$newProfile["rate"] = tfb_getRequestVar('rate');
$newProfile["maxuploads"] = tfb_getRequestVar('maxuploads');
$newProfile["drate"] = tfb_getRequestVar('drate');
示例12: tmplInitializeInstance
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
To read the license please visit http://www.gnu.org/copyleft/gpl.html
*******************************************************************************/
// prevent direct invocation
if (!isset($cfg['user']) || isset($_REQUEST['cfg'])) {
@ob_end_clean();
@header("location: ../../../index.php");
exit;
}
/******************************************************************************/
// init template-instance
tmplInitializeInstance($cfg["theme"], "page.admin.controlSettings.tmpl");
// set vars
$tmpl->setvar('enable_btclient_chooser', $cfg["enable_btclient_chooser"]);
$tmpl->setvar('transfer_profiles', $cfg["transfer_profiles"]);
$tmpl->setvar('transfer_customize_settings', $cfg["transfer_customize_settings"]);
$tmpl->setvar('showdirtree', $cfg["showdirtree"]);
$tmpl->setvar('maxdepth', $cfg["maxdepth"]);
//
tmplSetTitleBar("Administration - Control Settings");
tmplSetAdminMenu();
tmplSetFoot();
tmplSetIidVars();
// parse template
$tmpl->pparse();
示例13: tmplInitializeInstance
To read the license please visit http://www.gnu.org/copyleft/gpl.html
*******************************************************************************/
// prevent direct invocation
if (!isset($cfg['user']) || isset($_REQUEST['cfg'])) {
@ob_end_clean();
@header("location: ../../index.php");
exit;
}
/******************************************************************************/
// common functions
require_once 'inc/functions/functions.common.php';
// transfer functions
require_once 'inc/functions/functions.transfer.php';
// init template-instance
tmplInitializeInstance($cfg["theme"], "page.transferScrape.tmpl");
// init transfer
transfer_init();
// client-switch
if (substr($transfer, -8) == ".torrent") {
// this is a t-client
$tmpl->setvar('hasScrape', 1);
$tmpl->setvar('scrapeInfo', getTorrentScrapeInfo($transfer));
} else {
if (substr($transfer, -5) == ".wget") {
// this is wget.
$tmpl->setvar('hasScrape', 0);
$tmpl->setvar('scrapeInfo', "Scrape not supported by wget");
} else {
if (substr($transfer, -4) == ".nzb") {
// this is nzbperl.
示例14: header
header("Location: index.php?iid=dir");
}
exit;
}
// check if valid entry
if ($dir != "" && isValidEntry($dir) !== true) {
AuditAction($cfg["constants"]["error"], "ILLEGAL DIR: " . $cfg["user"] . " tried to access " . $dir);
@error("Invalid Dir", "index.php?iid=dir", "", array($dir));
}
// check for permission to read
if ($dir != "" && hasPermission($dir, $cfg["user"], 'r') !== true) {
AuditAction($cfg["constants"]["error"], "ILLEGAL DIR: " . $cfg["user"] . " tried to access " . $dir);
@error("No Permission for Dir", "index.php?iid=dir", "", array($dir));
}
// init template-instance
tmplInitializeInstance($cfg["theme"], "page.dir.tmpl");
// dirstats
if ($cfg['enable_dirstats'] == 1) {
$tmpl->setvar('enable_dirstats', 1);
$du = dirsize($dirName);
$tmpl->setvar('duTotal', formatBytesTokBMBGBTB($du));
$tmpl->setvar('_TDDU', $cfg['_TDDU']);
} else {
$tmpl->setvar('enable_dirstats', 0);
}
// read in entries
$entrys = array();
$entrysDirs = array();
$entrysFiles = array();
$handle = opendir($dirName);
while (false !== ($entry = readdir($handle))) {
示例15: AuditAction
*******************************************************************************/
// prevent direct invocation
if (!isset($cfg['user']) || isset($_REQUEST['cfg'])) {
@ob_end_clean();
@header("location: ../../index.php");
exit;
}
/******************************************************************************/
// is enabled ?
if ($cfg["enable_dereferrer"] != 1) {
AuditAction($cfg["constants"]["error"], "ILLEGAL ACCESS: " . $cfg["user"] . " tried to use dereferrer");
@error("dereferrer is disabled", "index.php?iid=index", "");
}
// check param
if (!isset($_REQUEST["u"])) {
@header("location: index.php?iid=index");
exit;
} else {
$url = tfb_getRequestVarRaw("u");
}
// init template-instance
tmplInitializeInstance($cfg["theme"], "page.dereferrer.tmpl");
// set vars
$url2 = tfb_htmlencode($url);
$tmpl->setvar('url', $url2);
$tmpl->setvar('meta_refresh', '0;URL=' . $url2);
//
tmplSetTitleBar($cfg["pagetitle"] . ' - dereferrer', false);
tmplSetFoot(false);
tmplSetIidVars();
$tmpl->pparse();