本文整理汇总了PHP中wp_base函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_base函数的具体用法?PHP wp_base怎么用?PHP wp_base使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_base函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fetch
function fetch($tplfile, $cache_id = null, $compile_id = null, $display = false)
{
if ($this->tplbase == 'base') {
$tpldir = wp_base() . '/templates';
} else {
if ($this->tplbase == 'theme') {
$tplpath = get_custom_path('templates/' . $tplfile);
$tpldir = dirname($tplpath);
$tplfile = basename($tplpath);
} else {
$tpldir = wp_base() . '/' . $this->tplbase . '/templates';
}
}
$this->template_dir = $tpldir;
if (!$compile_id) {
if ($this->tplbase == 'theme') {
$compile_id = wp_prefix() . $GLOBALS['xoopsConfig']['theme_set'] . '_';
} else {
$compile_id = wp_prefix() . $this->tplbase . '_';
}
}
return parent::fetch($tplfile, $cache_id, $compile_id, $display);
}
示例2: get_weblogs_updatedfile
/**
** get_weblogs_updatedfile()
** Retrieves and caches a copy of the weblogs.com changed blogs xml file.
** If the file exists check it's age, get new copy if old.
** If a new or updated file has been written return true (needs processing)
** otherwise return false (nothing to do)
**/
function get_weblogs_updatedfile()
{
$update = false;
$file = wp_base() . "/" . get_settings('weblogs_cache_file');
if ($GLOBALS['ignore_weblogs_cache']) {
$update = true;
} else {
if (file_exists($file)) {
// is it old?
$modtime = filemtime($file);
if (time() - $modtime > get_settings('weblogs_cacheminutes') * 60) {
$update = true;
}
} else {
// doesn't exist
$update = true;
}
}
if ($update) {
// get a new copy
$a = @file(get_settings('weblogs_xml_url'));
if ($a != false && count($a) && $a[0]) {
$contents = implode('', $a);
// Clean up the input, because weblogs.com doesn't output clean XML
$contents = preg_replace("/'/", ''', $contents);
$contents = preg_replace('|[^[:space:][:punct:][:alpha:][:digit:]]|', '', $contents);
$cachefp = fopen(wp_base() . "/" . get_settings('weblogs_cache_file'), "w");
fwrite($cachefp, $contents);
fclose($cachefp);
} else {
return false;
//don't try to process
}
}
return $update;
}
示例3: wp_base
require wp_base() . '/wp-includes/wp-filter-setup.php';
if (empty($GLOBALS['wp_inblock']) || $GLOBALS['wp_inblock'] != 1) {
if (!defined('XOOPS_PULUGIN' . wp_id())) {
define('XOOPS_PULUGIN' . wp_id(), 1);
if (get_settings('active_plugins')) {
$check_plugins = explode("\n", get_settings('active_plugins'));
foreach ($check_plugins as $check_plugin) {
if (file_exists(wp_base() . '/wp-content/plugins/' . $check_plugin)) {
if (!defined(md5('WP_PLUGIN_' . strtoupper($check_plugin) . '_INCLUDED'))) {
define(md5('WP_PLUGIN_' . strtoupper($check_plugin) . '_INCLUDED'), 1);
require_once wp_base() . '/wp-content/plugins/' . $check_plugin;
} else {
// It is very tricky!!
if (!defined(md5('WP_PLUGIN_' . strtoupper($check_plugin) . wp_base() . '_DEFINED'))) {
define(md5('WP_PLUGIN_' . strtoupper($check_plugin) . wp_base() . '_DEFINED'), 1);
if (preg_match_all('/(add|remove)_(action|filter)\\s*\\([^\\)]+\\)\\s*\\;/', implode('', file(wp_base() . '/wp-content/plugins/' . $check_plugin)), $matches, PREG_SET_ORDER)) {
foreach ($matches as $match) {
eval($match[0]);
}
}
}
}
}
}
}
if (!defined('SHUTDOWN_ACTION_HOOK')) {
define('SHUTDOWN_ACTION_HOOK', '1');
function wp_shutdown_action_hook()
{
do_action('shutdown', '');
}
示例4: dirname
require_once dirname(dirname(__FILE__)) . '/wp-config.php';
}
}
$xmlrpc_filename = get_settings('xmlrpc_filename') ? get_settings('xmlrpc_filename') : 'xmlrpc.php';
$__file__ = str_replace('\\', '/', __FILE__);
if (wp_base() . '/' . $xmlrpc_filename != $__file__) {
@header('HTTP/1.x 404 Not Found');
echo "404 Not Found";
exit;
}
include 'wp-config.php';
require_once wp_base() . '/wp-includes/class-xmlrpc.php';
require_once wp_base() . '/wp-includes/class-xmlrpcs.php';
require_once wp_base() . '/wp-includes/template-functions.php';
require_once wp_base() . '/wp-includes/functions.php';
require_once wp_base() . '/wp-includes/vars.php';
error_reporting(E_ERROR);
#Temporally fix for kousagi
init_param('GET', 'kousagi', 'integer', '');
$use_cache = 1;
$post_autobr = 0;
$post_default_title = '';
// posts submitted via the xmlrpc interface get that title
$GLOBALS['post_default_category'] = 1;
// posts submitted via the xmlrpc interface go into that category
function logIO($io, $msg)
{
if ($GLOBALS['wp_debug']) {
$fp = fopen('./log/xmlrpc.log', 'a+');
$date = date('Y-m-d H:i:s ');
$iot = $io == 'I' ? ' Input: ' : ' Output: ';
示例5: define
<?php
if (!defined('WP_TEMPLATE_FUNCTIONS_INCLUDED')) {
define('WP_TEMPLATE_FUNCTIONS_INCLUDED', 1);
/***** About-the-blog tags *****/
require_once wp_base() . '/wp-includes/template-functions-general.php';
/***** Links *****/
require_once wp_base() . '/wp-includes/template-functions-links.php';
/**** // Geo Tags ****/
require_once wp_base() . '/wp-includes/template-functions-geo.php';
/***** Author tags *****/
require_once wp_base() . '/wp-includes/template-functions-author.php';
/***** Post tags *****/
require_once wp_base() . '/wp-includes/template-functions-post.php';
/***** Category tags *****/
require_once wp_base() . '/wp-includes/template-functions-category.php';
/***** Comment tags *****/
require_once wp_base() . '/wp-includes/template-functions-comment.php';
}
示例6: define
define('MOD_PUKI_LANG', 'en');
} else {
if (file_exists(MOD_PUKI_LANG_BASE . '/' . _LANGCODE)) {
define('MOD_PUKI_LANG', _LANGCODE);
} else {
define('MOD_PUKI_LANG', 'en');
}
}
}
} else {
if (defined('ABSPATH') and 'WPINC') {
//For WordPress Environment
//キャッシュのファイルの保管先
// XOOPS環境下では、wp-contentディレクトリ下にmodPukiWikiというディレクトリを作成して自動設定
if (!defined('MOD_PUKI_CACHE_DIR')) {
define('MOD_PUKI_CACHE_DIR', wp_base() . '/wp-content/modPukiWiki/');
if (!file_exists(MOD_PUKI_CACHE_DIR)) {
mkdir(MOD_PUKI_CACHE_DIR, 0777);
}
}
//画像キャッシュなどのファイルの保管先
// WordPress環境下では、Fileアップロード関連の設定を参照して自動設定
if (file_exists(get_settings('fileupload_realpath'))) {
if (!defined('MOD_PUKI_UPLOAD_URL')) {
define('MOD_PUKI_UPLOAD_URL', get_settings('fileupload_url') . '/modPukiWiki/');
}
if (!defined('MOD_PUKI_UPLOAD_DIR')) {
define('MOD_PUKI_UPLOAD_DIR', get_settings('fileupload_realpath') . '/modPukiWiki/');
if (!file_exists(MOD_PUKI_UPLOAD_DIR)) {
mkdir(MOD_PUKI_UPLOAD_DIR, 0777);
}
示例7: define
#wp-calendar #today {
\tbackground: #D85F7D;
\tcolor: #ffffff;
}
#wp-calendar th {
\tfont-style: normal;
\tfont-size: 11px;
\ttext-transform: capitalize;
}
EOD;
/* Don't remove this line */
}
/* Don't remove this line */
if (@in_array('pukiwiki', $GLOBALS['wp_filter'][wp_id()]['the_content']["6"]) && !preg_match("/^" . preg_quote(wp_base() . "/", "/") . "/i", $cur_PATH)) {
/* Don't remove this line */
if (!defined("WP_BLOCK_WIKI_READ")) {
/* Don't remove this line */
define("WP_BLOCK_WIKI_READ", "1");
$wp_block_style .= <<<EOD
/*
* modPukiWiki錮ㅞⅩ�엠ㄵ瑜래샵혼데澄婁�
*/
div.modPukiWP_ie5 {
\ttext-align:left;
}
.modPukiWP_style_table
{
\tpadding:0px;
示例8: WordPresTpl
function WordPresTpl($tplbase = "")
{
$this->XoopsTpl();
$this->template_dir = wp_base() . '/' . $tplbase . '/templates/';
$this->error_reporting = error_reporting();
}
示例9: foreach
?>
<ul id="adminmenu2">
<?php
foreach ($submenu["{$parent_file}"] as $item) {
if ($user_level < $item[1]) {
continue;
}
if ($parent_file != 'options.php' || !preg_match('/^options.php/', $item[2])) {
if (substr($self, -10) == substr($item[2], -10) || isset($plugin_page) && $plugin_page == $item[2]) {
$class = ' class="current"';
} else {
$class = '';
}
} else {
if (isset($_GET['option_group_id']) && $item[2] == 'options.php?option_group_id=' . $_GET['option_group_id']) {
$class = ' class="current"';
} else {
$class = '';
}
}
if (file_exists(wp_base() . "/wp-content/plugins/{$item[2]}")) {
echo "\n\t<li><a href='" . wp_siteurl() . "/wp-admin/admin.php?page={$item[2]}'{$class}>{$item[0]}</a></li>";
} else {
echo "\n\t<li><a href='" . wp_siteurl() . "/wp-admin/{$item[2]}'{$class}>{$item[0]}</a></li>";
}
}
?>
</ul>
<?php
}
示例10: wp_base
<?php
require_once wp_base() . "/class/xoopstableobject.php";
require_once wp_base() . "/class/wp_posts.php";
require_once wp_base() . "/class/wp_users.php";
require_once wp_base() . "/class/wp_categories.php";
require_once wp_base() . "/class/wp_comments.php";
require_once wp_base() . "/class/wp_postmeta.php";
require_once wp_base() . "/class/wp_post2cat.php";
require_once wp_base() . "/class/wp_links.php";
require_once wp_base() . "/class/wp_linkcategories.php";
require_once wp_base() . "/class/wp_options.php";
require_once wp_base() . "/class/wp_optiongroup_options.php";
require_once wp_base() . "/class/wp_template.php";
require_once wp_base() . "/class/wp_misc.php";
示例11: sort
<th nowrap><?php
echo _LANG_PG_SUB_DESCR;
?>
</th>
<th nowrap><?php
echo _LANG_PG_SUB_ACTION;
?>
</th>
</tr>
<?php
sort($plugin_files);
// Alphabetize by filename. Better way?
$style = '';
$ticket = $xoopsWPTicket->getTicketParamString('plugins');
foreach ($plugin_files as $plugin_file) {
$plugin_data = implode('', file(wp_base() . '/wp-content/plugins/' . $plugin_file));
preg_match("|Plugin Name:(.*)|i", $plugin_data, $plugin_name);
preg_match("|Plugin URI:(.*)|i", $plugin_data, $plugin_uri);
preg_match("|Description:(.*)|i", $plugin_data, $description);
preg_match("|Author:(.*)|i", $plugin_data, $author_name);
preg_match("|Author URI:(.*)|i", $plugin_data, $author_uri);
if (preg_match("|Version:(.*)|i", $plugin_data, $version)) {
$version = $version[1];
} else {
$version = '';
}
$description = wptexturize($description[1]);
if ('' == $plugin_uri) {
$plugin = $plugin_name[1];
} else {
$plugin = "<a href='{$plugin_uri[1]}' title='Visit plugin homepage'>{$plugin_name[1]}</a>";
示例12: dirname
<?php
if (file_exists(dirname(__FILE__) . '/xoops_version.php')) {
require_once dirname(__FILE__) . '/wp-config.php';
} else {
if (file_exists(dirname(dirname(__FILE__)) . '/xoops_version.php')) {
require_once dirname(dirname(__FILE__)) . '/wp-config.php';
}
}
$trackback_filename = get_settings('trackback_filename') ? get_settings('trackback_filename') : 'wp-trackback.php';
if (wp_base() . '/' . $trackback_filename != __FILE__) {
trackback_response(1, 'Sorry, Invalid Request.');
}
// trackback is done by a POST
$_tb_id = explode('/', $_SERVER['REQUEST_URI']);
$_tb_id = intval($_tb_id[count($_tb_id) - 1]);
init_param('', 'url', 'string', '');
init_param('', 'title', 'string', '');
init_param('', 'excerpt', 'html', '');
init_param('', 'blog_name', 'string', '');
init_param('', 'charset', 'string', '');
init_param('', 'p', 'integer', '');
init_param('', 'name', 'string', '');
init_param('', '__mode', 'string', '');
require_once 'wp-blog-header.php';
//Anti Trackback SPAM
$ref = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : (isset($_ENV['HTTP_REFERER']) ? $_ENV['HTTP_REFERER'] : '');
if ($ref) {
// Most of Trackbacks don't have HTTP_REFERER
header('Location: ' . get_permalink($tb_id));
}
示例13: wp_mail_receive
function wp_mail_receive()
{
global $wpdb, $wp_pop3, $img_target;
require_once wp_base() . '/wp-includes/class-pop3.php';
timer_start();
$use_cache = 1;
$time_difference = get_settings('time_difference');
// Get Server Time Zone
// If Server Time Zone is not collect, Please comment out following line;
$server_timezone = date("O");
// echo "Server TimeZone is ".date('O')."<br />";
// If Server Time Zone is not collect, Please uncomment following line and set collect timezone value;
// $server_timezone = "+0900"; //This is a sample value for JST+0900
$server_timezone = $server_timezone / 100;
$weblog_timezone = $server_timezone + $time_difference;
error_reporting(2037);
$wp_pop3 = new POP3();
if (!$wp_pop3->connect(get_settings('mailserver_url'), get_settings('mailserver_port'))) {
echo "Ooops {$wp_pop3->ERROR} <br />\n";
return;
}
$Count = $wp_pop3->login(get_settings('mailserver_login'), get_settings('mailserver_pass'));
if ($Count == false) {
if (!$wp_pop3->FP) {
echo "Oooops Login Failed: {$wp_pop3->ERROR}<br />\n";
} else {
echo "No Message<br />\n";
$wp_pop3->quit();
}
return;
}
// ONLY USE THIS IF YOUR PHP VERSION SUPPORTS IT!
register_shutdown_function('wp_mail_quit');
for ($iCount = 1; $iCount <= $Count; $iCount++) {
$MsgOne = $wp_pop3->get($iCount);
if (!$MsgOne || gettype($MsgOne) != 'array') {
echo "oops, {$wp_pop3->ERROR}<br />\n";
$wp_pop3->quit();
return;
}
$content = '';
$content_type = '';
$boundary = '';
$att_boundary = '';
$hatt_boundary = '';
$bodysignal = 0;
$dmonths = array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec');
while (list($lineNum, $line) = each($MsgOne)) {
if (strlen($line) < 3) {
$bodysignal = 1;
}
if ($bodysignal) {
$content .= $line;
} else {
if (preg_match('/^Content-Type:\\s+(.*?)\\;/i', $line, $match)) {
$content_type = $match[1];
$content_type = strtolower($match[1]);
}
if ($content_type == 'multipart/mixed' && preg_match('/boundary=(?:")?([^;"\\s\\n]*?)(?:")?\\s*(?:$|;)/', $line, $match) && $att_boundary == '') {
$att_boundary = trim($match[1]);
}
if ($content_type == 'multipart/alternative' && preg_match('/boundary=(?:")?([^;"\\s\\n]*?)(?:")?\\s*(?:$|;)/', $line, $match) && $boundary == '') {
$boundary = trim($match[1]);
}
if ($content_type == 'multipart/related' && preg_match('/boundary=(?:")?([^;"\\s\\n]*?)(?:")?\\s*(?:$|;)/', $line, $match) && $hatt_boundary == '') {
$hatt_boundary = trim($match[1]);
}
if (preg_match('/Subject: /', $line)) {
$subject = trim($line);
$subject = substr($subject, 9, strlen($subject) - 9);
if (function_exists('mb_decode_mimeheader')) {
$subject1 = mb_decode_mimeheader($subject);
if ($subject != $subject) {
$sub_charset = mb_internal_encoding();
} else {
$sub_charset = "auto";
}
$subject = $subject1;
}
if (get_settings('use_phoneemail')) {
$subject = explode(get_settings('phoneemail_separator'), $subject);
$subject = trim($subject[0]);
}
}
if (preg_match('/Date: /', $line)) {
// of the form '20 Mar 2002 20:32:37'
$ddate = trim($line);
$ddate = str_replace('Date: ', '', $ddate);
if (strpos($ddate, ',')) {
$ddate = trim(substr($ddate, strpos($ddate, ',') + 1, strlen($ddate)));
}
$date_arr = explode(' ', $ddate);
$date_time = explode(':', $date_arr[3]);
$ddate_H = $date_time[0];
$ddate_i = $date_time[1];
$ddate_s = $date_time[2];
$ddate_m = $date_arr[1];
$ddate_d = $date_arr[0];
$ddate_Y = $date_arr[2];
$mail_timezone = trim(ereg_replace("\\([^)]*\\)", "", $date_arr[4])) / 100;
//.........这里部分代码省略.........
示例14: header
}
if (!test_param('title') && !test_param('url') && !test_param('blog_name')) {
// If it doesn't look like a trackback at all...
header('Location: ' . get_permalink($_tb_id));
}
if (!empty($_tb_id) && !test_param('__mode') && test_param('url')) {
@header('Content-Type: text/xml');
if (!get_settings('use_trackback')) {
trackback_response(1, 'Sorry, this weblog does not allow you to trackback its posts.');
}
$_title = get_param('title');
$_excerpt = get_param('excerpt');
$_blog_name = get_param('blog_name');
$_charset = get_param('charset');
if ($GLOBALS['wp_debug']) {
$_debug_file = wp_base() . '/log/trackback_r.log';
$_fp = fopen($_debug_file, 'a');
fwrite($_fp, "Title(Orig) ={$_title}\n");
fwrite($_fp, "Excerpt(Orig) ={$_excerpt}\n");
fwrite($_fp, "BlogName(Orig) ={$_blog_name}\n");
fwrite($_fp, "CharSet(Orig) ={$_charset}\n\n");
}
$postHandler =& wp_handler('Post');
$postObject =& $postHandler->get($_tb_id);
if (!$postObject) {
trackback_response(1, 'Sorry, no post is exist for this post id.');
}
if ($postObject->getVar('ping_status') == 'closed') {
trackback_response(1, 'Sorry, trackbacks are closed for this item.');
}
if (get_settings('check_trackback_content')) {
示例15: current_wp
function current_wp()
{
$cur_PATH = $_SERVER['SCRIPT_FILENAME'];
if (preg_match('/^' . preg_quote(wp_base() . '/', '/') . '/i', $cur_PATH)) {
return true;
} else {
return false;
}
}