本文整理汇总了PHP中get_qm函数的典型用法代码示例。如果您正苦于以下问题:PHP get_qm函数的具体用法?PHP get_qm怎么用?PHP get_qm使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_qm函数的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_close_convert
function plugin_close_convert()
{
global $vars, $script;
$qm = get_qm();
$qt = get_qt();
$page = isset($vars['page']) ? $vars['page'] : '';
//キャッシュ無効
$qt->enable_cache = false;
$title = $qm->m['plg_close']['title'];
$msg = $qm->m['plg_close']['ntc'];
//parse arguments
$args = func_get_args();
$num = count($args);
if ($num == 0) {
//do nothing
} else {
if ($num == 1) {
$title = array_pop($args);
} else {
list($title, $msg) = $args;
}
}
$editable = edit_auth($page, FALSE, FALSE);
if ($editable) {
return $qm->m['plg_close']['ntc_admin'];
} else {
force_output_message($title, '', $msg);
}
}
示例3: plugin_lookup_action
function plugin_lookup_action()
{
global $post;
// Deny GET method to avlid GET loop
$qm = get_qm();
$page = isset($post['page']) ? $post['page'] : '';
$inter = isset($post['inter']) ? $post['inter'] : '';
if ($page == '') {
return FALSE;
}
// Do nothing
if ($inter == '') {
return array('msg' => $qm->m['plg_lookup']['err_invalid_access'], 'body' => '');
}
$url = get_interwiki_url($inter, $page);
if ($url === FALSE) {
$msg = $qm->replace('fmt_err_iw_not_found', $inter);
$msg = h($msg);
return array('msg' => $qm->m['plg_lookup']['title_not_found'], 'body' => $msg);
}
pkwk_headers_sent();
header('Location: ' . $url);
// Publish as GET method
exit;
}
示例4: plugin_online_itself
function plugin_online_itself($type = 0)
{
static $count, $result, $base;
$qm = get_qm();
if (!isset($count)) {
if (isset($_SERVER['REMOTE_ADDR'])) {
$host =& $_SERVER['REMOTE_ADDR'];
} else {
$host = '';
}
// Try read
if (plugin_online_check_online($count, $host)) {
$result = TRUE;
} else {
// Write
$result = plugin_online_sweep_records($host);
}
}
if ($result) {
return $count;
// Integer
} else {
if (!isset($base)) {
$base = basename(PLUGIN_ONLINE_USER_LIST);
}
$error = $qm->replace('plg_online.err_not_writable', $base);
if ($type == 0) {
$error = $qm->replace('plg_online.err_convert', $error) . "\n";
} else {
$error = $qm->replace('plg_online.err_inline', $error);
}
return $error;
// String
}
}
示例5: 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;
}
示例6: plugin_pp_button_inline
/**
* PayPal Shopping Cart Button Plugin
* -------------------------------------------
* pp_button.inc.php
*
* Copyright (c) 2010 hokuken
* http://hokuken.com/
*
* created :
* modified : 2010-08-27
*
* PayPal のショッピングカートボタンを設置します
* 日本語商品名は文字化けが起こることが多いです
*
* USAGE:
* &pp_button($paypal_account, product name, price);
*/
function plugin_pp_button_inline()
{
$qm = get_qm();
$args = func_get_args();
$num = func_num_args();
if ($num < 3) {
return $qm->m['plg_pp_button']['err_usage'];
}
list($account, $pname, $price, $pcode) = array_pad($args, 4, '');
$pname = h($pname);
$price = h($price);
$pcode = $pcode == '' ? $pname : h($pcode);
return <<<EOD
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post" style="display:inline">
<input type="image" src="https://www.paypal.com/ja_JP/JP/i/btn/btn_cart_LG.gif" border="0" name="submit" alt="{$qm->m['plg_pp_button']['title_paypal']}">
<img alt="" border="0" src="https://www.paypal.com/ja_JP/i/scr/pixel.gif" width="1" height="1">
<input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="{$account}">
<input type="hidden" name="item_name" value="{$pname}">
<input type="hidden" name="item_number" value="{$pcode}">
<input type="hidden" name="amount" value="{$price}">
<input type="hidden" name="no_shipping" value="0">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="JPY">
<input type="hidden" name="lc" value="JP">
<input type="hidden" name="bn" value="PP-ShopCartBF">
</form>\t
EOD;
}
示例7: plugin_insert_convert
function plugin_insert_convert()
{
global $script, $vars, $digest;
$qm = get_qm();
static $numbers = array();
if (PKWK_READONLY) {
return '';
}
// Show nothing
if (!isset($numbers[$vars['page']])) {
$numbers[$vars['page']] = 0;
}
$insert_no = $numbers[$vars['page']]++;
$s_page = htmlspecialchars($vars['page']);
$s_digest = htmlspecialchars($digest);
$s_cols = INSERT_COLS;
$s_rows = INSERT_ROWS;
$string = <<<EOD
<form action="{$script}" method="post">
<div>
<input type="hidden" name="insert_no" value="{$insert_no}" />
<input type="hidden" name="refer" value="{$s_page}" />
<input type="hidden" name="plugin" value="insert" />
<input type="hidden" name="digest" value="{$s_digest}" />
<textarea name="msg" rows="{$s_rows}" cols="{$s_cols}"></textarea><br />
<input type="submit" name="insert" value="{$qm->m['plg_insert']['btn_label']}" />
</div>
</form>
EOD;
return $string;
}
示例8: plugin_ganatracker_convert
function plugin_ganatracker_convert()
{
global $accesstag;
global $vars;
$qm = get_qm();
$page = isset($vars['page']) ? $vars['page'] : '';
$args = func_get_args();
$num = func_num_args();
if ($num != 1) {
return $qm->replace('fmt_err_cvt', 'ganatracker', $qm->m['plg_ganatracker']['err_usage_cvt']);
}
$name = $args[0];
//versionをチェックして、置換
$version = $qm->m['plg_ganatracker']['old'];
if (strstr($accesstag, "gaJsHost") == false) {
//Old version
$repstr = 'urchinTracker(\'' . $name . '\')';
$accesstag = str_replace('urchinTracker()', $repstr, $accesstag);
} else {
$version = $qm->m['plg_ganatracker']['old'];
$repstr = 'pageTracker._trackPageview(\'' . $name . '\')';
$accesstag = str_replace('pageTracker._trackPageview()', $repstr, $accesstag);
}
$editable = edit_auth($page, FALSE, FALSE);
if ($editable) {
return '<div style="margin:1em;border:dashed 2px #f00;background-color:#fee">' . $qm->replace('plg_ganatracker.ntc_admin_cvt', $version, $name) . '</div>';
} else {
return '';
}
}
示例9: plugin_img_convert
function plugin_img_convert()
{
$qm = get_qm();
if (PKWK_DISABLE_INLINE_IMAGE_FROM_URI) {
return $qm->replace('fmt_err_deny_uri_img', '#img');
}
$args = func_get_args();
// Check the 2nd argument first, for compatibility
$arg = isset($args[1]) ? strtoupper($args[1]) : '';
if ($arg == '' || $arg == 'L' || $arg == 'LEFT') {
$align = 'left';
} else {
if ($arg == 'R' || $arg == 'RIGHT') {
$align = 'right';
} else {
// Stop word-wrapping only (Ugly but compatible)
// Short usage: #img(,clear)
return PLUGIN_IMG_CLEAR;
}
}
$url = isset($args[0]) ? $args[0] : '';
if (!is_url($url) || !preg_match('/\\.(jpe?g|gif|png)$/i', $url)) {
return $qm->replace('fmt_err_cvt', 'img', $qm->m['plg_img']['err_usage']);
}
$arg = isset($args[2]) ? strtoupper($args[2]) : '';
$clear = $arg == 'C' || $arg == 'CLEAR' ? PLUGIN_IMG_CLEAR : '';
return <<<EOD
<div style="float:{$align};padding:.5em 1.5em .5em 1.5em">
<img src="{$url}" alt="" />
</div>{$clear}
EOD;
}
示例10: plugin_counter_get_count
function plugin_counter_get_count($page)
{
global $vars;
static $counters = array();
static $default;
$qm = get_qm();
if (!isset($default)) {
$default = array('total' => 0, 'date' => get_date('Y/m/d'), 'today' => 0, 'yesterday' => 0, 'ip' => '');
}
if (!is_page($page)) {
return $default;
}
if (isset($counters[$page])) {
return $counters[$page];
}
// Set default
$counters[$page] = $default;
$modify = FALSE;
$file = COUNTER_DIR . encode($page) . PLUGIN_COUNTER_SUFFIX;
$fp = fopen($file, file_exists($file) ? 'r+' : 'w+') or die('counter.inc.php: ' . $qm->replace('fmt_err_open_counterdir', basename($file)));
set_file_buffer($fp, 0);
flock($fp, LOCK_EX);
rewind($fp);
foreach ($default as $key => $val) {
// Update
$counters[$page][$key] = rtrim(fgets($fp, 256));
if (feof($fp)) {
break;
}
}
if ($counters[$page]['date'] != $default['date']) {
// New day
$modify = TRUE;
$is_yesterday = $counters[$page]['date'] == get_date('Y/m/d', time() - 86400);
$counters[$page]['ip'] = $_SERVER['REMOTE_ADDR'];
$counters[$page]['date'] = $default['date'];
$counters[$page]['yesterday'] = $is_yesterday ? $counters[$page]['today'] : 0;
$counters[$page]['today'] = 1;
$counters[$page]['total']++;
} else {
if ($counters[$page]['ip'] != $_SERVER['REMOTE_ADDR']) {
// Not the same host
$modify = TRUE;
$counters[$page]['ip'] = $_SERVER['REMOTE_ADDR'];
$counters[$page]['today']++;
$counters[$page]['total']++;
}
}
// Modify
if ($modify && $vars['cmd'] == 'read') {
rewind($fp);
ftruncate($fp, 0);
foreach (array_keys($default) as $key) {
fputs($fp, $counters[$page][$key] . "\n");
}
}
flock($fp, LOCK_UN);
fclose($fp);
return $counters[$page];
}
示例11: 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;
}
示例12: plugin_conversion_r_inline
function plugin_conversion_r_inline()
{
global $vars, $script;
$qm = get_qm();
$page = isset($vars['page']) ? $vars['page'] : '';
$args = func_get_args();
if (count($args) != 6) {
return $qm->replace('fmt_err_iln', 'conversion_r', $qm->m['plg_conversion_r']['err_usage']);
}
$text = array_pop($args);
list($step, $group, $name, $url, $site_url) = $args;
if (!is_url($url)) {
return $qm->replace('fmt_err_iln', 'conversion_r', $qm->m['plg_conversion_r']['err_url']);
}
$raw_url = $url;
$step = rawurlencode($step);
$group = rawurlencode($group);
$name = rawurlencode($name);
$url = rawurlencode($url);
$site_url .= preg_match('/\\/$/', $site_url) ? '' : '/';
$dest = $site_url . '?cmd=conversion&mode=link&step=' . $step . '&group=' . $group . '&name=' . $name . '&url=' . $url;
//edit auth check
$editable = edit_auth($page, FALSE, FALSE);
if ($editable) {
return '<a href="' . $dest . '">' . $text . '</a><span style="font-size:11px;background-color:#fdd">←' . $qm->m['plg_conversion_r']['ntc_admin'] . '</span>';
} else {
return '<a href="' . $dest . '">' . $text . '</a>';
}
}
示例13: 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;
}
示例14: 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';
}
}
示例15: plugin_search_menu_convert
function plugin_search_menu_convert()
{
global $script;
$qm = get_qm();
return <<<EOF
<div id="searchmenu">
<h2>{$qm->m['plg_search_menu']['hdr']}</h2>
<form action="{$script}" method="get">
<div style="text-align:center">
<div class="form-group">
<div class="input-group">
\t<input type="text" name="word" value="" tabindex="1" accesskey="k" class="form-control input-sm" />
<span class="input-group-btn">
\t <input type="submit" value="{$qm->m['plg_search']['btn']}" tabindex="2" accesskey="s" class="btn btn-default btn-sm" />
</span>
</div>
</div>
<div class="form-group">
<label for="and_search" class="radio-inline" style="display:inline-block;line-height:normal">
\t<input type="radio" name="type" value="AND" checked="checked" id="and_search" tabindex="3" accesskey="a" />{$qm->m['plg_search']['lbl_and']}
</label>
<label for="or_search" class="radio-inline" style="display:inline-block;line-height:normal">
<input type="radio" name="type" value="OR" id="or_search" tabindex="3" accesskey="o" />{$qm->m['plg_search']['lbl_or']}
</label>
</div>
\t<input type="hidden" name="cmd" value="search" />
\t<input type="hidden" name="encode_hint" value="ぷ" />
</div>
</form>
</div>
EOF;
}