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
Image in profile Details »»
Image in profile
Version: 1.00, by Zzed Zzed is offline
Developer Last Online: Feb 2012 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 05-04-2002 Last Update: Never Installs: 52
 
No support by the author.

This hack was requested by NerdNations.

Here is what you need to do to add a image field to user profiles.

That's it.

Show Your Support

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

Comments
  #42  
Old 07-03-2002, 09:08 PM
Zzed's Avatar
Zzed Zzed is offline
 
Join Date: Feb 2002
Location: Glendale, CA, USA
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Actually, all you have to do is to assign $profilefield[value] to a global variable and use it in your template. Be sure to do this after it has been assigned the proper HTML value.

Please note that if the image URL is an invalid link or not a picture, $profilefield[value] will say Invalid image link:....

Hope this helps.
Reply With Quote
  #43  
Old 07-03-2002, 09:12 PM
Xelation's Avatar
Xelation Xelation is offline
 
Join Date: Jan 2002
Location: Buffalo, New York
Posts: 457
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

how would I do that? I'm not good at php at all so I wouldnt know how to do it sorry
Reply With Quote
  #44  
Old 07-03-2002, 09:35 PM
Zzed's Avatar
Zzed Zzed is offline
 
Join Date: Feb 2002
Location: Glendale, CA, USA
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
    $profilefieldname="field$profilefield[profilefieldid]";
    if(
strstr($profilefield[title], "Picture") and $userinfo[$profilefieldname]) {
      
error_reporting(0);
      
$img_info getimagesize($userinfo[$profilefieldname]);
      if(
$img_info[0]) {
        if((
$img_info[0] <= 640) and ($img_info[1] <= 480)) {
          
$profilefield[value]="<img src="$userinfo[$profilefieldname]">";
        }
        else {
          
$xratio $img_info[0] / 640;
          
$yratio $img_info[1] / 480;
          
$factor $xratio;
          if(
$yratio $xratio) {
            
$factor $yratio;
          }
          
$xsize intval($img_info[0] / $factor);
          
$ysize intval($img_info[1] / $factor);
          
$profilefield[value]="<img src="$userinfo[$profilefieldname]" width="$xsize" height="$ysize">";
        }
      }
      else {
        
$profilefield[value]="Invalid image link: <a href="$userinfo[$profilefieldname]">$userinfo[$profilefieldname]</a>";
      }

      
$profilepic $profilefield[value];

    }
    else {
      
$profilefield[value]=$userinfo[$profilefieldname];
    }

    eval(
"\$customfields .= "".gettemplate("getinfo_customfields")."";"); 
Then you can use $profilepic in your template.
Reply With Quote
  #45  
Old 07-04-2002, 12:59 AM
Xelation's Avatar
Xelation Xelation is offline
 
Join Date: Jan 2002
Location: Buffalo, New York
Posts: 457
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

if I wanted a second pic, for a car pic, could I jsut add another one of those below it and change the variables?
Reply With Quote
  #46  
Old 07-04-2002, 01:07 AM
Xelation's Avatar
Xelation Xelation is offline
 
Join Date: Jan 2002
Location: Buffalo, New York
Posts: 457
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok, it works... but I cant get rid of them if I make it hidden it doesnt show up for me... if I make it viewable there are 2
Reply With Quote
  #47  
Old 07-04-2002, 04:14 AM
Xelation's Avatar
Xelation Xelation is offline
 
Join Date: Jan 2002
Location: Buffalo, New York
Posts: 457
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

here this should explain things for you....
Reply With Quote
  #48  
Old 07-04-2002, 06:41 AM
Zzed's Avatar
Zzed Zzed is offline
 
Join Date: Feb 2002
Location: Glendale, CA, USA
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you post your template here? or Email it to me at edwink@seebeyond.com
Reply With Quote
  #49  
Old 07-04-2002, 04:22 PM
Xelation's Avatar
Xelation Xelation is offline
 
Join Date: Jan 2002
Location: Buffalo, New York
Posts: 457
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>$bbtitle - View Profile</title>
$headinclude
<script language="javascript" type="text/javascript">
<!--
function aimwindow(aimid) {
window.open("member.php?s=$session[sessionhash]&action=aimmessage&aim="+aimid,"_blank","toolbar=n o,location=no,menubar=no,scrol lbars=no,width=175,height=275,resizeable=yes,statu s=no")
}
// -->
</script>
</head>
<body>
$header
<p> </p>
<p> </p>
<table cellpadding="0" cellspacing="0" border="0" width="779" align="center" style="border: 1 solid #000000"><tr><td>
<table cellpadding="4" cellspacing="0" border="0" width="779">
<tr>
<td bgcolor="#485363" background="skin/images/profiletopbg.gif" colspan="2" align="center">
<normalfont><b>Viewing profile for user <i>$userinfo[username]</i>
</b> <font size="1" face="Arial, Helvetica, sans-serif"><b>Profile viewed $userinfo[profileviews]
times</b></font></normalfont>
</td>
</tr>
<tr><td bgcolor="#242F3D" valign="top">
<table width="100%" cellspacing="0" cellpadding="2" border="0">
<tr>
<td align="center" bgcolor="#2F3948" background="skin/images/profilebars.gif" valign="top" style="border: 1 solid #000000" width="48%"><normalfont><b>Picture</b></normalfont></td>
<td align="center" valign="top" style="border: 0 solid #000000" width="4%">&nbsp;</td>
<td align="center" bgcolor="#2F3948" background="skin/images/profilebars.gif" valign="top" style="border: 1 solid #000000" width="48%"><normalfont><B>Avatar</B></normalfont></td>
</tr>
<tr>
<td align="center" valign="middle" width="48%" Height="80">$profilepic</td>
<td align="center" valign="middle" width="4%" Height="80">&nbsp;</td>
<td align="center" valign="middle" width="48%" Height="80"><img src="$userinfo[avatarurl]" border="0" align="middle"></td>
</tr>
</table>
</td><td bgcolor="#242F3D" rowspan="2" valign="top">
<table width="100%" cellspacing="0" cellpadding="2" border="0">
<tr><td align="center" bgcolor="#2F3948" background="skin/images/profilebars.gif" valign="top" style="border: 1 solid #000000"><normalfont><B>User Info</B></normalfont></td></tr>
<tr><td valign="top">
<table width="100%" cellspacing="0" cellpadding="2" border="0">
<tr><td valign="top"><smallfont><B>Registered: </B></smallfont></td><td valign="top"><smallfont>$userinfo[datejoined]</smallfont></td></tr>
<tr><td valign="top"><smallfont><B>Status: </B></smallfont></td><td valign="top"><smallfont><b>$userinfo[usertitle]</b></smallfont></td></tr>
<tr><td valign="top"><smallfont><B>Posts: </B></smallfont></td><td valign="top"><smallfont>$userinfo[posts]<BR><b>[</b> $postsperday posts per day / $percentoftotalposts% of total posts<b>]</b><BR><a href="search.php?s=$session[sessionhash]&action=finduser&userid=$userinfo[userid]">Search for all posts by this user.</a><br></smallfont></td></tr>
<tr>
<td valign="top"><smallfont><b>Last Post:</b></smallfont></td>
<td valign="top"><smallfont>$lastpostdate $lastposttime<br>
<a href="$lastposturl">$lastposttitle</a>$nolastpost</smallfont></td>
</tr>

<tr><td valign="top"><smallfont><B>Website: </B></smallfont></td><td valign="top"><smallfont><a href="$userinfo[homepage]" target="_blank">$userinfo[homepage]</a></smallfont></td></tr>
$referrals
$birthday
$customfields
<smallfont>
<tr><td valign="top" colspan="2"><smallfont><img src="skin/images/plus.gif" border="0"> <a href="member2.php?s=$session[sessionhash]&action=addlist&userlist=buddy&userid=$userinfo[userid]"><font color="#ffffff">Add to buddy list</font></a><BR>
<img src="skin/images/minus.gif" border="0"> <a href="member2.php?s=$session[sessionhash]&action=addlist&userlist=ignore&userid=$userinf o[userid]"><font color="#ffffff">Add to ignore list</font></a>
</smallfont>
</td></tr>
</td></tr>
</table>
</td></tr>
</td></tr></table>
<tr><td bgcolor="#242F3D" valign="top">
<table width="100%" cellspacing="0" cellpadding="2" border="0">
<tr><td align="center" bgcolor="#2F3948" background="skin/images/profilebars.gif" valign="top" style="border: 1 solid #000000"><normalfont><B>User Contact</B></normalfont></td></tr>
<tr><td align="center" valign="top">
<table width="100%" cellspacing="0" cellpadding="2" border="0">
<tr><td valign="top"><smallfont><B>E-Mail: </B></smallfont></td><td valign="top"><smallfont><a href="member.php?s=$session[sessionhash]&action=mailform&userid=$userinfo[userid]">Click here to email $userinfo[username]</a></smallfont></td></tr>
<tr><td valign="top"><smallfont><B>Private Message: </B></smallfont></td><td valign="top"><smallfont>$userinfo[sendpm]</smallfont></td></tr>
<tr><td valign="top"><smallfont><B>ICQ: </B></smallfont></td><td valign="top"><smallfont>$userinfo[icq]</smallfont></td></tr>
<tr><td valign="top"><smallfont><B>AIM: </B></smallfont></td><td valign="top"><smallfont>$userinfo[aim]</smallfont></td></tr>
<tr><td valign="top"><smallfont><B>YAHOO: </B></smallfont></td><td valign="top"><smallfont>$userinfo[yahoo]</smallfont></td></tr>
</table>
</td></tr>
</table>
</td></tr>
</td></tr></table>
</td></tr></table>

<br>

<table cellpadding="2" cellspacing="0" border="0" width="779" align="center">
<tr>
<td align="center"><smallfont><b>
Administrative Options: <a href="moderator.php?s=$session[sessionhash]&action=useroptions&userid=$userinfo[userid]">User Options</a>
</b></smallfont></td>
</tr>
</table>

$footer

</body>
</html>
Reply With Quote
  #50  
Old 09-16-2002, 09:44 AM
concept's Avatar
concept concept is offline
 
Join Date: Mar 2002
Posts: 51
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

excellent hack.. great work
Reply With Quote
  #51  
Old 10-10-2002, 11:32 AM
poolking poolking is offline
 
Join Date: Aug 2002
Posts: 193
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

When I try to install this hack I get a parse error in member.php around line 1487.
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 01:19 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.07624 seconds
  • Memory Usage 2,335KB
  • 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
  • (1)bbcode_php
  • (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