vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Pulling info from a profile field (https://vborg.vbsupport.ru/showthread.php?t=119281)

bashy 06-21-2006 06:20 PM

Pulling info from a profile field
 
Hi peeps

I have just created a new profile field and now i would like to pull the information from the said field.....

I would like to add this information into a new page (Logican's web template)

Please can someone advise as to how to do this....

I have tried this

Code:

<if condition="$post['field24']"><div>$vbphrase[referral]: $post[field24]</div></if>
Didnt work, i got a parse error
Again i tried this and got another parse error :(

Code:

<if condition="$post[field24] != ''"><div class="smallfont">
I have copied these from other hacks that pull infor from profile fields and trying them :)

Also is there away that the profile field information can show which member it pulled the info from please?
Something like this

Bashy-----------------[field24]
member---------------[field24]
nother member--------[field24]

get the idea?

noppid 06-21-2006 06:50 PM

You nailed it both times. There must be errant characters in your template.

The var is going to contain the custom field info from the posting member.

bashy 06-21-2006 06:52 PM

Well actually i tried them both in the postbit and thats where i got the errors for the code.....

noppid 06-21-2006 06:54 PM

We can be sure of one thing here, what you showed us will work.

However, I think your problem is in code in the template we here can't see. Perhaps you are causing a nesting problem?

bashy 06-21-2006 07:04 PM

Ok lets try a differant way...

Can it be used in a html page or does it have to be a full php page?

Ok...this is what i have, nothing shows apart from

Code:

How did you find us :
Heres my code

Code:

<table width='100%'><tr>
        <td class="panelsurround" align="center" >
        <div class="panel">
                  <div style="width:100%" align="$stylevar[left]">
    How did you find us :
<if condition="$bbuserinfo[field29] != ''">$vbphrase[referral]:<div class="smallfont"></if>
    </div></div>
</td>
</tr>
</table>

From what i can make out, this code should show the member, their field and the phrase, is this correct code?

EDIT:

Right...The code

Code:

<if condition="$post['field29']"><div>$vbphrase[referral]: $post[field29]</div></if>
works in the postbit, but does not work in this code

Code:

<table width='100%'><tr>
        <td class="panelsurround" align="center" >
        <div class="panel">
                  <div style="width:100%" align="$stylevar[left]">
    How did you find us :
<if condition="$bbuserinfo['field29']"><div>$vbphrase[referral] $post[field29]</div></if>
    </div></div>
</td>
</tr>
</table>

Its not showing the info in a new web template (Logicans)
Also in the post bit (just for testing the code) it aint pulling the username.

Have i mentioned i want to compile a list of all members and show [fieldX] along with thier name?

noppid 06-21-2006 07:57 PM

Can you link me to the page or the hack you got the code from? I don't understand what's going on ie. what user id is being used for the custom fields info and where ya get it.

bashy 06-21-2006 08:05 PM

The code is made up from a template within logicans web templates...
It was just something to use to base this on is all...

See it working here its the How did you find us? in the postbit
Although this will be removed once i sort the list out

that main code i want working in the template is

Code:

<if condition="$bbuserinfo['field29']"><div>$vbphrase[referral] $post[field29]</div></if>
like i said it works in the postbit (sort of) it shows the user's profile field. :)

I think for what im wanting the $bbuserinfo is not the right variable as i want
to create a list of ALL members that have filled [fieldx] showing [fieldx] like this

Bashy-----------------[field24]
member---------------[field24]
nother member--------[field24]

gulldarek 06-21-2006 08:10 PM

You'll have to query all users from db with non-empty specified profile field and iterate through printing the code.

bashy 06-22-2006 03:02 PM

Dam...that means nothing to me :(
Can someone ellaborate please, Perhaps peterska2 knows a little more?

Quote:

Originally Posted by gulldarek
You'll have to query all users from db with non-empty specified profile field and iterate through printing the code.


peterska2 06-22-2006 09:06 PM

You will need to include a query on the userfields table to get this to work on other pages (it would work on memberlist, postbit, and memberinfo only otherwise). However, to include the query will require some PHP coding, so I'm not really the person to ask. The HTML that you have is spot on, and that's my field of knowledge, not PHP.

bashy 06-23-2006 05:22 AM

Ok thanks for taking a look KA much appreciated, i forgot you was more of a template magician ;)

Does anyone with a bit of coding knowledge know what to do here please?
Cause i aint got a clue and this is sommat i really need?

DarkDraco07 11-29-2006 04:02 AM

did anyone get this to work? i would like to use $post[fieldx] on another page as well

Raptor 07-01-2009 06:46 AM

I need to get a custom field to show on the main index page

ive tried $bbuserinfo[field5] & $post[field5] - neither of them parse


All times are GMT. The time now is 03:28 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.01215 seconds
  • Memory Usage 1,743KB
  • 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
  • (7)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (13)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