vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   How to call $userinfo[textfield] in functions.php when field is from the 'user' TABLE (https://vborg.vbsupport.ru/showthread.php?t=53421)

007 05-26-2003 09:50 PM

How to call $userinfo[textfield] in functions.php when field is from the 'user' TABLE
 
Hi,

I added a field to that is in the user table, and is varchar(20) to an if/else statement in functions.php

It looks like

PHP Code:

if ($post[field5]==and $userinfo[textfield]!="") {
$image="path to image.gif";} else if ($post[field5]==1) {
$image="path to alternate image.gif";} else {
$image="";} 

Is it possible to do this? I am trying to have an image appear in the postbit depending on if a member has certain profile fields selected or filled out...

I have tried $post, $bbuserinfo, and $userinfo in front of the [textfield] in the PHP above and it hasn't worked any of the times.

Is what I am trying to do possible??? Please HELP! :(

filburt1 05-26-2003 10:27 PM

I don't see anything immediately wrong, but you desperately need to indent correctly. Your code is next to impossible to read...

007 05-27-2003 01:26 AM

I copied and pasted it from notepad and didn't realise that. Here's a better one...

PHP Code:

if ($post[field5]==and $userinfo[textfield]!="") {
    
$image="path to image.gif";
    } 

else if (
$post[field5]==1) {
    
$image="path to alternate image.gif";
    } 

else {
    
$image="";
    } 

I don't know the exact technical way to align the code but you get the picture.

Is there any reason why this wouldn't work? This is exactly what I am doing and it is not working at all. I placed this code in the functions.php if that helps..

I will try to mess around some more with it but I think there is something I'm missing... :(

007 05-27-2003 02:52 AM

Got it now. It was an easy fix. Thanks. :)


All times are GMT. The time now is 09:57 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.01033 seconds
  • Memory Usage 1,719KB
  • 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
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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