Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
649 views
in Q2A Core by

I need to "mark" certain users with a flag (they register not directly in my q2a forum but register on another site, both are linked).

My idea of best practice:

1. Edit qa-config.php

2. Add my custom flag: define('QA_USER_FLAGS_EXTREG', 1024);

However, I would run into problems if new flags are added to the core. The recent flags are 1 - 512, see qa-include\app\users.php

So now I am wondering if I should take a very high number to avoid this issue - or if there is another way?

(I could create an extra table to log those, but it would be overkill...)

Thanks!
Kai

---

Edit:

Idea for my scenario: Maybe I could use the field "sessionsource" in table "qa_users" and set it to my custom site - instead of using the flags?!

Another way would be to user the qa_usermeta table and add a custom field, but again, it might be overkill...

Q2A version: 1.8.0

1 Answer

+1 vote
by
You should create an extra table where each flag (1/0) is represented by a field. A good design is never overkill.
by
If I'd need more flags, then it would make sense actually - and it would be safe. But then I can directly use table qa_usermeta.
by
It depends. If you need to perform searches on the fields then you should use an index which the usermeta table will not provide
by
Thanks. Good point!
...