WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to send a trackback using rss (1 post)

  1. Cristescu Bogdan
    Member
    Posted 4 years ago #

    I try to make a script which send a trackback to another blog , this being done after another script that is listing a series of articles taken by rss method.
    The trackback function i want to run for each rss links.
    I made a pretty nice code to do that, but i dont know if work or not!
    the code is >

    <?php
    include_once(ABSPATH . WPINC . '/rss.php');
    if($links = get_post_meta($post->ID, "Links", true))
    {
    $rss = fetch_rss("$links");
    if ($rss)
    {
    $items = array_slice($rss->items, 0, 20);
    echo '<ul>';
    if ($trackback = true) {
    foreach ($items as $item)
    {
    $desc = htmlspecialchars(substr(strip_tags($item['description']),0,400));
    echo '<li><a target="_blank" href="'. $item['link'] .'" title="header=[] body=[' . $desc . ']">' . $item['title'] . '</a></li>';
    trackback( $item['link'], $item['title'], "", "" ); }
    
    }
    }
    
    }
    else {
    print 'Nimic de ar─âtat...';
    }
    echo '</ul>';
    ?>

    Can anybody verify my work?

    Thx,
    Cristescu Bogdan

Topic Closed

This topic has been closed to new replies.

About this Topic