Menu

#82 Add_Post Bugs

open
nobody
None
5
2006-09-26
2006-09-26
No

The function add_post does not work the way it should
be. When I use it, it adds a new post but does not show
the new post on the SDK page. No matter how many times
I try reloading it. It also will not show smilies no
matter what I set the value disableemos to. I set it to
false they don't show up, if I set it to True same effect.

Here is my code I used, granted I am using
Object-oriented programming here.

function add_comment_box() {

$this->SDK_ERROR = $GLOBALS['SDK']->sdk_error();
$error_message = $this->SDK_ERROR;
$topic = intval($_POST['topicid']);
$post = $_POST['post'];

if (isset($_POST['topicid']) AND
is_numeric($_POST['topicid']) AND isset($_POST['post'])) {

if ($GLOBALS['SDK']->add_post ($topic, $post, 0, 0, 0)) {
$comment_box = '<div class="center"><p><b>Your Post
has been added</b></p></div><br />';
} else {
$comment_box = '<div class="errorwrap"><h4>The error
returned was:</h4><p>{$error_message}</p></div><br />';
}
} else {
$comment_box .= <<<EOF
<form action="" method="post">
<input type="hidden" name="topicid"
value="{$_GET['id']}" />
<h1 class="center">Fast Reply</h1>
<div class="center"><textarea name="post" cols="50"
rows="8"></textarea></div>
<div class="center"><input type="Submit" value="Add
Comment" /></div>
</form>
EOF;
}
return($comment_box);

}

Discussion


Log in to post a comment.