Forum Moderators: coopster
Also i will need the comments to be linked to the blog per subject.
I have been messing around with other blogging systems but nothing as simple as i need.
I just need the comments to come up with the blog.
Many Thanks
if($res) {
while ($newArray = mysqli_fetch_array($res, MYSQLI_ASSOC)) {
$id = $newArray['blog_id'];
$date = $newArray['date'];
$title = $newArray['title'];
$main = $newArray['main'];
echo "<div id='border'>";
echo "<div class='bg'><div class='subject'>".$id." ".$title. "
" .$date."</div></div>";
echo "<div class='body'>".$title."<div class='body'>".$main."<div class='morelink'><a target='_blank' href=\"comments.php?id=".$id."\">view comments</a></div></div><br>";
echo "</div><br>";
i have a problem with punctuation marks coming up as ?
Are you writing your copy in Word and then cut/pasting it? If so, it is a problem with Word's special characters.
Depending on your platform, you may be able to solve some of the problem with character encoding. But, you will probably need more, as discussed in this thread [webmasterworld.com]
I ended up with the following which took care of much of the problem:
function cleanUpHTML($text)
{
//discard unwanted tags
$text = strip_tags($text, '<b><i><ol><ul><li>');
//strip header stuff
$text = stristr($text, '<p');
//strip all attributes (word garbage)
$text = preg_replace("/<(\w)[^>]*?>/s", "<$1>", $text);
//get rid of useless non breaking spaces
$text = preg_replace("/ /", "", $text);
//get rid of empty p's
$text = preg_replace("/<p><\/p>/i", "", $text);
$text = mb_convert_encoding($text, "EUCJP-WIN", "UTF-8");
return $text;
}
table 1: comments (id, blog_id, name, comments)
table 2: blog_board (id, blog_id, date, title, main)
result
displays (title) (date) here
displays (main) here
then
display (comment) here
but only the comments and blog (main) that are linked to the blog_id numbers.
Hope this makes sense