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

Reply
 
Thread Tools
Show icon if user has Profile Picture Details »»
Show icon if user has Profile Picture
Version: 1.00, by TechGuy TechGuy is offline
Developer Last Online: Aug 2015 Show Printable Version Email this Page

Version: 3.0.1 Rating:
Released: 04-07-2004 Last Update: Never Installs: 20
 
No support by the author.

What does this do?
Basically, when viewing a thread, if a user has a Profile Picture, it will show a camera icon (or whatever picture you choose) next to his/her online status icon. For example:


How to do this hack:
Download the instructions!

Updates!
July 1, 2004: I finally got around to re-writting this a bit so that you don't have a query for every post in every thread. However, after you install this, you'll notice that the first time you view a thread there will be a ton of queries. That will happen until we've essentially cached each user's "haspic" status in the user table... meaning that, in the end, this should be a lot nicer than the last version.

Show Your Support

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

Comments
  #12  
Old 06-17-2004, 11:49 PM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can do this without any queries whatsoever. There's another hack somewhere that does the same without a query - just add the variable to an existing query.
Reply With Quote
  #13  
Old 06-18-2004, 10:38 AM
Alien's Avatar
Alien Alien is offline
 
Join Date: Oct 2001
Posts: 827
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I haven't been able to locate this, any pointers?

I'd really like to get this one up.
Reply With Quote
  #14  
Old 06-23-2004, 12:29 PM
TechGuy TechGuy is offline
 
Join Date: Nov 2001
Location: Waynesboro, PA USA
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't know how to do anything with no queries... ? But, I'm no expert. The only way I can think to do this with only one query would be to add a field to the user table, but I didn't want to worry with those who have already uploaded a pic, though it'd certainly be possible. Maybe I'll play around with it a bit.
Reply With Quote
  #15  
Old 06-23-2004, 12:45 PM
Polo's Avatar
Polo Polo is offline
 
Join Date: Jun 2004
Posts: 893
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Erwin
You can do this without any queries whatsoever. There's another hack somewhere that does the same without a query - just add the variable to an existing query.
can you give us the link? :ermm: :squareeyed:
Reply With Quote
  #16  
Old 06-29-2004, 07:47 PM
Alien's Avatar
Alien Alien is offline
 
Join Date: Oct 2001
Posts: 827
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Please.
Reply With Quote
  #17  
Old 07-01-2004, 03:45 AM
TechGuy TechGuy is offline
 
Join Date: Nov 2001
Location: Waynesboro, PA USA
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think I've got it working.
Reply With Quote
  #18  
Old 07-04-2004, 06:47 AM
Alien's Avatar
Alien Alien is offline
 
Join Date: Oct 2001
Posts: 827
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What did you come up with?

If it just adds one query total (or even 0) to each page I'd be thrilled!
Reply With Quote
  #19  
Old 07-04-2004, 10:15 AM
TechGuy TechGuy is offline
 
Join Date: Nov 2001
Location: Waynesboro, PA USA
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It's included with the user query now -- check it out!
Reply With Quote
  #20  
Old 07-04-2004, 10:37 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice one, but let me suggest an optimization (this is how I did it some weeks ago):

In showthread.php FIND
PHP Code:
post_parsed.pagetext_htmlpost_parsed.hasimages
BELOW that ADD
PHP Code:
NOT ISNULL(customprofilepic.userid) AS haspic
Further down in showthread.php FIND
PHP Code:
LEFT JOIN " . TABLE_PREFIX . "post_parsed AS post_parsed ON(post_parsed.postid post.postid
BELOW that ADD
PHP Code:
LEFT JOIN " . TABLE_PREFIX . "customprofilepic  AS customprofilepic ON(customprofilepic.userid=post.userid
And use this template modification:

In template postbit FIND
PHP Code:
$post[onlinestatus
BELOW that ADD
PHP Code:
<if condition="$post['haspic']"><img src="/photo.gif" border=0 alt="Photo in Profile!"></if> 
That's it. This way you don't have to alter table user, file profile.php and functions_showthread.php.
You also might want to extend this for single post display and PM
Reply With Quote
  #21  
Old 07-04-2004, 10:54 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by KirbyDE
Nice one, but let me suggest an optimization (this is how I did it some weeks ago):

In showthread.php FIND
PHP Code:
post_parsed.pagetext_htmlpost_parsed.hasimages
BELOW that ADD
PHP Code:
NOT ISNULL(customprofilepic.userid) AS haspic
Further down in showthread.php FIND
PHP Code:
LEFT JOIN " . TABLE_PREFIX . "post_parsed AS post_parsed ON(post_parsed.postid post.postid
BELOW that ADD
PHP Code:
LEFT JOIN " . TABLE_PREFIX . "customprofilepic ON(customprofilepic.userid=post.userid
And use this template modification:

In template postbit FIND
PHP Code:
$post[onlinestatus
BELOW that ADD
PHP Code:
<if condition="$post['haspic']"><img src="/photo.gif" border=0 alt="Photo in Profile!"></if> 
That's it. This way you don't have to alter table user, file profile.php and functions_showthread.php.
You also might want to extend this for single post display and PM
Do we need to do this in the posts AND the caheposts queries?
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:28 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.04353 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
  • (12)bbcode_php
  • (2)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
  • (3)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