Gossamer Forum
Home : Products : DBMan : Customization :

Short display

Quote Reply
Short display
previously, in my short display, i put in this

print qq|<a href="$long_url">$rec{'LoginID'}</a></td>|;
unless ($db_userid eq "default")
{
print qq|
<td><a href="mailto:$rec{'E-mail'}">$rec{'E-mail'}</a>|;
}
print qq|
<td>$rec{'Sex'}</td>
<td>$rec{'Age'}</td>|;
unless ($db_userid eq "default")
{
print qq|
<td>$rec{'Photoyesno'}</td>
<td>$rec{'Voiceyesno'}</td>|;
}
print qq|
<td>$rec{'Brief'}|;

For the LoginID and Email, how can I make it that it will extract the data out from the default.pass? cause now , in the adding of database, I created another individual LoginID and email in the db.cgi for the user to enter. its like double work.
Quote Reply
Re: Short display In reply to
You can just use a hidden field for the LoginID, since it's set automatically within the add_record subroutine.

I'm not sure what you're asking about. You're talking about the short display, but it seems that you're asking for the LoginID and Email to be inserted into the form when the user adds a record. Sorry. I'm confused.

------------------
JPD





Quote Reply
Re: Short display In reply to
in my database, when the user register, they will be direct to add a record.

in the add record, I let them enter the LoginID and Email.

as u can see from below..

print qq|<a href="$long_url">$rec{'LoginID'}</a></td>|;
unless ($db_userid eq "default")
{
print qq|
<td><a href="mailto:$rec{'E-mail'}">$rec{'E-mail'}</a>|;
}

the $rec{LoginID'}and $rec{'E-mail'} is not the one that they entered when creating new account.

so now what i wan it, how to mod it to show what they have entered when they register for a account? the login and email

$rec{LoginID'}and $rec{'E-mail'}

how should i mod it?
Quote Reply
Re: Short display In reply to
and also

unless ($db_userid eq "default")
{
print qq|
<td><a href="mailto:$rec{'E-mail'}">$rec{'E-mail'}</a>|;
}

This email info , i only want the Full member can see only,not the member. I tried to mod it, but canont work.
Quote Reply
Re: Short display In reply to
I don't know what's wrong with the $fmem mod. I'll look at it later.

Code:
foreach $field (keys %db_defaults) {
$default{$field} = $db_defaults{$field};
}

add

Code:
open (PASS, "<$auth_pw_file") or &cgierr ("unable to open: $auth_pw_file.\nReason: $!");
if ($db_use_flock) { flock(PASS, 1) }
@lines = <PASS>;
close PASS;
foreach $line (@lines) {
if ($line =~ /^$db_userid:/) {
@data = split /:/, $line;
$default{'LoginID'} = $data[0];
$default{'E-mail'} = $data[7];
last;
}
}

------------------
JPD







[This message has been edited by JPDeni (edited July 08, 1999).]

[This message has been edited by JPDeni (edited July 09, 1999).]
Quote Reply
Re: Short display In reply to
This mod look like it would solve my problem under another thread!

I just want to retrieve the usertype which I have written to the password file and write it to the record the first time a record is added to the db.

Not sure I understand the code though -- how does this mod know which field to get from the password file -- in your mod -- email for example?
Quote Reply
Re: Short display In reply to
I'm sure glad you asked that, pablo, because I made a *huge* error in the code.

I'll put the correct line here, and I'll fix it when I get done writing this.

Code:
($default{'LoginID'},$default{'E-mail'},@rest) = split /:/, $line;

should be

Code:
@data = split /:/, $line;
$default{'LoginID'} = $data[0];
$default{'E-mail'} = $data[7];

Does that help you understand?

------------------
JPD





Quote Reply
Re: Short display In reply to
sorry for not being clear again Smile

For this short display. It only display afew data. the userid and email will be shown.

Now, in my htmp.pl, under the "sub html_record_form {" , I request the user to enter their userid and email again.
<tr><td align=right valign=top width=110><b><font color=red>*</font><$font_color>Login ID:</font></td></b>
<td width=372 valign="top"><input type=text name="LoginID" value="$rec{'LoginID'}" size="30" maxlength="255"></td></tr>


<tr><td align=right valign=top width=110><b><font color=red>*</font><$font_color>E-mail:</font></td></b>
<td width=372 valign="top"><input type=text name="E-mail" value="$rec{'E-mail'}" size="50" maxlength="50"></td></tr>


Then at the short display,


# if you want to display your fields in columns, use the following format:

print qq|<a href="$long_url">$rec{'LoginID'}</a></td>|;


unless ($db_userid eq "default")
{
print qq|
<td><a href="mailto:$rec{'E-mail'}">$rec{'E-mail'}</a>|;
}
print qq|
<td>$rec{'Sex'}</td>
<td>$rec{'Age'}</td>|;
unless ($db_userid eq "default")
{
print qq|
<td>$rec{'Photoyesno'}</td>
<td>$rec{'Voiceyesno'}</td>|;
}
print qq|
<td>$rec{'Brief'}|;


so now, I was thinking, can i save the 2 steps (request user to enter again their userid and email). While the short display can show out the userid and email.

so I just follow the mod and will achive what i requested?

thks for being patient Smile
Quote Reply
Re: Short display In reply to
The mod I gave you will enter the userid and the email address from the password file automatically into the add form. It would be too much scripting work and too much work for the server to pull out the info from the password file every time there was a search done. Besides, the LoginID has to be in the record anyway, so the script will "know" who the record belongs to. It's not much more to duplicate the email address in the .db file, even though it's also in the .pass file.


------------------
JPD





Quote Reply
Re: Short display In reply to
ok Smile thks alot
Quote Reply
Re: Short display In reply to
when the admin change any of the user password in the User management, it doesnt update the E-mail field.

Quote Reply
Re: Short display In reply to
As soon as I can build a database to test it, there will be a new password lookup mod which will be a whole lot better. Just hang on for a bit, okay?


------------------
JPD