<?php

function smiles($msg) {
    $db = new db;
    $q = $db->query("SELECT * FROM smiles_spis");
    while ($post = $db->get_row($q)) {
        $msg = str_replace($post['sim'], "<img src='/style/smiles/$post[name].png' alt='$post[name]' />", $msg);
    }
    return $msg;
}
