UBB.Dev
Posted By: havoq Help With Statement - 01/30/2005 6:48 PM
Im trying to write an If statement here.

if ($user_profile[104] eq 'yes')
blah blah

however if i write a
print $user_profile[104];

its not printing anything, and I know its because Im probably not writing a require statement in the code somewhere.

Which file do I have to require in order to grab the user_profile information. Ive tried so many, like ubb_lib_posting, ubb_profile, etc.

The [104] is only in cp_users.cgi that I created, and it writes to the members file.

I tried including cp_users.cgi but its not grabing the data from that array.

Any ideas?
Posted By: AllenAyres Re: Help With Statement - 01/30/2005 10:00 PM
Quote
Originally posted by havoq:

Which file do I have to require in order to grab the user_profile information. Ive tried so many, like ubb_lib_posting, ubb_profile, etc.

sub OpenProfile {

is in ubb_lib_files smile
Posted By: havoq Re: Help With Statement - 02/01/2005 7:56 AM
weird, must be doing something else wrong if it aint workin
Posted By: havoq Re: Help With Statement - 02/10/2005 5:03 AM
Now rather Im trying to do the same statement in public_common. However its not grabbing the users profile.

Can anyone lend a hand as to what code to put in public_common, so I could grab a user_profile[104]
?
Posted By: havoq Re: Help With Statement - 02/12/2005 4:47 PM
Becuase requiring ubb_lib_files doesnt work.
Posted By: Brett Re: Help With Statement - 02/13/2005 5:24 AM
Before you start to grab the info, make absolutely sure it is printing to the file. Meaning physically open the file up through ftp and see that there is content on line 104 or not.

You'll also need to make changes to the maximum profile line limit variable as it's default is below 50, depending on the version that you have. If you have below 6.6(I believe), you'll want to look for the $mamxmemfield(in ubb_lib_files.cgi) and set it to above 104. In 6.7 it's in ubb_lib.cgi, search for $vars_config{'MaxMemFields'}, changing the value respectively.
Posted By: havoq Re: Help With Statement - 02/13/2005 6:56 PM
oh I know, thats all been done already wink
Posted By: navaho Re: Help With Statement - 02/15/2005 6:01 AM
lets go back to basics, shall we?

Open the file directly and see what is in there

open (PROFILE, "/usr/local/myname/Members/00000001.cgi") || die "can't open file $!";
@readthis = ;
close PROFILE;

print "profile field 104 is $readthis[104]";


You'll have to clean that up a lil, it's been a while since I coded in perl, but you get the idea.
Posted By: navaho Re: Help With Statement - 02/15/2005 6:04 AM
You could even stick a while loop in there and dump the whole file out. My point is, let's just make sure it works ourside the ubb first, then make the ubb do it.
© UBB.Developers