本文整理汇总了PHP中wp_handler函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_handler函数的具体用法?PHP wp_handler怎么用?PHP wp_handler使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_handler函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_permalink
function get_permalink($id = false)
{
$rewritecode = array('%year%', '%monthnum%', '%day%', '%hour%', '%minute%', '%second%', '%postname%', '%post_id%', '%category%', '%author%', '%pagename%');
$permalink = get_settings('permalink_structure');
$postHandler =& wp_handler('Post');
if ($id) {
$id = intval($id);
if ($permalink == '') {
return wp_siteurl() . '/index.php?p=' . $id;
}
if (!isset($GLOBALS['permalink_cache'][wp_id()]) || !isset($GLOBALS['permalink_cache'][wp_id()][$id])) {
$postObject =& $postHandler->get($id);
$GLOBALS['permalink_cache'][wp_id()][$id] =& $postObject->exportWpObject();
}
$idpost = $GLOBALS['permalink_cache'][wp_id()][$id];
} else {
$idpost = $GLOBALS['post'];
}
if ('' != $permalink) {
$unixtime = strtotime($idpost->post_date);
$cats = get_the_category($idpost->ID);
$category = $cats[0]->category_nicename;
$authordata = get_userdata($idpost->post_author);
$author = $authordata->user_login;
$rewritereplace = array(date('Y', $unixtime), date('m', $unixtime), date('d', $unixtime), date('H', $unixtime), date('i', $unixtime), date('s', $unixtime), $idpost->post_name, $idpost->ID, $category, $author, $idpost->post_name);
return wp_siteurl() . str_replace($rewritecode, $rewritereplace, $permalink);
} else {
return wp_siteurl() . '/index.php?p=' . $idpost->ID;
}
}
示例2: _b_wp_archives_monthly_show
function _b_wp_archives_monthly_show($options, $wp_num = '')
{
$block_style = $options[0] ? $options[0] : 0;
$with_count = $options[1] == 0 ? false : true;
$tpl_file = empty($options[2]) ? 'wp_archives_monthly.html' : $options[2];
$sel_value = '';
if (current_wp()) {
if (!empty($_SERVER['PATH_INFO'])) {
permlink_to_param();
}
init_param('GET', 'm', 'string', '');
init_param('GET', 'year', 'integer', '');
init_param('GET', 'monthnum', 'integer', '');
init_param('GET', 'day', 'integer', '');
if (strlen(get_param('m')) == 6) {
$sel_value = get_param('m');
} else {
if (test_param('year') && test_param('monthnum') && !test_param('day')) {
$sel_value = get_param('year') . zeroise(get_param('monthnum'), 2);
}
}
}
$block['wp_num'] = $wp_num;
$block['divid'] = 'wpArchive' . $wp_num;
$block['siteurl'] = wp_siteurl();
$block['style'] = block_style_get(false);
$block['block_style'] = $block_style;
$block['with_count'] = $with_count;
$now = current_time('mysql');
$postHandler =& wp_handler('Post');
$criteria =& new CriteriaCompo(new Criteria('post_date', $now, '<'));
$criteria->add(new Criteria('post_status', 'publish'));
$criteria->setSort('post_date');
$criteria->setOrder('DESC');
$criteria->setGroupby('YEAR(post_date), MONTH(post_date)');
$postObjects =& $postHandler->getObjects($criteria, false, 'DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts');
$block['records'] = array();
if ($postObjects) {
foreach ($postObjects as $postObject) {
$this_year = $postObject->getExtraVar('year');
$this_month = $postObject->getExtraVar('month');
$_record['url'] = get_month_link($this_year, $this_month);
$_record['text'] = format_month($this_year, $GLOBALS['month'][zeroise($this_month, 2)]);
if ($with_count) {
$_record['count'] = ' (' . $postObject->getExtraVar('posts') . ')';
} else {
$_record['count'] = '';
}
$_record['select'] = $sel_value == $this_year . zeroise($this_month, 2) ? 'selected="selected"' : '';
$block['records'][] = $_record;
}
}
$_wpTpl =& new WordPresTpl('theme');
$_wpTpl->assign('block', $block);
if (!$_wpTpl->tpl_exists($tpl_file)) {
$tpl_file = 'wp_archives_monthly.html';
}
$block['content'] = $_wpTpl->fetch($tpl_file);
return $block;
}
示例3: _b_wp_calendar_show
function _b_wp_calendar_show($option, $wp_num = "")
{
if (current_wp()) {
if (!empty($_SERVER['PATH_INFO'])) {
permlink_to_param();
}
init_param('GET', 'p', 'integer', '');
init_param('GET', 'm', 'integer', '');
init_param('GET', 'w', 'integer', '');
init_param('GET', 'monthnum', 'integer', '');
init_param('GET', 'year', 'integer', '');
if (test_param('p') && !(test_param('m') || test_param('monthnum') || test_param('w'))) {
$postHandler =& wp_handler('Post');
$postObject =& $postHandler->get(get_param('p'));
if ($postObject) {
$GLOBALS['m'] = mysql2date('Ym', $postObject->getVar('post_date'));
}
}
}
$block['wp_num'] = $wp_num;
$block['divid'] = 'wpCalendar' . $wp_num;
$block['style'] = block_style_get(false);
$block['calendar'] = get_calendar(1, false);
$_wpTpl =& new WordPresTpl('theme');
$_wpTpl->assign('block', $block);
$block['content'] = $_wpTpl->fetch('wp_calendar.html');
return $block;
}
示例4: b_wp_categories_show
function b_wp_categories_show($options, $wp_num = "")
{
$block_style = $options[0] ? $options[0] : 0;
$with_count = $options[1] ? $options[1] : 0;
$sorting_key = $options[2] ? $options[2] : 'name';
$sorting_order = $options[3] ? $options[3] : 'asc';
global $wpdb, $siteurl, $wp_id, $wp_inblock, $user_cache, $cache_categories, $category_name, $cat, $wp_mod, $wp_base;
$id = 1;
$GLOBALS['use_cache'] = 1;
if ($wp_num == "") {
$GLOBALS['wp_id'] = $wp_num;
$GLOBALS['wp_inblock'] = 1;
require dirname(__FILE__) . '/../wp-config.php';
$GLOBALS['wp_inblock'] = 0;
}
if (current_wp()) {
init_param('GET', 'cat', 'string', '');
init_param('GET', 'category_name', 'string', '');
if (!empty($GLOBALS['category_name']) && empty($GLOBALS['$cat'])) {
if (stristr($GLOBALS['category_name'], '/')) {
$GLOBALS['category_name'] = explode('/', $GLOBALS['category_name']);
if ($category_name[count($category_name) - 1]) {
$GLOBALS['category_name'] = $GLOBALS['category_name'][count($GLOBALS['category_name']) - 1];
// no trailing slash
} else {
$GLOBALS['category_name'] = $GLOBALS['category_name'][count($GLOBALS['category_name']) - 2];
// there was a trailling slash
}
}
$categoryHandler =& wp_handler('Category');
$categoryObject =& $categoryHandler->getByNiceName($GLOBALS['category_name']);
$cat = $categoryObject->getVar('cat_ID');
}
}
if ($block_style == 0) {
// Simple Listing
ob_start();
block_style_get($wp_num);
echo "<ul class='wpBlockList'>\n";
wp_list_cats("sort_column={$sorting_key}&sorting_order={$sorting_order}&optioncount={$with_count}");
echo "</ul>\n";
$block['content'] = ob_get_contents();
ob_end_clean();
} else {
// Dropdown Listing
$file = "{$siteurl}/index.php";
$link = $file . '?cat=';
ob_start();
block_style_get($wp_num);
echo '<form name="listcatform' . $wp_num . '" id="listcatform' . $wp_num . '" action="#">';
$select_str = '<select name="cat" onchange="window.location = (document.forms.listcatform' . $wp_num . '.cat[document.forms.listcatform' . $wp_num . '.cat.selectedIndex].value);"> ';
dropdown_cats(1, _WP_LIST_CAT_ALL, $sorting_key, $sorting_order, 0, $with_count, 0, false, 0, 0, true, 0, true, 0);
echo '</form>';
$block_str = ob_get_contents();
ob_end_clean();
$block['content'] = ereg_replace('\\<select name\\=[^\\>]*\\>', $select_str, $block_str);
}
return $block;
}
示例5: comments_popup_link
function comments_popup_link($zero = 'No Comments', $one = '1 Comment', $more = '% Comments', $CSSclass = '', $none = 'Comments Off', $echo = true)
{
if (get_xoops_option(wp_mod(), 'wp_use_xoops_comments') == 0) {
if (empty($GLOBALS['comment_count_cache'][wp_id()]["{$GLOBALS['wp_post_id']}"])) {
$criteria =& new CriteriaCompo(new Criteria('comment_post_ID', $GLOBALS['wp_post_id']));
$criteria->add(new Criteria('comment_approved', '1 '));
// Trick for numeric chars only string compare
$commentHandler =& wp_handler('Comment');
$number = $commentHandler->getCount($criteria);
} else {
$number = $GLOBALS['comment_count_cache'][wp_id()]["{$GLOBALS['wp_post_id']}"];
}
} else {
$criteria =& new CriteriaCompo(new Criteria('comment_post_ID', $GLOBALS['wp_post_id']));
$criteria->add(new Criteria('comment_approved', '1 '));
// Trick for numeric chars only string compare
$criteria_c =& new CriteriaCompo(new Criteria('comment_content', "<trackback />%", 'like'));
$criteria_c->add(new Criteria('comment_content', "<pingback />%", 'like'), 'OR');
$criteria_c->add(new Criteria('comment_type', 'trackback'), 'OR');
$criteria_c->add(new Criteria('comment_type', 'pingback'), 'OR');
$criteria->add($criteria_c);
$commentHandler =& wp_handler('Comment');
$number = $commentHandler->getCount($criteria);
}
$comments_popup_link = "";
if (0 == $number && 'closed' == $GLOBALS['post']->comment_status && 'closed' == $GLOBALS['post']->ping_status) {
return _echo($none, $echo);
} else {
if (!empty($GLOBALS['post']->post_password)) {
// if there's a password
if ($_COOKIE['wp-postpass_' . $GLOBALS['cookiehash']] != $GLOBALS['post']->post_password) {
// and it doesn't match the cookie
return _echo("Enter your password to view comments", $echo);
}
}
$comments_popup_link .= '<a href="';
if (!empty($GLOBALS['wpcommentsjavascript'])) {
$comments_popup_link .= wp_siteurl() . '/' . $GLOBALS['wpcommentspopupfile'] . '?p=' . $GLOBALS['wp_post_id'] . '&c=1';
$comments_popup_link .= '" onclick="wpopen(this.href); return false"';
} else {
// if comments_popup_script() is not in the template, display simple comment link
$comments_popup_link .= comments_link('', false);
$comments_popup_link .= '"';
}
$comments_popup_link .= ' title="Comment for \'\'' . apply_filters('the_title', $GLOBALS['post']->post_title) . '\'\'"';
if (!empty($CSSclass)) {
$comments_popup_link .= ' class="' . $CSSclass . '"';
}
$comments_popup_link .= '>';
$comments_popup_link .= comments_number($zero, $one, $more, $number, false);
$comments_popup_link .= '</a>';
return _echo($comments_popup_link, $echo);
}
}
示例6: _b_wp_categories_show
function _b_wp_categories_show($options, $wp_num = "")
{
$block_style = $options[0] ? $options[0] : 0;
$with_count = $options[1] ? $options[1] : 0;
$sorting_key = $options[2] ? $options[2] : 'name';
$sorting_order = $options[3] ? $options[3] : 'asc';
if (current_wp()) {
if (!empty($_SERVER['PATH_INFO'])) {
permlink_to_param();
}
init_param('GET', 'cat', 'string', '');
init_param('GET', 'category_name', 'string', '');
if (!empty($GLOBALS['category_name']) && empty($GLOBALS['cat'])) {
if (stristr($GLOBALS['category_name'], '/')) {
$GLOBALS['category_name'] = explode('/', $GLOBALS['category_name']);
if ($GLOBALS['category_name'][count($GLOBALS['category_name']) - 1]) {
$GLOBALS['category_name'] = $GLOBALS['category_name'][count($GLOBALS['category_name']) - 1];
// no trailing slash
} else {
$GLOBALS['category_name'] = $GLOBALS['category_name'][count($GLOBALS['category_name']) - 2];
// there was a trailling slash
}
}
$categoryHandler =& wp_handler('Category');
$categoryObject =& $categoryHandler->getByNiceName($GLOBALS['category_name']);
$GLOBALS['cat'] = $categoryObject->getVar('cat_ID');
}
}
if ($block_style == 0) {
// Simple Listing
ob_start();
block_style_get($wp_num);
echo '<ul class="wpBlockList">' . "\n";
wp_list_cats("hide_empty=0&sort_column={$sorting_key}&sorting_order={$sorting_order}&optioncount={$with_count}");
echo '</ul>' . "\n";
$block['content'] = ob_get_contents();
ob_end_clean();
} else {
// Dropdown Listing
$file = wp_siteurl() . '/index.php';
$link = $file . '?cat=';
ob_start();
block_style_get($wp_num);
echo '<form name="listcatform' . $wp_num . '" id="listcatform' . $wp_num . '" action="#">';
$select_str = '<select name="cat" onchange="window.location = (document.forms.listcatform' . $wp_num . '.cat[document.forms.listcatform' . $wp_num . '.cat.selectedIndex].value);"> ';
dropdown_cats(1, _WP_LIST_CAT_ALL, $sorting_key, $sorting_order, 0, $with_count, 0, false, 0, 0, true, 0, true, 0);
echo '</form>';
$block_str = ob_get_contents();
ob_end_clean();
$block['content'] = ereg_replace('\\<select name\\=[^\\>]*\\>', $select_str, $block_str);
}
return $block;
}
示例7: _b_wp_recent_posts_edit
function _b_wp_recent_posts_edit($options, $wp_num = "")
{
$categoryHandler =& wp_handler('Category');
$optFormCatOptions = array("0" => _WP_LIST_CAT_ALL) + $categoryHandler->getParentOptionArray();
require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
$optForm = new XoopsSimpleForm('Block Option Dummy Form', 'optionform', '');
$optForm->addElement(new XoopsFormText('Number of Posts in this block:', 'options[0]', 5, 5, $options[0]));
$optForm->addElement(new XoopsFormRadioYN('Display Posted Date:', 'options[1]', $options[1]));
$optForm->addElement(new XoopsFormRadioYN('Display RSS Icon:', 'options[2]', $options[2]));
$optForm->addElement(new XoopsFormRadioYN('Display RDF Icon:', 'options[3]', $options[3]));
$optForm->addElement(new XoopsFormRadioYN('Display RSS2 Icon:', 'options[4]', $options[4]));
$optForm->addElement(new XoopsFormRadioYN('Display ATOM Icon:', 'options[5]', $options[5]));
$optForm->addElement(new XoopsFormText('Number of Posts in Meta Feed(RSS,RDF,ATOM):', 'options[6]', 5, 5, $options[6]));
$optFormCat = new XoopsFormSelect('Listing only in a following categoty:', 'options[7]', $options[7]);
$optFormCat->addOptionArray($optFormCatOptions);
$optForm->addElement($optFormCat);
$optForm->addElement(new XoopsFormRadioYN('Display New Flag:', 'options[8]', $options[8]));
$optForm->addElement(new XoopsFormText('Custom Block Template File<br />(Default: wp_recent_posts.html):', 'options[9]', 25, 50, $options[9]));
$_wpTpl =& new WordPresTpl('theme');
$optForm->assign($_wpTpl);
return $_wpTpl->fetch('wp_block_edit.html');
}
示例8: _b_wp_calendar_show
function _b_wp_calendar_show($option, $wp_num = "")
{
if (current_wp()) {
if (!empty($_SERVER['PATH_INFO'])) {
permlink_to_param();
}
init_param('GET', 'p', 'integer', '');
init_param('GET', 'm', 'integer', '');
init_param('GET', 'w', 'integer', '');
init_param('GET', 'monthnum', 'integer', '');
init_param('GET', 'year', 'integer', '');
if (test_param('p') && !(test_param('m') || test_param('monthnum') || test_param('w'))) {
$postHandler =& wp_handler('Post');
$postObject =& $postHandler->get(get_param('p'));
$GLOBALS['m'] = mysql2date('Ym', $postObject->getVar('post_date'));
}
}
ob_start();
block_style_get();
get_calendar(1);
$block['content'] = ob_get_contents();
ob_end_clean();
return $block;
}
示例9: veriflog
function veriflog()
{
if ($GLOBALS['xoopsUser']) {
$userHandler =& wp_handler('User');
$userObject =& $userHandler->get($GLOBALS['xoopsUser']->uid());
if ($userObject) {
return $userHandler->insert($userObject, true, true);
} else {
$userObject =& $userHandler->create();
$userObject->setVar('ID', $GLOBALS['xoopsUser']->uid(), true);
return $userHandler->insert($userObject, true, true);
}
}
return false;
}
示例10: wp_base
}
require_once wp_base() . '/wp-includes/wp-tickets.php';
require_once wp_base() . '/wp-includes/functions-formatting.php';
require_once wp_base() . '/wp-includes/functions-filter.php';
require_once wp_base() . '/wp-includes/kses.php';
if (get_settings('hack_file')) {
include_once wp_base() . '/my-hacks.php';
}
require 'wp-config-extra.php';
require_once wp_base() . '/wp-includes/template-functions.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/links.php';
if (empty($GLOBALS['cache_categories'][wp_id()]) || count($GLOBALS['cache_categories'][wp_id()]) == 0) {
$GLOBALS['cache_categories'][wp_id()] = array();
$categoryHandler =& wp_handler('Category');
$categoryObjects =& $categoryHandler->getObjects();
foreach ($categoryObjects as $categoryObject) {
$catt = $categoryObject->exportWpObject();
$GLOBALS['cache_categories'][wp_id()][$catt->cat_ID] = $catt;
}
}
// We should eventually migrate to either calling
// get_settings() wherever these are needed OR
// accessing a single global $all_settings var
if (get_xoops_option(wp_mod(), 'wp_use_xoops_smilies')) {
$GLOBALS['smilies_directory'] = XOOPS_URL . "/uploads";
} else {
$GLOBALS['smilies_directory'] = get_settings('smilies_directory');
}
//WordPressプラグイン互換性確保用
示例11: wp_delete_post
function wp_delete_post($post_ID = 0)
{
$postHandler =& wp_handler('Post');
$postObject =& $postHandler->get($post_ID);
$result = $postHandler->delete($postObject, true);
return $result;
}
示例12: b2getcategories
function b2getcategories($m)
{
$blog_ID = $m->getParam(0);
$username = $m->getParam(1);
$password = $m->getParam(2);
$blog_ID = $blogid->scalarval();
$username = $username->scalarval();
$password = $password->scalarval();
if (user_pass_ok($username, $password)) {
$userdata = get_userdatabylogin($username);
if ($userdata->user_level < 1) {
return new xmlrpcresp(0, $GLOBALS['xmlrpcerruser'] + 1, 'Sorry, level 0 users can not post');
}
$categoryHandler =& wp_handler('Category');
$criteria =& new Criteria(1, 1);
$criteria->setSort('cat_ID');
$criteria->setOrder('ACS');
$categoryObjects =& $categoryHandler->getObjects($criteria);
if (!$categoryObjects) {
die('Error getting data');
}
$i = 0;
foreach ($categoryObjects as $categoryObject) {
$struct[$i++] = new xmlrpcval(array('categoryID' => new xmlrpcval($categoryObject->getVar('cat_ID')), 'categoryName' => new xmlrpcval(mb_conv($categoryObject->getVar('cat_name'), 'UTF-8', $GLOBALS['blog_charset']))), 'struct');
}
$data = array($struct[0]);
for ($j = 1; $j < $i; $j++) {
array_push($data, $struct[$j]);
}
$resp = new xmlrpcval($data, 'array');
return new xmlrpcresp($resp);
} else {
return new xmlrpcresp(0, $GLOBALS['xmlrpcerruser'] + 3, 'Wrong username/password combination ' . $username . ' / ' . starify($password));
}
}
示例13: post_count_exceeds
function post_count_exceeds()
{
$postHandler =& wp_handler('Post');
$GLOBALS['current_posts_criteria']->setGroupBy('');
$postObjects =& $postHandler->getObjects($GLOBALS['current_posts_criteria'], false, 'count(DISTINCT ID) numposts', '', $GLOBALS['current_posts_join']);
$numposts = $postObjects[0]->getExtraVar('numposts');
if ($GLOBALS['posts_per_page'] != -1 && $numposts > $GLOBALS['posts_per_page']) {
echo '<p><b>' . sprintf(_LANG_NKA_EXCEEDS_COUNT, $GLOBALS['posts_per_page']) . '</b></p>';
}
}
示例14: wp_handler
<?php
// Links
// Copyright (C) 2002, 2003 Mike Little -- mike@zed1.com
require_once 'admin.php';
$linkHandler =& wp_handler('Link');
$userHandler =& wp_handler('User');
$linkCategoryHandler =& wp_handler('LinkCategory');
$title = 'Manage Links';
$this_file = 'link-manager.php';
$parent_file = 'link-manager.php';
init_param(array('POST', 'GET'), 'action2', 'string', '');
init_param(array('POST', 'GET'), 'action', 'string', $action2);
switch ($action) {
case _LANG_WLM_ASSIGN_TEXT:
//Check Ticket
if (!$xoopsWPTicket->check()) {
redirect_header($siteurl . '/wp-admin/' . $this_file, 3, $xoopsWPTicket->getErrors());
}
//Check User_Level
if ($user_level < get_settings('links_minadminlevel')) {
redirect_header($siteurl . '/wp-admin/', 5, _LANG_P_CHEATING_ERROR);
}
//Check Paramaters
init_param('POST', 'linkcheck', 'array-int', array(), true);
init_param('POST', 'newowner', 'integer', -1, true);
if (count($linkcheck) == 0) {
header('Location: ' . $this_file);
exit;
}
if (!$userHandler->get($newowner)) {
示例15: wp_mail_receive
//.........这里部分代码省略.........
$userdata = get_userdatabylogin($user_login);
$user_level = $userdata->user_level;
$post_author = $userdata->ID;
if ($user_level > 0) {
$post_title = xmlrpc_getposttitle($content);
if ($post_title == '') {
$post_title = $subject;
}
echo "Subject : " . mb_conv($post_title, $blog_charset, $sub_charset) . " <br />\n";
$post_category = get_settings('default_category');
if (preg_match('/<category>(.+?)<\\/category>/is', $content, $matchcat)) {
$post_category = xmlrpc_getpostcategory($content);
}
if (empty($post_category)) {
$post_category = get_settings('default_post_category');
}
echo "Category : {$post_category} <br />\n";
$post_category = explode(',', $post_category);
if (!get_settings('emailtestonly')) {
// Attaching Image Files Save
if ($att_boundary != "") {
$attachment = wp_getattach($contents[2], "user-" . trim($post_author), 1);
}
if ($boundary != "" && $hatt_boundary != "") {
for ($i = 2; $i < count($contents); $i++) {
$hattachment = wp_getattach($contents[$i], "user-" . trim($post_author), 0);
if ($hattachment) {
if (preg_match("/Content-Id: \\<([^\\>]*)>/i", $contents[$i], $matches)) {
$content = preg_replace("/(cid:" . preg_quote($matches[1]) . ")/", get_settings('fileupload_url') . '/' . $hattachment, $content);
}
}
}
}
if ($boundary != "") {
$content = preg_replace("/\\=[\r\n]/", "", $content);
$content = preg_replace("/[\r\n]/", " ", $content);
}
$content = preg_replace("|\n([^\n])|", " \$1", $content);
$content = preg_replace("/\\=([0-9a-fA-F]{2,2})/e", "pack('c',base_convert('\\1',16,10))", $content);
$content = mb_conv(trim($content), $blog_charset, $charset);
// If we find an attachment, add it to the post
if ($attachment) {
if (isset($img_target) && $img_target) {
$img_target = ' target="' . $img_target . '"';
} else {
$img_target = '';
}
if (file_exists(get_settings('fileupload_realpath') . "/thumb-" . $attachment)) {
$content = "<a href=\"" . get_settings('fileupload_url') . '/' . rawurlencode($attachment) . "\"" . $img_target . "><img style=\"float: left;\" hspace=\"6\" src = \"" . get_settings('fileupload_url') . '/thumb-' . rawurlencode($attachment) . "\" alt=\"" . $attachment . "\" title=\"" . $attachment . "\" /></a>" . $content . "<br clear=\"left\" />";
} else {
$content = "<a href=\"" . get_settings('fileupload_url') . '/' . rawurlencode($attachment) . "\"" . $img_target . "><img style=\"float: left;\" hspace=\"6\" src = \"" . get_settings('fileupload_url') . '/' . rawurlencode($attachment) . "\" alt=\"" . $attachment . "\" title=\"" . $attachment . "\" /></a>" . $content . "<br clear=\"left\" />";
}
}
$postHandler =& wp_handler('Post');
$postObject =& $postHandler->create();
$postObject->setVar('post_content', $content);
$postObject->setVar('post_title', trim(mb_conv($post_title, $blog_charset, $sub_charset)));
$postObject->setVar('post_date', $post_date);
$postObject->setVar('post_author', $post_author);
$postObject->setVar('post_category', $post_category[0]);
$postObject->setVar('post_name', sanitize_title($post_title));
if ($flat < 500) {
$postObject->setVar('post_lat', $flat);
$postObject->setVar('post_lon', $flon);
}
if (!$postHandler->insert($postObject, true)) {
echo "<b>Error: Insert New Post</b><br />";
}
$post_ID = $postObject->getVar('ID');
echo "Post ID = {$post_ID}<br />\n";
$postObject->assignCategories($post_category);
do_action('publish_post', $post_ID);
do_action('publish_phone', $post_ID);
if ($flat < 500) {
pingGeoUrl($post_ID);
}
$blog_ID = 1;
pingWeblogs($blog_ID);
pingBlogs($blog_ID);
pingback($content, $post_ID);
}
echo "\n<p><b>Posted title:</b> {$post_title}<br />\n";
echo "<b>Posted content:</b><br /><pre>" . $content . "</pre></p>\n";
if (!$wp_pop3->delete($mail_num)) {
echo "<p>Oops " . $wp_pop3->ERROR . "</p></div>\n";
$wp_pop3->reset();
return;
} else {
echo "<p>Mission complete, message <strong>{$mail_num}</strong> deleted.</p>\n";
}
} else {
echo "<p><strong>Level 0 users can\\'t post.</strong></p>\n";
}
echo "</div>\n";
}
}
$wp_pop3->quit();
timer_stop($output_debugging_info);
return;
}