[Add-on] Default Avatar vs. Gender Mod

Mod that adds a extra field to the users profile, the gender is displayed beside the posts

Moderator: Moderators

Forum rules
The content in this forum is dated Dec. 21 2005 and can be used as Archive only. This Forum is LOCKED and READ ONLY !

[Add-on] Default Avatar vs. Gender Mod

Postby kooky on Sat 31. May, 2003 00:08

MOD Title: Default Avatar Mod
MOD Author: Shannado
MOD Homepage: http://www.shannado.nl/forumorg/
MOD Description: This MOD shows a default avatar for user who doesn't have set an avatar. The default avatar must be set in template config file.
You can also specify an avatar for the guest user.

Code: Select all
#################################################################
## MOD Title: Default Avatar vs. Gender Mod
## MOD Version: 1.0.1.3
## MOD Author: Kooky < kooky06@hotmail.com - http://planetsport.nasov.net >
##
## Also: morpheus2matrix < morpheus2matrix@yahoo.fr >
##
## MOD Description: it gives you the possibility to show one avatar if the member is a male
##                  and another avatar if the member is a female. If the member have not
##                  choosen gender, a default avatar is use.
##                  it works only on users who have not choosen an avatar in their profile.
##
## Requirement: Default Avatar Mod v1.0.1 by Shannado <sven@shannado.nl> (Sven) http://www.shannado.nl/forumorg
##              Gender Mod v1.2.3 by Niels Chr, Denmark < ncr@db9.dk > (Niels Chr. Rød) http://mods.db9.dk
##
## Installation Level: Easy
## Installation Time: 5 - 15 minutes
## Files To Edit: 3
##                viewtopic.php
##                usercp_viewprofile.php
##                subSilver.cfg
##
## Included Files: 4
##                 images/guest_avatar.gif
##                 images/no_avatar.gif
##                 images/no_avatar_male.gif
##                 images/no_avatar_female.gif
##
## History:
##   0.9.0 - Initial release phpBB2 RC-1
##   0.9.1 - You can also specify an avatar for the guest user !
##   1.0.0 - Final Release
##   1.0.1 - Made phpBB v2.0.2 compliant and EasyMod 0.0.7 compliant
##   1.0.1.1 - Added Gender mod support (morpheus2matrix)
##   1.0.1.2 - Made phpBB v2.0.4 compliant and fixed issue with Gender Mod (Kooky)
##   1.0.1.3 - Fixed default guest avatar issue with Gender (Kooky)
##
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/
##############################################################
##
## Author Note:
##   First you have to install the MOD it self AND
##   You must have the Gender Mod of Niels Chr Denmark installed to use this extra how-to !!
##
#################################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
#################################################################

#
#-----[ COPY ]------------------------------------------
#
copy *.gif to /templates/subSilver/images/

#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php

#
#-----[ FIND ]------------------------------------------
#
         case USER_AVATAR_GALLERY:
            $poster_avatar = ( $board_config['allow_avatar_local'] ) ? '<img src="' . $board_config['avatar_gallery_path'] . '/' . $postrow[$i]['user_avatar'] . '" alt="" border="0" />' : '';
            break;
      }
   }

#
#-----[ AFTER, ADD ]------------------------------------------
#
   //
   // Default Avatar MOD vs Gender - Begin
   //
   if ( empty($poster_avatar) && $poster_id != ANONYMOUS && $postrow[$i]['user_gender'] == '1')
   {
      $poster_avatar = '<img src="'. $images['default_avatar_male'] .'" alt="" border="0" />';
   }
   else if ( empty($poster_avatar) && $poster_id != ANONYMOUS && $postrow[$i]['user_gender'] == '2')
   {
      $poster_avatar = '<img src="'. $images['default_avatar_female'] .'" alt="" border="0" />';
   }
   else if ( empty($poster_avatar) && $poster_id != ANONYMOUS)
   {
      $poster_avatar = '<img src="'.  $images['default_avatar'] .'" alt="" border="0" />';
   }

   if ( $poster_id == ANONYMOUS )
   {
      $poster_avatar = '<img src="'.  $images['guest_avatar'] .'" alt="" border="0" />';
   }
   //
   // Default Avatar MOD vs Gender - End
   //

#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_viewprofile.php

#
#-----[ FIND ]------------------------------------------
#
      case USER_AVATAR_GALLERY:
         $avatar_img = ( $board_config['allow_avatar_local'] ) ? '<img src="' . $board_config['avatar_gallery_path'] . '/' . $profiledata['user_avatar'] . '" alt="" border="0" />' : '';
         break;
   }
}

#
#-----[ AFTER, ADD ]------------------------------------------
#
//
// Default Avatar MOD vs Gender - Begin
//
if ( empty($avatar_img) && $profiledata['user_gender'] == '1')
{
   $avatar_img = '<img src="'. $images['default_avatar_male'] .'" alt="" border="0" />';
}
else if ( empty($avatar_img) && $profiledata['user_gender'] == '2')
{
   $avatar_img = '<img src="'. $images['default_avatar_female'] .'" alt="" border="0" />';
}
else if ( empty($avatar_img) )
{
   $avatar_img = '<img src="'.  $images['default_avatar'] .'" alt="" border="0" />';
}
//
// Default Avatar MOD vs Gender - End
//

#
#-----[ OPEN ]------------------------------------------
#
# (make sure to edit file .cfg for every theme you use).
templates/subSilver/subSilver.cfg

#
#-----[ FIND ]------------------------------------------
#
?>

#
#-----[ BEFORE, ADD ]------------------------------------------
#

// Default Avatar MOD
$images['default_avatar'] = "$current_template_images/no_avatar.gif";
$images['guest_avatar'] = "$current_template_images/guest_avatar.gif";
$images['default_avatar_male'] = "$current_template_images/no_avatar_male.gif";
$images['default_avatar_female'] = "$current_template_images/no_avatar_female.gif";

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM


Don't forget to download the zip Archive including the 4 .gif on Shannado's website, or create your own gif ^_^
Last edited by kooky on Tue 29. Jul, 2003 01:00, edited 1 time in total.
kooky
brilliant supporter
 
Posts: 1329
Joined: Tue 31. Dec, 2002 17:52
Location: Au pays des rêves

Postby Heartless_King on Thu 26. Jun, 2003 01:16

Great Mod Koosy i've actually looked around (not much) for something like this. Btw, does it work on 2.0.5? (I know hate it :P)
Administrator and Founder of the Heartless Crew Online Gaming Community

"Keep it Heartless... Always"
User avatar
Heartless_King
Poster
Poster
 
Posts: 38
Joined: Wed 23. Oct, 2002 20:30
Location: United Kingdom

Postby kooky on Thu 26. Jun, 2003 01:50

Not tested but i guess it works with 2.0.5, no code is replaced in this MOd
kooky
brilliant supporter
 
Posts: 1329
Joined: Tue 31. Dec, 2002 17:52
Location: Au pays des rêves

Postby carloclaessen on Sun 17. Aug, 2003 20:40

confirmed by me

working with 2.06
carloclaessen
Poster
Poster
 
Posts: 97
Joined: Mon 16. Dec, 2002 01:38

Postby ligeiro on Sat 06. Mar, 2004 15:03

And what about rank images? is it somehow possible to suit them to??
ligeiro
Poster
Poster
 
Posts: 2
Joined: Fri 05. Mar, 2004 12:20

Postby Aragon on Fri 21. May, 2004 01:43

I really want the rank to be determined by gender as well
User avatar
Aragon
Poster
Poster
 
Posts: 20
Joined: Mon 26. May, 2003 08:45

Postby Blubibulga on Mon 11. Jul, 2005 13:20

How can I find Shannado's default pictures :?:
Blub ... BlUb !!!
Blubibulga
Poster
Poster
 
Posts: 9
Joined: Wed 25. May, 2005 13:16
Location: France


Return to Gender [2.0.10/EM]

Who is online

Users browsing this forum: No registered users and 1 guest

cron