当前位置: 首页>>代码示例>>PHP>>正文


PHP trackback函数代码示例

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


在下文中一共展示了trackback函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: trackbacks

/**
 * trackbacks(-)
 *
 * Do multiple trackbacks
 *
 * fplanque: added
 */
function trackbacks($post_trackbacks, $Item)
{
    global $Messages;
    $excerpt = $Item->get_excerpt();
    $Messages->add(T_('Excerpt sent in trackbacks:') . ' ' . $excerpt, 'note');
    $trackback_urls = preg_split('/( )+/', $post_trackbacks, 10);
    // fplanque: ;
    foreach ($trackback_urls as $tb_url) {
        // trackback each url:
        $tb_url = trim($tb_url);
        if (empty($tb_url)) {
            continue;
        }
        trackback($tb_url, $Item->title, $excerpt, $Item->ID, $Item->get_permanent_url('', '', '&'));
    }
}
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:23,代码来源:_trackback.funcs.php

示例2: trackbacks

/**
 * trackbacks(-)
 *
 * Do multiple trackbacks
 *
 * fplanque: added
 */
function trackbacks($post_trackbacks, $content, $post_title, $post_ID)
{
    global $Messages;
    $excerpt = strlen(strip_tags($content)) > 255 ? substr(strip_tags($content), 0, 252) . '...' : strip_tags($content);
    $Messages->add(T_('Excerpt sent in trackbacks:') . ' ' . $excerpt, 'note');
    $trackback_urls = split('( )+', $post_trackbacks, 10);
    // fplanque: ;
    foreach ($trackback_urls as $tb_url) {
        // trackback each url:
        $tb_url = trim($tb_url);
        if (empty($tb_url)) {
            continue;
        }
        trackback($tb_url, $post_title, $excerpt, $post_ID);
    }
}
开发者ID:LFSF,项目名称:oras,代码行数:23,代码来源:_trackback.funcs.php

示例3: trackback_url_list

/**
 * Do trackbacks for a list of URLs.
 *
 * @since 1.0.0
 *
 * @param string $tb_list Comma separated list of URLs
 * @param int $post_id Post ID
 */
function trackback_url_list($tb_list, $post_id)
{
    if (!empty($tb_list)) {
        // get post data
        $postdata = wp_get_single_post($post_id, ARRAY_A);
        // import postdata as variables
        extract($postdata, EXTR_SKIP);
        // form an excerpt
        $excerpt = strip_tags($post_excerpt ? $post_excerpt : $post_content);
        if (strlen($excerpt) > 255) {
            $excerpt = substr($excerpt, 0, 252) . '...';
        }
        $trackback_urls = explode(',', $tb_list);
        foreach ((array) $trackback_urls as $tb_url) {
            $tb_url = trim($tb_url);
            trackback($tb_url, stripslashes($post_title), $excerpt, $post_id);
        }
    }
}
开发者ID:BGCX261,项目名称:zombie-craft-svn-to-git,代码行数:27,代码来源:post.php

示例4: trackback_url_list

/**
 * Do trackbacks for a list of URLs.
 *
 * @since 1.0.0
 *
 * @param string $tb_list Comma separated list of URLs.
 * @param int    $post_id Post ID.
 */
function trackback_url_list($tb_list, $post_id)
{
    if (!empty($tb_list)) {
        // Get post data.
        $postdata = get_post($post_id, ARRAY_A);
        // Form an excerpt.
        $excerpt = strip_tags($postdata['post_excerpt'] ? $postdata['post_excerpt'] : $postdata['post_content']);
        if (strlen($excerpt) > 255) {
            $excerpt = substr($excerpt, 0, 252) . '…';
        }
        $trackback_urls = explode(',', $tb_list);
        foreach ((array) $trackback_urls as $tb_url) {
            $tb_url = trim($tb_url);
            trackback($tb_url, wp_unslash($postdata['post_title']), $excerpt, $post_id);
        }
    }
}
开发者ID:SayenkoDesign,项目名称:ividf,代码行数:25,代码来源:post.php

示例5: do_trackbacks

function do_trackbacks($post_id) {
	global $wpdb;

	$post = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID = $post_id");
	$to_ping = get_to_ping($post_id);
	$pinged  = get_pung($post_id);
	if ( empty($to_ping) ) {
		$wpdb->query("UPDATE $wpdb->posts SET to_ping = '' WHERE ID = '$post_id'");
		return;
	}
	
	if (empty($post->post_excerpt))
		$excerpt = apply_filters('the_content', $post->post_content);
	else
		$excerpt = apply_filters('the_excerpt', $post->post_excerpt);
	$excerpt = str_replace(']]>', ']]>', $excerpt);
	$excerpt = strip_tags($excerpt);
	if ( function_exists('mb_strcut') ) // For international trackbacks
    	$excerpt = mb_strcut($excerpt, 0, 252, get_settings('blog_charset')) . '...';
	else
		$excerpt = substr($excerpt, 0, 252) . '...';

	$post_title = apply_filters('the_title', $post->post_title);
	$post_title = strip_tags($post_title);

	if ($to_ping) : foreach ($to_ping as $tb_ping) :
		$tb_ping = trim($tb_ping);
		if ( !in_array($tb_ping, $pinged) ) {
			trackback($tb_ping, $post_title, $excerpt, $post_id);
			$pinged[] = $tb_ping;
		} else {
			$wpdb->query("UPDATE $wpdb->posts SET to_ping = TRIM(REPLACE(to_ping, '$tb_ping', '')) WHERE ID = '$post_id'");
		}
	endforeach; endif;
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:35,代码来源:functions-post.php

示例6: do_trackbacks

/**
 * Perform trackbacks.
 *
 * @since 1.5.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param int $post_id Post ID to do trackbacks on.
 */
function do_trackbacks($post_id)
{
    global $wpdb;
    $post = get_post($post_id);
    $to_ping = get_to_ping($post_id);
    $pinged = get_pung($post_id);
    if (empty($to_ping)) {
        $wpdb->update($wpdb->posts, array('to_ping' => ''), array('ID' => $post_id));
        return;
    }
    if (empty($post->post_excerpt)) {
        /** This filter is documented in wp-includes/post-template.php */
        $excerpt = apply_filters('the_content', $post->post_content, $post->ID);
    } else {
        /** This filter is documented in wp-includes/post-template.php */
        $excerpt = apply_filters('the_excerpt', $post->post_excerpt);
    }
    $excerpt = str_replace(']]>', ']]>', $excerpt);
    $excerpt = wp_html_excerpt($excerpt, 252, '…');
    /** This filter is documented in wp-includes/post-template.php */
    $post_title = apply_filters('the_title', $post->post_title, $post->ID);
    $post_title = strip_tags($post_title);
    if ($to_ping) {
        foreach ((array) $to_ping as $tb_ping) {
            $tb_ping = trim($tb_ping);
            if (!in_array($tb_ping, $pinged)) {
                trackback($tb_ping, $post_title, $excerpt, $post_id);
                $pinged[] = $tb_ping;
            } else {
                $wpdb->query($wpdb->prepare("UPDATE {$wpdb->posts} SET to_ping = TRIM(REPLACE(to_ping, %s, '')) WHERE ID = %d", $tb_ping, $post_id));
            }
        }
    }
}
开发者ID:hadywisam,项目名称:WordPress,代码行数:43,代码来源:comment-functions.php

示例7: do_trackback

 function do_trackback($postObject, $useutf8, $target_charset = "")
 {
     $pinged = explode("\n", $postObject->getVar('pinged'));
     $to_ping = $postObject->getVar('to_ping');
     if ('' != $to_ping) {
         if (strlen($postObject->getVar('post_excerpt')) > 0) {
             $the_excerpt = apply_filters('the_excerpt', $postObject->getVar('post_excerpt'));
         } else {
             $the_excerpt = apply_filters('the_content', $postObject->getVar('post_content'));
         }
         $the_excerpt = strlen(strip_tags($the_excerpt)) > 255 ? substr(strip_tags($the_excerpt), 0, 252) . '...' : strip_tags($the_excerpt);
         $excerpt = $the_excerpt;
         $to_pings = explode("\n", $to_ping);
         if ($useutf8 == "1") {
             $target_charset = 'UTF-8';
         }
         $ping_charset = $target_charset;
         foreach ($to_pings as $tb_ping) {
             $tb_ping = trim($tb_ping);
             if (!in_array($tb_ping, $pinged)) {
                 trackback($tb_ping, $postObject->getVar('post_title'), $excerpt, $postObject->getVar('ID'), $ping_charset);
             }
         }
     }
 }
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:25,代码来源:admin-functions.php

示例8: do_trackbacks

/**
 * Perform trackbacks.
 *
 * @since 1.5.0
 * @uses $wpdb
 *
 * @param int $post_id Post ID to do trackbacks on.
 */
function do_trackbacks($post_id)
{
    global $wpdb;
    $post = $wpdb->get_row($wpdb->prepare("SELECT * FROM {$wpdb->posts} WHERE ID = %d", $post_id));
    $to_ping = get_to_ping($post_id);
    $pinged = get_pung($post_id);
    if (empty($to_ping)) {
        $wpdb->query($wpdb->prepare("UPDATE {$wpdb->posts} SET to_ping = '' WHERE ID = %d", $post_id));
        return;
    }
    if (empty($post->post_excerpt)) {
        $excerpt = apply_filters('the_content', $post->post_content);
    } else {
        $excerpt = apply_filters('the_excerpt', $post->post_excerpt);
    }
    $excerpt = str_replace(']]>', ']]>', $excerpt);
    $excerpt = wp_html_excerpt($excerpt, 252) . '...';
    $post_title = apply_filters('the_title', $post->post_title);
    $post_title = strip_tags($post_title);
    if ($to_ping) {
        foreach ((array) $to_ping as $tb_ping) {
            $tb_ping = trim($tb_ping);
            if (!in_array($tb_ping, $pinged)) {
                trackback($tb_ping, $post_title, $excerpt, $post_id);
                $pinged[] = $tb_ping;
            } else {
                $wpdb->query($wpdb->prepare("UPDATE {$wpdb->posts} SET to_ping = TRIM(REPLACE(to_ping, '{$tb_ping}', '')) WHERE ID = %d", $post_id));
            }
        }
    }
}
开发者ID:SymbiSoft,项目名称:litprojects,代码行数:39,代码来源:comment.php

示例9: trackback_url_list

function trackback_url_list($tb_list, $post_id)
{
    if (!empty($tb_list)) {
        // get post data
        $postdata = wp_get_single_post($post_id, ARRAY_A);
        // form an excerpt
        $excerpt = strip_tags($postdata['post_excerpt'] ? $postdata['post_excerpt'] : $postdata['post_content']);
        if (strlen($excerpt) > 255) {
            $excerpt = substr($excerpt, 0, 252) . '...';
        }
        $trackback_urls = explode(',', $tb_list);
        foreach ($trackback_urls as $tb_url) {
            $tb_url = trim($tb_url);
            trackback($tb_url, $postdata['post_title'], $excerpt, $post_id);
        }
    }
}
开发者ID:nobunobuta,项目名称:xoops_mod_WordPress,代码行数:17,代码来源:xmlrpc.php

示例10: strlen

             if (strlen($excerpt) > 0) {
                 $the_excerpt = strlen(strip_tags($excerpt)) > 255 ? substr(strip_tags($excerpt), 0, 252) . '...' : strip_tags($excerpt);
             } else {
                 $the_excerpt = strlen(strip_tags($content)) > 255 ? substr(strip_tags($content), 0, 252) . '...' : strip_tags($content);
             }
             $excerpt = stripslashes($the_excerpt);
             $to_pings = explode("\n", $to_ping);
             if ($useutf8 == "1") {
                 $ping_charset = 'UTF-8';
             } else {
                 $ping_charset = '';
             }
             foreach ($to_pings as $tb_ping) {
                 $tb_ping = trim($tb_ping);
                 if (!in_array($tb_ping, $pinged)) {
                     trackback($tb_ping, stripslashes($post_title), $excerpt, $post_ID, $ping_charset);
                 }
             }
         }
     }
     // end if publish
     if ($HTTP_POST_VARS['save']) {
         $location = $_SERVER['HTTP_REFERER'];
     } else {
         $location = 'post.php';
     }
     header('Location: ' . $location);
     break;
 case 'delete':
     $standalone = 1;
     require_once './admin-header.php';
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:31,代码来源:post.php

示例11: urlencode

    $blogname = urlencode($xoopsConfig['sitename']);
    $permalink = urlencode($post->getPermaLink());
    $tburl = urlencode($url);
    $querys = "title={$title}&url={$permalink}&blog_name={$blogname}&excerpt={$excerpt}";
    $url = parse_url($url);
    $http_request = 'POST ' . $url['path'] . (isset($url['query']) ? '?' . $url['query'] : '') . " HTTP/1.0\r\n";
    $http_request .= 'Host: ' . $url['host'] . "\r\n";
    $http_request .= 'Content-Type: application/x-www-form-urlencoded; charset=' . _CHARSET . "\r\n";
    $http_request .= 'Content-Length: ' . strlen($querys) . "\r\n";
    $http_request .= "User-Agent: NaturalPress";
    $http_request .= "\r\n\r\n";
    $http_request .= $querys;
    if (!isset($url['port']) || '' == $url['port']) {
        $url['port'] = 80;
    }
    $fs = @fsockopen($url['host'], $url['port'], $errno, $errstr, 4);
    @fputs($fs, $http_request);
    @fclose($fs);
    return true;
}
$sql = "SELECT id_post, toping FROM " . $db->prefix("mw_posts") . " WHERE toping<>'' LIMIT 0, 2";
$result = $db->query($sql);
while ($row = $db->fetchArray($result)) {
    $tracks = explode(' ', $row['toping']);
    foreach ($tracks as $k) {
        if (trackback($k, new NPPost($row['id_post']))) {
            $db->queryF("UPDATE " . $db->prefix("mw_posts") . " SET pinged = CONCAT(pinged, '\n', '{$k}') WHERE id_post = '{$row['id_post']}'");
            $db->queryF("UPDATE " . $db->prefix("mw_posts") . " SET toping = TRIM(REPLACE(toping, '{$k}', '')) WHERE id_post = '{$row['id_post']}'");
        }
    }
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:31,代码来源:dopings.php

示例12: do_trackback

function do_trackback($post_ID, $post_title, $content, $excerpt, $useutf8, $target_charset = "")
{
    global $wpdb, $wp_id;
    $to_ping = $wpdb->get_var("SELECT to_ping FROM {$wpdb->posts[$wp_id]} WHERE ID = {$post_ID}");
    $pinged = $wpdb->get_var("SELECT pinged FROM {$wpdb->posts[$wp_id]} WHERE ID = {$post_ID}");
    $pinged = explode("\n", $pinged);
    if ('' != $to_ping) {
        if (strlen($excerpt) > 0) {
            $the_excerpt = apply_filters('the_excerpt', $excerpt);
        } else {
            $the_excerpt = apply_filters('the_content', $content);
        }
        $the_excerpt = strlen(strip_tags($the_excerpt)) > 255 ? substr(strip_tags($the_excerpt), 0, 252) . '...' : strip_tags($the_excerpt);
        $excerpt = stripslashes($the_excerpt);
        $to_pings = explode("\n", $to_ping);
        if ($useutf8 == "1") {
            $target_charset = 'UTF-8';
        }
        $ping_charset = $target_charset;
        foreach ($to_pings as $tb_ping) {
            $tb_ping = trim($tb_ping);
            if (!in_array($tb_ping, $pinged)) {
                trackback($tb_ping, stripslashes($post_title), $excerpt, $post_ID, $ping_charset);
            }
        }
    }
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:27,代码来源:admin-functions.php

示例13: do_trackbacks

function do_trackbacks($post_id)
{
    global $wpdb;
    $post = $wpdb->get_row("SELECT * FROM {$wpdb->posts} WHERE ID = {$post_id}");
    $to_ping = get_to_ping($post_id);
    $pinged = get_pung($post_id);
    if (empty($to_ping)) {
        $wpdb->query("UPDATE {$wpdb->posts} SET to_ping = '' WHERE ID = '{$post_id}'");
        return;
    }
    if (empty($post->post_excerpt)) {
        $excerpt = apply_filters('the_content', $post->post_content);
    } else {
        $excerpt = apply_filters('the_excerpt', $post->post_excerpt);
    }
    $excerpt = str_replace(']]>', ']]&gt;', $excerpt);
    $excerpt = strip_tags($excerpt);
    if (function_exists('mb_strcut')) {
        // For international trackbacks
        $excerpt = mb_strcut($excerpt, 0, 252, get_option('blog_charset')) . '...';
    } else {
        $excerpt = substr($excerpt, 0, 252) . '...';
    }
    $post_title = apply_filters('the_title', $post->post_title);
    $post_title = strip_tags($post_title);
    if ($to_ping) {
        foreach ((array) $to_ping as $tb_ping) {
            $tb_ping = trim($tb_ping);
            if (!in_array($tb_ping, $pinged)) {
                trackback($tb_ping, $post_title, $excerpt, $post_id);
                $pinged[] = $tb_ping;
            } else {
                $wpdb->query("UPDATE {$wpdb->posts} SET to_ping = TRIM(REPLACE(to_ping, '{$tb_ping}', '')) WHERE ID = '{$post_id}'");
            }
        }
    }
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:37,代码来源:comment.php

示例14: do_trackbacks

function do_trackbacks($post_id)
{
    global $wpdb;
    $post = $wpdb->get_row("SELECT * FROM {$wpdb->posts} WHERE ID = {$post_id}");
    $to_ping = get_to_ping($post_id);
    $pinged = get_pung($post_id);
    if (empty($to_ping)) {
        return;
    }
    if (empty($post->post_excerpt)) {
        $excerpt = apply_filters('the_content', $post->post_content);
    } else {
        $excerpt = apply_filters('the_excerpt', $post->post_excerpt);
    }
    $excerpt = str_replace(']]>', ']]&gt;', $excerpt);
    $excerpt = strip_tags($excerpt);
    $excerpt = substr($excerpt, 0, 252) . '...';
    $post_title = apply_filters('the_title', $post->post_title);
    $post_title = strip_tags($post_title);
    if ($to_ping) {
        foreach ($to_ping as $tb_ping) {
            $tb_ping = trim($tb_ping);
            if (!in_array($tb_ping, $pinged)) {
                trackback($tb_ping, $post_title, $excerpt, $post_id);
            }
        }
    }
}
开发者ID:BackupTheBerlios,项目名称:steampress-svn,代码行数:28,代码来源:functions-post.php

示例15: trim

         // Trackback time.
         $to_ping = trim($wpdb->get_var("SELECT to_ping FROM {$tableposts} WHERE ID = {$post_ID}"));
         $pinged = trim($wpdb->get_var("SELECT pinged FROM {$tableposts} WHERE ID = {$post_ID}"));
         $pinged = explode("\n", $pinged);
         if ('' != $to_ping) {
             if (strlen($excerpt) > 0) {
                 $the_excerpt = strlen(strip_tags($excerpt)) > 255 ? substr(strip_tags($excerpt), 0, 252) . '...' : strip_tags($excerpt);
             } else {
                 $the_excerpt = strlen(strip_tags($content)) > 255 ? substr(strip_tags($content), 0, 252) . '...' : strip_tags($content);
             }
             $excerpt = stripslashes($the_excerpt);
             $to_pings = explode("\n", $to_ping);
             foreach ($to_pings as $tb_ping) {
                 $tb_ping = trim($tb_ping);
                 if (!in_array($tb_ping, $pinged)) {
                     trackback($tb_ping, stripslashes($post_title), $excerpt, $post_ID);
                 }
             }
         }
     }
     // end if publish
     if ($HTTP_POST_VARS['save']) {
         $location = $_SERVER['HTTP_REFERER'];
     } else {
         $location = 'post.php';
     }
     header('Location: ' . $location);
     break;
 case 'delete':
     $standalone = 1;
     require_once './admin-header.php';
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:31,代码来源:post.php


注:本文中的trackback函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。