DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • April 19, 2019, 07:18:12 AM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1] 2   Go Down
  Print  
Author Topic: Avatar Mod By: Anpera - English  (Read 10770 times)
0 Members and 1 Guest are viewing this topic.
Arune
Member
Mod God
*****
Offline Offline

Posts: 718


Arune Vai - khatfield


View Profile WWW
« on: February 25, 2004, 12:42:37 PM »

This mod was created by anpera - I just did the translation

!EDITED!
I forgot to add the dragon.php addition:
Added now

Code:
Code:
----- SQL:
ALTER TABLE accounts ADD avatar TEXT;


----- Open:
bio.php

----- Find:
$result = db_query("SELECT login,name,level,sex,title,specialty,hashorse,acctid,

----- Join at the end:
avatar,

----- Find:
if ($session[user][loggedin]) output("<a href=\"mail.php?op=write&to=$row[login]\" target=\"_blank\"
onClick=\"".popup("mail.php?op=write&to=$row[login]").";return false;\"><img src='images/newscroll.GIF' width='16'
height='16' alt='Write Mail' border='0'></a>",true);

----- Add After:
if (getsetting("avatare",0)==1){
   if ($row[avatar]){
      $pic_size = @getimagesize($row[avatar]);
      $pic_width = $pic_size[0];
      $pic_height = $pic_size[1];
      output("<table><tr><td valign='top'>`n`n<img src=\"$row[avatar]\" ",true);
      if ($pic_width > 200) output("width=\"200\" ",true );
      if ($pic_height > 200) output("height=\"200\" ",true );
      output("alt=\"$row[name]\">&nbsp;</td><td valign='top'>",true);
   } else {
      output("<table><tr><td>(No Image)&nbsp;&nbsp;&nbsp;</td><td>",true);
   }
}

----- Find:
if ($row['bio']>"")
   output("`n`^Bio: `@`n".soap($row['bio'])."`n");

----- Add After:
if (getsetting("avatare",0)==1)output ("</td></tr></table>",true);

----- Open:
configuration.php

----- Find:
   "selfdelete"=>"Allow players to delete their characters,bool",

----- Add After:
   "avatare"=>"Allow Character Avatars,bool",


----- Find:
prefs.php:

----- Find:
   if ($_POST[email]!=$session[user][emailaddress]){

----- Add After:
   if (getsetting("avatare",0)==1) {
      if (stripslashes($_POST['avatar'])!=$session['user']['avatar']){
         $session['user']['avatar']=stripslashes($_POST['avatar']);
      }
   }

----- Find:
      ,"bio"=>"Brief Description of Character (Maximum 255 Characters)`n"

----- Add After:
      ,"avatar"=>"Link to Avatar`n(File - maximum 200x200 Pixel)`n"

----- Find:
   $prefs['bio'] = $session['user']['bio'];

----- Add After:
   if (getsetting("avatare",0)==1) {
       $prefs['avatar'] = $session['user']['avatar'];
   } else {
      $prefs['avatar'] = "(Avatar Not Allowed)";
   }


----- Open:
superuser.php

----- Find:
   if ($session[user][superuser]>=3) addnav("Retitler","retitle.php");

----- Add Before:
   addnav("Avatars","avatars.php");

Open dragon.php
------ Find:
,"beta"=>1

------ Add After:
,"avatar"=>1

---Save and Close all Files!
Drop avatars.php into your logd directory.
http://dragonprime.cawsquad.net/users/khatfield/avatars.zip
« Last Edit: March 13, 2004, 09:59:16 PM by Arune » Logged
sixf00t4
Mod God
*****
Offline Offline

Posts: 1916



View Profile WWW
« Reply #1 on: March 21, 2004, 05:07:33 PM »

it doesnt seem to be saving the links people enter.  any ideas?  it gives the "saved" message.  if i add it directly into the database, it displays fine.  the image is 173x164 pixels.
Logged

anpera
Guest
« Reply #2 on: March 21, 2004, 07:40:42 PM »

Avatars enabled in game settings?
Logged
sixf00t4
Mod God
*****
Offline Offline

Posts: 1916



View Profile WWW
« Reply #3 on: March 21, 2004, 07:42:01 PM »

yep.
Logged

sixf00t4
Mod God
*****
Offline Offline

Posts: 1916



View Profile WWW
« Reply #4 on: March 21, 2004, 07:43:02 PM »

when someone gets the "saved" message, the avatar link field goes blank again, should that happen?
Logged

bwatford
Guest
« Reply #5 on: March 21, 2004, 07:47:28 PM »

I altered it just a little on our server to leave the address in the bar field so they are sure it was saved.
Logged
sixf00t4
Mod God
*****
Offline Offline

Posts: 1916



View Profile WWW
« Reply #6 on: March 21, 2004, 07:51:38 PM »

how did you do that?  

regardless, it isnt saving.
Logged

lonnyl
Guest
« Reply #7 on: March 22, 2004, 07:14:21 AM »

I know exactly what you did cause I did it to!  in prefs.php  move the

if (getsetting("avatare",0)==1) {
         if (stripslashes($_POST['avatar'])!=$session['user']['avatar']){
           $session['user']['avatar']=stripslashes($_POST['avatar']);
            }
        }

out of the mail section... it says to put it after line
if ($_POST[email]!=$session[user][emailaddress]){


but you need to put it after the routine..... so simply move it under the last bracket for the mail routine.
Logged
lonnyl
Guest
« Reply #8 on: March 22, 2004, 08:09:05 AM »

Ok, so I like this mod, but it doesn't allow for uploads of avatars.  so......
I found an old upload script I had downloaded from somewhere... sorry there were no credits in the file.   And modified it to fit my needs.  I created a folder under my logd folder called avatars and dropped this file into it.  You will need to set write permissions to the folder for all users.  And I simply added a nav to prefs.php to go to
addnav ("Upload Avatar","http://yourserverhere/logd/avatars",false,true);

this adds a popup and loads the index file (which is the upload script)
 
The script limits uploads to 20K gifs only.
That is about all there is to it.

http://dragonprime.cawsquad.net/users/lonnyl/avatarupload.zip
Logged
drake2k
Guest
« Reply #9 on: May 06, 2004, 03:07:34 PM »

Hey lonny, how can I get this to allow jpg's?  I tried a || $file_type <> "image/jpg" after the "image/gif" portion in the index php located in the avatar folder, to no avail.  i'm sure it's prolly my syntax maybe.




Ok, so I like this mod, but it doesn't allow for uploads of avatars.  so......
I found an old upload script I had downloaded from somewhere... sorry there were no credits in the file.   And modified it to fit my needs.  I created a folder under my logd folder called avatars and dropped this file into it.  You will need to set write permissions to the folder for all users.  And I simply added a nav to prefs.php to go to
addnav ("Upload Avatar","http://yourserverhere/logd/avatars",false,true);

this adds a popup and loads the index file (which is the upload script)
 
The script limits uploads to 20K gifs only.
That is about all there is to it.

http://dragonprime.cawsquad.net/users/lonnyl/avatarupload.zip
Logged
Talisman
Administrator
Mod God
*****
Offline Offline

Posts: 5483



View Profile WWW
« Reply #10 on: May 06, 2004, 03:51:49 PM »

Change that line to:
Code:
else if ( $file_type <> "image/gif" and $file_type <> "image/jpg") {

And don't forget to change the rest of the output texts to indicate jpg's are allowed  Wink
Logged

Play the latest beta version here on DragonPrime
drake2k
Guest
« Reply #11 on: May 06, 2004, 05:23:50 PM »

Strangly it did not work. Still won't upload jpg's. I even tried && instead of and.  Any suggestions?

Change that line to:
Code:
else if ( $file_type <> "image/gif" and $file_type <> "image/jpg") {

And don't forget to change the rest of the output texts to indicate jpg's are allowed  Wink

Logged
lonnyl
Guest
« Reply #12 on: May 06, 2004, 06:19:05 PM »

How big is your jpg??? It has a limit of 20K for file size.... and that is extremely small for a jpg....
Logged
anpera
Guest
« Reply #13 on: May 06, 2004, 06:19:26 PM »

The "content-type" of .jpg files is "image/jpeg", so try "image/jpeg" instead of "image/jpg". I'm pretty sure this will help.
Logged
drake2k
Guest
« Reply #14 on: May 06, 2004, 09:01:09 PM »

The "content-type" of .jpg files is "image/jpeg", so try "image/jpeg" instead of "image/jpg". I'm pretty sure this will help.

tried this, it did not work.  The jpg file size is 5k so it's very small.  Still won't upload after changing it to jpeg.  

If worse comes to worse I can just put a message on there if they want jpg they will have to host it themselves.
Logged
Pages: [1] 2   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Version 1.1.2 is the current supported version and is available for download.

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
75 Guests, 1 User
tnyguy
Home Forums News Downloads Login Register Advanced Search