début de gestion des commentaires avec punbb

This commit is contained in:
nojhan 2008-04-22 19:35:44 +00:00
commit 596b5dee05
2 changed files with 28 additions and 2 deletions

View file

@ -52,6 +52,16 @@ class configuration
*/ */
var $forum = 'http://perdu.com'; var $forum = 'http://perdu.com';
/**
* Use PunBB integration ?
*/
var $use_punbb = false;
/**
* PunBB's forum ID to use for strips comment
*/
var $punbb_forum_id = '1';
/** /**
* Additional URL * Additional URL
*/ */

View file

@ -131,6 +131,11 @@ class strip_manager
*/ */
var $current_id = 0; var $current_id = 0;
/**
* Comments associated to a strip
*/
var $comments = '';
/** /**
* Additional variables * Additional variables
* *
@ -273,13 +278,24 @@ class strip_manager
// Description // Description
preg_match_all('/<dc:description>(.*?)<\/dc:description>/is', $data, $matches); preg_match_all('/<dc:description>(.*?)<\/dc:description>/is', $data, $matches);
//$this->description = str_replace( "\n", '<br/>', html_entity_decode( $matches[1][0] ) ); $this->description = str_replace( "\n", '<br/>', html_entity_decode( $matches[1][0] ) );
$this->description = html_entity_decode( $matches[1][0] ); //$this->description = html_entity_decode( $matches[1][0] );
// All the texts inside the SVG // All the texts inside the SVG
preg_match_all('/">(.*?)<\/tspan>/i',$data,$matches); preg_match_all('/">(.*?)<\/tspan>/i',$data,$matches);
$this->text = html_entity_decode( implode( $matches[1], "\n" ) ); $this->text = html_entity_decode( implode( $matches[1], "\n" ) );
} }
if( $this->general->use_punbb ) {
// TODO : url en fonction du mod punbb
$fh = fopen($this->general->forum . '/post.php?ttitle=TODO&fid=TODO', 'r');
if (!$fh) {
$this->comments = "Impossible de lire les commentaires.";
} else {
$this->comments = stream_get_contents($fh);
fclose($fh);
}
}
} }