I was working on d version 3.0 of my script and i had to make sql for about 200 gifs n jpgs bt u didnt really fink i'd do it one by one did u? O.o Okay i used to, anyway wit dis piece of codin u cud generate SQL dependin on ur smilies folder:
ofcuz u can modify it easily. And oh make sure u rename ur files cuz d code for a haha.gif file would be -haha- and d code for a haha_01.gif wud be -haha_01- . To c d sql, view just view d source code of d display. It'l be ther. If u found dis useful, hola atchur boi. :-)
Code:
<?php $han = dir("/"); while($fnm = $han->read()){ $file = explode(".",$fnm); if(strlen($file[0])>2 && count($file)==2){ echo "INSERT INTO `ibwf_smilies` (`id`,`scode`,`imgsrc`,`hidden`)\n"; echo "VALUES (NULL,'-".$file[0]."-', 'smilies/".$fnm."','0');\n"; } } ?>
Comment