Mar 1, 2003, 12:36 PM
Veteran / Moderator (6956 posts)
Mar 1, 2003, 12:36 PM
Post #2 of 4
Views: 1827
From anywhere? Or in the templates?
In the templates, you need a global, called Fetch_User which, as you show, takes a Usesrname and loads the fields for that username. There are several pitfalls, akin to name-space collisions, but if you know the users ahead of time, you can avoid that.
What you need to do in the global is to simple call the Users table using Username=>$user where $user is the passed in username.
The *problem* is passing this back to the template. The fields will cause a name-space collision.
So, the *best* way to deal with it, is to have the global load the template, and return a formatted string to the original template. You can either embed the HTML in the global, or load the template into the global.
By returning the formatted string, you avoid the potential collisions.
I can try to hack this later, it shold only be a few lines of code, or a minor change to one of the existing globals, but it's to chaotic here now.
<%Fetch_User('string')%>
<%returned_user%>
<%Fetch_User('string2')%>
<%returned_user%>
The function should be initialized each time it's called, and the value of <%returned_user%> should change based on the most recent call.
PUGDOG� Enterprises, Inc.
The best way to contact me is to NOT use Email.
Please leave a PM here.