本文整理汇总了PHP中tpl::parse方法的典型用法代码示例。如果您正苦于以下问题:PHP tpl::parse方法的具体用法?PHP tpl::parse怎么用?PHP tpl::parse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tpl
的用法示例。
在下文中一共展示了tpl::parse方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: gmdate
}
$row['location'] = '-';
} else {
$row['regdate'] = gmdate($lang->phrase('dformat2'), times($row['regdate']));
}
$bbcode->setSmileys(1);
$bbcode->setReplace($config['wordstatus']);
$bbcode->setAuthor($row['mid']);
$row['comment'] = $bbcode->parse($row['comment']);
$row['date'] = str_date($lang->phrase('dformat1'), times($row['date']));
$row['read'] = iif($row['status'] == 1, 'old', 'new');
$row['level'] = $slog->getStatus($row['groups'], ', ');
($code = $plugins->load('pm_show_prepared')) ? eval($code) : null;
$breadcrumb->Add(get_pmdir($row['dir']), 'pm.php?action=browse&id=' . $row['dir'] . SID2URL_x);
$breadcrumb->Add($lang->phrase('pm_show'));
echo $tpl->parse("header");
echo $tpl->parse("menu");
echo $tpl->parse("pm/menu");
echo $tpl->parse("pm/show");
($code = $plugins->load('pm_show_end')) ? eval($code) : null;
} elseif ($_GET['action'] == "massmanage") {
$breadcrumb->Add($lang->phrase('pm_massmanage'));
echo $tpl->parse("header");
echo $tpl->parse("menu");
echo $tpl->parse("pm/menu");
$querystr = implode(',', $_POST['delete']);
if (!empty($_POST['move2'])) {
if ($_POST['id'] == 3) {
$verz = get_pmdir(1);
} else {
$verz = get_pmdir(3);
示例2: errorLogin
if (count($error) > 0) {
errorLogin($error, "showforum.php?id=" . $info['board'] . SID2URL_x);
}
if (strlen($_GET['fid']) == 32) {
$data = $gpc->prepare(import_error_data($_GET['fid']));
for ($i = 1; $i <= $temp; $i++) {
if (!isset($data[$i])) {
$data[$i] = '';
}
}
} else {
$data = array_fill(1, $temp, '');
$data['question'] = '';
}
$breadcrumb->Add($lang->phrase('add_vote_to_thread'));
echo $tpl->parse("header");
echo $tpl->parse("menu");
($code = $plugins->load('newtopic_startvote_prepared')) ? eval($code) : null;
echo $tpl->parse("newtopic/startvote");
($code = $plugins->load('newtopic_startvote_end')) ? eval($code) : null;
} elseif ($_GET['action'] == "savevote") {
$temp = $gpc->get('temp', int);
$topic_id = $gpc->get('topic_id', int);
if (!empty($_POST['Update'])) {
$_POST['notice']['question'] = $_POST['question'];
$fid = save_error_data($_POST['notice']);
$slog->updatelogged();
$db->close();
viscacha_header("Location: newtopic.php?action=startvote&id={$board}&topic_id={$topic_id}&temp={$temp}&fid=" . $fid . SID2URL_x);
exit;
}
示例3: foreach
$cache[$row['id']] = $row;
}
// E-mail them all
$lang_dir = $lang->getdir(true);
foreach ($cache as $row) {
$lang->setdir($row['language']);
$row = $gpc->plain_str($row);
$data = $lang->get_mail('report_post');
$to = array(array('name' => $row['name'], 'mail' => $row['mail']));
xmail($to, array(), $data['title'], $data['comment']);
}
$lang->setdir($lang_dir);
ok($lang->phrase('report_post_success'), "showtopic.php?action=jumpto&id={$last['id']}&topic_id={$info['id']}" . SID2URL_x);
}
} else {
echo $tpl->parse("header");
echo $tpl->parse("menu");
echo $tpl->parse("misc/report_post");
}
} elseif ($_GET['action'] == "wwo") {
$my->p = $slog->Permissions();
if ($my->p['wwo'] == 0) {
errorLogin();
}
if ($_GET['type'] == 1) {
$htmlonload .= "ReloadCountdown(60);";
}
$breadcrumb->Add($lang->phrase('wwo_detail_title'));
echo $tpl->parse("header");
echo $tpl->parse("menu");
$wwo = array('i' => 0, 'r' => 0, 'g' => 0, 'b' => 0);
示例4: eval
}
($code = $plugins->load('showtopic_redirect')) ? eval($code) : null;
$prefix = '';
if ($info['prefix'] > 0) {
$prefix_obj = $scache->load('prefix');
$prefix_arr = $prefix_obj->get($info['board']);
if (isset($prefix_arr[$info['prefix']])) {
$prefix = $prefix_arr[$info['prefix']]['value'];
$prefix = $lang->phrase('showtopic_prefix_title');
}
}
$topforums = get_headboards($fc, $last, TRUE);
$breadcrumb->Add($last['name'], "showforum.php?id=" . $last['id'] . SID2URL_x);
$breadcrumb->Add($prefix . $info['topic']);
forum_opt($last);
echo $tpl->parse("header");
echo $tpl->parse("menu");
($code = $plugins->load('showtopic_start')) ? eval($code) : null;
// Some speed optimisation
$speeder = $info['posts'] + 1;
$start = $_GET['page'] * $last['topiczahl'];
$start = $start - $last['topiczahl'];
$temp = pages($speeder, $last['topiczahl'], "showtopic.php?id=" . $info['id'] . "&", $_GET['page']);
$q = explode(' ', trim($q));
$memberdata_obj = $scache->load('memberdata');
$memberdata = $memberdata_obj->get();
$inner['index_bit'] = '';
$inner['vote_result'] = '';
$inner['related'] = '';
// prepare for vote
if (!empty($info['vquestion'])) {
示例5: error
$last = $fc[$info['board']];
forum_opt($last, 'edit');
$prefix_obj = $scache->load('prefix');
$prefix_arr = $prefix_obj->get($info['board']);
$prefix = '';
if ($info['prefix'] > 0) {
if (isset($prefix_arr[$info['prefix']])) {
$prefix = $prefix_arr[$info['prefix']]['value'];
$prefix = $lang->phrase('showtopic_prefix_title');
}
}
get_headboards($fc, $last);
$breadcrumb->Add($last['name'], "showforum.php?id=" . $last['id'] . SID2URL_x);
$breadcrumb->Add($prefix . $info['topic'], 'showtopic.php?id=' . $info['topic_id'] . SID2URL_x);
$breadcrumb->Add($lang->phrase('edit'));
echo $tpl->parse("header");
if ($info['status'] != 0) {
error($lang->phrase('topic_closed'), 'showtopic.php?action=jumpto&id=' . $info['topic_id'] . '&topic_id=' . $info['id']);
}
$diff = times() - $info['date'];
if ($config['edit_edit_time'] == 0) {
$edit_seconds = $diff;
} else {
$edit_seconds = $config['edit_edit_time'] * 60;
}
$delete_seconds = $config['edit_delete_time'] * 60;
if ($my->mp[4] == 1 && ($info['topic_id'] > 0 || $info['posts'] == 0)) {
$del_mod = TRUE;
} else {
$del_mod = FALSE;
}
示例6: eval
$fc = $catbid->get();
$last = $fc[$info['board']];
$topforums = get_headboards($fc, $last, true);
$prefix = '';
if ($info['prefix'] > 0) {
$prefix_obj = $scache->load('prefix');
$prefix_arr = $prefix_obj->get($info['board']);
if (isset($prefix[$info['prefix']])) {
$prefix = $prefix_arr[$info['prefix']]['value'];
$prefix = $lang->phrase('showtopic_prefix_title');
}
}
$breadcrumb->Add($last['name'], "showforum.php?id=" . $last['id'] . SID2URL_x);
$breadcrumb->Add($prefix . $info['topic'], "showtopic.php?id=" . $info['id'] . SID2URL_x);
$breadcrumb->Add($lang->phrase('teamcp'));
echo $tpl->parse("header");
forum_opt($last);
if ($my->vlogin && $my->mp[0] == 1) {
($code = $plugins->load('managetopic_start')) ? eval($code) : null;
if ($action == "delete") {
if ($my->mp[0] == 1 && $my->mp[4] == 0) {
errorLogin($lang->phrase('not_allowed'), 'showtopic.php?id=' . $info['id'] . SID2URL_x);
}
echo $tpl->parse("menu");
echo $tpl->parse("admin/topic/delete");
} elseif ($action == "delete2") {
if ($my->mp[0] == 1 && $my->mp[4] == 0) {
errorLogin($lang->phrase('not_allowed'), 'showtopic.php?id=' . $info['id'] . SID2URL_x);
}
if ($config['updatepostcounter'] == 1 && $last['count_posts'] == 1) {
$result = $db->query("SELECT COUNT(*) AS posts, name FROM {$db->pre}replies WHERE guest = '0' AND topic_id = '{$info['id']}' GROUP BY name", __LINE__, __FILE__);
示例7: error
$my->mp = $slog->ModPermissions($board);
$catbid = $scache->load('cat_bid');
$fc = $catbid->get();
if (empty($board) || !isset($fc[$board])) {
error($lang->phrase('query_string_error'));
}
$info = $fc[$board];
if ($my->p['admin'] == 1 || $my->p['gmod'] == 1 || $my->mp[0] == 1) {
$modcp = true;
} else {
$modcp = false;
}
$topforums = get_headboards($fc, $info);
$breadcrumb->Add($info['name']);
forum_opt($info);
echo $tpl->parse("header");
echo $tpl->parse("menu");
($code = $plugins->load('showforum_forums_start')) ? eval($code) : null;
$subforums = BoardSelect($board);
($code = $plugins->load('showforum_forums_end')) ? eval($code) : null;
$filter = $gpc->get('sort', int);
if ($filter == 2) {
$marksql = ' AND mark = "a" ' . iif($info['auto_status'] == 'a', 'AND mark = "" ');
} elseif ($filter == 3) {
$marksql = ' AND mark = "n" ' . iif($info['auto_status'] == 'n', 'AND mark = "" ');
} elseif ($filter == 4) {
$marksql = ' AND mark = "g" ';
} elseif ($filter == 5) {
if (empty($info['auto_status'])) {
$marksql = ' AND (mark = "g" OR mark = "n" OR mark = "a") ';
} else {
示例8: slog
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
error_reporting(E_ALL);
DEFINE('SCRIPTNAME', 'popup');
include "data/config.inc.php";
include "classes/function.viscacha_frontend.php";
$zeitmessung1 = t1();
$slog = new slog();
$my = $slog->logged();
$lang->init($my->language);
$tpl = new tpl();
($code = $plugins->load('popup_start')) ? eval($code) : null;
if ($_GET['action'] == "hlcode") {
if (strlen($_GET['fid']) != 32) {
echo $tpl->parse("popup/header");
error($lang->phrase('query_string_error'), 'javascript:parent.close();');
}
$codeObj = new CacheItem($_GET['fid'], 'cache/geshicode/');
if (!$codeObj->import()) {
echo $tpl->parse("popup/header");
error($lang->phrase('query_string_error'), 'javascript:parent.close();');
}
$sourcecode = $codeObj->get();
$sourcecode['source'] = html_entity_decode($sourcecode['source'], ENT_QUOTES);
($code = $plugins->load('popup_hlcode_start')) ? eval($code) : null;
if ($_GET['temp'] == 1) {
viscacha_header('Content-Type: text/plain');
viscacha_header('Content-Length: ' . strlen($sourcecode['source']));
viscacha_header('Content-Disposition: attachment; filename="' . date('d-m-Y_H-i') . '.txt"');
echo $sourcecode['source'];
示例9: sprintf
$row['percent'] = $row['votes'] / $votes * 100;
if (strstr($row['percent'], '.') > 0) {
$row['percent'] = sprintf("%01.1f", $row['percent']);
}
} else {
$row['percent'] = 0;
$row['percent2'] = 0;
}
$cachev[$key] = $row;
if (!isset($voter[$row['id']])) {
$voter[$row['id']] = array();
}
$voter[$row['id']][0] = implode(', ', $voter[$row['id']]);
}
($code = $plugins->load('print_vote_prepared')) ? eval($code) : null;
$inner['vote_result'] = $tpl->parse("print/vote");
}
if ($config['tpcallow'] == 1) {
$result = $db->query("SELECT id, tid, mid, file, source, hits FROM {$db->pre}uploads WHERE topic_id = " . $_GET['id'], __LINE__, __FILE__);
$uploads = array();
while ($row = $db->fetch_assoc($result)) {
$uploads[$row['tid']][] = $row;
}
}
($code = $plugins->load('print_query')) ? eval($code) : null;
$result = $db->query("\nSELECT r.edit, r.dosmileys, r.dowords, r.id, r.topic, r.comment, r.date, u.name as uname, r.name as gname, u.id as mid, u.groups, u.fullname, r.email as gmail, r.guest\nFROM {$db->pre}replies AS r \n\tLEFT JOIN {$db->pre}user AS u ON r.name=u.id \nWHERE r.topic_id = '{$_GET['id']}' {$searchsql}\n", __LINE__, __FILE__);
while ($row = $gpc->prepare($db->fetch_object($result))) {
$inner['upload_box'] = '';
if ($row->guest == 0) {
$row->mail = '';
$row->name = $row->uname;
示例10: tpl
$lang->init($my->language);
$tpl = new tpl();
$catbid = $scache->load('cat_bid');
$fc = $catbid->get();
if (empty($board) || !isset($fc[$board])) {
error($lang->phrase('query_string_error'));
}
$info = $fc[$board];
if ($info['forumzahl'] < 1) {
$info['forumzahl'] = $config['forumzahl'];
}
$my->p = $slog->Permissions($info['id']);
$my->mp = $slog->ModPermissions($info['id']);
forum_opt($info);
$breadcrumb->Add($lang->phrase('teamcp'));
echo $tpl->parse("header");
if ($my->vlogin && $my->mp[0] == 1) {
($code = $plugins->load('manageforum_start')) ? eval($code) : null;
if ($_GET['action'] == "index") {
if ($_GET['type'] == 'open') {
$marksql = ' AND status = "1" ';
} elseif ($_GET['type'] == 'close') {
$marksql = ' AND status = "0" ';
} else {
// 'close' or 'move'
$marksql = '';
}
($code = $plugins->load('manageforum_filter_query')) ? eval($code) : null;
if (!empty($marksql)) {
$result = $db->query("SELECT COUNT(*) FROM {$db->pre}topics WHERE board = '{$board}' {$marksql}", __LINE__, __FILE__);
$vlasttopics = $db->fetch_num($result);
示例11: banish
/**
* Bans a user.
*
* After calling the function exit() is called and script ends.
* Connection to database is closed. Template 'banned' will be shown.
* Error Message is loaded from 'data/banned.php'-file.
*/
function banish()
{
global $config, $db, $phpdoc, $gpc, $lang, $plugins;
$slog = new slog();
$my = $slog->logged();
$lang->init($my->language);
$tpl = new tpl();
ob_start();
include 'data/banned.php';
$banned = ob_get_contents();
ob_end_clean();
($code = $plugins->load('permissions_banish')) ? eval($code) : null;
echo $tpl->parse("banned");
$phpdoc->Out();
$db->close();
exit;
}
示例12: times
}
$info['date'] = str_date($lang->phrase('dformat1'), times($info['date']));
$info['update'] = str_date($lang->phrase('dformat1'), times($info['update']));
$type = doctypes();
if (isset($type[$info['type']])) {
$typedata = $type[$info['type']];
} else {
$typedata = array('title' => 'Fallback', 'template' => '', 'parser' => 1, 'inline' => 1, 'remote' => 0);
}
if ($typedata['inline'] == 0) {
if ((empty($info['content']) || $typedata['remote'] == 1) && $typedata['template'] != 'frame') {
$info['content'] = @file_get_contents($info['file']);
}
$info['content'] = DocCodeParser($info['content'], $typedata['parser']);
$breadcrumb->Add($info['title']);
echo $tpl->parse("header");
if (empty($typedata['template'])) {
echo $info['content'];
} else {
echo $tpl->parse("docs/{$typedata['template']}");
}
} else {
if (empty($info['content'])) {
$info['content'] = @file_get_contents($info['file']);
}
if (empty($typedata['template'])) {
preg_match("~<body([^>]+?)>~is", $info['content'], $match_body_attr);
preg_match("~<title>(.+?)</title>~is", $info['content'], $match_title);
preg_match("~<body[^>]*?>(.+?)</body>~is", $info['content'], $match_body);
preg_match("~<head[^>]*?>(.+?)</head>~is", $info['content'], $match_head);
if (!empty($match_head[1])) {
示例13: array
$from = array('name' => $my->name, 'mail' => $my->mail);
xmail($to, $from, $_POST['topic'], $gpc->unescape($_POST['comment']));
ok($lang->phrase('email_sent'), "profile.php?id=" . $_GET['id'] . SID2URL_x);
}
} else {
if ($row->opt_hidemail == 0) {
$chars = array('@', '.');
$entities = array('@', '.');
$row->mail = str_replace($chars, $entities, $row->mail);
}
if (strlen($_GET['fid']) == 32) {
$data = $gpc->prepare(import_error_data($_GET['fid']));
} else {
$data = array('comment' => '', 'topic' => '');
}
echo $tpl->parse("header");
($code = $plugins->load('profile_mail_prepared')) ? eval($code) : null;
echo $tpl->parse("profile/mail");
($code = $plugins->load('profile_mail_end')) ? eval($code) : null;
}
} else {
errorLogin();
}
} elseif ($_GET['action'] == "sendjabber" && $is_member) {
$error = array();
if (flood_protect() == FALSE) {
$error[] = $lang->phrase('flood_control');
}
if (strxlen($_POST['comment']) > $config['maxpostlength']) {
$error[] = $lang->phrase('comment_too_long');
}
示例14: error
} else {
error($lang->phrase('goboardpw_wrong_password'));
}
} else {
viscacha_header('Location: showforum.php?id=' . $board . SID2URL_JS_x);
}
} elseif ($_GET['action'] == "wwo") {
$my->p = $slog->Permissions();
if ($my->p['wwo'] == 0) {
errorLogin();
}
if ($_GET['type'] == 1) {
$htmlonload .= "ReloadCountdown(60);";
}
$breadcrumb->Add($lang->phrase('wwo_detail_title'));
echo $tpl->parse("header");
echo $tpl->parse("menu");
$wwo = array();
$wwo['i'] = 0;
$wwo['r'] = 0;
$wwo['g'] = 0;
$wwo['b'] = 0;
$inner['wwo_bit_bot'] = '';
$inner['wwo_bit_member'] = '';
$inner['wwo_bit_guest'] = '';
// Foren cachen
$catbid = $scache->load('cat_bid');
$cat_cache = $catbid->get();
// Documents cachen
$wraps_obj = $scache->load('wraps');
$wrap_cache = $wraps_obj->get();
示例15: slog
*/
error_reporting(E_ALL);
DEFINE('SCRIPTNAME', 'team');
include "data/config.inc.php";
include "classes/function.viscacha_frontend.php";
$zeitmessung1 = t1();
$slog = new slog();
$my = $slog->logged();
$lang->init($my->language);
$tpl = new tpl();
$my->p = $slog->Permissions();
if ($my->p['team'] == 0) {
errorLogin();
}
$breadcrumb->Add($lang->phrase('team'));
echo $tpl->parse("header");
echo $tpl->parse("menu");
($code = $plugins->load('team_top')) ? eval($code) : null;
$groups = $scache->load('groups');
$team = $groups->team();
$cache = array();
$t = array_merge($team['admin'], $team['gmod']);
foreach ($t as $row) {
$cache[] = "FIND_IN_SET({$row},groups)";
}
$result = $db->query('
SELECT id, name, mail, hp, location, fullname, groups
FROM ' . $db->pre . 'user
WHERE ' . implode(' OR ', $cache) . '
ORDER BY name ASC
', __LINE__, __FILE__);