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

Who's Online

173 user(s) are online (124 user(s) are browsing Support Forums)


Members: 0


Guests: 173


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Jun 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits