Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
$message = str_replace("(happy)","<img src=емотиконка.gif>",$message);
<?php
$query = mysql_query("SELECT * FROM `chat` ORDER BY id DESC")or die(mysql_error()."<br />ред: ".__LINE__);
while ($row = mysql_fetch_array($query)) {
$text =$row['text'];
if($row[username] == admin){
echo "<font color="red">$text</font><br />";
}
else{
echo "$text<br />";
}
}
?>
proba каза:Примерно като напишеш в чата "(happy)" за да ти го изкара на картинка а не надпис - ще стане с този код:
$message = str_replace("(happy)","<img src=емотиконка.gif>",$message);
И така за всички емотиконки добавяш по 1 ред.
<?php
include "конфиг файл";
$query = mysql_query("SELECT * FROM `chat` ORDER BY id DESC")or die(mysql_error()."<br />ред: ".__LINE__);
while ($row = mysql_fetch_array($query)) {
$text =$row['text'];
$text = str_replace("(happy)","<img src=емотиконка.gif>",$text);
$text = str_replace("(sad)","<img src=емотиконка2.gif>",$text);
$text = str_replace("(rofl)","<img src=емотиконка3.gif>",$text);
if($row[username] == admin){
echo "<font color="red">$text</font><br />";
}
else{
echo "$text<br />";
}
}
?>