Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by Admin (Coder) Admin is offline
Developer Last Online: Nov 2024 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 11-20-2001 Last Update: Never Installs: 63
 
No support by the author.

This is what we use on the main page of this forum.
So many people liked it and asked for it, I posted it on at least 5 threads already, but someone wanted a proper release so here it is.

Anyway, in index.php add this:
Code:
if ($bbuserinfo[userid]!=0) {
  $avatarurl=getavatarurl($bbuserinfo[userid]);
  if ($avatarurl=='') {
    $avatarurl='{imagesfolder}/noavatar.gif';
  }
  $avatarimage='<img src="'.$avatarurl.'">';
} else {
  $avatarimage='<a href="register.php?s='.$session[sessionhash].'&action=signup"><img src="{imagesfolder}/guestavatar.gif"></a>';
}
right after this:
Code:
$permissions=getpermissions();
if (!$permissions['canview']) {
	show_nopermission();
}
Now in any of your forumhome_xxx templates, you can use this:
Code:
$avatarimage
to display the user's avatar.

It will display the user's avatar if he has selected one, if he hasn't selected one it will show noavatar.gif (you'll need to upload that to your images folder), and if it's a guest, it will show guestavatar.gif, and link the image to register.php.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 11-21-2001, 12:08 PM
TheComputerGuy's Avatar
TheComputerGuy TheComputerGuy is offline
 
Join Date: Oct 2001
Location: TX
Posts: 580
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I like it, nice work there Firefly
Reply With Quote
  #3  
Old 11-21-2001, 12:36 PM
squawell's Avatar
squawell squawell is offline
 
Join Date: Oct 2001
Posts: 681
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it's good hack for me thankz FireFly~~

if i want it show up like main page of this forum what template

should i put this code$avatarimage?

forumhome or .....??
Reply With Quote
  #4  
Old 11-21-2001, 01:46 PM
SgtSling SgtSling is offline
 
Join Date: Oct 2001
Posts: 156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

forumhome template
Reply With Quote
  #5  
Old 11-21-2001, 01:46 PM
SgtSling SgtSling is offline
 
Join Date: Oct 2001
Posts: 156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

or any of the other's that are listed under forumhome
Reply With Quote
  #6  
Old 11-21-2001, 02:47 PM
snyx's Avatar
snyx snyx is offline
 
Join Date: Oct 2001
Location: Vancouver (whistler.2010)
Posts: 556
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

oh yeah, love'n it firefly!
http://www.form-kaos.com/board/
Reply With Quote
  #7  
Old 11-21-2001, 03:00 PM
Sinecure's Avatar
Sinecure Sinecure is offline
 
Join Date: Oct 2001
Location: Victoria, BC, Canada
Posts: 407
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How would I go about using $avatarimage in my header template. Modifying something in functions.php correct?
Reply With Quote
  #8  
Old 11-21-2001, 03:08 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Add the code to global.php, before:
Code:
$header='';
Reply With Quote
  #9  
Old 11-21-2001, 03:15 PM
Sinecure's Avatar
Sinecure Sinecure is offline
 
Join Date: Oct 2001
Location: Victoria, BC, Canada
Posts: 407
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank You
Reply With Quote
  #10  
Old 11-21-2001, 08:44 PM
Mike Gaidin's Avatar
Mike Gaidin Mike Gaidin is offline
 
Join Date: Oct 2001
Location: Michigan
Posts: 247
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks FireFly!
Reply With Quote
  #11  
Old 11-22-2001, 06:04 AM
JTMON's Avatar
JTMON JTMON is offline
 
Join Date: Oct 2001
Posts: 279
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Awesome Hack Firefly. What part of the code would I change to make it so the noavatar.gif is linked to userCP?
Reply With Quote
  #12  
Old 11-22-2001, 08:55 AM
Crinos's Avatar
Crinos Crinos is offline
 
Join Date: Oct 2001
Location: Los Angeles, CA
Posts: 151
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

w00t! Works great! Excellent hack, cheers!

See it in action
http://www.opentechsupport.net/forums/
Reply With Quote
  #13  
Old 11-22-2001, 11:42 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[QUOTE]Originally posted by JTMON
Awesome Hack Firefly. What part of the code would I change to make it so the noavatar.gif is linked to userCP?
Reply With Quote
  #14  
Old 11-22-2001, 11:11 PM
Matt's Avatar
Matt Matt is offline
 
Join Date: Oct 2001
Location: UK
Posts: 157
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there anyway to encorporate this into a non-vb page?
Reply With Quote
  #15  
Old 11-22-2001, 11:24 PM
JTMON's Avatar
JTMON JTMON is offline
 
Join Date: Oct 2001
Posts: 279
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

For some reason that code didn't work for me firefly. I just get a red x if I don't have an avatar selected, but no noavatar.gif. I have reuploaded the gif file twice too. Otherwise it works great.
Reply With Quote
  #16  
Old 11-23-2001, 12:06 AM
JTMON's Avatar
JTMON JTMON is offline
 
Join Date: Oct 2001
Posts: 279
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok I got it working now. I had to do this:

Code:
if ($bbuserinfo[userid]!=0) {
  $avatarurl=getavatarurl($bbuserinfo[userid]);
  if ($avatarurl=='') {
    $avatarurl='images/noavatar.gif';
  }
  $avatarimage='<a href="member.php3?s='.$session[sessionhash].'&action=editavatar"><img src="'.$avatarurl.'">';
} else {
  $avatarimage='<a href="register.php?s='.$session[sessionhash].'&action=signup"><img src="images/guestavatar.gif"></a>';
}
I chose to link right into the edit avatar spot instead but I had tack on the code you gave me to the beginning of:

$avatarimage'<img src="'.$avatarurl.'">';
Reply With Quote
  #17  
Old 11-23-2001, 02:17 AM
JTMON's Avatar
JTMON JTMON is offline
 
Join Date: Oct 2001
Posts: 279
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmm, the only problem now is I have a box around the avatar?
Reply With Quote
  #18  
Old 11-23-2001, 03:48 AM
Bane's Avatar
Bane Bane is offline
 
Join Date: Oct 2001
Posts: 411
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try changing
Code:
<img src="'.$avatarurl.'">
to
Code:
<img src="'.$avatarurl.'" border="0">
Reply With Quote
  #19  
Old 11-23-2001, 03:51 AM
JTMON's Avatar
JTMON JTMON is offline
 
Join Date: Oct 2001
Posts: 279
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Bane!! Worked perfectly!
Reply With Quote
  #20  
Old 11-26-2001, 04:18 AM
Jakeman's Avatar
Jakeman Jakeman is offline
 
Join Date: Nov 2001
Posts: 273
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hey Crinos (Tolitz i presume?), gimme your forumhome template. i want your table layout for the top box with the ava in it... i'm having brain farts here. :stupid:
Reply With Quote
  #21  
Old 11-26-2001, 06:13 AM
Crinos's Avatar
Crinos Crinos is offline
 
Join Date: Oct 2001
Location: Los Angeles, CA
Posts: 151
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

LOL, I wish it was that easy - the whole process of putting it together is scattered althroughout several templates:

forumhome
forumhome_unregmessage
forumhome_welcometext
forumhome_logincode
forumhome_logoutcode
forumhome_pmloggedin

I'm afraid giving you just the forumhome template is not gonna be useful

Took me about 3-4 hours of trial and error just trying to put it together ... what I did was set up a "mock-up" page with the layout as I want it to be ... then I just insert the relevant code and then chop it up by the <tr>'s and insert each one in the templates I mentioned
Reply With Quote
  #22  
Old 11-26-2001, 06:43 AM
Jakeman's Avatar
Jakeman Jakeman is offline
 
Join Date: Nov 2001
Posts: 273
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

oic. ok then... i'll manage
Reply With Quote
  #23  
Old 11-26-2001, 08:48 AM
trilOByte's Avatar
trilOByte trilOByte is offline
 
Join Date: Nov 2001
Location: England
Posts: 325
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey man, I think I just posted what you are looking for. I installed it all together, then wrote a walkthrough of most of it for a friend, thought someone might find it usefull, so uploaded the zip here...

https://vborg.vbsupport.ru/showthrea...threadid=32702

See my sig for a working example.

Even if it's not exactly what you are looking for, it should give you the *bones* to play with!
Reply With Quote
  #24  
Old 11-26-2001, 08:51 AM
trilOByte's Avatar
trilOByte trilOByte is offline
 
Join Date: Nov 2001
Location: England
Posts: 325
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thinking about it, I prolly should have posted it here - not sure about the protocol for such things

Anyway, I *think* I included all the edits
Reply With Quote
  #25  
Old 11-27-2001, 02:06 AM
Jakeman's Avatar
Jakeman Jakeman is offline
 
Join Date: Nov 2001
Posts: 273
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks
Reply With Quote
  #26  
Old 11-27-2001, 06:13 PM
Jakeman's Avatar
Jakeman Jakeman is offline
 
Join Date: Nov 2001
Posts: 273
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

cool... check out my www link
Reply With Quote
  #27  
Old 11-30-2001, 04:10 PM
fiona fiona is offline
 
Join Date: Nov 2001
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by JTMON
For some reason that code didn't work for me firefly. I just get a red x if I don't have an avatar selected, but no noavatar.gif. I have reuploaded the gif file twice too. Otherwise it works great.
have you checked the path to the image matches with what you have in index.php
ie mine is images/noavatar.gif

but in the code given by Firefly its
Quote:
<img src="vbimages/noavatar.gif">
i had the same problem
Reply With Quote
  #28  
Old 11-30-2001, 04:50 PM
Gamingforce's Avatar
Gamingforce Gamingforce is offline
 
Join Date: Oct 2001
Location: New York City
Posts: 128
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Really nice hack Firefly. I would install it but the default avatar size for our message board is 105x150 making the avatar take up too much board real estate. Awesome job though Firefly!
Reply With Quote
  #29  
Old 11-30-2001, 09:10 PM
JTMON's Avatar
JTMON JTMON is offline
 
Join Date: Oct 2001
Posts: 279
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by fiona


i had the same problem
Well it's been images for me this whole time. I never saw vbimages. I changed the coding so if they don't have an avatar it gives them the no avatar but it's also linked to the edit avatar page
Reply With Quote
  #30  
Old 12-02-2001, 12:59 PM
westi's Avatar
westi westi is offline
 
Join Date: Nov 2001
Location: Germany
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi,

Quote:
Originally posted by Matt
Is there anyway to encorporate this into a non-vb page?
include the follow global.php to your page...

PHP Code:
<?
// global.php
// Diese Datei ist f?r Webseiten die auf Funktionen eines vBulletin zugreifen
// wollen.
// Autor: westi (westi@ftpworld.org)
// Stand: v1.0 / 2001-12-02

$boardpath="/path/to/the/board";

unset($dbservertype);
//load config
require("$boardpath/admin/config.php");
require("$boardpath/admin/functions.php");

// init db **********************
// load db class
$dbservertype = strtolower($dbservertype);
$dbclassname="$boardpath/admin/db_$dbservertype.php";
require($dbclassname);

$DB_site=new DB_Sql_vb;
$DB_site->appname="vBulletin Control Panel";
$DB_site->appshortname="vBulletin (cp)";
$DB_site->database=$dbname;
$DB_site->server=$servername;
$DB_site->user=$dbusername;
$DB_site->password=$dbpassword;
$DB_site->connect();

$dbpassword="";
$DB_site->password="";
// end init db

// load options
$optionstemp=$DB_site->query_first("SELECT template FROM template WHERE title='options'");
eval($optionstemp[template]);
// ################ END INIT #################

if ($bbuserid!="") {
  $user=getuserinfo($bbuserid);
  $username=$user[username];
  $lastday=vbdate($dateformat,$user[lastvisit]+3600);
  $lasttime=vbdate($timeformat,$user[lastvisit]+3600);
  $templatesetid=$DB_site->query_first("SELECT templatesetid AS templatesetid FROM style WHERE styleid=$user[styleid]");
  $templatesetid=$templatesetid[templatesetid];

  $avatarurl=getavatarurl($user[userid]);
  if ($avatarurl=='') {
    $avatarurl='images/noavatar.gif';
  }
  $avatarimage='<a href="'.$bburl.'/member.php3?action=editavatar"><img src="'.$bburl.'/'.$avatarurl.'" border="0"></a>';
} else {
  $avatarimage='<a href="'.$bburl.'/register.php?action=signup"><img src="'.$bburl.'/images/guestavatar.gif" border="0"></a>';
}

}

?>
greets,
westi
Reply With Quote
  #31  
Old 12-02-2001, 08:24 PM
Airwaves's Avatar
Airwaves Airwaves is offline
 
Join Date: Nov 2001
Location: Chesterfield, Derbyshire, UK
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Where do I put

PHP Code:
$avatarimage 
to place it in the same place as on vb.org main forum page?
Reply With Quote
  #32  
Old 12-03-2001, 07:27 PM
Airwaves's Avatar
Airwaves Airwaves is offline
 
Join Date: Nov 2001
Location: Chesterfield, Derbyshire, UK
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Bump

cant anyone help a n00b ?
Reply With Quote
  #33  
Old 12-03-2001, 09:10 PM
JTMON's Avatar
JTMON JTMON is offline
 
Join Date: Oct 2001
Posts: 279
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

in the forumhome template, right above $postbits
Reply With Quote
  #34  
Old 12-04-2001, 06:48 AM
Airwaves's Avatar
Airwaves Airwaves is offline
 
Join Date: Nov 2001
Location: Chesterfield, Derbyshire, UK
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I cannot find $postbits in the forumdisplay template ??
Reply With Quote
  #35  
Old 12-04-2001, 07:16 AM
Lesane's Avatar
Lesane Lesane is offline
 
Join Date: Oct 2001
Location: The Netherlands
Posts: 1,149
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Put it in the forumhome template like Firefly said in his first post!
Reply With Quote
  #36  
Old 12-04-2001, 10:04 AM
Bedhead Bedhead is offline
 
Join Date: Oct 2001
Location: Canada
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have done everything step by step, but where exactly does $avatarimage go in the forumhome template.
Reply With Quote
  #37  
Old 12-04-2001, 10:05 AM
Bedhead Bedhead is offline
 
Join Date: Oct 2001
Location: Canada
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If it is installed here, how come i don't have it as noavater here as i have not selected one here?
Confused.
Reply With Quote
  #38  
Old 12-04-2001, 10:31 AM
Bedhead Bedhead is offline
 
Join Date: Oct 2001
Location: Canada
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I got it.
I thought this hack would add it to each member in the posts.
It is only on the main page.
Okay.
Reply With Quote
  #39  
Old 12-04-2001, 10:55 AM
JTMON's Avatar
JTMON JTMON is offline
 
Join Date: Oct 2001
Posts: 279
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Bedhead
I got it.
I thought this hack would add it to each member in the posts.
It is only on the main page.
Okay.

Each member already has his avatar in his post...?
Reply With Quote
  #40  
Old 12-04-2001, 08:00 PM
Airwaves's Avatar
Airwaves Airwaves is offline
 
Join Date: Nov 2001
Location: Chesterfield, Derbyshire, UK
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Having a bit of trouble with this...

I have the two image required in the /forums/images/avatars folder on my server, BUT, i still get a little red X in a box for someone who doesnt have an avatar set

here is the code in my index.php

PHP Code:
//avatar images
if ($bbuserinfo[userid]!=0) {
  
$avatarurl=getavatarurl($bbuserinfo[userid]);
  if (
$avatarurl=='') {
    
$avatarimage='<a href="usercp.php?s='.$session[sessionhash].'"><img border="0" src="images/avatars/noavatar.gif"></a>';
  }
  
$avatarimage='<img border="0" src="'.$avatarurl.'">';
} else {
  
$avatarimage='<a href="register.php?s='.$session[sessionhash].'&action=signup"><img border="0" src="images/avatars/guestavatar.gif"></a>';
}
//end avatar images 
I used a few fixes from the rest of this thread like removing the borders and making it linkk to the usercp to set an avatar.

please help?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:25 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.11350 seconds
  • Memory Usage 2,613KB
  • Queries Executed 53 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (7)bbcode_code
  • (3)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (40)post_thanks_box
  • (40)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (40)post_thanks_postbit_info
  • (39)postbit
  • (40)postbit_onlinestatus
  • (40)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete