vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Default Avatar if None is Selected (https://vborg.vbsupport.ru/showthread.php?t=44805)

GuruXL 10-20-2002 11:55 PM

Default Avatar if None is Selected
 
This is important, i will see what I can do to make it work...but I would love to see what some others could do.

Neo-Storm 10-21-2002 07:54 AM

i want that too, please someone make it :)

Automated 10-21-2002 01:56 PM

That would be nice, it seems quite simple, i am suprise that no one else has ever made it ;)

Matthew

Neo 10-21-2002 02:04 PM

FIND In admin/functions.php

PHP Code:

        if ($post[avatarid]!=0) {
            
$avatarurl=$post[avatarpath];
        } else {
            if (
$post[hascustomavatar] and $avatarenabled) {
                
$avatarurl="avatar.php?userid=$post[userid]&dateline=$post[avatardateline]";
            } else {
                
$avatarurl="";
            }
        }
        if (
$avatarurl=="" or ($bbuserinfo[userid]>and !($bbuserinfo[showavatars]))) {
            
$post[avatar]="";
        } else {
            eval(
"\$post[avatar] = \"".gettemplate("postbit_avatar")."\";");
        } 

AND REPLACE WITH

PHP Code:

        if ($post[avatarid]!=0) {
            
$avatarurl=$post[avatarpath];
        } else {
            if (
$post[hascustomavatar] and $avatarenabled) {
                
$avatarurl="avatar.php?userid=$post[userid]&dateline=$post[avatardateline]";
            } else {
                
$avatarurl="images/default.gif";
            }
        }
        if (
$avatarurl=="" or ($bbuserinfo[userid]>and !($bbuserinfo[showavatars]))) {
            
$post[avatar]="images/default.gif";
        } else {
            eval(
"\$post[avatar] = \"".gettemplate("postbit_avatar")."\";");
        } 

Now you will see that part that I edited. The blank $avatarurl.
Now you can change the path within the one that contains $avatarurl="images/default.gif"; to any path you want. Just dont touch the other two with parses the avatars on the site.

Hooloovoo 10-21-2002 05:50 PM

Cool - thanks Neo. This was somthing I was wondering about. :)

Chris M 10-21-2002 06:02 PM

Nice:)

Satan

Chris M 10-21-2002 06:10 PM

You could alternatively try doing this :

PHP Code:

PHP:  

if (
$post[avatarid]!=0) {
            
$avatarurl=$post[avatarpath];
        } else {
            if (
$post[hascustomavatar] and $avatarenabled) {
                
$avatarurl="avatar.php?userid=$post[userid]&dateline=$post[avatardateline]";
            } else {
                
$avatarurl="$defaultavurl";
            }
        }
        if (
$avatarurl=="" or ($bbuserinfo[userid]>and !($bbuserinfo[showavatars]))) {
            
$post[avatar]="$defaultavurl";
        } else {
            eval(
"\$post[avatar] = \"".gettemplate("postbit_avatar")."\";");
        } 

Then going to :

yourdomain.com/forum/admin/setting.php?action=add

Properties :

Setting Category - Avatars
Title - Default Avatar Url
Variable Name - defaultavurl
Value - (leave blank)
Description - Url to the Default Avatar Image
Code to generate option - (leave blank)
Display Order - 1

Then Save...

Then edit your options and enter the url of the default avatar...

=-=

What are the advantages of my way? It is easier to change the Default Avatar url;)

Satan

GuruXL 10-21-2002 08:58 PM

Quote:

Originally posted by Neo
FIND In admin/functions.php

PHP Code:

        if ($post[avatarid]!=0) {
            
$avatarurl=$post[avatarpath];
        } else {
            if (
$post[hascustomavatar] and $avatarenabled) {
                
$avatarurl="avatar.php?userid=$post[userid]&dateline=$post[avatardateline]";
            } else {
                
$avatarurl="";
            }
        }
        if (
$avatarurl=="" or ($bbuserinfo[userid]>and !($bbuserinfo[showavatars]))) {
            
$post[avatar]="";
        } else {
            eval(
"\$post[avatar] = \"".gettemplate("postbit_avatar")."\";");
        } 

AND REPLACE WITH

PHP Code:

        if ($post[avatarid]!=0) {
            
$avatarurl=$post[avatarpath];
        } else {
            if (
$post[hascustomavatar] and $avatarenabled) {
                
$avatarurl="avatar.php?userid=$post[userid]&dateline=$post[avatardateline]";
            } else {
                
$avatarurl="images/default.gif";
            }
        }
        if (
$avatarurl=="" or ($bbuserinfo[userid]>and !($bbuserinfo[showavatars]))) {
            
$post[avatar]="images/default.gif";
        } else {
            eval(
"\$post[avatar] = \"".gettemplate("postbit_avatar")."\";");
        } 

Now you will see that part that I edited. The blank $avatarurl.
Now you can change the path within the one that contains $avatarurl="images/default.gif"; to any path you want. Just dont touch the other two with parses the avatars on the site.

Thanks from the bottom of my heart :devious:


All times are GMT. The time now is 06:13 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01229 seconds
  • Memory Usage 1,780KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete