Loading...
 
Development

Development


some patch to blog trackback code?

posts: 3

First, sorry for my poor english.
There are some blog implements don't have trackback ping define in blogs, so I want tiki can just take the url as trackback ping, instead of looking the trackback ping in the result.
And one of the implements don't return anything when a trackback ping successed.
So I'm do the following in 1.8 cvs code
lib/blogs/bloglib.php:117
preg_match("/trackback:ping=(\"|\'|\s*)(.+)(\"|\'\s)/", $data, $reqs);

if (!isset($reqs2))
$reqs2 = $track; // if there is no trackback info in page, take the url as tackback ping url
// return $ret;

@$fp = fopen($reqs2, 'r');

if ($fp) {
fclose ($fp);

$submit_url = $reqs2;
$submit_vars%22url%22 = $uri;
$submit_vars%22blog_name%22 = $blog_info'title';
$submit_vars%22url%22 = $uri;
$submit_vars%22blog_name%22 = $blog_info'title';
$submit_vars%22title%22 = $post_info'title' ? $post_info'title' : date("d/m/Y h:i", $post_info'created');
$submit_vars%22title%22 .= ' ' . tra('by'). ' ' . $post_info'user';
$submit_vars%22excerpt%22 = substr($post_info'data', 0, 200);
$snoopy->submit($submit_url, $submit_vars);
$back = $snoopy->results;

if (!$back
!strstr('<error>1</error>', $back)) { // take no result as good result
$ret[] = $track;
}
The diff is :
88a89
>
117c118,119
< return $ret;
---
> $reqs2 = $track;
> // return $ret;
133c135
< if (!strstr('<error>1</error>', $back)) {
---
> if (!$back
!strstr('<error>1</error>', $back)) { // take no result as good result


hope it helps

posts: 2881 United Kingdom

The correct place for sure patches is on the SourceForge project area. They will get lost in the forums here. which are mainly for discussions.

With tiki, when displaying code snippets its wise to encase them with the {CODE()} plugin, to stop TikiWiki from parsing the code as wiki syntax.

Damian