[ Index ] |
|
Code source de LifeType 1.2.4 |
[Code source] [Imprimer] [Statistiques]
(pas de description)
Poids: | 257 lignes (11 kb) |
Inclus ou requis: | 0 fois |
Référencé: | 3 fois |
Nécessite: | 0 fichiers |
TrackbackClient:: (7 méthodes):
TrackbackClient()
getTrackbackLinks()
fetchPage()
sendTrackback()
_buildResult()
sendTrackbacks()
sendDirectTrackbacks()
Classe: TrackbackClient - X-Ref
Implementation of a very simple Trackback client. It is capable of autodiscoveringTrackbackClient() X-Ref |
Constructor. |
getTrackbackLinks( $page, $pageUrl = "" ) X-Ref |
Uses a very simple regexp to find all the trackback:ping attributes in a page, but it works without having to use an xml parser which would complicate things a little... param: page The html code which contains the RDF references embedded. param: pageUrl Additionally, we can have the url of the page so that we can return: Returns an array of urls which are the trackbackurls that have been |
fetchPage( $url ) X-Ref |
Fetches a page from the given url. param: url The url with the page we would like to fetch. return: Returns a string with the contents of the page or an empty string if the page |
sendTrackback( $trackbackUrl, $article, $blogInfo ) X-Ref |
Sends a trackback ping to the given url. param: trackbackUrl the url where to send the trackback ping. param: article The article object that is pinging the remote host. param: blogName The name of the blog sending the trackback ping return: Returns true if successful or false otherwise. |
_buildResult( $url, $code ) X-Ref |
Private function that builds an array with the results for the sendTrackbacks function. param: url The original url where we tried to send a trackback ping. param: code Our own internal error code. return: Returns an array with two positions, the first one with the url |
sendTrackbacks( $links, $article, $blogName ) X-Ref |
Tries to autodiscover the trackback links in the pages given as parameters. The first parameter is an array of urls to blog permalinks which are the urls where we would like to try to send trackback pings. The trackback urls will be autodiscovered and then we will attempt to send a trackback link if available. The result of this function is another array of arrays, where for every position we will have another array with two positions: <b>"url"</b> will be the original url and <b>"status"</b> will be a value identifying what happened:<ul> <li>TRACKBACK_SUCCESS: Trackback was successfully sent</li> <li>TRACKBACK_FAILED: There was some kind of problem sending the trackback</li> <li>TRACKBACK_UNAVAILABLE: the page did not specify any trackback link.</li> </ul> param: links An array with the urls where we would like to try and send trackback pings. param: article The Article object with the information we need to send the ping. param: blogName The name of the blog that is sending the information. |
sendDirectTrackbacks( $trackbacks, $article, $blogName ) X-Ref |
Send trackbacks directly. The result of this function is another array of arrays, where for every position we will have another array with two positions: <b>"url"</b> will be the original url and <b>"status"</b> will be a value identifying what happened:<ul> <li>TRACKBACK_SUCCESS: Trackback was successfully sent</li> <li>TRACKBACK_FAILED: There was some kind of problem sending the trackback</li> </ul> param: trackbacks An array with the urls where we would like to try and send trackback pings. param: article The Article object with the information we need to send the ping. param: blogName The name of the blog that is sending the information. |
Généré le : Mon Nov 26 21:04:15 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |