Вы не зашли.
Главная » PHP » Как ограничить количество смайлов в гостевой?
#1. Walson Off (1)
Участник
2008.07.30 13:01
в Гостевой флудят смайлами.Как сделать чтобы смайлов было не больше пяти или трех смайлов в сообщении?
#2. Gemor
Гость
2008.07.30 14:02
нужен сам код замены символов на смайлы чтобы его модифицировать
#3. Walson Off (1)
Участник
2008.07.30 15:03
Код:
lt;?$url=array("<img src='smile/1.gif' alt=':)'>","<img src='smile/2.gif' alt=':-))'>","<img src='smile/3.gif' alt=';)'>","<img src='smile/4.gif' alt=';-)'>","<img src='smile/5.gif' alt=':('>","<img src='smile/6.gif' alt='8)'>","<img src='smile/7.gif' alt=':D'>","<img src='smile/8.gif' alt=':X'>","<img src='smile/9.gif' alt=':F'>","<img src='smile/10.gif' alt=':?'>","<img src='smile/11.gif' alt=';/'>","<img src='smile/12.gif' alt='%]'>","<img src='smile/13.gif' alt='lol'>","<img src=\"smilean/4empion.gif\" alt=\".4empion.\"/>","<img src=\"smilean/zeva.gif\" alt=\".zeva.\"/>","<img src=\"smilean/zeva2.gif\" alt=\".zeva2.\"/>","<img src=\"smilean/zloy2.gif\" alt=\".zloy2.\"/>","<img src=\"smilean/zubastik2.gif\" alt=\".zubastik2.\"/>","<img src=\"smilean/zybu.gif\" alt=\".zybu.\"/>","<img src=\"smilean/zybu2.gif\" alt=\".zybu2.\"/>");$smile=array(":)",":-))",";)",";-)",":(","8)",":D",":X",":F",":?",";/","%]",":lol:",".4empion.",".4empion2.",".4erep.",".4mak.",".agree.",".airkiss.",".airkiss2.",".alc.",".alien.",".amur.",".angel.",".angel3.",".baby.",".blev.",".bad5.",".bb.",".beee.",".belarus.",".blat.",".blev2.",".blink.",".bog.",".bog2.",".bomb.",".bomb2.",".boo.",".boom.",".bous.",".brovi.",".buba.",".bye.",".canada.",".comp.",".comp2.",".cool2.",".cry3.",".crazy.",".cuklop.",".dance.",".dance2.",".dance3.",".declare.",".donjuan.",".down.",".eric.",".est.",".eto.",".fanat.",".figa.",".fingal.",".flirt.",".france.",".fu.",".fuck.",".fuck2.",".germany.",".girldev.",".good.",".groza.",".haha.",".happy2.",".heart.",".heart2.",".heat.",".hi.",".hihi.",".hlop.",".hz.",".hz2.",".inlove.",".israel.",".mod.",".flood.",".flood2.",".gun.",".kill.",".kill2.",".rupor.",".rtfm2.",".sniper.",".sex.",".translit.",".welcome.",".aaa.",".alc2.",".appl.",".au.",".basket.",".bath.",".bayan.",".bed.",".bis.",".box.",".burya.",".cem.",".chm.",".chmok.",".chmoks.",".dedm.",".dep.",".dev.",".dirol.",".dis.",".dm.",".dms.",".dog.",".draw.",".drinks.",".elka.",".em.",".end.",".fak.",".fans.",".feminist.",".flowers.",".fokus.",".friends.",".fut.",".ghost2.",".gitar.",".gl.",".gorilla.",".gruppa.",".hb.",".horovod.",".hu.",".huk.",".idu.",".ign.",".ir.",".kacheli.",".karate.",".kl.",".konyaka.",".kor.",".kovboi.",".krok.",".kuku.",".kur.",".lebozero.",".love8.",".lyalya.",".lyb.",".mai.",".maniak.",".mel.",".mert.",".minzdrav.",".mogila.",".molba.",".mot.",".nark2.",".nunu2.",".pan.",".pauk.",".pumping.",".re.",".redface.",".repa.",".res.",".rofl.",".salyut.",".shashlik.",".sht.",".shu.",".skleroz.",".skromno.",".sl.",".slad.",".slonik.",".sn.",".sob.",".spam.",".stereo.",".susel.",".tac.",".tel.",".titanic.",".top.",".tor.",".trubadyr.",".tua.",".vel.",".velo.",".ven.",".xhi.",".zag.",".zaluyu.",".zbya.",".zhadina.",".aikido.",".angel7.",".assasin.",".ball.",".buba2.",".censored.",".commando.",".devil6.",".devil7.",".elf.",".help.",".king.",".king2.",".love8.",".meo.",".pala4.",".pomidor.",".pooh2.",".puk.",".queen.",".russian.",".shut.",".suicide.",".suicide2.",".superman2.",".tormoz.",".trah.",".vampire.",".viking.",".wizard.",".yahoo.",".jongler.",".jva4ka.",".kazakhstan.",".krol.",".kiss.",".kiss3.",".kiss4.",":*",".latvia.",".lol2.",".love.",".love2.",".love3.",".love4.",".love5.",".love6.",".love7.",".mad2.",".mad3.",".mad4.",".mad5.",".mad6.",".mag.",".mda.",".mda2.",".me4.",".meet.",".ment.",".microfon.",".mig.",".mig2.",".mig3.",".mobila.",".moto.",".na.",".na2.",".na3.",".na4.",".na5.",".na6.",".na7.",".na8.",".nea.",".neo.",".nhl.",".nhl2.",".nhl3.",".ninja2.",".ninja3.",".ninja5.",".no.",".nono.",".notme.",".nuka.",".nunu.",".nyam.",".o4ki.",".obnim.",".off.",".ok.",".paf.",".paf2.",".paf3.",".papuas.",".pardon.",".patsak.",".pila.",".pilot.",".pioner.",".pletka3.",".pogranichnik.",".poisk.",".pooh.",".pop.",".pot.",".prank.",".prank2.",".pray.",".priv.",".prizrak.",".rap.",".razborki.",".razborki2.",".read.",".read2.",".red.",".red2.",".red4.",".resent.",".risyu.",".robot.",".roll.",".rose.",".rot.",".ruki.",".russia.",".sad2.",".samolet.",".scare.",".scare2.",".scout.",".scout2.",".sekret.",".shok.",".sick2.",".skleroz.",".skoraya.",".slepoy.",".smeh.",".smile3.",".smoke.",".smoke2.",".smoke3.",".smoke5.",".sorry2.",".spartak.",".spit2.",".spit3.",".spit4.",".stena.",".stop.",".svist.",".svist2.",".svist3.",".sweden.",".terminator.",".tfutfu.",".thankyou.",".tommy.",".triniti.",".tualet.",".tup.",".ujas.",".uk.",".ukraine.",".umnik.",".umnik2.",".unsure.",".up.",".usa.",".uwast.",".vedma.",".vic.",".volosu.",".wacko.",".wacko2.",".wacko3.",".wow.",".wvarz.",".xolms.",".yaz.",".yaz2.",".yes.",".yes2.",".yes3.",".yes4.",".yoo.",".zamerz.",".zamerz2.",".zerkalo.",".zeva.",".zeva2.",".zloy2.",".zubastik2.",".zybu.",".zybu2.");$row[message]=str_replace($smile, $url, $row[message]);$row[comment]=str_replace($smile, $url, $row[comment]);?>
#4. Gemorroj Off (107)
Administrator
2008.07.30 17:05
Код:
span style="color: #0000BB"><?php// максимальное количество замен$limit = 3;$url = array('<img src="smile/1.gif" alt=":)">','<img src="smile/2.gif" alt=":-))">','<img src="smile/3.gif" alt=";)">');$smile = array(':)',':-))',';)');$row['message']=preg_replace('/'.preg_quote($smile,'/').'/i', $url, $row['message'], $limit);$row['comment']=preg_replace('/'.preg_quote($smile,'/').'/i', $url, $row['comment'], $limit);?>
#5. walsonn
Гость
2008.07.30 19:07
мда.
сообщения невидно стало(
#6. walsonn
Гость
2008.07.30 19:07
всех сообщений не видно.
#7. Gemorroj Off (107)
Administrator
2008.07.31 01:01
извиняюсь)
вот, проверил
Код:
span style="color: #0000BB"><?php// максимальное количество замен$limit = 3;$url = array('<img src="smile/1.gif" alt=":)">','<img src="smile/2.gif" alt=":-))">','<img src="smile/3.gif" alt=";)">');$smile = array(':)',':-))',';)');$arr = array();foreach($smile as $var){$arr[] = '/'.preg_quote($var,'/').'/i';}$row['message']=preg_replace($arr, $url, $row['message'], $limit);$row['comment']=preg_replace($arr, $url, $row['comment'], $limit);?>
#8. walsonn
Гость
2008.07.31 08:08
спасибо!Вроде работает.
#9. KaspeR
Гость
2009.04.17 12:12
Такая же проблема...задолбали флудерасты на форуме...ставять кучу смайлов и вес страницы увеличивается в десятки раз!
Вроде бы этот файл у пхпббвап 6 за смайлы отвечате...
Хелп ми)
http://wapinet.ru/script/show.php?d=/Forumy/phpbb_wap_v6.zip&f=smiles.php
#10. KaspeR
Гость
2009.05.01 11:11
Хмм...никто не знает что ль?как переделать?
Страниц: 1 2 Все
Главная
WEB
PunBB Mod v0.6.2
0.016 s