Hello
Below is the code.
I find the problem also happens in this forum, I choose
smiley and ‘:wow:’ displayed
but after I press Preview Post, it display the smiley gif correctly. Is it better immediately display smiley gif instead of ‘:wow:’ otherwise user will be confused.
smileys.php
<?php
class Smileys extends Controller {
function Smileys()
{
parent::Controller();
}
function index()
{
$this->load->helper(‘smiley’);
$this->load->library(‘table’);
$image_array = get_clickable_smileys(‘http://localhost/images/smileys/’);
$col_array = $this->table->make_columns($image_array, 12);
$data[‘smiley_table’] = $this->table->generate($col_array);
$this->load->view(‘smiley_view’, $data);
}
}
smiley_view.php
<html>
<head>
<title>Smileys</title>
<?php echo js_insert_smiley(‘blog’, ‘comments’); ?>
</head>
<body>
<form name=“blog”>
<textarea name=“comments” cols=“40” rows=“4”></textarea>
</form>
Click to insert a smiley!
<?php echo $smiley_table; ?>
<?php
$str = ‘Here are some simileys:
’; $str = parse_smileys($str, “http://localhost/images/smileys/”); echo $str;
?>
</body>
</html>