vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Help with how to Show profile pic 'indication' if true, in post-bit.. (https://vborg.vbsupport.ru/showthread.php?t=96070)

Razasharp 09-11-2005 06:39 PM

Help with how to Show profile pic 'indication' if true, in post-bit..
 
Ok total nube here!

I've started to learn PHP and thought I would try to make a small hack to the post-bit in vB.

I want it to show a visual idication if someone has uploaded a profile pic and was trying to do it with this code:

<if condition="$userinfo['profilepic']">
<img src="images/hasprofile.gif" alt="Has a profile pic" />
</if>

I've also tried:

<if condition="$show['profilepic']">

and:

<if condition="$userinfo['profilepic'] = true">

But not sure what I'm doing really!

Do I need to make sure that value has loaded by making sure it is called in the actual php file too?

Any ideas?

sorry to be a total nube :(

Gio~Logist 09-11-2005 10:22 PM

I'm Trying To Do The Same Thing In Online.php!!!!!!!!!!!!!!!


For postbit try

HTML Code:

<if condition="$post['profilepic']">
<img src="images/hasprofile.gif" alt="Has a profile pic" />
</if>


Razasharp 09-11-2005 10:28 PM

that doesnt work either :(

I'm thinking perhaps it needs to be called in the associated php file as well for it to be resident in memory? maybe the result queried from the DB?...

Andreas 09-11-2005 10:28 PM

1) The Information "User has a Profile Picture" doesn't exist.
You havre to aggregate it somehow, for example by making a join on the custompprofilepic table

2) $post for sure will not work in WOL

3) Take a look at my Profile

Razasharp 09-11-2005 10:37 PM

Thanks Andreas... it's too much then :( I think I will wait utill I upgrade to 3.5 and then use your hack :)

Thanks for taking the time to put us out of our misery! :p

Andreas 09-11-2005 10:39 PM

Use Search, there is a 3.0 Hack that does it.

Razasharp 09-11-2005 10:53 PM

OK I found this....

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

*goes to try* :)

bigcurt 09-11-2005 11:31 PM

There IS 3.0.X hack that does this..I know there is, I even remember the little pic of the camera, BUT, I cannot find it ANYWHERE.

~Curt

Razasharp 09-11-2005 11:52 PM

For Post bit.... the quote in my post above works :)

(Thanks Kirby!)

Andreas 09-11-2005 11:57 PM

I knew it works, as I am running this Code in my production Board ;)

Gio~Logist 09-12-2005 12:43 AM

I used this in online.php (after putting it in the right spots in online.php) and it works fine as long as there are no guests online. The second a guest comes online i get this.

Quote:

Database error in vBulletin 3.0.7:

Invalid SQL:
SELECT user.username, session.useragent, session.location, session.lastactivity, user.userid, user.options, session.host, session.badlocation, session.incalendar, user.aim, user.icq, user.msn, user.yahoo,
NOT ISNULL(customprofilepic.userid) AS haspic,
IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid
FROM session AS session
LEFT JOIN customprofilepic AS customprofilepic ON(customprofilepic.userid=user.userid)
LEFT JOIN user AS user USING (userid)
WHERE session.lastactivity > 1126487892

ORDER BY user.username asc

mysql error: Cross dependency found in OUTER JOIN. Examine your ON conditions

mysql error number: 1120

Date: Sunday 11th of September 2005 09:33:12 PM
Script: http://www.net-fam.com/online.php?
Referer: http://www.net-fam.com/forums.php
Username: gio~logist
IP Address: xx.xxx.xxx.xx


All times are GMT. The time now is 05:03 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.01120 seconds
  • Memory Usage 1,749KB
  • 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
  • (1)bbcode_html_printable
  • (6)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (11)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete