Eagle_f90
  • Posts: 27
  • Joined: 16/07/2014
I have successfully gotten YAF to act as the membership backend for my web site but I had to set it up in a different database than the run that runs my main site. What I now need to do is sync the Username and DisplayName from the YAF User table into my database's User table. I only need to do the sync to keep the Displayname in sync so that when the user updates it via the forum it will be updated in my DB. Any thoughts on how best to do this.
Sponsor
Zero2Cool
  • Posts: 1077
  • Joined: 26/04/2011
I would probably piggy back the stored procedure that updates the username on the forum to execute a the sync that you're doing.
Eagle_f90
  • Posts: 27
  • Joined: 16/07/2014
What proc handles that?
Zero2Cool
  • Posts: 1077
  • Joined: 26/04/2011
Originally Posted by: Eagle_f90

What proc handles that?



Sorry, not sure, you'll have to check out the code.
bbobb
  • Posts: 1558
  • Joined: 21/10/2008
You can write an after update trigger
create TRIGGER displayNameWatcher_trigger
ON yaf_User
AFTER UPDATE
AS
IF ( UPDATE (DisplayName) )
BEGIN
-- do something
END;
Or use Flags field to set an unused user flag like Flags = Flags | 128 and check it by Flags & 128 = 128

After this you should write something that checks the changes connects to other database and sets all back to normal in yaf database
like Flags = Flags ^ 128 You can write a servic that can check it without intruding into YAF source code too. There's a lot of options.


Hopefully, it helps.



Forum Jump  
  • You cannot post new topics in this forum.
  • You cannot reply to topics in this forum.
  • You cannot delete your posts in this forum.
  • You cannot edit your posts in this forum.
  • You cannot create polls in this forum.
  • You cannot vote in polls in this forum.

About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved