vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Show icon if user has Profile Picture (https://vborg.vbsupport.ru/showthread.php?t=63613)

Erwin 06-17-2004 11:49 PM

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.

Alien 06-18-2004 10:38 AM

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

I'd really like to get this one up.

TechGuy 06-23-2004 12:29 PM

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.

Polo 06-23-2004 12:45 PM

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: :rolleyes: :)

Alien 06-29-2004 07:47 PM

Please. :)

TechGuy 07-01-2004 03:45 AM

I think I've got it working. :)

Alien 07-04-2004 06:47 AM

What did you come up with? :)

If it just adds one query total (or even 0) to each page I'd be thrilled!

TechGuy 07-04-2004 10:15 AM

It's included with the user query now -- check it out!

Andreas 07-04-2004 10:37 AM

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 ;)

Boofo 07-04-2004 10:54 AM

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?


All times are GMT. The time now is 07:05 AM.

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.01200 seconds
  • Memory Usage 1,763KB
  • 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
  • (12)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete