本文整理汇总了PHP中get_qt函数的典型用法代码示例。如果您正苦于以下问题:PHP get_qt函数的具体用法?PHP get_qt怎么用?PHP get_qt使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_qt函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: plugin_redirect_convert
function plugin_redirect_convert()
{
global $vars, $script;
$qm = get_qm();
$qt = get_qt();
//キャッシュしない
$qt->enable_cache = false;
$page = isset($vars['page']) ? $vars['page'] : '';
$args = func_get_args();
$url = strip_autolink(array_shift($args));
$status = array_shift($args);
$status_codes = array('301' => 'HTTP/1.1 301 Moved Permanently');
if (isset($status_codes[$status])) {
$headers[] = $status_codes[$status];
}
if ($url == '') {
$url = $script . '?FrontPage';
} else {
$url = is_url($url) ? $url : $script . '?' . rawurlencode($url);
}
$editable = ss_admin_check();
//自分自身にリダイレクトして、ループする場合は警告する
if ($url === $script . '?' . rawurlencode($page)) {
return $qm->m['plg_redirect']['err_self_ref'];
}
if ($editable) {
return $qm->replace('plg_redirect.ntc_admin', $url);
} else {
$headers[] = 'Location: ' . $url;
foreach ($headers as $header) {
header($header);
}
exit;
}
}
示例2: plugin_commu_value_convert
function plugin_commu_value_convert()
{
if (func_num_args() != 1) {
return PLUGIN_COMMU_USAGE_CONV;
}
//キャッシュを無効に
if (QHM_VERSION < 4.6) {
global $enable_cache;
$enable_cache = false;
} else {
$qt = get_qt();
$qt->enable_cache = false;
}
list($name) = func_get_args();
// strip_autolink() is not needed for size plugin
//$body = strip_htmltag($body);
if ($name == '') {
return PLUGIN_COMMU_USAGE_CONV;
}
if (isset($_SESSION['commu_user'])) {
$userdata = $_SESSION['commu_user'];
if (isset($userdata[$name])) {
$buffer = $userdata[$name];
$buffer = mb_convert_encoding($buffer, "UTF-8", "UTF-8,EUC-JP");
if ($name == 'expiration' && $buffer != '') {
$buffer = date('Y年m月d日', $buffer);
}
return $buffer;
} else {
return PLUGIN_NOT_COMMU_FIELD;
}
} else {
return PLUGIN_NOT_COMMU_FIELD;
}
}
示例3: plugin_canonical_show_info
function plugin_canonical_show_info()
{
global $vars, $style_name;
$qt = get_qt();
$page = $vars['page'];
if (edit_auth($page, FALSE, FALSE)) {
if (strpos($style_name, 'haik_') !== 0) {
return '
<div style="border:solid 1px #00e;background-color:#eef;max-width:80%;width:80%;text-align:left;padding:0 1.5em;margin:1em auto;">
<p>
<strong>このページは canonical URL が指定されています。</strong><br>
<a href="' . h($qt->getv('canonical_url')) . '" target="_blank">確認</a>
</p>
</div>';
} else {
return '
<div class="alert alert-info">
<button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">×</span>
<span class="sr-only">Close</span>
</button>
<strong>このページは canonical URL が指定されています。</strong><br>
<a href="' . h($qt->getv('canonical_url')) . '" target="_blank" class="btn btn-info">確認</a>
</div>';
}
}
}
示例4: plugin_read_url_inline
function plugin_read_url_inline()
{
$qt = get_qt();
//---- キャッシュのための処理を登録 -----
if ($qt->create_cache) {
$args = func_get_args();
return $qt->get_dynamic_plugin_mark(__FUNCTION__, $args);
}
//------------------------------------
global $vars;
$qm = get_qm();
$page = $vars['page'];
$args = func_get_args();
$num = func_num_args();
if ($num > 0) {
$url = $args[0];
}
$from_en = "auto";
if (isset($args[1]) && $args[1] != '') {
$from_en = h($args[1]);
}
if (is_url($url)) {
$_data = null;
if ($_http = fopen($url, "r")) {
while (!feof($_http)) {
$_data .= fgets($_http, 1024);
}
fclose($_http);
}
return mb_convert_encoding($_data, SOURCE_ENCODING, $from_en);
} else {
return "<p>" . $qm->replace('plg_read_url.err_invalid_url', $url) . "</p>";
}
}
示例5: plugin_uname_inline
function plugin_uname_inline()
{
$qt = get_qt();
//---- キャッシュのための処理を登録 -----
if ($qt->create_cache) {
$args = func_get_args();
return $qt->get_dynamic_plugin_mark(__FUNCTION__, $args);
}
//------------------------------------
global $vars;
$name = isset($vars['uname']) ? $vars['uname'] : '';
//unameパラメータがセットされていない場合
if ($name == '') {
return 'あなた';
} else {
$name = htmlspecialchars(mb_convert_encoding($name, SOURCE_ENCODING, 'UTF8,EUC-JP,Shift_JIS'));
}
$args = func_get_args();
$num = count($args);
$ntitle = "さん";
if ($num > 1) {
strip_htmltag(array_pop($args), FALSE);
$tmpstr = strip_htmltag(array_pop($args), FALSE);
if ($tmpstr == "none") {
$ntitle = '';
} else {
$ntitle = $tmpstr;
}
}
return $name . $ntitle;
}
示例6: plugin_qblog_archives_convert
/**
* QBlog Achives Plugin
* -------------------------------------------
* ./plugin/qblog_archives.inc.php
*
* Copyright (c) 2012 hokuken
* http://hokuken.com/
*
* created : 12/07/27
* modified :
*
* Description
*
*
* Usage :
*
*/
function plugin_qblog_archives_convert()
{
global $vars, $script, $qblog_close;
//閉鎖中は何も表示しない
if ($qblog_close && !ss_admin_check()) {
return '';
}
//---- キャッシュのための処理を登録 -----
$qt = get_qt();
if ($qt->create_cache) {
$args = func_get_args();
return $qt->get_dynamic_plugin_mark(__FUNCTION__, $args);
}
//------------------------------------
$archives_file = CACHEQBLOG_DIR . 'qblog_archives.dat';
if (file_exists($archives_file)) {
$archives_list = file_get_contents($archives_file);
} else {
$archives_list = array();
}
$list = '';
$list .= '<ul class="qblog_archives">';
foreach (explode("\n", $archives_list) as $line) {
if (rtrim($line) != '') {
list($year, $month, $num) = explode(",", rtrim($line));
$archives_url = $script . '?QBlog&mode=archives&date=' . rawurlencode($year . $month);
$list .= '<li><a href="' . $archives_url . '">' . $year . '年' . $month . '月 (' . $num . ')' . '</a></li>';
}
}
$list .= '</ul>';
return $list;
}
示例7: plugin_ga_link_inline
function plugin_ga_link_inline()
{
global $accesstag_moved;
global $accesstag;
global $vars;
$qm = get_qm();
$qt = get_qt();
$page = isset($vars['page']) ? $vars['page'] : '';
//parameter check
$args = func_get_args();
$num = func_num_args();
if ($num != 2) {
return $qm->replace('fmt_err_iln', 'ga_link', $qm->m['plg_ga_link']['err_usage']);
}
$text = strip_autolink(array_pop($args));
//テキストデータ
$url = array_pop($args);
if (!is_url($url)) {
$url = 'index.php?' . rawurlencode($url);
}
$acc_tag = '';
//初めて呼び出される場合、accesstag情報を表示する
if (!$accesstag_moved) {
$accesstag_moved = TRUE;
//accesstag_movedを設定
$editable = edit_auth($page, FALSE, FALSE);
if (!$editable) {
$qt->setv('toolkit_upper', $accesstag);
}
}
//Google Analytics用のjavascriptを先に読み込んでから、関数を呼び出す
$ret = '<a href="index.php?cmd=ga_link&url=' . rawurlencode($url) . '" onClick="javascript:pageTracker._link(this.href);return false;">' . $text . '</a>';
return $ret;
}
示例8: plugin_fb_likebutton_body
function plugin_fb_likebutton_body($args)
{
global $script, $vars, $defaultpage;
$page = $vars['page'];
$r_page = rawurlencode($page);
$qm = get_qm();
$qt = get_qt();
$layouts = array('standard', 'button_count', 'box_count');
$actions = array('like', 'recommend');
// scaffold
$def_attrs = array('href' => '', 'layout' => array('standard', $layouts), 'show-faces' => 'true', 'width' => FALSE, 'colorscheme' => FALSE, 'action' => array('like', $actions), 'ref' => FALSE, 'share' => 'true', 'kid-directed-site' => FALSE);
$attrs = plugin_fb_root_parse_args($args, $def_attrs);
//default URL set
if ($attrs['href'] == '') {
if ($page === $defaultpage) {
$attrs['href'] = dirname($script . 'dummy');
} else {
$attrs['href'] = $script . '?' . $r_page;
}
}
plugin_fb_root_set_jsapi(TRUE);
$tag = plugin_fb_root_create_tag('fb-like', $attrs);
$body = $tag;
return $body;
}
示例9: plugin_commu_logout_inline
function plugin_commu_logout_inline()
{
//キャッシュを無効に
if (QHM_VERSION < 4.6) {
global $enable_cache;
$enable_cache = false;
} else {
$qt = get_qt();
$qt->enable_cache = false;
}
$args = func_get_args();
$text = strip_autolink(array_pop($args));
if ($text == "") {
$text = 'ログアウト';
}
$dirpath = '';
if ($handle = opendir('./commu')) {
$dirpath = "./commu/";
closedir($handle);
} else {
if ($handle = opendir('../commu')) {
$dirpath = "../commu/";
closedir($handle);
} else {
return PLUGIN_COMMU_INFO_NOCOMMU;
}
}
return '<a href="' . $dirpath . 'user_logout.php">' . $text . '</a>';
}
示例10: plugin_iframe_convert
function plugin_iframe_convert()
{
global $pkwk_dtd;
$qm = get_qm();
$qt = get_qt();
$qt->setv('jquery_include', true);
$args = func_get_args();
$args_cnt = count($args);
list($formurl, $height, $width, $align) = array_pad($args, 4, '');
if (strlen(trim($formurl)) == 0) {
return $qm->replace('fmt_err_cvt', 'iframe', $qm->m['plg_iframe']['err_usage']);
}
$fit = '';
if ($args_cnt < 3) {
//correct args
$height = '200';
$width = '100%';
$fit = ' class="autofit_iframe" ';
$qt->appendv_once('plugin_iframe', 'beforescript', PLUGIN_IFRAME_FIT_IFRAME_JS);
}
if ($args_cnt < 4) {
$align = 'center';
}
if (PLUGIN_IFRAME_ALLOW_CSS === TRUE || !isset($pkwk_dtd) || $pkwk_dtd == PKWK_DTD_XHTML_1_1) {
return '<div style="text-align:' . $align . '"><iframe src="' . $formurl . '" frameborder="0" height="' . $height . '" width="' . $width . '" style="margin:0px;text-align:' . $align . ';" ' . $fit . '><p>' . $qm->replace('plg_iframe.ntc', $formurl) . '</p></iframe></div>';
} else {
return 'Invalid argument';
}
}
示例11: plugin_newpage_action
function plugin_newpage_action()
{
global $vars;
$qm = get_qm();
if (PKWK_READONLY) {
die_message($qm->m['fmt_err_pkwk_readonly']);
}
if ($vars['page'] == '') {
$retvars['msg'] = $qm->m['plg_newpage']['label'];
$retvars['body'] = plugin_newpage_convert();
if (preg_match('/id="([^"]+)"/', $retvars['body'], $ms)) {
$domid = $ms[1];
//jquery ライブラリの読み込み
$qt = get_qt();
$qt->setv('jquery_include', true);
$addscript = <<<EOS
<script type="text/javascript">
jQuery(function(){
\tjQuery("#{$domid}").focus().select();
});
</script>
EOS;
$qt->appendv_once('plugin_select_fsize', 'beforescript', $addscript);
}
return $retvars;
} else {
$page = strip_bracket($vars['page']);
$r_page = rawurlencode(isset($vars['refer']) ? get_fullname($page, $vars['refer']) : $page);
$r_refer = rawurlencode($vars['refer']);
pkwk_headers_sent();
header('Location: ' . get_script_uri() . '?cmd=read&page=' . $r_page . '&refer=' . $r_refer);
exit;
}
}
示例12: plugin_fb_recommends_convert
function plugin_fb_recommends_convert()
{
if ($alt = plugin_fb_root_is_deprecated('recommends')) {
$args = func_get_args();
return call_user_func_array($alt, $args);
}
global $script, $vars;
$page = $vars['page'];
$r_page = rawurlencode($page);
$qm = get_qm();
$qt = get_qt();
$args = func_get_args();
// scaffold
$def_attrs = array('site' => '', 'width' => FALSE, 'height' => FALSE, 'header' => 'true', 'colorscheme' => 'light', 'ref' => FALSE, 'action' => 'og.likes', 'app-id' => FALSE, 'linktarget' => FALSE, 'max-age' => FALSE);
$attrs = plugin_fb_root_parse_args($args, $def_attrs);
//default site set
if ($attrs['site'] == '') {
$parsed = parse_url($script);
$host = $parsed['host'];
$attrs['site'] = $host;
}
plugin_fb_root_set_jsapi(TRUE);
$body = plugin_fb_root_create_tag('fb-recommendations', $attrs);
if (edit_auth($page, FALSE, FALSE)) {
$fb_pagebox_help = h(QHM_HOME . '?PageName');
$warning = <<<EOM
\t\t\t<div class="alert alert-warning">
\t\t\t\tFacebook Recommends は Graph API v2.3 より廃止されました。<br>
\t\t\t\t<strong>2015 年 6 月 23 日</strong>に完全に使えなくなります。
\t\t\t</div>
EOM;
$body = $warning . $body;
}
return $body;
}
示例13: plugin_qcart_convert
function plugin_qcart_convert()
{
global $script;
$args = func_get_args();
$cnt = func_num_args();
$dir = 'qcart';
$position = 'right';
list($position, $dir) = array_pad($args, 2, '');
$dir = $dir == '' ? 'qcart' : htmlspecialchars($dir);
$position = $position == '' ? 'right' : htmlspecialchars($position);
$position = $position == 'right' || $position == 'left' ? $position : 'right';
if ($position == 'right') {
$position .= ';margin-left:1em;';
} else {
$position .= ';margin-right:1em;';
}
$addscript = <<<EOD
<script src="./{$dir}/shop/quickcart.js" type="text/javascript" language="javascript"></script>
EOD;
$qt = get_qt();
$qt->appendv_once('plugin_qcart', 'beforescript', $addscript);
$myurl = str_replace('index.php', '', $script);
return <<<EOD
<div style="width:200px;float:{$position};">
<script>cart('{$myurl}{$dir}/cgi-bin/')</script>
</div>
EOD;
}
示例14: plugin_fb_comments_convert
function plugin_fb_comments_convert()
{
global $script, $vars;
$page = $vars['page'];
$r_page = rawurlencode($page);
$qm = get_qm();
$qt = get_qt();
$args = func_get_args();
if (!exist_plugin("fb_root")) {
die('Fatal error: fb_root plugin not found');
}
$orders = array('social', 'reverse_time', 'time');
// scaffold
$def_attrs = array('href' => '', 'width' => FALSE, 'numposts' => '2', 'colorscheme' => 'light', 'mobile' => FALSE, 'order-by' => array(FALSE, $orders));
$attrs = plugin_fb_root_parse_args($args, $def_attrs);
//default URL set
if ($attrs['href'] == '') {
if ($page === $defaultpage) {
$attrs['href'] = dirname($script . 'dummy');
} else {
$attrs['href'] = $script . '?' . $r_page;
}
}
plugin_fb_root_set_jsapi(TRUE);
$tag = plugin_fb_root_create_tag('fb-comments', $attrs);
$body = $tag;
return $tag;
}
示例15: plugin_greybox_inline
function plugin_greybox_inline()
{
$qm = get_qm();
$addscript = '
<script type="text/javascript">
var GB_ROOT_DIR = "./plugin/greybox/";
</script>
<script type="text/javascript" src="./plugin/greybox/AJS.js"></script>
<script type="text/javascript" src="./plugin/greybox/AJS_fx.js"></script>
<script type="text/javascript" src="./plugin/greybox/gb_scripts.js"></script>
<link href="./plugin/greybox/gb_styles.css" rel="stylesheet" type="text/css" />
';
$qt = get_qt();
$qt->appendv_once('plugin_greybox', 'beforescript', $addscript);
$args = func_get_args();
$text = strip_autolink(array_pop($args));
// Already htmlspecialchars(text)
list($url, $title, $group) = array_pad($args, 3, '');
if ($url == '' && $group == '' || $text == '' || func_num_args() > 4) {
return $qm->replace('fmt_err_iln', 'greybox', $qm->m['plg_greybox']['err_usage']);
}
$url = htmlspecialchars($url);
$title = htmlspecialchars($title);
$group = htmlspecialchars($group);
$title = $title == '' ? '' : ' title="' . $title . '"';
//image grey box
if (preg_match("/.*(jpg|jpeg|png|gif)\$/i", $url)) {
$rel = $group == '' ? ' rel="gb_image[]"' : ' rel="gb_imageset[' . $group . ']"';
} else {
//web grey box
$rel = $group == '' ? ' rel="gb_page_fs[]"' : 'rel="gb_pageset[' . $group . ']"';
}
$ret = '<a href="' . $url . '" ' . $title . $rel . '>' . $text . '</a>';
return $ret;
}