viss_kedaas Posted August 9, 2005 Report Share Posted August 9, 2005 (edited) Kā lai uztaisa tā, lai ja lietotājs nevēlas, lai viņam parāda smailijus, tad parādas teksts, piemēram, ":)' , bet ja vēlas tad parādīsies "<img src ...." ? Visu uztaisīt varu, bet nesanāk tas, ja smailiji ir OFF tad lai parāda ":)" alt neder. Domāju uztaisīt ar strip_tags, bet izsvītros visu tagu un neparādīs tekstu ... :( P.S. pirms teksta ierakstīšanas failā jau ierakstas kā "<img ... " Edited August 9, 2005 by viss_kedaas Link to comment Share on other sites More sharing options...
Robis Posted August 9, 2005 Report Share Posted August 9, 2005 Ja nemaldos, smailiju parāda pie posta attēlošanas. Tātad, katram postam ir jābūt iespējai smiley on/off. Link to comment Share on other sites More sharing options...
Ugga Posted August 9, 2005 Report Share Posted August 9, 2005 (edited) str_replace vai ereg_replace visp labaak lai db ierakstaas kaut kas taads :smile: un ja useris veelas tad uztaisi "<img...", ja nee tad aizvieto ar ":)". var arii vienkaarshaak. Edited August 9, 2005 by Ugga Link to comment Share on other sites More sharing options...
Robis Posted August 9, 2005 Report Share Posted August 9, 2005 If ($smileys==1) { $stringi = str_replace($stringi, "<img src='img/smileys/smile1.gif' />", ":)"); $stringi = str_replace($stringi, "<img src='img/smileys/smile2.gif' />", ";)"); $stringi = str_replace($stringi, "<img src='img/smileys/smile3.gif' />", ":P"); // utt. } Link to comment Share on other sites More sharing options...
viss_kedaas Posted August 9, 2005 Author Report Share Posted August 9, 2005 tnx ;) Link to comment Share on other sites More sharing options...
Klez Posted August 9, 2005 Report Share Posted August 9, 2005 (edited) strtr Edited August 9, 2005 by Klez Link to comment Share on other sites More sharing options...
Recommended Posts