本文整理汇总了PHP中FrmAppHelper::site_url方法的典型用法代码示例。如果您正苦于以下问题:PHP FrmAppHelper::site_url方法的具体用法?PHP FrmAppHelper::site_url怎么用?PHP FrmAppHelper::site_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrmAppHelper
的用法示例。
在下文中一共展示了FrmAppHelper::site_url方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: akismet
function akismet($values)
{
$content = FrmEntriesHelper::entry_array_to_string($values);
if (empty($content)) {
return false;
}
$datas = array();
$datas['blog'] = FrmAppHelper::site_url();
$datas['user_ip'] = preg_replace('/[^0-9., ]/', '', $_SERVER['REMOTE_ADDR']);
$datas['user_agent'] = $_SERVER['HTTP_USER_AGENT'];
$datas['referrer'] = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : false;
$datas['comment_type'] = 'formidable';
if ($permalink = get_permalink()) {
$datas['permalink'] = $permalink;
}
$datas['comment_content'] = $content;
foreach ($_SERVER as $key => $value) {
if (!in_array($key, array('HTTP_COOKIE', 'HTTP_COOKIE2', 'PHP_AUTH_PW')) && is_string($value)) {
$datas["{$key}"] = $value;
} else {
$datas["{$key}"] = '';
}
unset($key, $value);
}
$query_string = '';
foreach ($datas as $key => $data) {
$query_string .= $key . '=' . urlencode(stripslashes($data)) . '&';
unset($key, $data);
}
if (is_callable('Akismet::http_post')) {
$response = Akismet::http_post($query_string, 'comment-check');
} else {
global $akismet_api_host, $akismet_api_port;
$response = akismet_http_post($query_string, $akismet_api_host, '/1.1/comment-check', $akismet_api_port);
}
return (is_array($response) and $response[1] == 'true') ? true : false;
}
示例2: dynamic_default_values
/**
* Get the value to replace a few standard shortcodes
*
* @since 2.0
* @return string
*/
public static function dynamic_default_values($tag, $atts = array(), $return_array = false)
{
$new_value = '';
switch ($tag) {
case 'admin_email':
$new_value = get_option('admin_email');
break;
case 'siteurl':
$new_value = FrmAppHelper::site_url();
break;
case 'frmurl':
$new_value = FrmAppHelper::plugin_url();
break;
case 'sitename':
$new_value = FrmAppHelper::site_name();
break;
case 'get':
$new_value = self::process_get_shortcode($atts, $return_array);
break;
}
return $new_value;
}
示例3: parse_akismet_array
/**
* @since 2.0
* @param string $content
*/
private static function parse_akismet_array(&$datas, $content)
{
$datas['blog'] = FrmAppHelper::site_url();
$datas['user_ip'] = preg_replace('/[^0-9., ]/', '', FrmAppHelper::get_ip_address());
$datas['user_agent'] = FrmAppHelper::get_server_value('HTTP_USER_AGENT');
$datas['referrer'] = isset($_SERVER['HTTP_REFERER']) ? FrmAppHelper::get_server_value('HTTP_REFERER') : false;
$datas['comment_type'] = 'formidable';
$datas['comment_content'] = $content;
if ($permalink = get_permalink()) {
$datas['permalink'] = $permalink;
}
foreach ($_SERVER as $key => $value) {
if (!in_array($key, array('HTTP_COOKIE', 'HTTP_COOKIE2', 'PHP_AUTH_PW')) && is_string($value)) {
$datas[$key] = wp_strip_all_tags($value);
} else {
$datas[$key] = '';
}
unset($key, $value);
}
}
示例4: referer_session
public static function referer_session()
{
global $frm_settings;
if (!isset($frm_settings->track) || !$frm_settings->track || defined('WP_IMPORTING')) {
return;
}
// keep the page history below 100
$max = 100;
if (!isset($_SESSION)) {
session_start();
}
if (!isset($_SESSION['frm_http_pages']) or !is_array($_SESSION['frm_http_pages'])) {
$_SESSION['frm_http_pages'] = array("http://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']);
}
if (!isset($_SESSION['frm_http_referer']) or !is_array($_SESSION['frm_http_referer'])) {
$_SESSION['frm_http_referer'] = array();
}
if (!isset($_SERVER['HTTP_REFERER']) or isset($_SERVER['HTTP_REFERER']) and strpos($_SERVER['HTTP_REFERER'], FrmAppHelper::site_url()) === false and !in_array($_SERVER['HTTP_REFERER'], $_SESSION['frm_http_referer'])) {
if (!isset($_SERVER['HTTP_REFERER'])) {
$direct = __('Type-in or bookmark', 'formidable');
if (!in_array($direct, $_SESSION['frm_http_referer'])) {
$_SESSION['frm_http_referer'][] = $direct;
}
} else {
$_SESSION['frm_http_referer'][] = $_SERVER['HTTP_REFERER'];
}
}
if ($_SESSION['frm_http_pages'] and !empty($_SESSION['frm_http_pages']) and end($_SESSION['frm_http_pages']) != "http://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']) {
$_SESSION['frm_http_pages'][] = "http://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
}
//keep the page history below the max
if (count($_SESSION['frm_http_pages']) > $max) {
foreach ($_SESSION['frm_http_pages'] as $pkey => $ppage) {
if (count($_SESSION['frm_http_pages']) <= $max) {
break;
}
unset($_SESSION['frm_http_pages'][$pkey]);
}
}
}
示例5: _e
_e('Entry update date', 'formidable');
?>
</option>
<?php
if (is_numeric($post->frm_form_id) && !empty($post->frm_form_id)) {
FrmProFieldsHelper::get_field_options($post->frm_form_id, $post->frm_edate_field_id, '', "'date', 'number'");
}
?>
</select>
<br/>
<label class="frm_left_label"><?php
_e('Repeat', 'formidable');
?>
<span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php
printf(__('Select a field from your form that contains values like 1 week, 2 weeks, 1 year, etc. This will set the repeat period for each event.', 'formidable'), FrmAppHelper::site_url());
?>
" ></span> </label>
<select id="repeat_event_field_id" name="options[repeat_event_field_id]">
<option value=""><?php
_e('No repeating events', 'formidable');
?>
</option>
<?php
if (is_numeric($post->frm_form_id) && !empty($post->frm_form_id)) {
FrmProFieldsHelper::get_field_options($post->frm_form_id, $post->frm_repeat_event_field_id, '', "'radio', 'select'");
}
?>
</select>
<br/>
示例6: _e
</table>
<h3><?php
_e('Advanced', 'formidable');
?>
</h3>
<table class="form-table frm-no-margin">
<tr class="hide_dyncontent <?php
echo in_array($post->frm_show_count, array('dynamic', 'calendar')) ? '' : 'frm_hidden';
?>
">
<td><?php
_e('Detail Page Slug', 'formidable');
?>
<span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php
printf(__('Example: If parameter name is \'contact\', the url would be like %1$s/selected-page?contact=2. If this entry is linked to a post, the post permalink will be used instead.', 'formidable'), FrmAppHelper::site_url());
?>
" ></span></td>
<td>
<?php
/*
if ( FrmProAppHelper::rewriting_on() && $frmpro_settings->permalinks ) { ?>
<select id="type" name="type">
<option value="id" <?php selected($post->frm_type, 'id') ?>><?php _e( 'ID', 'formidable' ); ?></option>
<option value="display_key" <?php selected($post->frm_type, 'display_key') ?>><?php _e( 'Key', 'formidable' ); ?></option>
</select>
<p class="description"><?php printf(__( 'Select the value that will be added onto the page URL. This will create a pretty URL like %1$s/selected-page/entry-key', 'formidable' ), FrmAppHelper::site_url()); ?></p>
<?php }else{ ?>
*/
?>
<input type="text" id="param" name="param" value="<?php
示例7: replace_shortcodes
//.........这里部分代码省略.........
$this_tag = str_replace('-', '_', $tag);
if ($conditional) {
$atts['short_key'] = $shortcodes[0][$short_key];
$content = self::check_conditional_shortcode($content, $entry->{$this_tag}, $atts, $tag);
} else {
if (isset($atts['time_ago'])) {
$date = FrmProAppHelper::human_time_diff(strtotime($entry->{$this_tag}));
} else {
$date = FrmProAppHelper::get_formatted_time($entry->{$this_tag}, $atts['format'], $time_format);
}
$content = str_replace($shortcodes[0][$short_key], $date, $content);
}
unset($this_tag);
break;
case 'created_by':
case 'created-by':
case 'updated_by':
case 'updated-by':
$this_tag = str_replace('-', '_', $tag);
$replace_with = self::get_display_value($entry->{$this_tag}, (object) array('type' => 'user_id'), $atts);
if ($conditional) {
$atts['short_key'] = $shortcodes[0][$short_key];
$content = self::check_conditional_shortcode($content, $entry->{$this_tag}, $atts, $tag);
} else {
$content = str_replace($shortcodes[0][$short_key], $replace_with, $content);
}
unset($this_tag);
unset($replace_with);
break;
case 'evenodd':
$content = str_replace($shortcodes[0][$short_key], $odd, $content);
break;
case 'siteurl':
$content = str_replace($shortcodes[0][$short_key], FrmAppHelper::site_url(), $content);
break;
case 'frmurl':
$content = str_replace($shortcodes[0][$short_key], FrmAppHelper::plugin_url(), $content);
break;
case 'sitename':
$content = str_replace($shortcodes[0][$short_key], get_option('blogname'), $content);
break;
case 'get':
if (isset($atts['param'])) {
$param = $atts['param'];
$replace_with = FrmAppHelper::get_param($param);
if (is_array($replace_with)) {
$replace_with = implode(', ', $replace_with);
}
$content = str_replace($shortcodes[0][$short_key], $replace_with, $content);
unset($param);
unset($replace_with);
}
break;
default:
if ($tag == 'deletelink') {
$page_id = isset($atts['page_id']) ? $atts['page_id'] : ($post ? $post->ID : 0);
if (!isset($atts['label'])) {
$atts['label'] = false;
}
$delete_atts = $atts;
$delete_atts['id'] = $entry->id;
$delete_atts['page_id'] = $page_id;
$replace_with = FrmProEntriesController::entry_delete_link($delete_atts);
unset($delete_atts);
$field = false;
} else {
示例8: selected
selected($post->frm_type, 'id');
?>
><?php
_e('ID', 'formidable');
?>
</option>
<option value="display_key" <?php
selected($post->frm_type, 'display_key');
?>
><?php
_e('Key', 'formidable');
?>
</option>
</select>
<p class="description"><?php
printf(__('Select the value that will be added onto the page URL. This will create a pretty URL like %1$s/selected-page/entry-key', 'formidable'), FrmAppHelper::site_url());
?>
</p>
<?php
} else {
?>
<?php
_e('Parameter Name', 'formidable');
?>
:
<input type="text" id="param" name="param" value="<?php
echo esc_attr($post->frm_param);
?>
">
<?php