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
  #22  
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
  #23  
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
  #24  
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
  #25  
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
  #26  
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
  #27  
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
  #28  
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
  #29  
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
  #30  
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
  #31  
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
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 09:36 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.06342 seconds
  • Memory Usage 2,317KB
  • Queries Executed 25 (?)
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
  • (3)bbcode_code
  • (1)bbcode_php
  • (4)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
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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