Documentation

GetPing

void
CBlogTrackback::GetPing(
 string blogUrl,
 int    postID,
 array  arParams
);

The method receives and saves arParams of a Trackback queries for the blog post with postID and with blogUrl address. Non-static method.

Method parameters

ParameterDescription
blogUrl Blog address.
postID Blog post ID.
arParams Array of Trackback query parameters:
  • title - required, Trackback title;
  • url - required, Trackback URL address;
  • excerpt - Trackback text;
  • blog_name - name of the blog.
Optional parameter.

Examples of use

<?
if (CModule::IncludeModule("blog"))
{
    $postID = IntVal($postID);
    $blogUrl = Trim($blogUrl);

    if (strtoupper($_SERVER["REQUEST_METHOD"]) != "POST")
    {
        LocalRedirect(CBlogPost::PreparePath($blogUrl, $postID));
        die();
    }

    $arParams = array();
    if (isset($_REQUEST))
    {
        if (isset($_REQUEST["title"]))
            $arParams["title"] = $_REQUEST["title"];
        if (isset($_REQUEST["url"]))
            $arParams["url"] = $_REQUEST["url"];
        if (isset($_REQUEST["excerpt"]))
            $arParams["excerpt"] = $_REQUEST["excerpt"];
        if (isset($_REQUEST["blog_name"]))
            $arParams["blog_name"] = $_REQUEST["blog_name"];
    }

    CBlogTrackback::GetPing($blogUrl, $postID, $arParams);
}
?>


© «Bitrix24», 2001-2024
Up