1
karuna
How to add a lot of avatars??
  • 2004/4/10 18:13

  • karuna

  • Not too shy to talk

  • Posts: 171

  • Since: 2002/5/29


i have named these avatars likes this ava001 ava002 ...ava200

My question is how to add so many avatars in a easy way?

2
Mithrandir
Re: How to add a lot of avatars??

Upload them to the uploads directory, then make a little php file with the following contents:
<?php include mainfile.php $avatars = [Number of avatars] //write a number here for ($i = 0; $i < $avatars; $i++) { $k = $i; if ($i < 100) { //add one zero in front of number $k = "0".$k; } if ($i < 10) { //add another zero $k = "0".$k; } $xoopsDB->query("INSERT INTO ".$xoopsDB->prefix("avatar")." VALUES ('ava$k.gif', 'ava$k', 'image/gif', ".time().", 1,0,'C')"); echo "ava$k inserted"; } include footer.php ?>

If the avatars are jpeg, change the extension in the query and the image/gif to image/jpeg

Just drop that little php file in the XOOPS root and run it once.

It may take a little more to get them to be choosable by the users - someone else able to elaborate?

3
karuna
Re: How to add a lot of avatars??
  • 2004/4/10 21:59

  • karuna

  • Not too shy to talk

  • Posts: 171

  • Since: 2002/5/29


Thank you very much

Login

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits