Gossamer Forum
Quote Reply
My_links DB bug..
Hi



In my link DB plug in.. if a signed on user (user A) try to view a given user (user B) favorites page all their users information will change to the user that they are viewing info..

What I mean is: the menu will say Welcome B - B profile - B ....so on..

while they should all say A not B...

Is there a fix for this? I know that the Username problem have been discussed before but may be someone have some solution..
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] My_links DB bug.. In reply to
Hi,

I'm not too sure what you mean, when I signup, add some favorites and then go to view someone elses favourites page I see:

some_user (support@somedomain.net) has 1 saved link. This list has a rating of 0.00 and has received 0 votes

...which is correct. Or did I misunderstand?

Last edited by:

Paul: Aug 5, 2002, 2:19 PM
Quote Reply
Re: [Paul] My_links DB bug.. In reply to
Hi, You need to add

$tags->{Username} = $USER->{Username};

in the sub user_list and

$tmp->{Username} = $tags->{Username} = $USER->{Username};

in the sub user_favourites.

Add them just before the print $IN->header line.

Laura.
The UK High Street
Quote Reply
Re: [afinlr] My_links DB bug.. In reply to
Can you explain a bit more about the problem, I can't seem to find it or maybe I just don't understand what the bug is Smile

Last edited by:

Paul: Aug 6, 2002, 6:34 AM
Quote Reply
Re: [Paul] My_links DB bug.. In reply to
Hi Paul,

The problem is for those of us that are displaying user specific information for the current logged in user. For example, in my menu bar I have a button which says 'log in' if there is no user logged in or 'log out' if there is a logged in user. With the mylinks plugin, if I was viewing the links for another user, it would say 'log out' on the menu bar even if I wasn't logged in. I think that KaTaBd has even more user specific features.

I have added the changes outlined above to my site and it all seems to work fine.

Laura.
The UK High Street
Quote Reply
Re: [Paul] My_links DB bug.. In reply to
Hi Paul

Here is a quick example:

On my site I have a Users menu that will be visiable through (<%if Username%>).



User A is logged in and viewing the site, and comes to another user's favorites Page (user B)..

Now the User A menu links will change to reflect the User B information...

Welcome User B: User B Home | User B MyLinks | Manage Your Sites | Update Profile | Logout |

I hope that helps..
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [afinlr] My_links DB bug.. In reply to
Thanks

The solution did fix it..
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] My_links DB bug.. In reply to
If you want, you can prefix all mylinks tags for those specific templates by using:

Code:
my $prefix = 'my_';

@$tags{ map { +"${prefix}_$_" } keys %$tags } = values %$tags;

@$tmp{ map { +"${prefix}_$_" } keys %$tmp } = values %$tmp;

Then you can use <%my_tagname%>

Otherwise use Laura's solution (thanks Laura).
Quote Reply
Re: [Paul] My_links DB bug.. In reply to
Thanks Paul

That does work too..
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [Paul] My_links DB bug.. In reply to
Paul,

I have a similar sort of problem which I can't see how to fix.

In my mylinks templates I have <%ifnot UserID%> to display the 'Delete' and 'Send' options to the mylinks owner. However, this doesn't seem to be working - it still displays when looking at anyone's mylinks list.

I've thought about trying to do this with a tag such as <%if Username eq $UserID%> but obviously this doesn't work as there is no UserID tag on my personal mylinks page. This is how I have got round this sort of problem on other plugins.

Now I'm stuck Unsure. Any ideas?

Thanks,

Laura.
The UK High Street
Quote Reply
Re: [afinlr] My_links DB bug.. In reply to
Are you trying to only show those buttons to the mylinks list owner and hide it from everyone else?
Quote Reply
Re: [Paul] My_links DB bug.. In reply to
Exactly.
Quote Reply
Re: [afinlr] My_links DB bug.. In reply to
How about passing in a new tag like...

this_user => $USER->{Username}

Then:

<%unless this_user eq $prefix_Username%>

Something like that?

this_user is the logged in user and prefix_Username is the mylinks user you prefixed using the code above (post 8).

Last edited by:

Paul: Sep 5, 2002, 11:09 AM
Quote Reply
Re: [Paul] My_links DB bug.. In reply to
Thanks Paul.

I've tried to do this by changing the saved_links line in the main sub to

$tags->{saved_links} .= Links::SiteHTML::display('mylinks_link', { %$rec, RealUser => $USER->{Username}, MyLinks_Font => $tmp->{MyLinks_Font} } );

But this doesn't seem to be workingUnsure

If I try to user RealUser as a tag in the mylinks_link template I get an unknown tag error. This seems quite strange since the MyLinks_Font is getting through and I'm not getting a general error message. I'm sure I'm doing something stupid but I'm beginning to get to the pulling my hair out stage so I think I'll leave it for the moment.