bugfix système de commentaire
This commit is contained in:
parent
f6b5aac244
commit
43bd663cb3
3 changed files with 21 additions and 20 deletions
|
|
@ -340,7 +340,7 @@ else if ( $_GET['action'] == 'topic') {
|
||||||
FROM
|
FROM
|
||||||
'.$db->prefix.'topics AS t
|
'.$db->prefix.'topics AS t
|
||||||
WHERE
|
WHERE
|
||||||
t.subject="'.$_GET['ttitle'].'"
|
t.subject="'.utf8_decode($_GET['ttitle']).'"
|
||||||
|
|
||||||
;';
|
;';
|
||||||
|
|
||||||
|
|
@ -361,10 +361,6 @@ else if ( $_GET['action'] == 'topic') {
|
||||||
ORDER BY
|
ORDER BY
|
||||||
p.edited
|
p.edited
|
||||||
;';
|
;';
|
||||||
} else {
|
|
||||||
|
|
||||||
error( 'Unable to fetch posts list, you must ask for a topic id or title', __FILE__, __LINE__, $db->error() );
|
|
||||||
}
|
|
||||||
|
|
||||||
$result = $db->query($sql) or error('Unable to fetch posts list', __FILE__, __LINE__, $db->error());
|
$result = $db->query($sql) or error('Unable to fetch posts list', __FILE__, __LINE__, $db->error());
|
||||||
|
|
||||||
|
|
@ -382,6 +378,10 @@ else if ( $_GET['action'] == 'topic') {
|
||||||
|
|
||||||
echo '<li>'.$subject_truncated.'</li>';
|
echo '<li>'.$subject_truncated.'</li>';
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// No error for a nice show in strip-it :-)
|
||||||
|
//error( 'Unable to fetch posts list, you must ask for a topic id or title', __FILE__, __LINE__, $db->error() );
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ $fid = isset($_GET['fid']) ? intval($_GET['fid']) : 0;
|
||||||
// Must ask for the topic title AND the forum id
|
// Must ask for the topic title AND the forum id
|
||||||
// http://localhost/~nojhan/punbb/upload/post.php?ttitle=Strip-It&fid=1
|
// http://localhost/~nojhan/punbb/upload/post.php?ttitle=Strip-It&fid=1
|
||||||
|
|
||||||
$ttitle = isset($_GET['ttitle']) ? $_GET['ttitle'] : '';
|
$ttitle = isset($_GET['ttitle']) ? utf8_decode($_GET['ttitle']) : '';
|
||||||
|
|
||||||
if ($ttitle != '') {
|
if ($ttitle != '') {
|
||||||
// query a topic id on title match
|
// query a topic id on title match
|
||||||
|
|
@ -67,7 +67,7 @@ if ($ttitle != '') {
|
||||||
|
|
||||||
$ids = $db->fetch_row($result);
|
$ids = $db->fetch_row($result);
|
||||||
|
|
||||||
var_dump( $ids );
|
//var_dump( $ids );
|
||||||
|
|
||||||
// fetch only one value
|
// fetch only one value
|
||||||
$_tid = intval( $ids[0] );
|
$_tid = intval( $ids[0] );
|
||||||
|
|
@ -83,6 +83,7 @@ if ($ttitle != '') {
|
||||||
|
|
||||||
// the topic does not exists, but as a title is suggested, we put it in the entry field
|
// the topic does not exists, but as a title is suggested, we put it in the entry field
|
||||||
$_POST['req_subject'] = $ttitle;
|
$_POST['req_subject'] = $ttitle;
|
||||||
|
$subject = $ttitle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -423,7 +423,7 @@ class strip_manager
|
||||||
// if one want to use punbb as forum
|
// if one want to use punbb as forum
|
||||||
if( $this->general->use_punbb ) {
|
if( $this->general->use_punbb ) {
|
||||||
// lasts posts associated to the strip
|
// lasts posts associated to the strip
|
||||||
$fh = fopen( $this->general->forum.'/extern.php?action=topic&tid=1', 'r');
|
$fh = fopen( $this->general->forum.'/extern.php?action=topic&ttitle='.urlencode($this->title), 'r');
|
||||||
|
|
||||||
if (!$fh) {
|
if (!$fh) {
|
||||||
// TODO traduction
|
// TODO traduction
|
||||||
|
|
@ -434,7 +434,7 @@ class strip_manager
|
||||||
}
|
}
|
||||||
|
|
||||||
// link for posting a new comment
|
// link for posting a new comment
|
||||||
$this->forum_post_url = $this->general->forum . '/post.php?ttitle='.$this->title.'&fid='.$this->general->punbb_forum_id;
|
$this->forum_post_url = $this->general->forum . '/post.php?ttitle='.urlencode($this->title).'&fid='.$this->general->punbb_forum_id;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue