Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Some help please on users table field

Quote Reply
Some help please on users table field
Hi



I have created two new fields in the users table (header, footer)...

And I need to pass those to :

1- Te detailed link page for all links owed by that user. (I use Pugdog dynamic plugin).

2- Te search results page through an extra hidden INPUT in the search form.. like (username) or so..

can some one give me some idea on how to do this?
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] Some help please on users table field In reply to
Just a thought...

Is there a global/tag that will insert a specific field from within the users table into the templete given that we have provided the Username or his/her email...?

Crazy
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] Some help please on users table field In reply to
There are a couple of issues here.... One is you really don't want to use "header" and "footer", but maybe something like user_header and user_footer, to avoid crunching fields.

I don't remember which fields are passed from the users table, but you can do a simple get/fetch from a template function that will do a select from Users where Username = current_user. At that point, all the user tags will be available.

Trouble is fields start crunching if you don't prefix them, and track them properly.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Some help please on users table field In reply to
Hi Pugdog:

Thanks, I do have user_header and user_footer, in use, I just wanted to be more clear..



You see the User will pass their e-mail through a hidden input within the search form..

<INPUT type="hidden" name="email" value="<%Your-email%>">

then when bringing up the search-results i have an IF statement

<%if email%>

<%user_header%>

<%else%>

<%My_header%>

<%endif%>

the email address provided is the one on file which is uniqe and does not interfer with a logged on user username tag..

But that will not work since User_header is not available...!!

I am not even sure if this is the right approach or not...!Unsure
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] Some help please on users table field In reply to
Why are you using a hidden email? Username is *Unique* by definition.

You can then just do a lookup on the Username field in the Users table, and you have all the fields that were in that record. You can do the lookup either as a global, returning the parsed header, or as a function inserting tags into the main tag hash.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Some help please on users table field In reply to
Hi Pugdog..

The reason I use email is to avoid conflict if we have a logged on user using another users search pages..

I thought that will cause a conflict between both Usernames..?

>>>You can do the lookup either as a global, returning the parsed >>>header, or as a function inserting tags into the main tag hash.

I really dom not much about the globals or parsing functions... I am only good at HTML and design **I think**

Can i get an example on how to pull user_header through passing Username field to the search_results page?
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] Some help please on users table field In reply to
That was the reason for LinkOwner. We made that point at the release of 2.0, that there would be confusion between the logged on user "Username" and the "Username" in the link, which is why the link has "LinkOwner".

Username is a primary key, so it should be safe to use, and you should not get it confused with other "Username" stuff. I realize it's hard... which is why it might actually behoove GT to go back and write an update script that will prefix all the fields in the different tables with a table_prefix_fieldname ie:

users_Username, links_LinkOwner, etc.

It means some real work, and template rewrites, but the program is getting big enough, and with Gossamer community, even bigger, so that name space, table space, etc collisions in the templates and plugins is going to be inevitable, and very hard to catch!


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Some help please on users table field In reply to
Or change the schema to include real unique values of autoincremented primary keys, like UserID, rather than text fields/columns that are subject to change.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [katabd] Some help please on users table field In reply to
I don't know if this helps:

Why not use a global on your detailed page:

First global <%userhead, 'Username'%> or insert the $Username
Second global <%userhead, 'Username'%> or insert the $Username

or you combine them to return both header and footer

Code:
sub {
my $user = shift;
$ut = $DB->table('Users');
my $output = $ut->select('Header', { Username => $user })->fetchrow_array;
return $output;
}
sub {
my $user = shift;
$ut = $DB->table('Users');
my $output = $ut->select('Footer', { Username => $user })->fetchrow_array;
return $output;
}


http://www.iuni.com/...tware/web/index.html
Links Plugins

Last edited by:

Ian: Jul 16, 2002, 9:52 PM