private function replaceEmotion($discuss)
 {
     if (preg_match_all("/\\[(.*?)\\]/is", $discuss, $out)) {
         if (count($out) <= 0) {
             return $discuss;
         }
         foreach ($out[0] as $emo) {
             $res = EmotionService::getIconByName($emo);
             $icon = $res['icon'];
             if (!empty($icon)) {
                 $emoHtml = "<img src='{$icon}' >";
                 $discuss = str_replace($emo, $emoHtml, $discuss);
             }
         }
     }
     return $discuss;
 }
Exemple #2
0
function queryAll()
{
    $data = EmotionService::queryAllEmotion();
    echo json_encode($data);
}