TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 09-11-2005, 07:31 PM   #1 (permalink)
The Acquainted
Inquisitive 
 
Join Date: Jul 2005
Location: UK
Posts: 121
Thanks: 41
Brook is on a distinguished road
Default Help!

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 :(
Brook is offline  
Reply With Quote
Old 09-12-2005, 05:52 PM   #2 (permalink)
The Acquainted
 
Join Date: Mar 2005
Posts: 177
Thanks: 0
CreativeLogic is on a distinguished road
Default

First off, this is mainly vBulletin's code and it's not exactly PHP. Just so you know in the future.

In a postbit you have to use the $post variable. Here's the code you would want to try:
<if condition="$post['profilepic']">
<img src="images/hasprofile.gif" alt="Has a profile pic" />
</if>

That should work inside the template to complete what you're after.
CreativeLogic is offline  
Reply With Quote
Old 09-12-2005, 06:03 PM   #3 (permalink)
The Acquainted
Inquisitive 
 
Join Date: Jul 2005
Location: UK
Posts: 121
Thanks: 41
Brook is on a distinguished road
Default

Hi Ryan

Thanks for getting back to me. Sorry didn't know not to post vB stuff here, you can delete the thread if you like.

Regarding the above, it doesn't work. I've since learned that it's because the Information "User has a Profile Picture" doesn't exist - you have to aggregate it somehow, for example by making a join on the custompprofilepic table.

Anyway its all sorted now, there was a hack at vb.org that I missed!
Brook is offline  
Reply With Quote
Old 09-12-2005, 06:29 PM   #4 (permalink)
The Acquainted
 
Join Date: Mar 2005
Posts: 177
Thanks: 0
CreativeLogic is on a distinguished road
Default

No, I'm not saying anything about not posing vBulletin questions here, that's fine. But yes, you're correct. I assumed you had already done the join statement.
CreativeLogic is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 12:26 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design