本文整理汇总了PHP中wp_base函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_base函数的具体用法?PHP wp_base怎么用?PHP wp_base使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_base函数的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:23,代码来源:wp_template.php
示例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;
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:43,代码来源:links-update-xml.php
示例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', '');
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:31,代码来源:wp-settings.php
示例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: ';
开发者ID:nobunobuta,项目名称:xoops_mod_WordPress,代码行数:31,代码来源:xmlrpc.php
示例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';
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:19,代码来源:template-functions.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);
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:31,代码来源:PukiWiki.php
示例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;
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:30,代码来源:wp-blocks.css.php
示例8: WordPresTpl
function WordPresTpl($tplbase = "")
{
$this->XoopsTpl();
$this->template_dir = wp_base() . '/' . $tplbase . '/templates/';
$this->error_reporting = error_reporting();
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:6,代码来源:wp_template.php
示例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
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:31,代码来源:menu-header.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";
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:15,代码来源:wp_classes.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>";
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:31,代码来源:plugins.php
示例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));
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:31,代码来源:wp-trackback.php
示例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;
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:101,代码来源:wp-mail.php
示例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')) {
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:31,代码来源:wp-trackback.php
示例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;
}
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:9,代码来源:functions.php
示例16: wp_base
<?php
/*
Plugin Name: Blacklist
Plugin URI: http://www.farook.org
Description: Checks each entered comment against a standard blacklist and either approves or holds the comment for later approval or automatically deletes it. Also allows you to work with comments in the moderation queue so that you can harvest information to add to the blacklist while mass-deleting held comments. If it's your first time you can use the <a href="../blacklist-install.php">Blacklist Installer</a> or you can simply go to the <a href="wpblacklist.php">Blacklist Configuration</a> screen.
Version: 2.9
Author: Fahim Farook
Author URI: http://www.farook.org
*/
require_once wp_base() . '/wp-includes/wpblfunctions.php';
$tableblacklist = $GLOBALS['xoopsDB']->prefix("wp_blacklist");
/*
notifies the moderator of the blog (usually the admin) about deleted comments
always returns true
*/
function wpbl_notify($comment_id, $reason, $harvest)
{
global $wbbl_comment;
$tableposts = wp_table('posts');
$sql = "SELECT * FROM {$tableposts} WHERE ID='{$wbbl_comment['comment_post_ID']}' LIMIT 1";
$post = $GLOBALS['wpdb']->get_row($sql);
if (!empty($wpbl_comment['comment_author_IP'])) {
$comment_author_domain = gethostbyaddr($wpbl_comment['comment_author_IP']);
} else {
$comment_author_domain = '';
}
// create the e-mail body
$notify_message = "A new ";
if ($wpbl_comment['comment_type'] == '') {
$notify_message .= "Comment";
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:31,代码来源:blacklist.php
示例17: redirect_header
<?php
require_once 'admin.php';
$mode = 'sidebar';
$standalone = 1;
$title = "";
require_once 'admin-header.php';
if ($user_level <= 0) {
redirect_header(wp_siteurl() . '/wp-admin/', 5, _LANG_P_CHEATING_ERROR);
}
init_param('GET', 'action', 'string', '');
require_once XOOPS_ROOT_PATH . '/class/template.php';
$wpTpl =& new XoopsTpl();
$wpTpl->error_reporting = error_reporting();
$wpTpl->assign('action', $action);
$wpTpl->assign('admin_area_charset', $admin_area_charset);
if ($action != 'done') {
$category_select = categories_nested_select(array(get_settings('default_post_category')));
$ticket = $xoopsWPTicket->getTicketHtml(__LINE__, 10800);
$wpTpl->assign('user_ID', $user_ID);
$wpTpl->assign('category_select', $category_select);
$wpTpl->assign('ticket', $ticket);
}
$wpTpl->template_dir = wp_base() . '/wp-admin/templates/';
$wpTpl->display('sidebar.html');
require_once 'admin-footer.php';
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:26,代码来源:sidebar.php
示例18: wp_mail_receive
function wp_mail_receive()
{
global $img_target;
require_once wp_base() . '/wp-includes/class-pop3.php';
timer_start();
$use_cache = 1;
$time_difference = get_settings('time_difference');
error_reporting(2037);
$GLOBALS['wp_pop3'] = new POP3();
if (!$GLOBALS['wp_pop3']->connect(get_settings('mailserver_url'), get_settings('mailserver_port'))) {
echo "Ooops {$GLOBALS['wp_pop3']}->ERROR <br />\n";
return;
}
$mail_count = $GLOBALS['wp_pop3']->login(get_settings('mailserver_login'), get_settings('mailserver_pass'));
if ($mail_count == false) {
if (!$GLOBALS['wp_pop3']->FP) {
echo "Oooops Login Failed: {$wp_pop3->ERROR}<br />\n";
} else {
echo "No Message<br />\n";
$GLOBALS['wp_pop3']->quit();
}
return;
}
// ONLY USE THIS IF YOUR PHP VERSION SUPPORTS IT!
register_shutdown_function('wp_mail_quit');
for ($mail_num = 1; $mail_num <= $mail_count; $mail_num++) {
$MsgOne = $GLOBALS['wp_pop3']->get($mail_num);
if (!$MsgOne || gettype($MsgOne) != 'array') {
echo "oops, {$GLOBALS['wp_pop3']}->ERROR<br />\n";
$GLOBALS['wp_pop3']->quit();
return;
}
$content = '';
$content_type = '';
$boundary = '';
$alt_boundary = '';
$emb_boundary = '';
$dmonths = array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec');
$mailMsg = '';
while (list($lineNum, $line) = each($MsgOne)) {
$mailMsg .= $line;
}
$mailParts = parse_msg($mailMsg);
if (!empty($mailParts['header']['date'])) {
$ddate = trim($mailParts['header']['date'][0]);
if (strpos($ddate, ',')) {
$ddate = trim(substr($ddate, strpos($ddate, ',') + 1, strlen($ddate)));
}
$ddate_U = strtotime($ddate) + $time_difference * 3600;
$post_date = date('Y-m-d H:i:s', $ddate_U);
}
if (!empty($mailParts['header']['subject'])) {
$subject = trim($mailParts['header']['subject'][0]);
if (function_exists('mb_decode_mimeheader')) {
$subject1 = mb_decode_mimeheader($subject);
if ($subject1 != $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 (!ereg(get_settings('subjectprefix'), $subject)) {
continue;
}
$charset = "";
$ncharset = preg_match("/\\s?charset=\"?([A-Za-z0-9\\-]*)\"?/i", $content, $matches);
if ($ncharset) {
$charset = $matches[1];
}
$ddate_today = time() + $time_difference * 3600;
$ddate_difference_days = ($ddate_today - $ddate_U) / 86400;
if ($ddate_difference_days > 14) {
echo "Too old<br />\n";
continue;
}
if (preg_match('/' . get_settings('subjectprefix') . '/', $subject)) {
$userpassstring = '';
echo "<div style=\"border: 1px dashed #999; padding: 10px; margin: 10px;\">\n";
echo "<p><b>{$mail_num}</b></p><p><b>Subject: </b>{$subject}</p>\n";
$subject = trim(str_replace(get_settings('subjectprefix'), '', $subject));
$attaches = array();
if ($mailParts['type'] == 'multipart') {
if ($mailParts['subtype'] == 'mixed') {
for ($i = 1; $i < count($mailParts['body']); $i++) {
$attaches[] = array('type' => 'mix', 'body' => $mailParts['body'][$i]);
}
if (!is_array($mailParts['body'][0]['body'])) {
$content = $mailParts['body'][0]['body'];
$charset = $mailParts['body'][0]['charset'];
$encoding = $mailParts['body'][0]['encodings'];
$content = convert_content($content, $charest, $encoding);
} else {
$mailParts = $mailParts['body'][0];
}
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:101,代码来源:wp-mail.php
注:本文中的wp_base函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论