• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP wp_handler函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中wp_handler函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_handler函数的具体用法?PHP wp_handler怎么用?PHP wp_handler使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了wp_handler函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
     }
 }
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:30,代码来源:template-functions-links.php


示例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'] = '&nbsp;(' . $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;
 }
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:60,代码来源:wp_archives_monthly.php


示例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;
 }
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:28,代码来源:wp_calendar.php


示例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;
 }
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:59,代码来源:wp_categories.php


示例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'] . '&amp;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);
     }
 }
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:54,代码来源:template-functions-comment.php


示例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;
 }
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:53,代码来源:wp_categories.php


示例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');
 }
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:22,代码来源:wp_recent_posts.php


示例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;
 }
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:24,代码来源:wp_calendar.php


示例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;
 }
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:15,代码来源:admin-functions.php


示例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プラグイン互換性確保用
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:31,代码来源:wp-settings.php


示例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;
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:7,代码来源:xmlrpc.php


示例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));
    }
}
开发者ID:nobunobuta,项目名称:xoops_mod_WordPress,代码行数:35,代码来源:xmlrpc.php


示例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>';
    }
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:10,代码来源:nkarchives.php


示例14: wp_handler

<?php

// Links
// Copyright (C) 2002, 2003 Mike Little -- [email protected]
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)) {
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:31,代码来源:link-manager.php


示例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;
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:101,代码来源:wp-mail.php


示例16: _b_wp_contents_show

 function _b_wp_contents_show($options, $wp_num = "")
 {
     $no_posts = empty($options[0]) ? 10 : $options[0];
     $GLOBALS['dateformat'] = stripslashes(get_settings('date_format'));
     $GLOBALS['timeformat'] = stripslashes(get_settings('time_format'));
     $_criteria = new CriteriaCompo(new Criteria('post_status', 'publish'));
     $_criteria->add(new Criteria('post_date', current_time('mysql'), '<='));
     $_criteria->setGroupBy(wp_table('posts') . '.ID');
     $_criteria->setSort('post_date');
     $_criteria->setOrder('DESC');
     $_criteria->setLimit($no_posts);
     $_criteria->setStart(0);
     $postHandler =& wp_handler('Post');
     $postObjects =& $postHandler->getObjects($_criteria, false, '', 'DISTINCT');
     $lposts = array();
     foreach ($postObjects as $postObject) {
         $lposts[] =& $postObject->exportWpObject();
     }
     if ($lposts) {
         // Get the categories for all the posts
         $_post_id_list = array();
         foreach ($lposts as $post) {
             $_post_id_list[] = $post->ID;
             $GLOBALS['category_cache'][wp_id()][$post->ID] = array();
         }
         $_post_id_list = implode(',', $_post_id_list);
         $_post_id_criteria =& new Criteria('post_id', '(' . $_post_id_list . ')', 'IN');
         $_joinCriteria =& new XoopsJoinCriteria(wp_table('post2cat'), 'ID', 'post_id');
         $_joinCriteria->cascade(new XoopsJoinCriteria(wp_table('categories'), 'category_id', 'cat_ID'));
         $postObjects =& $postHandler->getObjects($_post_id_criteria, false, 'ID, category_id, cat_name, category_nicename, category_description, category_parent', true, $_joinCriteria);
         foreach ($postObjects as $postObject) {
             $_cat->ID = $postObject->getVar('ID');
             $_cat->category_id = $postObject->getExtraVar('category_id');
             $_cat->cat_name = $postObject->getExtraVar('cat_name');
             $_cat->category_nicename = $postObject->getExtraVar('category_nicename');
             $_cat->category_description = $postObject->getExtraVar('category_description');
             $_cat->category_parent = $postObject->getExtraVar('category_parent');
             $GLOBALS['category_cache'][wp_id()][$postObject->getVar('ID')][] =& $_cat;
             unset($_cat);
         }
         // Do the same for comment numbers
         $_criteria =& new CriteriaCompo(new Criteria('post_status', 'publish'));
         $_criteria->add(new Criteria('comment_approved', '1 '));
         $_criteria->add($_post_id_criteria);
         $_criteria->setGroupBy('ID');
         $_joinCriteria =& new XoopsJoinCriteria(wp_table('comments'), 'ID', 'comment_post_ID');
         $postObjects =& $postHandler->getObjects($_criteria, false, 'ID, COUNT( comment_ID ) AS ccount', false, $_joinCriteria);
         foreach ($postObjects as $postObject) {
             $GLOBALS['comment_count_cache'][wp_id()]['' . $postObject->getVar('ID')] = $postObject->getExtraVar('ccount');
         }
     }
     $blog = 1;
     $block = array();
     $block['use_theme_template'] = get_xoops_option(wp_mod(), 'use_theme_template');
     $block['style'] = block_style_get(false);
     $block['divid'] = 'wpBlockContent' . $wp_num;
     $block['template_content'] = "";
     $i = 0;
     $GLOBALS['previousday'] = 0;
     foreach ($lposts as $post) {
         $GLOBALS['post'] = $post;
         if ($block['use_theme_template'] == 0) {
             $content = array();
             start_wp();
             $content['date'] = the_date($GLOBALS['dateformat'], '', '', false);
             $content['time'] = the_time('', false);
             $content['title'] = the_title('', '', false);
             $content['permlink'] = get_permalink();
             $content['author'] = the_author_posts_link('', false);
             $content['category'] = the_category('', '', false);
             $content['body'] = the_content(_WP_TPL_MORE, 0, '', false);
             $content['linkpage'] = link_pages('<br />Pages: ', '<br />', 'number', 'next page', 'previous page', '%', '', false);
             if (get_xoops_option(wp_mod(), 'wp_use_xoops_comments') == 0) {
                 $content['comments'] = comments_popup_link(_WP_TPL_COMMENT0, _WP_TPL_COMMENT1, _WP_TPL_COMMENTS, '', 'Comments Off', false);
             } else {
                 $content['comments'] = xcomments_popup_link(_WP_TPL_COMMENT0, _WP_TPL_COMMENT1, _WP_TPL_COMMENTS, '', 'Comments Off', false);
                 $content['comments'] .= " | ";
                 $content['comments'] .= comments_popup_link(_WP_TPL_COMMENT0, _WP_TPL_COMMENT1, _WP_TPL_COMMENTS, '', 'Comments Off', false);
             }
             $content['trackback'] = trackback_rdf(0, false);
             $block['contents'][] = $content;
         } else {
             ob_start();
             include get_custom_path('content_block-template.php');
             $block['template_content'] .= ob_get_contents();
             ob_end_clean();
         }
     }
     $GLOBALS['previousday'] = 0;
     $GLOBALS['day'] = 0;
     $GLOBALS['comment_count_cache'][wp_id()] = array();
     return $block;
 }
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:93,代码来源:wp_contents.php


示例17: wp_mail_receive


//.........这里部分代码省略.........
                echo "<p><b>Error: Wrong Login.</b></p></div>\n";
                continue;
            }
            $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, $GLOBALS['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);
                    $content = xmlrpc_removepostdata($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')) {
                    $content = preg_replace('|\\n([^\\n])|', " \$1", trim($content));
                    $content_before = "";
                    $content_after = "";
                    for ($i = 0; $i < count($attaches); $i++) {
                        $create_thumbs = $attaches[$i]['type'] == 'mix' ? 1 : 0;
                        list($file_name, $is_img, $orig_name) = wp_getattach($attaches[$i]['body'], "user-" . trim($post_author), $create_thumbs);
                        if ($file_name) {
                            if ($attaches[$i]['type'] == 'relate') {
                                $content = preg_replace("/cid:" . preg_quote($attaches[$i]['id']) . "/", get_settings('fileupload_url') . '/' . $file_name, $content);
                            } else {
                                if (isset($img_target) && $img_target) {
                                    $img_target = ' target="' . $img_target . '"';
                                } else {
                                    $img_target = '';
                                }
                                if ($is_img) {
                                    if (file_exists(get_settings('fileupload_realpath') . "/thumb-" . $file_name)) {
                                        $content_before .= "<a href=\"" . get_settings('fileupload_url') . '/' . rawurlencode($file_name) . "\"" . $img_target . "><img style=\"float: left;\" hspace=\"6\" src=\"" . get_settings('fileupload_url') . '/thumb-' . rawurlencode($file_name) . "\" alt=\"" . $orig_name . "\" title=\"" . $orig_name . "\" /></a>";
                                    } else {
                                        $content_before .= "<a href=\"" . get_settings('fileupload_url') . '/' . rawurlencode($file_name) . "\"" . $img_target . "><img style=\"float: left;\" hspace=\"6\" src=\"" . get_settings('fileupload_url') . '/' . rawurlencode($file_name) . "\" alt=\"" . $orig_name . "\" title=\"" . $orig_name . "\" /></a>";
                                    }
                                } else {
                                    $content_after .= "<a href=\"" . wp_siteurl() . "/wp-download.php?from=" . rawurlencode($file_name) . "&amp;fname=" . urlencode($orig_name) . "\"" . $img_target . "><img style=\"float: left;\" hspace=\"6\" src=\"" . wp_siteurl() . "/wp-images/file.gif\" alt=\"" . $orig_name . "\" title=\"" . $orig_name . "\" />" . $orig_name . "</a>";
                                }
                            }
                        }
                    }
                    $content = $content_before . $content . "<br clear=\"left\" />" . $content_after;
                    $postHandler =& wp_handler('Post');
                    $postObject =& $postHandler->create();
                    $postObject->setVar('post_content', $content, true);
                    $postObject->setVar('post_title', trim(mb_conv($post_title, $GLOBALS['blog_charset'], $sub_charset)), true);
                    $postObject->setVar('post_date', $post_date, true);
                    $postObject->setVar('post_author', $post_author, true);
                    $postObject->setVar('post_category', $post_category[0], true);
                    $postObject->setVar('post_name', sanitize_title($post_title), true);
                    if ($flat < 500) {
                        $postObject->setVar('post_lat', $flat, true);
                        $postObject->setVar('post_lon', $flon, true);
                    }
                    $postObject-> 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP wp_hash函数代码示例发布时间:2022-05-23
下一篇:
PHP wp_handle_upload函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap